PageSourceSearch

https://nooqgolf.com/_next/static/chunks/6031-832d23900480f9c0.js

js nooqgolf.com collected 2026-10-05 02:17:25 UTC 459,449 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6031],{282:(e,t,r)=>{"use strict";r.d(t,{NewTicketForm:()=>o});var n=r(29064),a=r(34340);function o(e){let{orgCode:t,accent:r}=e,[o,l]=(0,a.useState)(""),[s,i]=(0,a.useState)(""),[c,d]=(0,a.useState)(!1),[m,u]=(0,a.useState)(null);async function h(e){if(e.preventDefault(),!c){if(u(null),!o.trim()||!s.trim())return void u("Please add a subject and a message.");d(!0);try{let e=await fetch("/api/support-portal/tickets",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({...t?{org_code:t}:{},subject:o.trim(),message:s.trim()})}),r=await e.json().catch(()=>({}));if(!e.ok||!(null==r?void 0:r.success)){u((null==r?void 0:r.error)||"Couldn't create your ticket — please try again."),d(!1);return}let n=r.conversation_id;n?window.location.href="/support/tickets/".concat(n):window.location.reload()}catch(e){u("Couldn't create your ticket — please try again."),d(!1)}}}return(0,n.jsxs)("form",{onSubmit:h,className:"rounded-lg border border-gray-200 bg-white p-5",children:[(0,n.jsx)("h3",{className:"text-base font-semibold text-gray-900",children:"Open a new ticket"}),(0,n.jsxs)("div",{className:"mt-4 space-y-3",children:[(0,n.jsxs)("div",{children:[(0,n.jsx)("label",{htmlFor:"nt-subject",className:"block text-sm font-medium text-gray-700",children:"Subject"}),(0,n.jsx)("input",{id:"nt-subject",type:"text",value:o,onChange:e=>l(e.target.value),className:"mt-1 block w-full rounded-md border border-gray-300 px-3 py-2 text-sm shadow-sm focus:border-emerald-500 focus:outline-none focus:ring-1 focus:ring-emerald-500",placeholder:"Brief summary of your issue",disabled:c})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)("label",{htmlFor:"nt-message",className:"block text-sm font-medium text-gray-700",children:"Message"}),(0,n.jsx)("textarea",{id:"nt-message",value:s,onChange:e=>i(e.target.value),rows:4,className:"mt-1 block w-full rounded-md border border-gray-300 px-3 py-2 text-sm shadow-sm focus:border-emerald-500 focus:outline-none focus:ring-1 focus:ring-emerald-500",placeholder:"Tell us what's going on…",disabled:c})]}),m&&(0,n.jsx)("p",{className:"text-sm text-red-600",children:m}),(0,n.jsx)("button",{type:"submit",disabled:c,className:"inline-flex items-center rounded-md px-4 py-2 text-sm font-semibold text-white shadow-sm disabled:opacity-60",style:{backgroundColor:r||"var(--color-primary, #047857)"},children:c?"Sending…":"Send ticket"})]})]})}},681:(e,t,r)=>{"use strict";r.r(t),r.d(t,{BuyButton:()=>s,default:()=>i});var n=r(29064),a=r(34340),o=r(23554);function l(){return"undefined"!=typeof crypto&&"function"==typeof crypto.randomUUID?crypto.randomUUID():"".concat(Date.now().toString(36),"-").concat(Math.random().toString(36).slice(2))}function s(e){let{productId:t,label:r="Buy now",className:s,maxPerOrder:i=10,stripeMode:c}=e,[d,m]=a.useState(!1),[u,h]=a.useState(null),[p,x]=a.useState(1),[g]=a.useState(l),f=Math.max(1,Math.floor(i)),b="buy-qty-".concat(t),y=async()=>{m(!0),h(null);try{let e=await fetch("/api/shop/checkout",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({productId:t,quantity:p,attemptToken:g,successPath:"".concat(window.location.pathname,"?purchase=success"),cancelPath:window.location.pathname})});if(!e.ok){let t=await e.json().catch(()=>({}));throw Error((null==t?void 0:t.error)||"Checkout failed (".concat(e.status,")"))}let{checkoutUrl:r}=await e.json();if(r){window.location.href=r;return}throw Error("No checkout URL returned")}catch(e){h(e instanceof Error?e.message:"Checkout failed"),m(!1)}};return(0,n.jsxs)("div",{className:s,children:["test"===c&&(0,n.jsx)(o.C,{}),(0,n.jsxs)("div",{style:{display:"inline-flex",alignItems:"center",gap:"0.5rem"},children:[f>1?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("label",{htmlFor:b,style:{fontSize:"0.875rem",fontWeight:500,color:"#374151"},children:"Qty"}),(0,n.jsx)("select",{id:b,value:p,disabled:d,onChange:e=>x(Number(e.target.value)),style:{fontSize:"0.875rem",padding:"0.65rem 0.5rem",borderRadius:"0.375rem",border:"1px solid #d1d5db",backgroundColor:"#ffffff",color:"#111827",lineHeight:1.2},children:Array.from({length:f},(e,t)=>t+1).map(e=>(0,n.jsx)("option",{value:e,children:e},e))})]}):null,(0,n.jsx)("button",{type:"button",onClick:y,disabled:d,style:{display:"inline-flex",alignItems:"center",justifyContent:"center",backgroundColor:d?"#3d9140":"#4CAF50",color:"#ffffff",fontSize:"0.875rem",fontWeight:600,padding:"0.75rem 1.25rem",borderRadius:"0.375rem",border:"none",cursor:d?"not-allowed":"pointer",opacity:d?.7:1,boxShadow:"0 1px 2px rgba(0,0,0,0.05)",lineHeight:1.2},children:d?"Redirecting…":r})]}),u?(0,n.jsx)("p",{style:{marginTop:"0.5rem",fontSize:"0.875rem",color:"#dc2626"},children:u}):null]})}let i=s},804:(e,t,r)=>{"use strict";r.d(t,{AdminBar:()=>l});
1var n=r(29064),a=r(34340);async function o(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:fetch;try{let a=await r("/api/users/me",{credentials:"same-origin"});if(!a.ok)return!1;let{user:o}=await a.json();if(!(null==o?void 0:o.id))return!1;let l=await r("/api/".concat(e,"/access/").concat(encodeURIComponent(String(t))),{method:"POST",credentials:"same-origin"});if(!l.ok)return!1;var n=await l.json();if(!n||"object"!=typeof n)return!1;let s=n.update;return!0===s||!!s&&"object"==typeof s&&!0===s.permission}catch(e){return!1}}function l(e){let{collection:t,id:r,label:l="Page"}=e,[s,i]=(0,a.useState)(!1),[c,d]=(0,a.useState)(!1);return((0,a.useEffect)(()=>{let e=!1;return o(t,r).then(t=>{e||i(t)}),()=>{e=!0}},[t,r]),!s||c)?null:(0,n.jsxs)("div",{className:"nooq-admin-bar",role:"region","aria-label":"Editor tools",children:[(0,n.jsxs)("a",{className:"nooq-admin-bar__edit",href:"/admin/collections/".concat(t,"/").concat(r),children:[(0,n.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.25",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,n.jsx)("path",{d:"M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"}),(0,n.jsx)("path",{d:"M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z"})]}),"Edit ",l.toLowerCase()]}),(0,n.jsx)("a",{className:"nooq-admin-bar__link",href:"/admin",children:"Dashboard"}),(0,n.jsx)("button",{type:"button",className:"nooq-admin-bar__close",onClick:()=>d(!0),"aria-label":"Hide editor tools",children:"\xd7"}),(0,n.jsx)("style",{children:"\n        .nooq-admin-bar {\n          position: fixed;\n          left: 16px;\n          bottom: calc(16px + env(safe-area-inset-bottom, 0px));\n          z-index: 9999;\n          display: flex;\n          align-items: center;\n          gap: 4px;\n          padding: 4px;\n          border-radius: 999px;\n          background: var(--primary, #1f2937);\n          color: var(--primary-foreground, #ffffff);\n          box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);\n          font: 500 13px/1 system-ui, -apple-system, 'Segoe UI', sans-serif;\n        }\n        .nooq-admin-bar a,\n        .nooq-admin-bar button {\n          color: inherit;\n          text-decoration: none;\n          background: none;\n          border: 0;\n          cursor: pointer;\n          border-radius: 999px;\n          padding: 8px 12px;\n          display: inline-flex;\n          align-items: center;\n          gap: 6px;\n          font: inherit;\n        }\n        .nooq-admin-bar__edit { font-weight: 600; }\n        .nooq-admin-bar__link { opacity: 0.8; }\n        .nooq-admin-bar__close { padding: 8px 10px; font-size: 16px; opacity: 0.7; }\n        .nooq-admin-bar a:hover,\n        .nooq-admin-bar button:hover { background: rgba(255, 255, 255, 0.14); opacity: 1; }\n        .nooq-admin-bar a:focus-visible,\n        .nooq-admin-bar button:focus-visible { outline: 2px solid currentColor; outline-offset: 1px; }\n        @media print { .nooq-admin-bar { display: none; } }\n      "})]})}},3975:(e,t,r)=>{"use strict";r.d(t,{ClaraHeroBlock:()=>b});var n=r(29064),a=r(34340);let o={bg:"#0F1F17",bgCard:"#162B1F",bgChatBubbleUser:"#2C5F2D",bgChatBubbleClara:"#1A3528",bgChatHeader:"rgba(0,0,0,0.2)",bgFollowUp:"rgba(232, 114, 42, 0.06)",border:"#2A4A35",borderGlow:"#D4A843",accent:"#E8722A",accentGlow:"rgba(232, 114, 42, 0.3)",gold:"#D4A843",goldDim:"rgba(212, 168, 67, 0.5)",green:"#4A8B52",greenBright:"#6BBF59",greenDim:"rgba(74, 139, 82, 0.4)",moss:"#97BC62",white:"#F5F2EB",cream:"#E8E3D9",textMuted:"#8BA893",textDim:"#5A7A63",tabActive:"#E8722A",tabInactive:"#8BA893",tabActiveBg:"rgba(232, 114, 42, 0.1)",tabHoverBg:"#162B1F",buttonBg:"#E8722A",buttonText:"#0F1F17",avatarGradientStart:"#E8722A",avatarGradientEnd:"#D4A843",avatarTextColor:"#0F1F17"},l={primary:"var(--color-primary)",primaryLight:"var(--color-primary-light)",primaryDark:"var(--color-primary-dark)",secondary:"var(--color-secondary)",secondaryLight:"var(--color-secondary-light)",secondaryDark:"var(--color-secondary-dark)",accent:"var(--color-accent)",accentLight:"var(--color-accent-light, var(--color-accent))",accentDark:"var(--color-accent-dark, var(--color-accent))",dark:"var(--color-bg-dark)",muted:"var(--color-bg-muted)",subtle:"var(--color-bg-subtle, #f8f9fa)",white:"#ffffff"};function s(e,t){var r;return(null==e?void 0:e.source)?"custom"===e.source?(null==(r=e.custom)?void 0:r.trim())||t:l[e.source]||t:t}function i(e,t){if(e.startsWith("var(")||e.startsWith("rgba"))return e;let r=e.replace("#",""),n=parseInt(r.substring(0,2),16),a=parseInt(r.substring(2,4),16),o=parseInt(r.substring(4,6),16);return isNaN(n)||isNaN(a)||isNaN(o)?e:"rgba(".concat(n,", ").concat(a,", ").concat(o,", ").concat(t,")")}let c=(0,a.createContext)(o);function d(){return(0,a.useContext)(c)}let m=[{id:"saturday-medal",title:"Match Results",userMessage:"How did Scott get on in the medal on Saturday?",steps:[{text:"Finding Scott Goodfellow in Saturday Medal results",duration:900},{text:"Pulling scorecard and stats",duration:700}
1],response:[{type:"headline",text:"Scott shot 78 (net 69) — 3rd out of 58"},{type:"stats",items:[{label:"Gross",value:"78"},{label:"Net",value:"69"},{label:"Position",value:"3rd"},{label:"CSS",value:"71"}]},{type:"detail",text:"Strong front nine (39). Birdied the 2nd and 9th. Dropped shots on 15 and 17."},{type:"detail",text:"6.4 strokes better than average of peers in the 6-12 handicap group for the day."},{type:"detail",text:"Had a 3 on hole 12 (par 4), 1.8 strokes better than field average of 4.8 on the day."},{type:"detail",text:"Better than he normally plays in strong winds."},{type:"highlight",text:"He's cut 0.2 → HI now 7.4"}],followUp:"Want to see his full scorecard?"},{id:"holes-17-18",title:"Course Analysis",userMessage:"I really struggle on some holes, especially don't play 17 and 18 well. Who does?",steps:[{text:"Pulling your scoring on holes 17 and 18",duration:800},{text:"Finding best performers in your handicap range",duration:1e3},{text:"Analysing approach strategies",duration:700}],response:[{type:"headline",text:"You're averaging 5.18 on 17 and 4.92 on 18"},{type:"table",title:"Hole 17 — Best in your range (12-16 HI)",rows:[{rank:1,name:"Dougie Firth",value:"4.60"},{rank:2,name:"Scott Beattie",value:"4.63"},{rank:3,name:"Jim Rennie",value:"4.66"}]},{type:"table",title:"Hole 18 — Best in your range",rows:[{rank:1,name:"Scott Beattie",value:"4.11"},{rank:2,name:"Alan Park",value:"4.32"},{rank:3,name:"Stuart Campbell",value:"4.36"}]},{type:"detail",text:"Dougie's your man on 17. Scott owns 18. Might be worth watching them or asking them how they do it!"}],followUp:"Compare your approach strategy vs theirs?"},{id:"wind-performance",title:"Peer Analysis",userMessage:"My friend says he's better than I am, especially in the wind. Over last two years who is winning?",steps:[{text:"Identifying rounds played in wind >20mph",duration:800},{text:"Comparing scoring differential: calm vs wind",duration:1100},{text:"Ranking wind performance in your handicap group",duration:900}],response:[{type:"headline",text:"You average 80.2 normally but shoot 84.3 in wind vs Andy’s 82.2 normally but he is 83.5 in the wind"},{type:"windTable",rows:[{rank:1,name:"Gary Irvine",calm:"80.1",wind:"82.3",diff:"+2.2"},{rank:2,name:"Jim Rennie",calm:"83.5",wind:"86.1",diff:"+2.6"},{rank:3,name:"Craig Thomson",calm:"79.8",wind:"82.8",diff:"+3.0"},{rank:4,name:"Percy Burns",calm:"82.1",wind:"85.4",diff:"+3.3"},{rank:5,name:"You",calm:"80.2",wind:"84.3",diff:"+4.1",highlight:!0}]},{type:"detail",text:"Your par 3 scoring jumps 1.8 shots in wind. The wind specialists keep the ball low — their par 3 scores barely change."}],followUp:"Ask the pro about a punch shot clinic?"},{id:"best-time",title:"Smart Booking",userMessage:"Find the best time for me, Scott and Dougie next week. Not too windy, tee not too busy",steps:[{text:"Checking Scott Goodfellow's preferences",duration:800,result:"Free: Tue, Wed, Thu, Sat"},{text:"Checking Dougie Sander's preferences",duration:700,result:"Free: Tue, Thu"},{text:"Checking your calendar",duration:500,result:"Free: Tue, Wed, Thu, Fri"},{text:"Overlap found: Tuesday or Thursday",duration:400},{text:"Pulling 7-day weather forecast",duration:900},{text:"Analysing tee sheet patterns",duration:800},{text:"Checking course status",duration:600},{text:"Checking restaurant availability",duration:500},{text:"Checking member preferences",duration:400},{text:"Checking traffic",duration:500}],response:[{type:"headline",text:"Thursday 11:20 is your sweet spot"},{type:"weatherCompare",days:[{day:"Tue 18th",temp:"9\xb0C",wind:"22mph SW",windBad:!0,rain:"Showers AM",rainBad:!0},{day:"Thu 20th",temp:"12\xb0C",wind:"8mph NW",windBad:!1,rain:"Dry all day",rainBad:!1,winner:!0}]},{type:"teeSheet",day:"Thursday",slots:[{time:"08-10",pct:55},{time:"10-12",pct:35,best:!0},{time:"12-14",pct:40}]},{type:"detail",text:"Light wind, dry, quiet tee. All three free."},{type:"detail",text:"Do you want food before you play or after your round? The kitchen closes at 4pm — you might not finish in time."},{type:"detail",text:"Contacting kitchen to ask if they can stay open longer if you pre-order now..."},{type:"detail",text:"Kitchen can’t do Thursday after the round. Want to pre-order coffee and food before your round?"},{type:"highlight",text:"OK, booking confirmed. Food at 10AM — gives you 30 mins to use the range."},{type:"detail",text:"Checking travel time... Sending travel confirmations to everyone. Leave house at 9:24 to arrive for breakfast."},{type:"detail",text:"Play well ⛳"}],followUp:"All done — Scott and Dougie have been notified"}];function u(){let e=d();return(0,n.jsx)("span",{style:{display:"inline-block",width:14,height:14,border:"2px s
1olid ".concat(e.textDim),borderTopColor:e.accent,borderRadius:"50%",animation:"clara-spin 0.7s linear infinite",flexShrink:0,marginTop:2}})}function h(){let e=d();return(0,n.jsx)("span",{style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:14,height:14,borderRadius:"50%",background:e.green,flexShrink:0,marginTop:2,animation:"clara-pop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1)"},children:(0,n.jsx)("svg",{width:"8",height:"8",viewBox:"0 0 10 8",fill:"none",children:(0,n.jsx)("path",{d:"M1 4L3.5 6.5L9 1",stroke:e.white,strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round"})})})}function p(e){let{step:t,state:r}=e,a=d();return(0,n.jsxs)("div",{style:{display:"flex",gap:10,alignItems:"flex-start",opacity:+("hidden"!==r),transform:"hidden"===r?"translateY(6px)":"translateY(0)",transition:"opacity 0.35s ease, transform 0.35s ease",minHeight:22},children:["running"===r?(0,n.jsx)(u,{}):(0,n.jsx)(h,{}),(0,n.jsxs)("div",{style:{flex:1},children:[(0,n.jsx)("span",{style:{fontSize:13,fontFamily:"'JetBrains Mono', 'Fira Code', monospace",color:"done"===r?a.cream:a.textMuted,transition:"color 0.3s"},children:t.text}),t.result&&"done"===r&&(0,n.jsxs)("div",{style:{fontSize:11,color:a.gold,marginTop:2,fontFamily:"'JetBrains Mono', 'Fira Code', monospace",animation:"clara-fadeIn 0.3s ease"},children:["\\u2192 ",t.result]})]})]})}function x(e){let{item:t,visible:r}=e,a=d(),o={opacity:+!!r,transform:r?"translateY(0)":"translateY(8px)",transition:"opacity 0.4s ease, transform 0.4s ease"};return"headline"===t.type?(0,n.jsx)("div",{style:{...o,fontSize:16,fontWeight:700,color:a.white,fontFamily:"'Playfair Display', Georgia, serif",lineHeight:1.3,marginBottom:10},children:t.text}):"stats"===t.type?(0,n.jsx)("div",{style:{...o,display:"grid",gridTemplateColumns:"repeat(4, 1fr)",gap:8,marginBottom:12},children:t.items.map((e,t)=>(0,n.jsxs)("div",{style:{background:a.bgCard,borderRadius:8,padding:"10px 8px",textAlign:"center",border:"1px solid ".concat(a.border)},children:[(0,n.jsx)("div",{style:{fontSize:20,fontWeight:800,color:a.gold,fontFamily:"'Playfair Display', Georgia, serif"},children:e.value}),(0,n.jsx)("div",{style:{fontSize:10,color:a.textMuted,textTransform:"uppercase",letterSpacing:1,marginTop:3},children:e.label})]},t))}):"detail"===t.type?(0,n.jsx)("div",{style:{...o,fontSize:13,color:a.cream,lineHeight:1.6,marginBottom:8},children:t.text}):"highlight"===t.type?(0,n.jsxs)("div",{style:{...o,display:"inline-flex",alignItems:"center",gap:6,background:"rgba(74, 139, 82, 0.15)",border:"1px solid ".concat(a.greenDim),borderRadius:6,padding:"6px 12px",fontSize:13,color:a.greenBright,fontWeight:600,marginBottom:8},children:[(0,n.jsx)("span",{style:{fontSize:10},children:"▼"})," ",t.text]}):"table"===t.type?(0,n.jsxs)("div",{style:{...o,marginBottom:12},children:[(0,n.jsx)("div",{style:{fontSize:11,color:a.gold,textTransform:"uppercase",letterSpacing:.8,marginBottom:6,fontWeight:600},children:t.title}),(0,n.jsx)("div",{style:{borderRadius:8,overflow:"hidden",border:"1px solid ".concat(a.border)},children:t.rows.map((e,t)=>(0,n.jsxs)("div",{style:{display:"flex",alignItems:"center",padding:"7px 12px",background:t%2==0?a.bgCard:"transparent",gap:10},children:[(0,n.jsxs)("span",{style:{fontSize:11,color:a.textDim,width:18,fontFamily:"monospace"},children:["#",e.rank]}),(0,n.jsx)("span",{style:{flex:1,fontSize:13,color:a.cream},children:e.name}),(0,n.jsx)("span",{style:{fontSize:14,fontWeight:700,color:a.gold,fontFamily:"'Playfair Display', Georgia, serif"},children:e.value})]},t))})]}):"windTable"===t.type?(0,n.jsxs)("div",{style:{...o,marginBottom:12},children:[(0,n.jsxs)("div",{style:{fontSize:10,color:a.textDim,display:"grid",gridTemplateColumns:"20px 1fr 60px 60px 55px",gap:4,padding:"0 12px 4px",textTransform:"uppercase",letterSpacing:.6},children:[(0,n.jsx)("span",{}),(0,n.jsx)("span",{children:"Player"}),(0,n.jsx)("span",{style:{textAlign:"right"},children:"Calm"}),(0,n.jsx)("span",{style:{textAlign:"right"},children:"Wind"}),(0,n.jsx)("span",{style:{textAlign:"right"},children:"+/-"})]}),(0,n.jsx)("div",{style:{borderRadius:8,overflow:"hidden",border:"1px solid ".concat(a.border)},children:t.rows.map((e,t)=>(0,n.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"20px 1fr 60px 60px 55px",gap:4,alignItems:"center",padding:"7px 12px",background:e.highlight?i(a.accent,.08):t%2==0?a.bgCard:"transparent",borderLeft:e.highlight?"3px solid ".concat(a.accent):"3px solid transparent"}
1,children:[(0,n.jsx)("span",{style:{fontSize:10,color:a.textDim,fontFamily:"monospace"},children:e.rank}),(0,n.jsx)("span",{style:{fontSize:13,color:e.highlight?a.accent:a.cream,fontWeight:e.highlight?700:400},children:e.name}),(0,n.jsx)("span",{style:{fontSize:12,color:a.textMuted,textAlign:"right",fontFamily:"monospace"},children:e.calm}),(0,n.jsx)("span",{style:{fontSize:12,color:a.textMuted,textAlign:"right",fontFamily:"monospace"},children:e.wind}),(0,n.jsx)("span",{style:{fontSize:12,textAlign:"right",fontWeight:700,fontFamily:"monospace",color:parseFloat(e.diff)>4?a.accent:3>parseFloat(e.diff)?a.greenBright:a.gold},children:e.diff})]},t))})]}):"weatherCompare"===t.type?(0,n.jsx)("div",{style:{...o,display:"grid",gridTemplateColumns:"1fr 1fr",gap:8,marginBottom:12},children:t.days.map((e,t)=>(0,n.jsxs)("div",{style:{background:a.bgCard,borderRadius:8,padding:12,border:e.winner?"1px solid ".concat(a.green):"1px solid ".concat(a.border),position:"relative"},children:[e.winner&&(0,n.jsx)("div",{style:{position:"absolute",top:-8,right:12,background:a.green,color:a.white,fontSize:9,padding:"2px 8px",borderRadius:4,fontWeight:700,textTransform:"uppercase",letterSpacing:.5},children:"Best"}),(0,n.jsx)("div",{style:{fontSize:14,fontWeight:700,color:a.white,marginBottom:8},children:e.day}),(0,n.jsx)("div",{style:{fontSize:12,color:a.cream,marginBottom:4},children:e.temp}),(0,n.jsx)("div",{style:{fontSize:12,color:e.windBad?a.accent:a.greenBright,marginBottom:4},children:e.wind}),(0,n.jsx)("div",{style:{fontSize:12,color:e.rainBad?a.accent:a.greenBright},children:e.rain})]},t))}):"teeSheet"===t.type?(0,n.jsxs)("div",{style:{...o,marginBottom:12},children:[(0,n.jsxs)("div",{style:{fontSize:11,color:a.gold,textTransform:"uppercase",letterSpacing:.8,marginBottom:8,fontWeight:600},children:["Tee sheet \\u2014 ",t.day]}),(0,n.jsx)("div",{style:{display:"flex",flexDirection:"column",gap:6},children:t.slots.map((e,t)=>(0,n.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:10},children:[(0,n.jsx)("span",{style:{fontSize:11,color:a.textMuted,fontFamily:"monospace",width:42},children:e.time}),(0,n.jsxs)("div",{style:{flex:1,height:18,background:a.bgCard,borderRadius:4,overflow:"hidden",border:"1px solid ".concat(a.border),position:"relative"},children:[(0,n.jsx)("div",{style:{height:"100%",width:"".concat(e.pct,"%"),borderRadius:4,background:e.best?"linear-gradient(90deg, ".concat(a.green,", ").concat(a.moss,")"):"linear-gradient(90deg, ".concat(a.textDim,", ").concat(a.textMuted,")"),transition:"width 0.8s ease"}}),e.best&&(0,n.jsxs)("span",{style:{position:"absolute",right:6,top:1,fontSize:9,color:a.greenBright,fontWeight:700},children:["←"," QUIET"]})]}),(0,n.jsxs)("span",{style:{fontSize:11,color:e.best?a.greenBright:a.textMuted,fontFamily:"monospace",width:30,textAlign:"right"},children:[e.pct,"%"]})]},t))})]}):null}function g(e){let{size:t,identity:r,colors:a}=e,o=(null==r?void 0:r.avatarMode)==="upload"&&r.avatarImage&&"object"==typeof r.avatarImage&&null!==r.avatarImage?r.avatarImage.url:void 0;if(o)return(0,n.jsx)("div",{style:{width:t,height:t,borderRadius:"50%",overflow:"hidden",flexShrink:0,background:"linear-gradient(135deg, ".concat(a.avatarGradientStart,", ").concat(a.avatarGradientEnd,")")},children:(0,n.jsx)("img",{src:o,alt:(null==r?void 0:r.displayName)||"Clara",style:{width:"100%",height:"100%",objectFit:"cover"}})});let l=(null==r?void 0:r.avatarLetter)||"C";return(0,n.jsx)("div",{style:{width:t,height:t,borderRadius:"50%",flexShrink:0,background:"linear-gradient(135deg, ".concat(a.avatarGradientStart,", ").concat(a.avatarGradientEnd,")"),display:"flex",alignItems:"center",justifyContent:"center",fontSize:Math.round(.44*t),fontWeight:800,color:a.avatarTextColor},children:l})}function f(e,t){let r=e.appearance,n=e.textColors,a=e.accentColors,o=e.borderColors,l=e.buttonStyle,i=e.tabStyle,c=e.avatarStyle;return{bg:s(null==r?void 0:r.pageBg,t.bg),bgCard:s(null==r?void 0:r.cardBg,t.bgCard),bgChatBubbleUser:s(null==r?void 0:r.userBubbleBg,t.bgChatBubbleUser),bgChatBubbleClara:s(null==r?void 0:r.claraBubbleBg,t.bgChatBubbleClara),bgChatHeader:s(null==r?void 0:r.chatHeaderBg,t.bgChatHeader),bgFollowUp:s(null==r?void 0:r.followUpBg,t.bgFollowUp),border:s(null==o?void 0:o.border,t.border),borderGlow:s(null==o?void 0:o.borderGlow,t.borderGlow),accent:s(null==a?void 0:a.accent,t.accent),accentGlow:s(null==a?void 0:a.accentGlow,t.accentGlow),gold:s(null==a?void 0:a.gold,t.gold),goldDim:t.goldDim,green:s(null==a?void 0:a.success,t.green),greenBright:s(null==a?void 0:a.successBright,t.greenBright),greenDim:t.greenDim,moss:s(null==a?void 0:a.moss,t.moss),white:s(null==n?void 0:n.headingText,t.white),cream:s(null==n?void 0:n.bodyText,t.cream),textMuted:s(null==n?void 0:n.mutedText,t.textMuted),textDim:s(null==n?void 0:n.dimText,t.textDim),tabActive:s(null==i?void 0:i.tabActive,t.tabActive),tabInactive:s(null==i?void 0:i.tabInactive,t.tabInactive),tabActiveBg:s(null==i?void 0:i.tabActiveBg,t.tabActiveBg),tabHoverBg:s(null==i?void 0:i.tabHoverBg,t.tabHoverBg),buttonBg:s(null==l?void 0:l.buttonBg,t.buttonBg),buttonText:s(null==l?void 0:l.buttonText,t.buttonText),avatarGradientStart:s(null==c?void 0:c.avatarGradientStart,t.avatarGradientStart),avatarGradientEnd:s(null==c?void 0:c.avatarGradientEnd,t.avatarGradientEnd),avatarTextColor:s(null==c?void 0:c.avatarTextColor,t.avatarTextColor)}}let b=e=>{let{heading:t="Ask anything about your golf",subheading:r="Clara knows the course, the weather, your mates, and your game",clubName:l="Glen East Golf",tagline:s="O
1ne message. Everything sorted.",scenarios:d,theme:h,claraIdentity:b}=e,y=d&&d.length>0?d.map((e,t)=>({id:"custom-".concat(t),title:e.title,userMessage:e.userMessage,steps:(e.steps||[]).map(e=>({text:e.text,duration:e.duration||800,...e.result?{result:e.result}:{}})),response:(e.responseItems||[]).map(e=>{let t=e.blockType;return"clara-headline"===t?{type:"headline",text:e.text}:"clara-stats"===t?{type:"stats",items:e.items||[]}:"clara-detail"===t?{type:"detail",text:e.text}:"clara-highlight"===t?{type:"highlight",text:e.text}:"clara-table"===t?{type:"table",title:e.title,rows:e.rows||[]}:"clara-wind-table"===t?{type:"windTable",rows:(e.rows||[]).map(e=>({...e,highlight:e.highlightRow}))}:"clara-weather-compare"===t?{type:"weatherCompare",days:(e.days||[]).map(e=>({...e,windBad:!!e.windBad,rainBad:!!e.rainBad}))}:"clara-tee-sheet"===t?{type:"teeSheet",day:e.day,slots:e.slots||[]}:{type:"detail",text:""}}).filter(e=>"detail"!==e.type||""!==e.text),followUp:e.followUp||""})):m,v=function(e){for(let t of[e.appearance,e.textColors,e.accentColors,e.borderColors,e.buttonStyle,e.tabStyle,e.avatarStyle])if(t){for(let e of Object.values(t))if(e&&"object"==typeof e&&"source"in e&&e.source)return!0}return!1}(e),[j,w]=(0,a.useState)(()=>h?{...o,...h}:v?f(e,o):o);(0,a.useEffect)(()=>{h||fetch("/api/clara-theme").then(e=>e.json()).then(t=>{if(t&&"object"==typeof t){let r=function(e){return{...o,bg:e.bg||o.bg,bgCard:e.bgCard||o.bgCard,bgChatBubbleUser:e.bgChatBubbleUser||o.bgChatBubbleUser,bgChatBubbleClara:e.bgChatBubbleClara||o.bgChatBubbleClara,border:e.border||o.border,borderGlow:e.borderGlow||o.borderGlow,accent:e.orange||o.accent,accentGlow:i(e.orange||o.accent,.3),gold:e.gold||o.gold,goldDim:i(e.gold||o.gold,.5),green:e.green||o.green,greenBright:e.greenBright||o.greenBright,greenDim:i(e.green||o.green,.4),moss:e.moss||o.moss,white:e.white||o.white,cream:e.cream||o.cream,textMuted:e.textMuted||o.textMuted,textDim:e.textDim||o.textDim,tabActive:e.orange||o.tabActive,tabInactive:e.textMuted||o.tabInactive,tabActiveBg:i(e.orange||o.accent,.1),tabHoverBg:e.bgCard||o.tabHoverBg,buttonBg:e.orange||o.buttonBg,buttonText:e.bg||o.buttonText,avatarGradientStart:e.orange||o.avatarGradientStart,avatarGradientEnd:e.gold||o.avatarGradientEnd,avatarTextColor:e.bg||o.avatarTextColor}}(t);v?w(f(e,r)):w(r)}}).catch(()=>{})},[h]);let k=(null==b?void 0:b.displayName)||"Clara",N=(null==b?void 0:b.badgeText)||"Clara AI",[C,S]=(0,a.useState)(0),[_,T]=(0,a.useState)([]),[q,B]=(0,a.useState)([]),[z,M]=(0,a.useState)(!1),[P,L]=(0,a.useState)("typing"),[D,W]=(0,a.useState)(0),A=(0,a.useRef)([]),E=(0,a.useRef)(null),[F,R]=(0,a.useState)(0),I=y[C],H=(0,a.useCallback)(()=>{A.current.forEach(clearTimeout),A.current=[]},[]),G=(0,a.useCallback)((e,t)=>{let r=setTimeout(e,t);return A.current.push(r),r},[]);return(0,a.useEffect)(()=>{H(),L("typing"),W(0),T(I.steps.map(()=>"hidden")),B(I.response.map(()=>!1)),M(!1);let e=I.userMessage,t=0,r=setInterval(()=>{W(++t),t>=e.length&&(clearInterval(r),G(()=>{L("steps"),function(){let e=200;I.steps.forEach((t,r)=>{G(()=>{T(e=>{let t=[...e];return t[r]="running",t})},e),G(()=>{T(e=>{let t=[...e];return t[r]="done",t})},e+=t.duration),e+=150}),G(()=>{let e;L("response"),e=0,I.response.forEach((t,r)=>{G(()=>{B(e=>{let t=[...e];return t[r]=!0,t})},e),e+=250}),G(()=>{M(!0),L("done")},e+300)},e+200)}()},400))},22);return A.current.push(r),()=>{H(),clearInterval(r)}},[C]),(0,a.useEffect)(()=>{if("done"!==P||!E.current)return;let e=E.current.scrollHeight;R(t=>Math.max(t,e))},[P]),(0,a.useEffect)(()=>{if("done"!==P)return;let e=setTimeout(()=>{S(e=>(e+1)%y.length)},5e3);return()=>clearTimeout(e)},[P,y.length]),(0,n.jsxs)(c.Provider,{value:j,children:[(0,n.jsx)("style",{children:"\n        @import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;700;800&family=Source+Sans+3:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');\n        @keyframes clara-spin { to { transform: rotate(360deg); } }\n        @keyframes clara-pop { 0% { transform: scale(0); } 100% { transform: scale(1); } }\n        @keyframes clara-fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }\n        @keyframes clara-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }\n        @keyframes clara-glow { 0%, 100% { box-shadow: 0 0 15px ".concat(j.accentGlow,"; } 50% { box-shadow: 0 0 30px ").concat(j.accentGlow,", 0 0 60px ").concat(i(j.accent,.1),"; } }\n        @keyframes clara-cursor { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }\n        .clara-tab { cursor: pointer; padding: 8px 16px; border-radius: 6px; font-size: 12px; font-family: 'Source Sans 3', sans-serif; font-weight: 500; border: 1px solid transparent; transition: all 0.25s ease; text-transform: uppercase; letter-spacing: 0.8px; user-select: none; white-space: nowrap; }\n        .clara-tab:hover { background: ").concat(j.tabHoverBg,"; border-color: ").concat(j.border,"; }\n        .clara-tab-active { background: ").concat(j.tabActiveBg," !important; border-color: ").concat(j.tabActive," !important; color: ").concat(j.tabActive," !important; }\n        .clara-followup { opacity: 0; transform: translateY(6px); animation: clara-fadeIn 0.4s ease forwards; }\n        .clara-hero-container { position: relative; overflow: hidden; }\n        .clara-hero-container::before { content: ''; position: absolute; top: 0; left: 0; right: 0; bottom: 0; background: radial-gradient(ellipse at 20% 50%, rgba(44, 95, 45, 0.08) 0%, transparent 50%), radial-gradient(ellipse at 80% 20%, ").concat(i(j.accent,.04)," 0%, transparent 40%); pointer-events: none; }\n      ")}),(0,n.jsxs)("div",{className:"clara-hero-container",style:{background:j.bg,minHeight:"100vh",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",padding:"40px 20px",fontFamily:"'Source Sans 3', sans-serif",color:j.white,position:"relative"},children:[(0,n.jsxs)("div",{style:{textAlign:"center",marginBottom:32,position:"relative",zIndex:1},children:[(0,n.jsxs)("div",{style:{display:"inline-flex",alignItems:"center",gap:8,marginBottom:12,background:i(j.accent,.08),border:"1px solid ".concat(i(j.accent,.2)),borderRadius:20,padding:"5px 14px"},children:[(0,n.jsx)("div",{style:{width:6,height:6,borderRadius:"50%",background:j.greenBright,animation:"clara-
1pulse 2s ease infinite"}}),(0,n.jsx)("span",{style:{fontSize:11,color:j.accent,fontWeight:600,letterSpacing:1.5,textTransform:"uppercase"},children:N})]}),(0,n.jsx)("h2",{style:{fontSize:32,fontFamily:"'Playfair Display', Georgia, serif",fontWeight:800,color:j.white,margin:"8px 0 6px",letterSpacing:-.5,lineHeight:1.2},children:t}),(0,n.jsx)("p",{style:{fontSize:15,color:j.textMuted,maxWidth:420,margin:"0 auto",lineHeight:1.5},children:r})]}),(0,n.jsx)("div",{style:{display:"flex",gap:6,marginBottom:20,flexWrap:"wrap",justifyContent:"center",position:"relative",zIndex:1},children:y.map((e,t)=>(0,n.jsx)("button",{className:"clara-tab ".concat(t===C?"clara-tab-active":""),style:{color:t===C?j.tabActive:j.tabInactive,background:"transparent"},onClick:()=>S(t),children:e.title},e.id))}),(0,n.jsxs)("div",{ref:E,style:{width:"100%",maxWidth:520,minHeight:F||void 0,background:j.bgCard,borderRadius:16,border:"1px solid ".concat(j.border),overflow:"hidden",position:"relative",zIndex:1,animation:"steps"===P?"clara-glow 2.5s ease infinite":"none",boxShadow:"0 20px 60px rgba(0,0,0,0.4), 0 0 1px ".concat(j.border),transition:"box-shadow 0.5s ease, min-height 0.4s ease"},children:[(0,n.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:10,padding:"14px 20px",background:j.bgChatHeader,borderBottom:"1px solid ".concat(j.border)},children:[(0,n.jsx)(g,{size:32,identity:b,colors:j}),(0,n.jsxs)("div",{children:[(0,n.jsx)("div",{style:{fontSize:14,fontWeight:600,color:j.white},children:k}),(0,n.jsxs)("div",{style:{fontSize:10,color:j.greenBright,display:"flex",alignItems:"center",gap:4},children:[(0,n.jsx)("div",{style:{width:5,height:5,borderRadius:"50%",background:j.greenBright}}),l]})]}),(0,n.jsx)("div",{style:{marginLeft:"auto",display:"flex",gap:4},children:y.map((e,t)=>(0,n.jsx)("div",{style:{width:6,height:6,borderRadius:"50%",transition:"all 0.3s ease",background:t===C?j.accent:j.textDim,transform:t===C?"scale(1.3)":"scale(1)"}},t))})]}),(0,n.jsxs)("div",{style:{padding:20},children:[(0,n.jsx)("div",{style:{display:"flex",justifyContent:"flex-end",marginBottom:16},children:(0,n.jsxs)("div",{style:{background:j.bgChatBubbleUser,borderRadius:"14px 14px 4px 14px",padding:"10px 14px",maxWidth:"85%",fontSize:14,color:j.cream,lineHeight:1.5},children:[I.userMessage.slice(0,D),"typing"===P&&(0,n.jsx)("span",{style:{display:"inline-block",width:2,height:16,background:j.gold,marginLeft:1,verticalAlign:"text-bottom",animation:"clara-cursor 0.6s step-end infinite"}})]})}),"typing"!==P&&(0,n.jsxs)("div",{style:{display:"flex",gap:10},children:[(0,n.jsx)(g,{size:28,identity:b,colors:j}),(0,n.jsxs)("div",{style:{flex:1,background:j.bgChatBubbleClara,borderRadius:"4px 14px 14px 14px",padding:16,border:"1px solid ".concat(j.border)},children:["steps"===P&&(0,n.jsxs)("div",{style:{fontSize:11,color:j.accent,fontWeight:600,textTransform:"uppercase",letterSpacing:1.2,marginBottom:12,display:"flex",alignItems:"center",gap:6},children:[(0,n.jsx)(u,{})," ",k," is working..."]}),(0,n.jsx)("div",{style:{display:"flex",flexDirection:"column",gap:8,marginBottom:16*("response"===P||"done"===P)},children:I.steps.map((e,t)=>(0,n.jsx)(p,{step:e,state:_[t]},"".concat(I.id,"-").concat(t)))}),("response"===P||"done"===P)&&(0,n.jsx)("div",{style:{height:1,background:"linear-gradient(90deg, transparent, ".concat(j.border,", transparent)"),margin:"12px 0 14px",animation:"clara-fadeIn 0.3s ease"}}),I.response.map((e,t)=>(0,n.jsx)(x,{item:e,visible:q[t]},"".concat(I.id,"-resp-").concat(t))),z&&(0,n.jsxs)("div",{className:"clara-followup",style:{marginTop:12,padding:"10px 14px",background:j.bgFollowUp,border:"1px solid ".concat(i(j.accent,.15)),borderRadius:8,fontSize:13,color:j.accent,display:"flex",alignItems:"center",justifyContent:"space-between"},children:[(0,n.jsx)("span",{children:I.followUp}),(0,n.jsxs)("span",{style:{background:j.buttonBg,color:j.buttonText,padding:"4px 10px",borderRadius:4,fontSize:11,fontWeight:700,cursor:"pointer",whiteSpace:"nowrap",marginLeft:8},children:["Yes ","→"]})]})]})]})]})]}),(0,n.jsx)("div",{style:{marginTop:28,textAlign:"center",position:"relative",zIndex:1,animation:"clara-fadeIn 1s ease"},children:(0,n.jsx)("p",{style:{fontSize:13,color:j.textDim,letterSpacing:.3},children:s})})]})]})}},6674:(e,t,r)=>{"use strict";r.d(t,{default:()=>C});
1var n=r(29064),a=r(34340),o=r(97346),l=r(87482);function s(e){let{orientation:t}=e;return(0,n.jsx)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:(0,n.jsx)("path",{d:"left"===t?"M15 18l-6-6 6-6":"M9 18l6-6-6-6",strokeLinecap:"round",strokeLinejoin:"round"})})}function i(e){let{className:t,classNames:r,showOutsideDays:a=!0,...i}=e;return(0,n.jsx)(o.h,{showOutsideDays:a,className:(0,l.cn)("p-3",t),classNames:{months:"relative flex flex-col gap-4 sm:flex-row",month:"flex flex-col gap-4",month_caption:"flex items-center justify-center pt-1",caption_label:"text-sm font-medium",nav:"absolute inset-x-0 top-0 flex items-center justify-between px-1",button_previous:"inline-flex h-7 w-7 items-center justify-center rounded-md border border-input bg-transparent text-foreground hover:bg-muted",button_next:"inline-flex h-7 w-7 items-center justify-center rounded-md border border-input bg-transparent text-foreground hover:bg-muted",month_grid:"w-full border-collapse",weekdays:"flex",weekday:"w-9 text-[0.8rem] font-normal text-muted-foreground",week:"mt-2 flex w-full",day:"h-9 w-9 p-0 text-center text-sm",day_button:"inline-flex h-9 w-9 items-center justify-center rounded-md hover:bg-muted aria-selected:bg-primary aria-selected:text-primary-foreground aria-selected:hover:bg-primary",today:"font-semibold underline",outside:"text-muted-foreground opacity-50",disabled:"text-muted-foreground opacity-50",hidden:"invisible",...r},components:{Chevron:s},...i})}var c=r(65398);let d=c.bL,m=c.l9,u=a.forwardRef((e,t)=>{let{className:r,align:a="center",sideOffset:o=4,...s}=e;return(0,n.jsx)(c.ZL,{children:(0,n.jsx)(c.UC,{ref:t,align:a,sideOffset:o,className:(0,l.cn)("z-50 w-auto rounded-md border border-border bg-popover p-0 text-popover-foreground shadow-md outline-none",r),...s})})});u.displayName="PopoverContent";let h="w-full rounded-md border border-input bg-background px-2.5 py-1.5 text-sm text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:opacity-50",p="mb-1 block text-xs font-medium text-muted-foreground";function x(e){let{row:t,matchNumber:r,gameOutcomes:a,showHandicaps:o,homeListId:l,awayListId:s,onField:i,onPoints:c,onResult:d}=e,m={min:0,max:t.pointsWin,step:t.pointsDraw};return(0,n.jsxs)("div",{className:"rounded-md border border-border bg-background p-4",children:[(0,n.jsxs)("h4",{className:"mb-3 text-sm font-semibold text-foreground",children:["Match ",r]}),(0,n.jsxs)("div",{className:"grid grid-cols-1 gap-2 sm:grid-cols-[1fr_4.5rem_8rem_4.5rem_1fr] sm:items-end",children:[(0,n.jsxs)("div",{className:"space-y-1",children:[(0,n.jsx)("label",{className:p,children:"Home Players"}),(0,n.jsx)("input",{className:h,type:"text",list:l,placeholder:"Player 1",value:t.homePlayer1,onChange:e=>i("homePlayer1",e.target.value)}),(0,n.jsx)("input",{className:h,type:"text",list:l,placeholder:"Player 2",value:t.homePlayer2,onChange:e=>i("homePlayer2",e.target.value)}),o&&(0,n.jsxs)("div",{className:"flex gap-1",children:[(0,n.jsx)("input",{className:h,type:"number",step:.1,placeholder:"HCap 1",value:t.homeHandicap1,onChange:e=>i("homeHandicap1",e.target.value)}),(0,n.jsx)("input",{className:h,type:"number",step:.1,placeholder:"HCap 2",value:t.homeHandicap2,onChange:e=>i("homeHandicap2",e.target.value)})]})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)("label",{className:p,children:"Points"}),(0,n.jsx)("input",{className:h,type:"number",...m,value:t.homePoints,onChange:e=>c("home",e.target.value)})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)("label",{className:p,children:"Result"}),(0,n.jsxs)("select",{className:h,value:t.result,onChange:e=>d(e.target.value),children:[(0,n.jsx)("option",{value:"",children:"—"}),a.map(e=>(0,n.jsx)("option",{value:e,children:e},e))]})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)("label",{className:p,children:"Points"}),(0,n.jsx)("input",{className:h,type:"number",...m,value:t.awayPoints,onChange:e=>c("away",e.target.value)})]}),(0,n.jsxs)("div",{className:"space-y-1",children:[(0,n.jsx)("label",{className:p,children:"Away Players"}),(0,n.jsx)("input",{className:h,type:"text",list:s,placeholder:"Player 1",value:t.awayPlayer1,onChange:e=>i("awayPlayer1",e.target.value)}),(0,n.jsx)("input",{className:h,type:"text",list:s,placeholder:"Player 2",value:t.awayPlayer2,onChange:e=>i("awayPlayer2",e.target.value)}),o&&(0,n.jsxs)("div",{className:"flex gap-1",children:[(0,n.jsx)("input",{className:h,type:"number",step:.1,placeholder:"HCap 1",value:t.awayHandicap1,onChange:e=>i("awayHandicap1",e.target.value)}),(0,n.jsx)("input",{className:h,type:"number",step:.1,placeholder:"HCap 2",value:t.awayHandicap2,onChange:e=>i("awayHandicap2",e.target.value)})]})]})]})]})}function g(e){let{row:t,matchNumber:r,gameOutcomes:a,showHandicaps:o,homeListId:l,awayListId:s,onField:i,onPoints:c,onResult:d}=e,m={min:0,max:t.pointsWin,step:t.pointsDraw},u=o?"sm:grid-cols-[1fr_4rem_4.5rem_8rem_4.5rem_4rem_1fr]":"sm:grid-cols-[1fr_4.5rem_8rem_4.5rem_1fr]";return(0,n.jsxs)("div",{className:"rounded-md border border-border bg-background p-4",children:[(0,n.jsxs)("h4",{className:"mb-3 text-sm font-semibold text-foreground",children:["Match ",r]}),(0,n.jsxs)("div",{className:"grid grid-cols-1 gap-2 ".concat(u," sm:items-end"),children:[(0,n.jsxs)("div",{children:[(0,n.jsx)("label",{className:p,children:"Home Player"}),(0,n.jsx)("input",{className:h,type:"text",list:l,value:t.homePlayer,onChange:e=>i("homePlayer",e.target.value)})]}),o&&(0,n.jsxs)("div",{children:[(0,n.jsx)("label",{className:p,children:"HCap"}),(0,n.jsx)("input",{className:h,type:"number",step:.1,value:t.homeHandicap,onChange:e=>i("homeHandicap",e.target.value)})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)("label",{className:p,children:"Points"}),(0,n.jsx)("input",{className:h,type:"number",...m,value:t.homePoints,onChange:e=>c("home",e.target.value)})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)("label",{className:p,children:"Result"}
1),(0,n.jsxs)("select",{className:h,value:t.result,onChange:e=>d(e.target.value),children:[(0,n.jsx)("option",{value:"",children:"—"}),a.map(e=>(0,n.jsx)("option",{value:e,children:e},e))]})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)("label",{className:p,children:"Points"}),(0,n.jsx)("input",{className:h,type:"number",...m,value:t.awayPoints,onChange:e=>c("away",e.target.value)})]}),o&&(0,n.jsxs)("div",{children:[(0,n.jsx)("label",{className:p,children:"HCap"}),(0,n.jsx)("input",{className:h,type:"number",step:.1,value:t.awayHandicap,onChange:e=>i("awayHandicap",e.target.value)})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)("label",{className:p,children:"Away Player"}),(0,n.jsx)("input",{className:h,type:"text",list:s,value:t.awayPlayer,onChange:e=>i("awayPlayer",e.target.value)})]})]})]})}let f=e=>{let t="number"==typeof e?e:parseFloat(String(null!=e?e:""));return Number.isFinite(t)?t:0};function b(e){let t=Math.floor(e);return e-t==.5?"".concat(t,"\xbd"):String(t)}function y(e,t){let r={};for(let n of[...e.map(e=>({sectionName:e.sectionName,matchType:"singles",pointsWin:e.pointsWin,pointsDraw:e.pointsDraw,homePoints:f(e.homePoints),awayPoints:f(e.awayPoints)})),...t.map(e=>({sectionName:e.sectionName,matchType:"doubles",pointsWin:e.pointsWin,pointsDraw:e.pointsDraw,homePoints:f(e.homePoints),awayPoints:f(e.awayPoints)}))]){let e=r[n.sectionName]||(r[n.sectionName]={match_type:n.matchType,points_win:n.pointsWin,points_draw:n.pointsDraw,home_won:0,home_lost:0,home_drawn:0,home_pts:0,away_won:0,away_lost:0,away_drawn:0,away_pts:0});e.home_pts+=n.homePoints,e.away_pts+=n.awayPoints,n.homePoints>n.awayPoints?(e.home_won+=1,e.away_lost+=1):n.awayPoints>n.homePoints?(e.away_won+=1,e.home_lost+=1):n.homePoints>0&&n.awayPoints>0&&(e.home_drawn+=1,e.away_drawn+=1)}return r}let v="/api/league/match-report";async function j(e){let t=await fetch(e,{cache:"no-store"}),r=await t.json().catch(()=>({}));if(!t.ok)throw Error((null==r?void 0:r.error)||"Request failed (".concat(t.status,")"));return r}function w(e){let t=/^(\d{4})-(\d{2})-(\d{2})$/.exec(e);return t?"".concat(t[3],"/").concat(t[2],"/").concat(t[1]):e}function k(e){let t=/^(\d{4})-(\d{2})-(\d{2})$/.exec(e);return t?new Date(+t[1],t[2]-1,+t[3]):void 0}function N(){return(0,n.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"text-muted-foreground",children:[(0,n.jsx)("rect",{x:"3",y:"4",width:"18",height:"18",rx:"2"}),(0,n.jsx)("path",{d:"M16 2v4M8 2v4M3 10h18",strokeLinecap:"round"})]})}function C(e){var t;let{org:r,comp:o,season:l,accentColor:s,headingColor:c,leagueBase:C}=e,[S,_]=(0,a.useState)(null),[T,q]=(0,a.useState)(null),[B,z]=(0,a.useState)([]),[M,P]=(0,a.useState)([]),[L,D]=(0,a.useState)([]),[W,A]=(0,a.useState)(1),[E,F]=(0,a.useState)(""),[R,I]=(0,a.useState)(""),[H,G]=(0,a.useState)(""),[U,O]=(0,a.useState)(""),[Y,V]=(0,a.useState)(""),[J,Z]=(0,a.useState)(""),[$,X]=(0,a.useState)(""),[K,Q]=(0,a.useState)({hw:"",hd:"",hl:"",aw:"",ad:"",al:""}),[ee,et]=(0,a.useState)(""),[er,en]=(0,a.useState)(""),[ea,eo]=(0,a.useState)([]),[el,es]=(0,a.useState)([]),[ei,ec]=(0,a.useState)([]),[ed,em]=(0,a.useState)([]),[eu,eh]=(0,a.useState)(""),[ep,ex]=(0,a.useState)(!1),[eg,ef]=(0,a.useState)(null),[eb,ey]=(0,a.useState)(!1),[ev,ej]=(0,a.useState)(!1),ew="knockout"===(null!=(t=null==S?void 0:S.competition_type)?t:"league");(0,a.useEffect)(()=>{let e=!0,t=new URLSearchParams({org:r,comp:o,season:l});return E&&t.set("division_or_round",E),j("".concat(v,"/descriptor?").concat(t)).then(t=>e&&_(t)).catch(t=>e&&q(t.message)),()=>{e=!1}},[r,o,l,E]),(0,a.useEffect)(()=>{let e=!0,t=new URLSearchParams({org:r,comp:o,season:l});return j("".concat(v,"/divisions?").concat(t)).then(t=>{e&&z((t.options||[]).map(e=>"string"==typeof e?{value:e,display:e}:e))}).catch(()=>{}),()=>{e=!1}},[r,o,l]),(0,a.useEffect)(()=>{if(!E){P([]),D([]);return}let e=!0,t=new URLSearchParams({org:r,comp:o,season:l});return ew?t.set("round",E):t.set("division",E),j("".concat(v,"/teams?").concat(t)).then(t=>{e&&(P(t.teams||[]),D(t.pairings||[]))}).catch(()=>{e&&(P([]),D([]))}),()=>{e=!1}},[r,o,l,E,ew]),(0,a.useEffect)(()=>
1{if(!U||!Y){eo([]),es([]);return}let e=!0,t=new URLSearchParams({org:r,comp:o,home_team_id:U,away_team_id:Y});return j("".concat(v,"/players?").concat(t)).then(t=>{e&&(eo(t.home||[]),es(t.away||[]))}).catch(()=>{}),()=>{e=!1}},[r,o,U,Y]);let ek=(0,a.useCallback)(e=>{var t;return(null==(t=M.find(t=>t["Team-ID"]===e))?void 0:t.Team)||""},[M]),eN=(0,a.useCallback)(e=>{var t;let r=null==(t=M.find(t=>t["Team-ID"]===e))?void 0:t.Logo;return r&&"string"==typeof r&&r.trim()?r.startsWith("http")?r:"".concat(C||"").concat(r):null},[M,C]),eC=(0,a.useMemo)(()=>{if(ew&&U){let e=new Set;for(let t of L)t.home_team_id===U&&e.add(t.away_team_id),t.away_team_id===U&&e.add(t.home_team_id);return M.filter(t=>e.has(t["Team-ID"]))}return M.filter(e=>e["Team-ID"]!==U)},[M,L,ew,U]),eS=()=>(ef(null),E)?R?U&&Y?U!==Y||(ef({type:"error",text:"Home and away teams must differ."}),!1):(ef({type:"error",text:"Select both teams."}),!1):(ef({type:"error",text:"Select a match date."}),!1):(ef({type:"error",text:"Select a division/round."}),!1),e_=()=>({org_name:S.org_name,competition_name:S.competition_name,season:l,division_or_round:E,match_date:R,venue:H,home_team:ek(U),home_team_id:U,away_team:ek(Y),away_team_id:Y,competition_type:S.competition_type}),eT=async()=>{if(!eS()||!S)return;let e={...e_()};if(S.is_norfolk_handicap)e.home_games_won=parseInt(K.hw)||0,e.home_games_drawn=parseInt(K.hd)||0,e.home_games_lost=parseInt(K.hl)||0,e.away_games_won=parseInt(K.aw)||0,e.away_games_drawn=parseInt(K.ad)||0,e.away_games_lost=parseInt(K.al)||0,e.is_norfolk_handicap="true";else if(S.alt_game_outcomes){if(!ee)return ef({type:"error",text:"Select a match result."});if(e.alt_match_result=ee,["all square","a/s","halved"].includes((ee||"").trim().toLowerCase()))e.game_points_home=.5,e.game_points_away=.5;else{if(!er)return ef({type:"error",text:"Select the winning team."});e.winner="home"===er?U:Y,e.game_points_home=+("home"===er),e.game_points_away=+("home"!==er)}}else e.game_points_home=(parseFloat(J)||0).toString(),e.game_points_away=(parseFloat($)||0).toString();ex(!0),ef(null);try{let t=await fetch("".concat(v,"/submit"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(e)});if(t.ok)ef({type:"success",text:"Match report submitted successfully."});else{let e=await t.json().catch(()=>({}));ef({type:"error",text:e.message||e.error||"Failed to submit match report."})}}catch(e){ef({type:"error",text:"Network error submitting match report."})}finally{ex(!1)}},eq=(e,t,r)=>{var n,a;let o=parseFloat(r),l={["home"===t?"homePoints":"awayPoints"]:r},s=(n=e.pointsWin,a=e.pointsDraw,o===n?0:o===a?a:0===o?n:null);return null!==s&&(l["home"===t?"awayPoints":"homePoints"]=String(s)),o===e.pointsDraw?l.result="All Square":o===e.pointsWin&&"All Square"===e.result&&(l.result=""),l},eB=(e,t)=>{let r={result:t};return"All Square"===t?(r.homePoints=String(e.pointsDraw),r.awayPoints=String(e.pointsDraw)):"All Square"===e.result&&parseFloat(e.homePoints)===e.pointsDraw&&parseFloat(e.awayPoints)===e.pointsDraw&&(r.homePoints="",r.awayPoints=""),r},ez=(e,t)=>ec(r=>r.map((r,n)=>n===e?{...r,...t}:r)),eM=(e,t)=>em(r=>r.map((r,n)=>n===e?{...r,...t}:r)),eP=e=>{let t=parseFloat(e);return Number.isFinite(t)?t:0},eL=ei.reduce((e,t)=>e+eP(t.homePoints),0),eD=ei.reduce((e,t)=>e+eP(t.awayPoints),0),eW=ed.reduce((e,t)=>e+eP(t.homePoints),0),eA=ed.reduce((e,t)=>e+eP(t.awayPoints),0),eE=async()=>{if(!S)return;ex(!0),ef(null);let e=e_(),t=eu.split(",").map(e=>e.trim()).filter(e=>e.length>0&&e.includes("@"));try{let r=await fetch("".concat(v,"/submit"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(function(e,t,r,n){let a=t.reduce((e,t)=>e+f(t.homePoints),0),o=t.reduce((e,t)=>e+f(t.awayPoints),0),l=r.reduce((e,t)=>e+f(t.homePoints),0),s=r.reduce((e,t)=>e+f(t.awayPoints),0),i={singles:t.map(e=>({home_player:e.homePlayer||"",home_points:f(e.homePoints).toFixed(1),away_player:e.awayPlayer||"",away_points:f(e.awayPoints).toFixed(1),result:e.result||"",home_handicap:e.homeHandicap||null,away_handicap:e.awayHandicap||null})),doubles:r.map(e=>({home_player1:e.homePlayer1||"",home_player2:e.homePlayer2||"",home_points:f(e.homePoints).toFixed(1),away_player1:e.awayPlayer1||"",away_player2:e.awayPlayer2||"",away_points:f(e.awayPoints).toFixed(1),result:e.result||"",home_handicap1:e.homeHandicap1||null,home_handicap2:e.homeHandicap2||null,away_handicap1:e.awayHandicap1||null,away_handicap2:e.awayHandicap2||null})),singles_total_home:a.toFixed(1),singles_total_away:o.toFixed(1),doubles_total_home:l.toFixed(1),doubles_total_away:s.toFixed(1),section_stats:y(t,r)},c=n.map(e=>e.trim()).filter(e=>e.length>0&&e.includes("@")),d={};for(let[e,n]of Object.entries(y(t,r))){let t=e.toLowerCase().replace(/[^a-z0-9]+/g,"_").replace(/^_+|_+$/g,"");d["".concat(t,"_home_pts")]=n.home_pts.toFixed(1),d["".concat(t,"_away_pts")]=n.away_pts.toFixed(1)}return{...e,game_points_home:(a+l).toFixed(1),game_points_away:(o+s).toFixed(1),singles_total_home:a.toFixed(1),singles_total_away:o.toFixed(1),doubles_total_home:l.toFixed(1),doubles_total_away:s.toFixed(1),...d,detailed_player_results:i,detailed_player_reports:"true",cc_email:c.length>0?c:null}}(e,ei,ed,t))});if(r.ok)ef({type:"success",text:"Match report submitted successfully."});else{let e=await r.json().catch(()=>({}));ef({type:"error",text:e.message||e.error||"Failed to submit match report."})}}catch(e){ef({type:"error",text:"Network error submitting match report."})}finally{ex(!1)}},eF=async e=>{if(S&&U&&Y){ej(!0),ef(null);try{let t=new URLSearchParams({org:r,comp:o,season:l,division_or_roun
1d:E,home_team_id:U,away_team_id:Y}),{match_id:n}=await j("".concat(v,"/resolve-fixture?").concat(t)),a=await fetch("".concat(v,"/concession"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({match_id:n,org:S.org_name,comp:S.competition_name,season:l,conceded_side:e})});if(a.ok)ef({type:"success",text:"Marked ".concat(e," as conceded.")});else{let e=await a.json().catch(()=>({}));ef({type:"error",text:e.message||e.error||"Failed to mark concession."})}}catch(e){ef({type:"error",text:e.message})}finally{ej(!1)}}},eR=async e=>{if(S){ey(!0),ef(null);try{var t;let r=new FormData;r.append("score_sheet",e),r.append("org_name",S.org_name),r.append("competition_name",S.competition_name),r.append("season",l),r.append("home_team",ek(U)),r.append("away_team",ek(Y));let n=await fetch("".concat(v,"/ocr"),{method:"POST",body:r}),a=await n.json().catch(()=>({}));if(!n.ok||!a.success)return void ef({type:"error",text:a.message||a.error||"Could not read scorecard."});eI(a.matches||[]),ef({type:"success",text:"Auto-filled ".concat((null==(t=a.matches)?void 0:t.length)||0," matches from scorecard.")})}catch(e){ef({type:"error",text:"Network error uploading scorecard."})}finally{ey(!1)}}},eI=e=>{let t=[...ei],r=[...ed],n=0,a=0;for(let c of e){var o,l,s,i;let e=(c.type||"").toLowerCase().startsWith("single"),d=c.home_players||[],m=c.away_players||[];if(e&&n<t.length){let e=t[n];t[n]={...e,homePlayer:d[0]||e.homePlayer,awayPlayer:m[0]||e.awayPlayer,homePoints:((null!=(o=c.home_points)?o:0)*e.pointsWin).toString(),awayPoints:((null!=(l=c.away_points)?l:0)*e.pointsWin).toString(),result:c.result_text||e.result},n++}else if(!e&&a<r.length){let e=r[a];r[a]={...e,homePlayer1:d[0]||e.homePlayer1,homePlayer2:d[1]||e.homePlayer2,awayPlayer1:m[0]||e.awayPlayer1,awayPlayer2:m[1]||e.awayPlayer2,homePoints:((null!=(s=c.home_points)?s:0)*e.pointsWin).toString(),awayPoints:((null!=(i=c.away_points)?i:0)*e.pointsWin).toString(),result:c.result_text||e.result},a++}}ec(t),em(r)};if(T)return(0,n.jsxs)("div",{className:"rounded-lg border border-border bg-muted/30 p-6 text-center text-muted-foreground",children:["Match report unavailable — ",T]});if(!S)return(0,n.jsx)("div",{className:"rounded-lg border border-border bg-muted/30 p-6 text-center text-muted-foreground",children:"Loading match report…"});let eH=S.game_outcomes||[],eG=S.detailed_player_reports?"detailed":S.is_norfolk_handicap?"norfolk":S.alt_game_outcomes?"alt":"points",eU=c?{color:c}:void 0,eO=s?{backgroundColor:s}:void 0,eY=S.logo_to_display,eV=eY?eY.startsWith("http")?eY:"".concat(C||"").concat(eY):null,eJ=e=>{let t=[];return e.forEach((e,r)=>{let n=t.find(t=>t.name===e.sectionName);n||(n={name:e.sectionName,rows:[]},t.push(n)),n.rows.push({row:e,index:r})}),t},eZ=e=>({home:e.reduce((e,t)=>{let{row:r}=t;return e+eP(r.homePoints)},0),away:e.reduce((e,t)=>{let{row:r}=t;return e+eP(r.awayPoints)},0)}),e$=function(e,t,r){let a=arguments.length>3&&void 0!==arguments[3]&&arguments[3],o=a?"h-7 w-auto":"h-5 w-auto";return(0,n.jsxs)("div",{className:"rounded-md border border-border bg-muted/30 px-4 py-3 text-center",children:[(0,n.jsx)("div",{className:"text-xs font-medium uppercase tracking-wide text-muted-foreground",children:e}),(0,n.jsxs)("div",{className:"mt-1 flex flex-wrap items-center justify-center gap-2 font-medium text-foreground ".concat(a?"text-lg":""),children:[eN(U)&&(0,n.jsx)("img",{src:eN(U),alt:"",className:o}),(0,n.jsx)("span",{children:ek(U)}),(0,n.jsxs)("span",{className:a?"px-1 text-2xl font-bold":"px-1 text-lg font-semibold",style:a?eU:void 0,children:[b(t)," – ",b(r)]}),(0,n.jsx)("span",{children:ek(Y)}),eN(Y)&&(0,n.jsx)("img",{src:eN(Y),alt:"",className:o})]})]})};return(0,n.jsxs)("div",{className:"text-foreground",children:[(0,n.jsxs)("div",{className:"mb-6 text-center",children:[eV&&(0,n.jsx)("img",{src:eV,alt:"",className:"mx-auto mb-2 h-20 w-auto"}),(0,n.jsx)("h2",{className:"text-2xl font-bold",style:eU,children:S.competition_name_display}),(0,n.jsx)("p",{className:"text-muted-foreground",children:"Match Report — enter results"})]}),eg&&(0,n.jsx)("div",{role:"alert",className:"mb-4 rounded-md border p-3 text-sm ".concat("success"===eg.type?"border-green-300 bg-green-50 text-green-800":"error"===eg.type?"border-red-300 bg-red-50 text-red-800":"border-border bg-muted/30 text-muted-foreground"),children:eg.text}),1===W&&(0,n.jsxs)("div",{className:"space-y-4",children:[(0,n.jsxs)("div",{className:"grid grid-cols-2 gap-3 sm:grid-cols-3",children:[(0,n.jsxs)("div",{children:[(0,n.jsx)("label",{className:p,children:ew?"Round":"Division"}),(0,n.jsxs)("select",{className:h,value:E,onChange:e=>
1{F(e.target.value),O(""),V("")},children:[(0,n.jsx)("option",{value:"",children:"Select…"}),B.map(e=>(0,n.jsx)("option",{value:e.value,children:e.display},e.value))]})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)("label",{className:p,children:"Match date"}),(0,n.jsxs)(d,{children:[(0,n.jsx)(m,{asChild:!0,children:(0,n.jsxs)("button",{type:"button",className:"".concat(h," flex items-center justify-between gap-2 text-left"),children:[(0,n.jsx)("span",{className:R?"":"text-muted-foreground",children:R?w(R):"dd/mm/yyyy"}),(0,n.jsx)(N,{})]})}),(0,n.jsx)(u,{align:"start",children:(0,n.jsx)(i,{mode:"single",selected:k(R),onSelect:e=>I(e?"".concat(e.getFullYear(),"-").concat(String(e.getMonth()+1).padStart(2,"0"),"-").concat(String(e.getDate()).padStart(2,"0")):""),defaultMonth:k(R),autoFocus:!0})})]})]}),(0,n.jsxs)("div",{className:"col-span-2 sm:col-span-1",children:[(0,n.jsx)("label",{className:p,children:"Venue (optional)"}),(0,n.jsx)("input",{className:h,type:"text",value:H,onChange:e=>G(e.target.value)})]})]}),(0,n.jsxs)("div",{className:"grid items-end gap-3 ".concat("points"===eG?"grid-cols-2 sm:grid-cols-[1fr_5rem_5rem_1fr]":"grid-cols-2"),children:[(0,n.jsxs)("div",{children:[(0,n.jsx)("label",{className:p,children:"Home team"}),(0,n.jsxs)("select",{className:h,value:U,onChange:e=>{O(e.target.value),V(""),en("")},children:[(0,n.jsx)("option",{value:"",children:"Select…"}),M.map(e=>(0,n.jsx)("option",{value:e["Team-ID"],children:e.Team},e["Team-ID"]))]})]}),"points"===eG&&(0,n.jsxs)("div",{children:[(0,n.jsx)("label",{className:p,children:"Home"}),(0,n.jsx)("input",{className:h,type:"number",min:0,max:S.max_total_match,step:.5,placeholder:"0",value:J,onChange:e=>Z(e.target.value)})]}),"points"===eG&&(0,n.jsxs)("div",{children:[(0,n.jsx)("label",{className:p,children:"Away"}),(0,n.jsx)("input",{className:h,type:"number",min:0,max:S.max_total_match,step:.5,placeholder:"0",value:$,onChange:e=>X(e.target.value)})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)("label",{className:p,children:"Away team"}),(0,n.jsxs)("select",{className:h,value:Y,onChange:e=>{V(e.target.value),en("")},children:[(0,n.jsx)("option",{value:"",children:"Select…"}),eC.map(e=>(0,n.jsx)("option",{value:e["Team-ID"],children:e.Team},e["Team-ID"]))]})]})]}),"alt"===eG&&(0,n.jsxs)("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-[1fr_auto] sm:items-end",children:[(0,n.jsxs)("div",{children:[(0,n.jsx)("label",{className:p,children:"Result"}),(0,n.jsxs)("select",{className:h,value:ee,onChange:e=>{et(e.target.value),"halved"===e.target.value.toLowerCase()&&en("")},children:[(0,n.jsx)("option",{value:"",children:"Select…"}),eH.map(e=>(0,n.jsx)("option",{value:e,children:e},e))]})]}),"halved"!==ee.toLowerCase()&&(0,n.jsxs)("div",{children:[(0,n.jsx)("label",{className:p,children:"Winner"}),(0,n.jsx)("div",{className:"flex gap-2",children:["home","away"].map(e=>(0,n.jsx)("button",{type:"button",onClick:()=>en(e),className:"rounded-md border px-3 py-1.5 text-sm ".concat(er===e?"border-transparent bg-primary text-white":"border-border hover:bg-muted/50"),style:er===e?eO:void 0,children:"home"===e?ek(U)||"Home":ek(Y)||"Away"},e))})]})]}),"norfolk"===eG&&(0,n.jsx)("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2",children:["home","away"].map(e=>(0,n.jsxs)("div",{children:[(0,n.jsxs)("div",{className:"mb-1 text-sm font-medium text-foreground",children:["home"===e?ek(U)||"Home":ek(Y)||"Away"," ","games"]}),(0,n.jsx)("div",{className:"grid grid-cols-3 gap-2",children:["w","d","l"].map(t=>{let r=("home"===e?"h":"a")+t;return(0,n.jsxs)("div",{children:[(0,n.jsx)("label",{className:p,children:"w"===t?"Won":"d"===t?"Drawn":"Lost"}),(0,n.jsx)("input",{className:h,type:"number",min:0,placeholder:"0",value:K[r],onChange:e=>Q(t=>({...t,[r]:e.target.value}))})]},t)})})]},e))}),(0,n.jsxs)("div",{className:"flex flex-wrap items-center gap-3",children:[(0,n.jsx)("button",{type:"button",onClick:S.detailed_player_reports?()=>{eS()&&S&&(ec(function(e){let t=[];for(let[r,n]of Object.entries(e.report_config.singles_sections||{}))for(let e=0;e<(n.num_matches||0);e++)t.push({sectionName:r,pointsWin:f(n.points_win)||1,pointsDraw:f(n.points_draw)||.5,homePlayer:"",awayPlayer:"",homePoints:"",awayPoints:"",result:"",homeHandicap:"",awayHandicap:""});return t}(S)),em(function(e){let t=[];for(let[r,n]of Object.entries(e.report_config.doubles_sections||{}))for(let e=0;e<(n.num_matches||0);e++)t.push({sectionName:r,pointsWin:f(n.points_win)||1,pointsDraw:f(n.points_draw)||.5,homePlayer1:"",homePlayer2:"",awayPlayer1:"",awayPlayer2:"",homePoints:"",awayPoints:"",result:"",homeHandicap1:"",homeHandicap2:"",awayHandicap1:"",awayHandicap2:""});return t}(S)),A(2))}:eT,disabled:ep,style:eO,className:"rounded-md bg-primary px-5 py-2 text-sm font-medium text-white shadow-sm hover:opacity-90 disabled:opacity-50",children:S.detailed_player_reports?"Next":ep?"Submitting…":"Submit match report"}),S.concession_enabled&&U&&Y&&(0,n.jsxs)("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[(0,n.jsx)("span",{children:"or concession:"}),(0,n.jsx)("button",{type:"button",disabled:ev,onClick:()=>eF("home"),className:"rounded-md border border-border px-3 py-1.5 hover:bg-muted/50 disabled:opacity-50",children:"Home conceded"}),(0,n.jsx)("button",{type:"button",disabled:ev,onClick:()=>eF("away"),className:"rounded-md border border-border px-3 py-1.5 hover:bg-muted/50 disabled:opacity-50",children:"Away conceded"})]})]})]}),2===W&&(0,n.jsxs)("div",{className:"space-y-6",children:[(0,n.jsxs)("div",{className:"space-y-3",children:[(0,n.jsx)("div",{className:"flex justify-end",children:(0,n.jsx)("button",{type:"button",onClick:()=>A(1),className:"rounded-md border border-border px-3 py-1.5 text-sm hover:bg-muted/50",children:"Back"})}),(0,n.jsxs)("div",{className:"flex flex-wrap items-center justify-center gap-3",children:[eN(U)&&(0,n.jsx)("img",{src:eN(U),alt:"",className:"h-10 w-auto"}),(0,n.jsx)("span",{className:"text-lg font-semibold text-foreground",children:ek(U)}),(0,n.jsx)("span",{className:"text-muted-foreground",children:"vs"}),(0,n.jsx)("span",{className:"text-lg font-semibold text-foreground",children:ek(Y)}),eN(Y)&&(0,n.jsx)("img",{src:eN(Y),alt:"",className:"h-10 w-auto"})]}),(0,n.jsxs)("div",{className:"text-center text-sm text-muted-foreground",children:[E," \xb7 ",w(R)]})]}),(0,n.jsxs)("label",{className:"inline-flex cursor-pointer items-center gap-2 rounded-md border border-border px-3 py-2 text-sm hover:bg-muted/50",children:[(0,n.jsx)("input",{type:"file",accept:"application/pdf,image/*",className:"hidden",disabled:eb,onChange:e=>{var t;let r=null==(t=e.target.files)?void 0:t[0];r&&eR(r),e.target.value=""}}),eb?"Reading scorecard…":"Upload scorecard (auto-fill)"]}),(0,n.jsx)("datalist",{id:"mr-home-players",children:ea.map(e=>(0,n.jsx)("option",{value:e},e))}),(0,n.jsx)("datalist",{id:"mr-away-players",children:el.map(e=>(0,n.jsx)("option",{value:e},e))}),eJ(ei).map(e=>{let t=eZ(e.rows);return(0,n.jsxs)("section",{className:"space-y-3 rounded-lg border border-border bg-card p-4 shadow-sm sm:p-6",children:[(0,n.jsx)("h3",{className:"text-sm font-semibold",style:eU,children:e.name}),e.rows.map(e=>{let{row:t,index:r}=e;return(0,n.jsx)(g,{row:t,matchNumber:r+1,gameOutcomes:eH,showHandicaps:S.show_handicaps,homeListId:"mr-home-players",awayListId:"mr-away-players",onField:(e,t)=>ez(r,{[e]:t}),onPoints:(e,n)=>ez(r,eq(t,e,n)),onResult:e=>ez(r,eB(t,e))},"s-".concat(r))}),e$("".concat(e.name," total"),t.home,t.away)]},"s-".concat(e.name))}),eJ(ed).map(e=>{let t=eZ(e.rows);return(0,n.jsxs)("section",{className:"space-y-3 rounded-lg border border-border bg-card p-4 shadow-sm sm:p-6",children:[(0,n.jsx)("h3",{className:"text-sm font-semibold",style:eU,children:e.name}),e.rows.map(e=>{let{row:t,index:r}=e;return(0,n.jsx)(x,{row:t,matchNumber:r+1,gameOutcomes:eH,showHandicaps:S.show_handicaps,homeListId:"mr-home-players",awayListId:"mr-away-players",onField:(e,t)=>eM(r,{[e]:t}),onPoints:(e,n)=>eM(r,eq(t,e,n)),onResult:e=>eM(r,eB(t,e))},"d-".concat(r))}),e$("".concat(e.name," total"),t.home,t.away)]},"d-".concat(e.name))}),e$("Match total",eL+eW,eD+eA,!0),(0,n.jsxs)("div",{children:[(0,n.jsx)("label",{className:p,children:"CC emails (comma-separated, optional)"}),(0,n.jsx)("input",{className:h,type:"text",value:eu,onChange:e=>eh(e.target.value),placeholder:"[email protected], [email protected]"})]}),(0,n.jsx)("button",{type:"button",onClick:eE,disabled:ep,style:eO,className:"rounded-md bg-primary px-6 py-2.5 text-sm font-medium text-white shadow-sm hover:opacity-90 disabled:opacity-50",children:ep?"Submitting…":"Submit match report"})]})]})}},7329:(e,t,r)=>{"use strict";r.d(t,{SupportFormBlock:()=>d});
1var n=r(29064),a=r(34340),o=r(87482),l=r(10021),s=r(45450);let i=r(85450).env.NEXT_PUBLIC_TURNSTILE_SITE_KEY||"",c={invalid_captcha:"The verification check failed. Please try again.",org_not_configured:"Support isn't set up for this club yet.",wrong_inbox_type:"We couldn't open a ticket. Please try again later.",chatwoot_unavailable:"We couldn't reach support right now. Please try again later.",validation_failed:"Please check the highlighted fields and try again.",missing_org:"Couldn't determine which club this form belongs to.",upstream_unreachable:"We couldn't reach support right now. Please try again later.",internal_error:"Something went wrong on our end. Please try again later."},d=e=>{let{heading:t,eyebrow:r,form:d,orgCodeOverride:m,confirmationMessage:u,fallbackContactEmail:h,displayOptions:p,buttonLabel:x,className:g}=e,f="object"==typeof d?d:null,b=(null==f?void 0:f.fields)||[],[y,v]=(0,a.useState)({}),[j,w]=(0,a.useState)(!1),[k,N]=(0,a.useState)(null),[C,S]=(0,a.useState)(null),_=(0,a.useRef)(""),T=(0,a.useRef)(null),q=(0,l.DM)(null==p?void 0:p.headingColor,null==p?void 0:p.headingColorCustom),B=(0,l.DM)(null==p?void 0:p.textColor,null==p?void 0:p.textColorCustom),z=(0,l.DM)(null==p?void 0:p.iconColor,null==p?void 0:p.iconColorCustom),M=(0,l.DM)(null==p?void 0:p.backgroundColor,null==p?void 0:p.backgroundColorCustom),P=(e,t,r)=>e?"custom"===e?(null==t?void 0:t.trim())||r:"var(--color-".concat(e,", ").concat(r,")"):r,L=P(null==p?void 0:p.buttonColor,null==p?void 0:p.buttonColorCustom,"#111827"),D=P(null==p?void 0:p.buttonTextColor,null==p?void 0:p.buttonTextColorCustom,"#ffffff"),W=P(null==p?void 0:p.fieldBackgroundColor,null==p?void 0:p.fieldBackgroundColorCustom,"#ffffff"),A=P(null==p?void 0:p.fieldTextColor,null==p?void 0:p.fieldTextColorCustom,"#111827"),E=M?{backgroundColor:M}:void 0;(0,a.useEffect)(()=>{let e={};for(let r of b){var t;r.name&&(e[r.name]=null!=(t=r.defaultValue)?t:"")}v(e)},[b]),(0,a.useEffect)(()=>{let e;if(i)return(window.turnstile?Promise.resolve():new Promise((e,t)=>{let r=document.createElement("script");r.src="https://challenges.cloudflare.com/turnstile/v0/api.js?render=explicit",r.async=!0,r.defer=!0,r.onload=()=>e(),r.onerror=()=>t(Error("turnstile-script-failed")),document.head.appendChild(r)})).then(()=>{T.current&&window.turnstile&&(e=window.turnstile.render(T.current,{sitekey:i,callback:e=>{_.current=e}}))}),()=>{e&&window.turnstile&&window.turnstile.reset(e)}},[]);let F=async e=>{e.preventDefault(),N(null),w(!0);try{let e=await fetch("/api/support-tickets/submit",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({formId:null==f?void 0:f.id,orgCodeOverride:m||null,values:(()=>{let e={...y},t=e=>b.find(t=>t.blockType===e&&t.name&&y[t.name]),r=e=>b.find(t=>t.name&&e.test(t.name)&&y[t.name]);if(!e.email){let n=t("email")||r(/e-?mail/i);(null==n?void 0:n.name)&&(e.email=y[n.name])}if(!e.message){let n=t("textarea")||r(/message|enquiry|comment|details/i);(null==n?void 0:n.name)&&(e.message=y[n.name])}return e})(),captcha_token:_.current||null})}),r=await e.json();if(e.ok&&r.success){var t;S(null!=(t=r.display_id)?t:0)}else N(r.error_code||"internal_error")}catch(e){N("upstream_unreachable")}finally{w(!1)}};if(null!==C)return(0,n.jsx)("section",{className:(0,o.cn)("py-8 sm:py-16 lg:py-24",!E&&"bg-white",g),style:E,children:(0,n.jsxs)("div",{className:"mx-auto max-w-2xl px-4 sm:px-6 lg:px-8 text-center",children:[u?(0,n.jsx)(s.s,{data:u}):(0,n.jsx)("p",{className:"text-lg",style:B?{color:B}:void 0,children:"Thanks — we've received your message."}),(0,n.jsxs)("p",{className:"mt-4 text-sm text-gray-600",children:["Your reference: ",(0,n.jsxs)("span",{className:"font-mono",children:["#",C]})]})]})});let R=k?("chatwoot_unavailable"===k||"org_not_configured"===k)&&h?"".concat(c[k]," You can also email us at ").concat(h,"."):c[k]||c.internal_error:null;return(0,n.jsx)("section",{className:(0,o.cn)("py-8 sm:py-16 lg:py-24",!E&&"bg-white",g),style:E,children:(0,n.jsxs)("div",{className:"mx-auto max-w-2xl px-4 sm:px-6 lg:px-8",children:[(t||r)&&(0,n.jsxs)("div",{className:"text-center mb-6 sm:mb-10",children:[r&&(0,n.jsx)("p",{className:"font-medium tracking-widest uppercase text-sm mb-2",style:z?{color:z}:void 0,children:r}),t&&(0,n.jsx)("h2",{className:"text-2xl sm:text-3xl lg:text-4xl font-bold",style:q?{color:q}:void 0,children:t})]}),R&&(0,n.jsx)("div",{className:"mb-4 rounded-md border border-red-300 bg-red-50 p-3 text-sm text-red-700",children:R}),(0,n.jsxs)("form",{onSubmit:F,className:"space-y-4",noValidate:!0,children:[b.map((e,t)=>{var r;if(!e.name)return null;let a={id:"sf-".concat(e.name),name:e.name,required:e.required,value:null!=(r=y[e.name])?r:"",onChange:t=>{let r,n;return r=e.name,n=t.target.value,v(e=>({...e,[r]:n}))},style:{fontFamily:"inherit",backgroundColor:W,color:A},suppressHydrationWarning:!0,className:"w-full rounded-md border border-gray-300 px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-offset-1"},l=(0,n.jsxs)("label",{htmlFor:a.id,className:(0,o.cn)("block text-sm font-medium mb-1",!B&&"text-gray-700"),style:B?{color:B}:void 0,children:[e.label||e.name,e.required&&(0,n.jsx)("span",{className:"text-red-500",children:" *"})]});return"textarea"===e.blockType?(0,n.jsxs)("div",{children:[l,(0,n.jsx)("textarea",{rows:5,...a}
1)]},t):"email"===e.blockType?(0,n.jsxs)("div",{children:[l,(0,n.jsx)("input",{type:"email",...a})]},t):(0,n.jsxs)("div",{children:[l,(0,n.jsx)("input",{type:"text",...a})]},t)}),i&&(0,n.jsx)("div",{ref:T,className:"my-3"}),(0,n.jsx)("button",{type:"submit",disabled:j,style:{backgroundColor:L,color:D,fontFamily:"inherit"},className:"inline-flex items-center justify-center rounded-md px-5 py-2.5 text-sm font-medium transition-opacity hover:opacity-90 disabled:opacity-60",children:j?"Sending…":x||"Send"})]})]})})}},7356:(e,t,r)=>{"use strict";r.d(t,{GroupBookingBlock:()=>p});var n=r(29064),a=r(34340),o=r(97346);r(80142);var l=r(10021),s=r(29599),i=r(36015);let c=[{id:"live_scoring",label:"Group live scoring"},{id:"longest_drive",label:"Longest drive"},{id:"nearest_pin",label:"Nearest the pin"}],d=["longest_drive","nearest_pin"],m=e=>e?"".concat(e.getFullYear(),"-").concat(String(e.getMonth()+1).padStart(2,"0"),"-").concat(String(e.getDate()).padStart(2,"0")):"",u=["breakfast","lunch","dinner","drinks"],h=e=>!!e.meal_period&&u.includes(e.meal_peri
1od),p=e=>{let{heading:t="Society & Group Bookings",subheading:r,showPartyName:u=!0,showPhone:p=!0,showTeeTimes:x=!0,showHoles:g=!0,showTimeRange:f=!0,showPackages:b=!0,showFunctionRoom:y=!0,showPrizeGiving:v=!0,showCompetitions:j=!0,showCatering:w=!0,showGolfExtras:k=!0,showDietary:N=!0,showNotes:C=!0,buttonColor:S="primary",buttonColorCustom:_,buttonTextColor:T="text-inverse",buttonTextColorCustom:q,successHeading:B="Thank you — we’ve received your enquiry",successAvailableMessage:z="Your preferred date looks available. We’ll email you a provisional confirmation shortly, followed by a deposit request to secure the booking.",successUnavailableMessage:M="Unfortunately that date isn’t available. We’ll be in touch by email with the nearest alternatives."}=e,[P,L]=(0,a.useState)([]),[D,W]=(0,a.useState)([]),[A,E]=(0,a.useState)({}),[F,R]=(0,a.useState)({}),[I,H]=(0,a.useState)({kind:"idle"}),[G,U]=(0,a.useState)(),[O,Y]=(0,a.useState)({group_name:"",organiser_name:"",organiser_email:"",organiser_phone:"",total_players:16,tee_times_count:4,holes:18,date_from:"",date_to:"",preferred_time_from:"",preferred_time_to:"",package_id:"",function_room:!1,prize_giving:!1,competitions_notes:"",dietary_requirements:"",notes:""});(0,a.useEffect)(()=>{(w||k)&&fetch("/api/group-booking/submit",{method:"GET"}).then(e=>e.json()).then(e=>L(e.items||[])).catch(()=>L([]))},[w,k]),(0,a.useEffect)(()=>{b&&fetch("/api/group-booking/packages",{method:"GET"}).then(e=>e.json()).then(e=>W(e.items||[])).catch(()=>W([]))},[b]);let V=(e,t)=>Y(r=>({...r,[e]:t})),J=c.filter(e=>F[e.id]).map(e=>e.id),Z=J.some(e=>d.includes(e));(0,a.useEffect)(()=>{Y(e=>({...e,date_from:m(null==G?void 0:G.from),date_to:m(null==G?void 0:G.to)}))},[G]);let $=(0,l.DM)(S,_)||"var(--color-primary)",X=(0,l.DM)(T,q)||"var(--color-text-inverse)",K=P.filter(h),Q=P.filter(e=>!h(e));async function ee(e){if(e.preventDefault(),!O.organiser_name||!O.organiser_email||!O.date_from)return void H({kind:"error",message:"Please fill in the lead booker’s name, email and a date."});H({kind:"submitting"});let t=[];O.function_room&&t.push("Function room"),O.prize_giving&&t.push("Prize-giving");try{var r,n,a;let e=await fetch("/api/group-booking/submit",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({group_name:O.group_name||void 0,organiser_name:O.organiser_name,organiser_email:O.organiser_email,organiser_phone:O.organiser_phone,total_players:O.total_players,tee_times_count:O.tee_times_count,holes:O.holes,date_from:O.date_from,date_to:O.date_to||O.date_from,preferred_time_from:O.preferred_time_from,preferred_time_to:O.preferred_time_to,package_id:O.package_id||void 0,function_room:t.join(" + ")||void 0,competitions:J,competitions_notes:Z&&O.competitions_notes||void 0,dietary_requirements:O.dietary_requirements||void 0,notes:O.notes,extras:P.filter(e=>
1A[e.id]).map(e=>({extra_id:e.id,quantity:1})),utm:(0,i.hB)()})}),o=await e.json();if(!e.ok)return void H({kind:"error",message:o.error||"Something went wrong."});(0,s.s)("enquiry_submitted",{form:"group_booking"}),H({kind:"done",ref:o.group_ref,status:o.status,nearest:null!=(a=null==(n=o.availability)||null==(r=n.nearest)?void 0:r.date)?a:null})}catch(e){H({kind:"error",message:"Could not submit your enquiry. Please try again."})}}if("done"===I.kind){let e="available"===I.status;return(0,n.jsx)("section",{className:"mx-auto max-w-2xl p-6",children:(0,n.jsxs)("div",{className:"rounded-xl border p-6 ".concat(e?"border-green-300 bg-green-50":"border-amber-300 bg-amber-50"),children:[(0,n.jsx)("h3",{className:"text-lg font-semibold",children:B}),I.ref&&(0,n.jsxs)("p",{className:"mt-1 text-sm text-gray-600",children:["Reference: ",(0,n.jsx)("strong",{children:I.ref})]}),e?(0,n.jsx)("p",{className:"mt-2",children:z}):(0,n.jsxs)("p",{className:"mt-2",children:[M,I.nearest?(0,n.jsxs)(n.Fragment,{children:[" The nearest available date is ",(0,n.jsx)("strong",{children:I.nearest}),"."]}):null]})]})})}let et=e=>(0,n.jsxs)("label",{className:"flex items-center gap-2 text-sm",children:[(0,n.jsx)("input",{type:"checkbox",checked:!!A[e.id],onChange:t=>E(r=>({...r,[e.id]:t.target.checked}))}),e.name," ",(0,n.jsxs)("span",{className:"text-gray-500",children:["(\xa3",e.price," ",e.pricing_unit,")"]})]},e.id);return(0,n.jsxs)("section",{className:"mx-auto max-w-2xl p-6",children:[(0,n.jsx)("h2",{className:"text-2xl font-bold",children:t}),r&&(0,n.jsx)("p",{className:"mt-1 text-gray-600",children:r}),(0,n.jsxs)("form",{onSubmit:ee,className:"mt-5 grid grid-cols-1 gap-4 sm:grid-cols-2",children:[u&&(0,n.jsxs)("label",{className:"flex flex-col text-sm sm:col-span-2",children:["Party name",(0,n.jsx)("input",{className:"mt-1 rounded border p-2",value:O.group_name,onChange:e=>V("group_name",e.target.value),placeholder:"e.g. Bearsden Wanderers Golf Society"})]}),(0,n.jsxs)("label",{className:"flex flex-col text-sm",children:["Lead booker name",(0,n.jsx)("input",{className:"mt-1 rounded border p-2",value:O.organiser_name,onChange:e=>V("organiser_name",e.target.value),required:!0})]}),(0,n.jsxs)("label",{className:"flex flex-col text-sm",children:["Email",(0,n.jsx)("input",{type:"email",className:"mt-1 rounded border p-2",value:O.organiser_email,onChange:e=>V("organiser_email",e.target.value),required:!0})]}),p&&(0,n.jsxs)("label",{className:"flex flex-col text-sm",children:["Phone",(0,n.jsx)("input",{className:"mt-1 rounded border p-2",value:O.organiser_phone,onChange:e=>V("organiser_phone",e.target.value)})]}),(0,n.jsxs)("label",{className:"flex flex-col text-sm",children:["Number of players",(0,n.jsx)("input",{type:"number",min:1,className:"mt-1 rounded border p-2",value:O.total_players,onChange:e=>V("total_players",Number(e.target.value))})]}),x&&(0,n.jsxs)("label",{className:"flex flex-col text-sm",children:["Number of tee times",(0,n.jsx)("input",{type:"number",min:1,className:"mt-1 rounded border p-2",value:O.tee_times_count,onChange:e=>V("tee_times_count",Number(e.target.value))})]}),g&&(0,n.jsxs)("label",{className:"flex flex-col text-sm",children:["Holes",(0,n.jsxs)("select",{className:"mt-1 rounded border p-2",value:O.holes,onChange:e=>V("holes",Number(e.target.value)),children:[(0,n.jsx)("option",{value:18,children:"18 holes"}),(0,n.jsx)("option",{value:36,children:"36 holes"})]})]}),(0,n.jsxs)("div",{className:"text-sm sm:col-span-2",children:[(0,n.jsx)("span",{className:"font-medium",children:"Preferred date"}),(0,n.jsx)("span",{className:"ml-1 text-gray-500",children:"(or pick a range if you’re flexible)"}),(0,n.jsx)("div",{className:"mt-2 rounded-lg border p-2 inline-block",children:(0,n.jsx)(o.h,{mode:"range",selected:G,onSelect:U,numberOfMonths:1,weekStartsOn:1,disabled:{before:new Date}})}),(0,n.jsx)("p",{className:"mt-1 text-gray-600",children:O.date_from?(0,n.jsxs)(n.Fragment,{children:["Selected: ",(0,n.jsx)("strong",{children:O.date_from}),O.date_to&&O.date_to!==O.date_from?(0,n.jsxs)(n.Fragment,{children:[" – ",(0,n.jsx)("strong",{children:O.date_to})]}):null]}):"No date selected yet."})]}),f&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("label",{className:"flex flex-col text-sm",children:["Preferred tee time (from)",(0,n.jsx)("input",{type:"time",className:"mt-1 rounded border p-2",value:O.preferred_time_from,onChange:e=>V("preferred_time_from",e.target.value)})]}),(0,n.jsxs)("label",{className:"flex flex-col text-sm",children:["Preferred tee time (to)",(0,n.jsx)("input",{type:"time",className:"mt-1 rounded border p-2",value:O.preferred_time_to,onChange:e=>V("preferred_time_to",e.target.value)})]})]}),b&&D.length>0&&(0,n.jsxs)("fieldset",{className:"sm:col-span-2 border-0 p-0 m-0",children:[(0,n.jsx)("legend",{className:"text-sm font-medium",children:"Packages"}),(0,n.jsxs)("div",{className:"mt-2 grid grid-cols-1 gap-2",children:[D.map(e=>{var t;return(0,n.jsxs)("label",{className:"flex cursor-pointer gap-3 rounded-lg border p-3 text-sm",style:O.package_id===e.id?{borderColor:$,background:"var(--color-muted)"}:void 0,children:[(0,n.jsx)("input",{type:"radio",name:"group_package",className:"mt-1",checked:O.package_id===e.id,onChange:()=>V("package_id",e.id)}),(0,n.jsxs)("span",{className:"flex-1",children:[(0,n.jsxs)("span",{className:"flex flex-wrap items-baseline justify-between gap-2",children:[(0,n.jsx)("strong",{children:e.name}),(0,n.jsx)("span",{children:(e=>"\xa3".concat(e.price).concat("per_player"===e.pricing_unit?" per person":" per group"))(e)})]}),e.description&&(0,n.jsx)("span",{className:"mt-0.5 block text-gray-600",children:e.description}),!!(null==(t=e.inclusions)?void 0:t.length)&&(0,n.jsx)("ul",{className:"mt-1 list-inside list-disc text-gray-600",children:e.inclusions.map((e,t)=>(0,n.jsx)("li",{children:e},t))})]})]},e.id)}),(0,n.jsxs)("label",{className:"flex cursor-pointer items-center gap-3 rounded-lg border p-3 text-sm",style:""===O.package_id?{borderColor:$,background:"var(--color-muted)"}:void 0,children:[(0,n.jsx)("input",{type:"radio",name:"group_package",checked:""===O.package_id,onChange:()=>V("package_id","")}),(0,n.jsx)("span",{children:"No package — green fees only"})]})]})]}),(y||v)&&(0,n.jsxs)("fieldset",{className:"sm:col-span-2 border-0 p-0 m-0",children:[(0,n.jsx)("legend",{className:"text-sm font-medium",children:"Facilities"}),(0,n.jsxs)("div",{className:"mt-2 flex flex-wrap gap-4",children:[y&&(0,n.jsxs)("label",{className:"flex items-center gap-2 text-sm",children:[(0,n.jsx)("input",{type:"checkbox",checked:O.function_room,onChange:e=>V("function_room",e.target.checked)}),"Function room"]}),v&&(0,n.jsxs)("label",{className:"flex items-center gap-2 text-sm",children:[(0,n.jsx)("input",{type:"checkbox",checked:O.prize_giving,onChange:e=>V("prize_giving",e.target.checked)}),"Prize giving"]})]})]}),j&&(0,n.jsxs)("fieldset",{className:"sm:col-span-2 border-0 p-0 m-0",children:[(0,n.jsx)("legend",{className:"text-sm font-medium",children:"On the course"}),(0,n.jsx)("div",{className:"mt-2 flex flex-wrap gap-4",children:c.map(e=>(0,n.jsxs)("label",{className:"flex items-center gap-2 text-sm",children:[(0,n.jsx)("input",{type:"checkbox",checked:!!F[e.id],onChange:t=>R(r=>({...r,[e.id]:t.target.checked}))}),e.label]},e.id))}),Z&&(0,n.jsxs)("label",{className:"mt-3 flex flex-col text-sm",children:["Which holes?",(0,n.jsx)("input",{className:"mt-1 rounded border p-2",value:O.competitions_notes,onChange:e=>V("competitions_notes",e.target.value),placeholder:"e.g. longest drive on 5, nearest the pin on 12"})]})]}),w&&K.length>0&&(0,n.jsxs)("fieldset",{className:"sm:col-span-2 border-0 p-0 m-0",children:[(0,n.jsx)("legend",{className:"text-sm font-medium",children:"Catering"}),(0,n.jsx)("div",{className:"mt-2 grid grid-cols-1 gap-2 sm:grid-cols-2",children:K.map(et)})]}),k&&Q.length>0&&(0,n.jsxs)("fieldset",{className:"sm:col-span-2 border-0 p-0 m-0",children:[(0,n.jsx)("legend",{className:"text-sm font-medium",children:"Golf hire & extras"}),(0,n.jsx)("div",{className:"mt-2 grid grid-cols-1 gap-2 sm:grid-cols-2",children:Q.map(et)})]}),N&&(0,n.jsxs)("label",{className:"flex flex-col text-sm sm:col-span-2",children:["Dietary requirements",(0,n.jsx)("textarea",{className:"mt-1 rounded border p-2",rows:2,value:O.dietary_requirements,onChange:e=>V("dietary_requirements",e.target.value),placeholder:"e.g. two coeliacs, one vegan"})]}),C&&(0,n.jsxs)("label",{className:"flex flex-col text-sm sm:col-span-2",children:["Anything else?",(0,n.jsx)("textarea",{className:"mt-1 rounded border p-2",rows:3,value:O.notes,onChange:e=>V("notes",e.target.value),placeholder:"Any other requirements for your day?"})]}),"error"===I.kind&&(0,n.jsx)("p",{className:"text-sm text-red-600 sm:col-span-2",children:I.message}),(0,n.jsx)("div",{className:"sm:col-span-2",children:(0,n.jsx)("button",{type:"submit",disabled:"submitting"===I.kind,className:"rounded-lg px-5 py-2.5 disabled:opacity-50",style:{backgroundColor:$,color:X},children:"submitting"===I.kind?"Checking availability…":"Send enquiry"})})]})]})}},8492:(e,t,r)=>{"use strict";r.d(t,{LaunchGrantIframe:()=>o});
1var n=r(29064),a=r(34340);let o=e=>{let{src:t,title:r,allowOrigin:o,launchGrant:l}=e,s=(0,a.useRef)(null);return(0,n.jsx)("iframe",{ref:s,src:t,title:r,width:"100%",height:"100%",frameBorder:"0",style:{border:"none",display:"block"},onLoad:function(){var e,t;o&&(null==(t=s.current)||null==(e=t.contentWindow)||e.postMessage({type:"nooq:launch-grant",token:l},o))}})}},8608:(e,t,r)=>{"use strict";r.d(t,{DemoBookingBlock:()=>x});var n=r(29064),a=r(34340),o=r(87482),l=r(10021);let s={none:"0",small:"clamp(1.5rem, 3vw, 2.5rem)",medium:"clamp(2.5rem, 5vw, 4rem)",large:"clamp(3.5rem, 7vw, 6rem)"},i={"to-b":"to bottom","to-r":"to right","to-br":"to bottom right","to-bl":"to bottom left"},c=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"];function d(e){return new Date(e.getFullYear(),e.getMonth(),1)}function m(e,t){return new Date(e.getFullYear(),e.getMonth()+t,1)}function u(e){let t=String(e.getMonth()+1).padStart(2,"0"),r=String(e.getDate()).padStart(2,"0");return"".concat(e.getFullYear(),"-").concat(t,"-").concat(r)}function h(e){return e.slice(0,10)}function p(e){let t=new Date(e),r=t.getHours(),n=t.getMinutes().toString().padStart(2,"0");return"".concat(r%12||12,":").concat(n).concat(r<12?"am":"pm")}let x=e=>{var t,r;let{heading:x,eyebrow:g,subheading:f,defaultMeetingType:b="Quick Chat",daysAhead:y=14,successMessage:v="You’re booked in — check your inbox for the Zoom link and calendar invite.",meetingTypeLabels:j,displayOptions:w,className:k}=e,N="db-"+(0,a.useId)().replace(/[^a-zA-Z0-9_-]/g,""),C=(0,a.useMemo)(()=>{let e=new Map;for(let n of j||[]){var t,r;let a=null==n||null==(t=n.meetingType)?void 0:t.trim(),o=null==n||null==(r=n.label)?void 0:r.trim();a&&o&&e.set(a.toLowerCase(),o)}return t=>e.get(t.trim().toLowerCase())||t},[j]),S=(0,l.DM)(null==w?void 0:w.headingColor,null==w?void 0:w.headingColorCustom),_=(0,l.DM)(null==w?void 0:w.textColor,null==w?void 0:w.textColorCustom),T=(0,l.DM)(null==w?void 0:w.iconColor,null==w?void 0:w.iconColorCustom)||"var(--color-primary)",q=(0,l.DM)(null==w?void 0:w.buttonTextColor,null==w?void 0:w.buttonTextColorCustom)||"#ffffff",B=(0,l.DM)(null==w?void 0:w.surfaceColor,null==w?void 0:w.surfaceColorCustom)||"#ffffff",z="#0f172a",M=(null==w?void 0:w.backgroundType)||"none",P={paddingTop:s[(null==w?void 0:w.paddingTop)||"large"],paddingBottom:s[(null==w?void 0:w.paddingBottom)||"large"]};if("color"===M){let e=(0,l.DM)(null==w?void 0:w.backgroundColor,null==w?void 0:w.backgroundColorCustom);e&&(P.backgroundColor=e)}else if("gradient"===M){let e=(0,l.DM)(null==w?void 0:w.backgroundColor,null==w?void 0:w.backgroundColorCustom)||"var(--color-primary)",t=(0,l.DM)(null==w?void 0:w.gradientEndColor,null==w?void 0:w.gradientEndColorCustom)||"var(--color-primary-dark)",r=i[(null==w?void 0:w.gradientDirection)||"to-br"];P.background="linear-gradient(".concat(r,", ").concat(e,", ").concat(t,")")}let L={background:B,color:z,borderRadius:"22px",boxShadow:"0 24px 60px -24px rgba(0,0,0,0.55), 0 0 0 1px rgba(15,23,42,0.06)",padding:"clamp(1.25rem, 3.2vw, 2.25rem)"},D="\n#".concat(N," .db-day:not(:disabled):not(.db-day--selected):hover{border-color:").concat(T,";color:").concat(T,";}\n#").concat(N," .db-slot:not(.db-slot--active):hover{border-color:").concat(T,";color:").concat(T,";}\n#").concat(N," .db-input:focus{border-color:").concat(T,";box-shadow:0 0 0 3px color-mix(in srgb, ").concat(T," 24%, transparent);outline:none;}\n#").concat(N," .db-cta:hover{filter:brightness(0.94);}\n").trim(),[W,A]=(0,a.useState)([]),[E,F]=(0,a.useState)(b),[R,I]=(0,a.useState)([]),[H,G]=(0,a.useState)(!1),[U,O]=(0,a.useState)(null),[Y,V]=(0,a.useState)(d(new Date)),[J,Z]=(0,a.useState)(null),[$,X]=(0,a.useState)(null),[K,Q]=(0,a.useState)(""),[ee,et]=(0,a.useState)(""),[er,en]=(0,a.useState)(""),[ea,eo]=(0,a.useState)(""),[el,es]=(0,a.useState)("payload_block");(0,a.useEffect)(()=>{let e=new URLSearchParams(window.location.search),t=e.get("name"),r=e.get("phone");t&&Q(t),r&&eo(r.startsWith("44")?"+".concat(r):r),(t||r)&&es("voice_sms_link")},[]);let[ei,ec]=(0,a.useState)(""),[ed,em]=(0,a.useState)(!1),[eu,eh]=(0,a.useState)(null),[ep,ex]=(0,a.useState)(null);(0,a.useEffect)(()=>{let e=!1;return fetch("/api/demo-booking/config",{cache:"no-store"}).then(e=>e.ok?e.json():null).then(t=>{var r;!e&&(null==t||null==(r=t.meeting_types)?void 0:r.length)&&(A(t.meeting_types),t.meeting_types.find(e=>e.name===E)||F(t.meeting_types[0].name))}).catch(()=>{}),()=>{e=!0}},[]);let eg="".concat(Y.getFullYear(),"-").concat(String(Y.getMonth()+1).padStart(2,"0"));(0,a.useEffect)(()=>{let e=!1;return G(!0),O(null),X(null),fetch("/api/demo-booking/availability?meeting_type=".concat(encodeURIComponent(E),"&month=").concat(eg),{cache:"no-store"}).then(async e=>{let t=await e.json().catch(()=>({}));if(!e.ok)throw Error((null==t?void 0:t.error)||(null==t?void 0:t.detail)||"HTTP ".concat(e.status));return t}).then(t=>{if(e)return;let r=t.slots||[];I(r);let n=Array.from(new Set(r.map(e=>h(e.iso)))).sort();Z(n.length?n[0]:null)}
1).catch(t=>{e||(O(t.message),I([]),Z(null))}).finally(()=>{e||G(!1)}),()=>{e=!0}},[E,eg]);let ef=(0,a.useMemo)(()=>{let e={};for(let t of R){let r=h(t.iso);e[r]||(e[r]=[]),e[r].push(t)}return e},[R]),eb=(0,a.useMemo)(()=>{let e=(d(Y).getDay()+6)%7,t=new Date(Y.getFullYear(),Y.getMonth()+1,0).getDate(),r=[];for(let t=0;t<e;t++)r.push({date:null,key:"pad-".concat(t)});for(let e=1;e<=t;e++){let t=new Date(Y.getFullYear(),Y.getMonth(),e);r.push({date:t,key:u(t)})}return r},[Y]),ey=u(new Date),ev=new Date,ej=Y.getFullYear()===ev.getFullYear()&&Y.getMonth()===ev.getMonth(),ew=async e=>{if(e.preventDefault(),$){em(!0),ex(null);try{let e=await fetch("/api/demo-booking/book",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:K,email:ee,company:er,phone:ea,notes:ei,meeting_type:$.meeting_type,slot_iso:$.iso,duration_minutes:$.duration_minutes,source:el})}),t=await e.json().catch(()=>({}));if(!e.ok||!t.success)throw Error(t.error||t.detail||"HTTP ".concat(e.status));eh(t)}catch(e){ex(e.message||"Something went wrong. Please try again.")}finally{em(!1)}}},ek="db-input w-full rounded-lg border border-slate-300 bg-white px-3.5 py-2.5 text-sm text-slate-900 placeholder:text-slate-400 transition-colors";return(null==eu?void 0:eu.success)?(0,n.jsxs)("section",{className:(0,o.cn)(k),style:P,children:[(0,n.jsx)("style",{dangerouslySetInnerHTML:{__html:D}}),(0,n.jsx)("div",{className:"mx-auto max-w-xl px-4 sm:px-6 lg:px-8",children:(0,n.jsxs)("div",{id:N,className:"text-center",style:L,children:[(0,n.jsx)("div",{className:"mx-auto mb-5 flex h-14 w-14 items-center justify-center rounded-full",style:{backgroundColor:"color-mix(in srgb, ".concat(T," 16%, transparent)"),color:T},"aria-hidden":!0,children:(0,n.jsx)("svg",{width:"26",height:"26",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:(0,n.jsx)("path",{d:"M20 6 9 17l-5-5"})})}),(0,n.jsx)("h2",{className:"text-2xl sm:text-3xl font-bold tracking-tight text-slate-900",children:"You’re booked in"}),(0,n.jsx)("p",{className:"mt-3 text-base text-slate-600",children:v}),(0,n.jsxs)("div",{className:"mt-6 flex flex-col items-center gap-3",children:[eu.zoom_join_url&&(0,n.jsx)("a",{href:eu.zoom_join_url,className:"db-cta inline-flex items-center justify-center rounded-lg px-5 py-2.5 text-sm font-semibold transition",style:{backgroundColor:T,color:q},children:"Open Zoom link"}),eu.event_link&&(0,n.jsx)("a",{href:eu.event_link,className:"text-sm font-medium text-slate-500 underline underline-offset-4 hover:text-slate-700",children:"Add to calendar"})]})]})})]}):(0,n.jsxs)("section",{className:(0,o.cn)(k),style:P,children:[(0,n.jsx)("style",{dangerouslySetInnerHTML:{__html:D}}),(0,n.jsxs)("div",{className:"mx-auto max-w-4xl px-4 sm:px-6 lg:px-8",children:[(x||g||f)&&(0,n.jsxs)("div",{className:"text-center mb-8 sm:mb-10",children:[g&&(0,n.jsx)("p",{className:"font-semibold tracking-[0.18em] uppercase text-xs sm:text-sm mb-3",style:{color:T},children:g}),x&&(0,n.jsx)("h2",{className:"text-3xl sm:text-4xl font-bold tracking-tight",style:S?{color:S}:void 0,children:x}),f&&(0,n.jsx)("p",{className:"mt-3 text-base sm:text-lg max-w-2xl mx-auto opacity-90",style:{color:_||"#9aa7a4"},children:f})]}),(0,n.jsxs)("div",{id:N,style:L,children:[W.length>1&&(0,n.jsx)("div",{className:"flex flex-wrap gap-2 justify-center mb-7",children:W.map(e=>{let t=e.name===E;return(0,n.jsxs)("button",{type:"button",onClick:()=>F(e.name),className:(0,o.cn)("rounded-full border px-4 py-2 text-sm font-medium transition",!t&&"border-slate-300 bg-white text-slate-700 hover:border-slate-400"),style:t?{backgroundColor:T,borderColor:T,color:q}:void 0,children:[C(e.name),(0,n.jsxs)("span",{className:"ml-2 text-xs opacity-70",children:[e.duration_minutes," min"]})]},e.name)})}),(0,n.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6 lg:gap-10",children:[(0,n.jsxs)("div",{children:[(0,n.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,n.jsx)("button",{type:"button",onClick:()=>V(m(Y,-1)),disabled:ej,className:"flex h-9 w-9 items-center justify-center rounded-full text-slate-600 hover:bg-slate-100 transition disabled:opacity-30 disabled:cursor-not-allowed disabled:hover:bg-transparent","aria-label":"Previous month",children:(0,n.jsx)("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:(0,n.jsx)("path",{d:"m15 18-6-6 6-6"})})}),(0,n.jsx)("div",{className:"text-base font-semibold text-slate-900",children:Y.toLocaleStr
1ing(void 0,{month:"long",year:"numeric"})}),(0,n.jsx)("button",{type:"button",onClick:()=>V(m(Y,1)),className:"flex h-9 w-9 items-center justify-center rounded-full text-slate-600 hover:bg-slate-100 transition","aria-label":"Next month",children:(0,n.jsx)("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:(0,n.jsx)("path",{d:"m9 18 6-6-6-6"})})})]}),(0,n.jsx)("div",{className:"grid grid-cols-7 gap-1.5 text-[11px] font-medium uppercase tracking-wide text-slate-400 mb-2",children:c.map(e=>(0,n.jsx)("div",{className:"text-center py-1",children:e},e))}),(0,n.jsx)("div",{className:"grid grid-cols-7 gap-1.5",children:eb.map(e=>{var t;if(!e.date)return(0,n.jsx)("div",{},e.key);let r=u(e.date),a=!!(null==(t=ef[r])?void 0:t.length),l=J===r,s=r===ey;return(0,n.jsx)("button",{type:"button",disabled:!a,onClick:()=>{Z(r),X(null)},className:(0,o.cn)("db-day relative aspect-square text-sm rounded-xl border flex items-center justify-center transition",l&&"db-day--selected font-semibold",!l&&a&&"font-semibold cursor-pointer",!a&&"border-transparent text-slate-300 cursor-not-allowed"),style:l?{backgroundColor:T,borderColor:T,color:q}:a?{backgroundColor:"color-mix(in srgb, ".concat(T," 14%, transparent)"),borderColor:"color-mix(in srgb, ".concat(T," 42%, transparent)"),color:z,...s?{boxShadow:"inset 0 0 0 1px ".concat(T)}:{}}:void 0,children:e.date.getDate()},e.key)})}),H&&(0,n.jsx)("p",{className:"mt-4 text-sm text-slate-500",children:"Loading availability…"}),U&&(0,n.jsxs)("p",{className:"mt-4 text-sm text-red-600",children:["Couldn’t load availability: ",U]}),!H&&!U&&0===R.length&&(0,n.jsxs)("p",{className:"mt-4 text-sm text-slate-500",children:["No availability in ",Y.toLocaleString(void 0,{month:"long"}),". Try the next month ›"]})]}),(0,n.jsxs)("div",{className:"lg:border-l lg:border-slate-200/70 lg:pl-10",children:[J&&(null==(t=ef[J])?void 0:t.length)?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{className:"mb-4 text-sm font-semibold text-slate-900",children:new Date(J).toLocaleDateString(void 0,{weekday:"long",day:"numeric",month:"long"})}),(0,n.jsx)("div",{className:"flex flex-wrap gap-2 mb-6",children:ef[J].map(e=>{let t=(null==$?void 0:$.iso)===e.iso;return(0,n.jsx)("button",{type:"button",onClick:()=>X(e),className:(0,o.cn)("db-slot rounded-lg border px-3.5 py-2 text-sm font-medium transition",t?"db-slot--active":"border-slate-200 text-slate-700"),style:t?{backgroundColor:T,borderColor:T,color:q}:void 0,children:p(e.iso)},e.iso)})})]}):(0,n.jsx)("div",{className:"mb-2 text-sm text-slate-500",children:"Select a highlighted date to see available times."}),$&&(0,n.jsxs)("form",{onSubmit:ew,className:"space-y-3.5",noValidate:!0,children:[(0,n.jsxs)("div",{children:[(0,n.jsxs)("label",{htmlFor:"".concat(N,"-name"),className:"block text-sm font-medium text-slate-700 mb-1.5",children:["Your name ",(0,n.jsx)("span",{style:{color:T},children:"*"})]}),(0,n.jsx)("input",{id:"".concat(N,"-name"),type:"text",required:!0,value:K,onChange:e=>Q(e.target.value),className:ek})]}),(0,n.jsxs)("div",{children:[(0,n.jsxs)("label",{htmlFor:"".concat(N,"-email"),className:"block text-sm font-medium text-slate-700 mb-1.5",children:["Work email ",(0,n.jsx)("span",{style:{color:T},children:"*"})]}),(0,n.jsx)("input",{id:"".concat(N,"-email"),type:"email",required:!0,value:ee,onChange:e=>et(e.target.value),className:ek})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)("label",{htmlFor:"".concat(N,"-company"),className:"block text-sm font-medium text-slate-700 mb-1.5",children:"Golf club / organisation"}),(0,n.jsx)("input",{id:"".concat(N,"-company"),type:"text",value:er,onChange:e=>en(e.target.value),className:ek})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)("label",{htmlFor:"".concat(N,"-phone"),className:"block text-sm font-medium text-slate-700 mb-1.5",children:"Phone (optional)"}),(0,n.jsx)("input",{id:"".concat(N,"-phone"),type:"tel",value:ea,onChange:e=>eo(e.target.value),className:ek})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)("label",{htmlFor:"".concat(N,"-notes"),className:"block text-sm font-medium text-slate-700 mb-1.5",children:"Anything you’d like us to cover?"}),(0,n.jsx)("textarea",{id:"".concat(N,"-notes"),rows:3,value:ei,onChange:e=>ec(e.target.value),className:ek})]}),ep&&(0,n.jsx)("div",{className:"rounded-lg border border-red-200 bg-red-50 p-3 text-sm text-red-700",children:ep}),(0,n.jsxs)("div",{className:"rounded-lg px-3.5 py-2.5 text-sm text-slate-600",style:{backgroundColor:"color-mix(in srgb, "+T+" 8%, transparent)"},children:["Booking ",(0,n.jsx)("strong",{className:"text-slate-900",children:C($.meeting_type)})," on"," ",(0,n.jsxs)("strong",{className:"text-slate-900",children:[new Date($.iso).toLocaleStr
1ing(void 0,{weekday:"short",day:"numeric",month:"short"})," ","at ",p($.iso)]})," ","(",$.duration_minutes," min)."]}),(0,n.jsx)("button",{type:"submit",disabled:ed,className:"db-cta inline-flex w-full items-center justify-center rounded-lg px-5 py-3 text-sm font-semibold transition disabled:opacity-60",style:{backgroundColor:T,color:q},children:ed?"Booking…":"Confirm booking"})]}),!$&&J&&(null==(r=ef[J])?void 0:r.length)?(0,n.jsx)("p",{className:"text-sm text-slate-500",children:"Pick a time above to continue."}):null]})]})]})]})]})}},10021:(e,t,r)=>{"use strict";function n(e,t){if(e)return"custom"===e?(null==t?void 0:t.trim())||void 0:"var(--color-".concat(e,")")}r.d(t,{DM:()=>n})},11718:(e,t,r)=>{"use strict";r.d(t,{SessionActions:()=>o});var n=r(29064),a=r(34340);let o=e=>{let{session:t,lessonId:r,signedIn:o,ctaLabel:l,signInPrompt:s,signInHref:i,accentColor:c,mutedTextColor:d}=e,[m,u]=(0,a.useState)(t),[h,p]=(0,a.useState)(!1),[x,g]=(0,a.useState)(null),[f,b]=(0,a.useState)(null),y=function(e,t){var r;return(null==(r=e.my_place)?void 0:r.status)==="offered"?"offered":e.my_place?"booked":t?e.my_queue_position&&e.my_queue_position>0?"queued":e.is_full||e.places_remaining<=0?"full":"open":"sign-in"}(m,o);async function v(){try{let e=await fetch("/api/lesson-sessions/lessons/".concat(encodeURIComponent(r),"/sessions"),{cache:"no-store"});if(!e.ok)return;let t=await e.json(),n=((null==t?void 0:t.sessions)||[]).find(e=>e.booking_id===m.booking_id);n&&u(n)}catch(e){}}async function j(e,t,r){if(!h){p(!0),g(null),b(null);try{let n=await fetch("/api/lesson-sessions/group-sessions/".concat(encodeURIComponent(m.booking_id),"/").concat(e),{method:t,headers:{"Content-Type":"application/json"},..."POST"===t?{body:"{}"}:{}}),a=await n.json().catch(()=>({}));n.ok?b(r):401===n.status?g("Your session has expired — sign in again to book."):g(function(e){let t=null==e?void 0:e.detail;if("string"==typeof t&&t.trim())return t;if(t&&"object"==typeof t){let e=t.message;if("string"==typeof e&&e.trim())return e}return null}(a)||"That did not work. Please try again.")}catch(e){g("That did not work. Please try again.")}finally{p(!1),await v()}}}let w={color:d},k={background:c||void 0,opacity:h?.6:1};return(0,n.jsxs)("div",{className:"mt-3",children:[(0,n.jsx)("p",{className:"text-sm font-medium",children:function(e){return e.is_full||e.places_remaining<=0?"Full":1===e.places_remaining?"1 place left":"".concat(e.places_remaining," places left")}(m)}),"sign-in"===y&&(0,n.jsx)("a",{href:i,className:"mt-2 inline-block text-sm underline",children:s}),"open"===y&&(0,n.jsx)("button",{type:"button",disabled:h,onClick:()=>j("take","POST","Your place is booked."),style:k,className:"mt-2 rounded-md px-4 py-2 text-sm font-medium text-white disabled:cursor-not-allowed",children:h?"Booking…":l}),"booked"===y&&(0,n.jsxs)("div",{className:"mt-2",children:[(0,n.jsx)("p",{className:"text-sm font-medium",children:"You have a place on this session."}),(0,n.jsx)("button",{type:"button",disabled:h,onClick:()=>j("release","POST","Your place has been given up."),className:"mt-1 text-xs underline disabled:cursor-not-allowed",style:w,children:h?"Working…":"Give up my place"})]}),"offered"===y&&(0,n.jsxs)("div",{className:"mt-2",children:[(0,n.jsx)("p",{className:"text-sm font-medium",children:"A place is being held for you on this session."}),(0,n.jsx)("button",{type:"button",disabled:h,onClick:()=>j("accept-offer","POST","Your place is confirmed."),style:k,className:"mt-2 rounded-md px-4 py-2 text-sm font-medium text-white disabled:cursor-not-allowed",children:h?"Confirming…":"Confirm my place"})]}),"full"===y&&(0,n.jsx)("button",{type:"button",disabled:h,onClick:()=>j("waitlist","POST","You are on the waiting list for this session."),className:"mt-2 rounded-md border px-4 py-2 text-sm font-medium disabled:cursor-not-allowed",children:h?"Joining…":"Join the waiting list"}),"queued"===y&&(0,n.jsxs)("div",{className:"mt-2",children:[(0,n.jsx)("p",{className:"text-sm",children:function(e){var t,r;let n=null!=(t=e.my_queue_position)?t:0;if(n<=0)return"";let a=null!=(r=e.queue_length)?r:0;return a>
11?"You are ".concat(function(e){let t=["th","st","nd","rd"],r=e%100;return"".concat(e).concat(t[(r-20)%10]||t[r]||t[0])}(n)," of ").concat(a," waiting"):"You are next in line"}(m)}),(0,n.jsx)("p",{className:"text-xs mt-1",style:w,children:"If a place frees up it is held for you and we will email you — you do not need to watch this page."}),(0,n.jsx)("button",{type:"button",disabled:h,onClick:()=>j("waitlist","DELETE","You have left the waiting list."),className:"mt-1 text-xs underline disabled:cursor-not-allowed",style:w,children:h?"Working…":"Leave the waiting list"})]}),f&&(0,n.jsx)("p",{className:"text-xs mt-2",children:f}),x&&(0,n.jsx)("p",{className:"text-xs mt-2",role:"alert",children:x})]})}},14135:(e,t,r)=>{"use strict";r.d(t,{CarouselClient:()=>u});var n=r(29064);r(34340);var a=r(1834),o=r(17727);r(11782),r(7854),r(88684),r(25910),r(84753),r(78355),r(64001);let l={inverse:"#ffffff",primary:"var(--color-primary)",primaryLight:"var(--color-primary-light, var(--color-primary))",primaryDark:"var(--color-primary-dark, var(--color-primary))",secondary:"var(--color-secondary)",secondaryLight:"var(--color-secondary-light, var(--color-secondary))",secondaryDark:"var(--color-secondary-dark, var(--color-secondary))",accent:"var(--color-accent)",accentLight:"var(--color-accent-light, var(--color-accent))",accentDark:"var(--color-accent-dark, var(--color-accent))",dark:"#1e293b",muted:"var(--color-text-muted)"},s={primary:"var(--color-primary)",secondary:"var(--color-secondary)",accent:"var(--color-accent)",dark:"#1e293b",muted:"var(--color-muted)"},i={default:"btn btn-primary",secondary:"btn btn-secondary",outline:"btn btn-outline"},c={h1:{fontFamily:"var(--font-heading, serif)",fontSize:"var(--text-h1)",fontWeight:700},h2:{fontFamily:"var(--font-heading, serif)",fontSize:"var(--text-h2)",fontWeight:700},h3:{fontFamily:"var(--font-heading, serif)",fontSize:"var(--text-h3)",fontWeight:600},h4:{fontFamily:"var(--font-heading, serif)",fontSize:"var(--text-h4)",fontWeight:600},body:{fontFamily:"var(--font-body, sans-serif)",fontSize:"var(--text-body)",fontWeight:400}},d={inverse:"#ffffff",primary:"var(--color-primary)",dark:"#1e293b"};function m(e){var t,r,a,o,d,m;let u,{slide:h,height:p,overlayOpacity:x}=e,g=h.slideType||"image",f=h.linkUrl||null,b=h.imageUrl||"",y=h.imageAlt||"",v=h.videoUrl||"",j=h.posterUrl||"",w=l[h.titleColor||"inverse"]||"#ffffff",k=l[h.subtitleColor||"inverse"]||"#ffffff",N=l[h.descriptionColor||"inverse"]||"#ffffff",C=h.subtitlePosition||"below",S=c[h.subtitleStyle||"h4"]||c.h4,_=()=>h.subtitle?(0,n.jsx)("p",{style:{fontSize:S.fontSize,opacity:.9,textShadow:"0 1px 2px rgba(0,0,0,0.3)",color:k,fontFamily:S.fontFamily,fontWeight:S.fontWeight,letterSpacing:"0.05em",marginBottom:"above"===C?"0.5rem":0,marginTop:"below"===C?"0.5rem":0},children:h.subtitle}):null,T=()=>(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{style:{position:"absolute",inset:0,backgroundColor:"rgba(0,0,0,0.".concat(x,")")}}),(0,n.jsxs)("div",{style:{position:"absolute",inset:0,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",textAlign:"center",padding:"2rem"},children:["above"===C&&_(),h.title&&(0,n.jsx)("h2",{style:{fontSize:"var(--text-h2)",marginBottom:"0.5rem",textShadow:"0 2px 4px rgba(0,0,0,0.3)",color:w},children:h.title}),"below"===C&&_(),h.description&&(0,n.jsx)("p",{style:{fontSize:"var(--text-body)",opacity:.85,maxWidth:"600px",marginTop:"1rem",color:N},children:h.description}),f&&h.linkLabel&&(0,n.jsx)("a",{href:f,target:h.linkNewTab?"_blank":void 0,rel:h.linkNewTab?"noopener noreferrer":void 0,className:i[h.linkAppearance||"default"],style:{marginTop:"1.5rem"},children:h.linkLabel})]})]}),q=()=>h.subtitle?(0,n.jsx)("p",{style:{fontSize:S.fontSize,opacity:.9,color:k,fontFamily:S.fontFamily,fontWeight:S.fontWeight,letterSpacing:"0.05em",marginBottom:"above"===C?"0.5rem":0,marginTop:"below"===C?"0.5rem":0},children:h.subtitle}):null;switch(g){case"image":u=(0,n.jsx)("div",{style:{position:"relative",height:p,overflow:"hidden"},children:b&&(0,n.jsx)("img",{src:b,alt:y||"",style:{width:"100%",height:"100%",objectFit:"cover",objectPosition:"calc(50% + ".concat(null!=(t=h.offsetX)?t:0,"px) calc(50% + ").concat(null!=(r=h.offsetY)?r:0,"px)")}})});break;case"imageWithText":u=(0,n.jsxs)("div",{style:{position:"relative",height:p,overflow:"hidden"},children:[b&&(0,n.jsx)("img",{src:b,alt:y||h.title||"",style:{width:"100%",height:"100%",objectFit:"cover",objectPosition:"calc(50% + ".concat(null!=(a=h.offsetX)?a:0,"px) calc(50% + ").concat(null!=(o=h.offsetY)?o:0,"px)")}}
1),T()]});break;case"video":u=(0,n.jsx)("div",{style:{position:"relative",height:p,overflow:"hidden",backgroundColor:"#000"},children:v&&(0,n.jsx)("video",{src:v,poster:j||void 0,autoPlay:h.videoAutoplay,muted:!1!==h.videoMuted,loop:h.videoLoop,playsInline:!0,controls:!h.videoAutoplay,style:{width:"100%",height:"100%",objectFit:"cover"}})});break;case"videoWithText":u=(0,n.jsxs)("div",{style:{position:"relative",height:p,overflow:"hidden",backgroundColor:"#000"},children:[v&&(0,n.jsx)("video",{src:v,poster:j||void 0,autoPlay:h.videoAutoplay,muted:!1!==h.videoMuted,loop:h.videoLoop,playsInline:!0,style:{width:"100%",height:"100%",objectFit:"cover"}}),T()]});break;case"contentCard":u=(0,n.jsxs)("div",{style:{height:"auto"===p?"auto":p,minHeight:"auto"===p?"300px":void 0,backgroundColor:s[h.cardBgColor||"primary"],display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",textAlign:"center",padding:"3rem 2rem"},children:["above"===C&&q(),h.title&&(0,n.jsx)("h2",{style:{fontSize:"var(--text-h2)",marginBottom:"0.5rem",color:w},children:h.title}),"below"===C&&q(),h.description&&(0,n.jsx)("p",{style:{fontSize:"var(--text-body)",opacity:.85,maxWidth:"600px",marginTop:"1rem",color:N},children:h.description}),f&&h.linkLabel&&(0,n.jsx)("a",{href:f,target:h.linkNewTab?"_blank":void 0,rel:h.linkNewTab?"noopener noreferrer":void 0,className:i[h.linkAppearance||"default"],style:{marginTop:"1.5rem"},children:h.linkLabel})]});break;default:u=(0,n.jsx)("div",{style:{position:"relative",height:p,overflow:"hidden"},children:b&&(0,n.jsx)("img",{src:b,alt:y||"",style:{width:"100%",height:"100%",objectFit:"cover",objectPosition:"calc(50% + ".concat(null!=(d=h.offsetX)?d:0,"px) calc(50% + ").concat(null!=(m=h.offsetY)?m:0,"px)")}})})}return f&&!h.linkLabel?(0,n.jsx)("a",{href:f,target:h.linkNewTab?"_blank":void 0,rel:h.linkNewTab?"noopener noreferrer":void 0,style:{display:"block"},children:u}):(0,n.jsx)(n.Fragment,{children:u})}function u(e){let{slides:t,height:r,overlayOpacity:l,fullWidth:s,rounded:i,shadow:c,effect:u="slide",slidesPerView:h=1,spaceBetween:p=0,speed:x=500,loop:g=!0,centeredSlides:f=!1,autoplay:b=!0,autoplaySpeed:y=5e3,pauseOnHover:v=!0,showArrows:j=!0,showDots:w=!0,paginationType:k="bullets",navigationColor:N="inverse"}=e,C=d[N]||"#ffffff",S=[o.Jq];return j&&S.push(o.Vx),w&&S.push(o.dK),b&&S.push(o.Ij),"fade"===u&&S.push(o._R),"coverflow"===u&&S.push(o.t9),"cube"===u&&S.push(o.hw),"flip"===u&&S.push(o.n),(0,n.jsx)("section",{style:{position:"relative",width:s?"100%":"auto",margin:s?0:"0 auto",maxWidth:s?"none":"var(--container-max)",borderRadius:i?"var(--radius-lg)":0,boxShadow:c?"0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06)":"none",overflow:"hidden","--swiper-navigation-color":C,"--swiper-pagination-color":C,"--swiper-navigation-size":"28px"},children:(0,n.jsx)(a.RC,{modules:S,effect:u,slidesPerView:h,spaceBetween:p,speed:x,loop:g&&t.length>1,centeredSlides:f,navigation:j&&t.length>1,pagination:!!w&&t.length>1&&{clickable:!0,type:k},autoplay:!!b&&t.length>1&&{delay:y,disableOnInteraction:!1,pauseOnMouseEnter:v},fadeEffect:"fade"===u?{crossFade:!0}:void 0,grabCursor:!0,style:{width:"100%"},children:t.map((e,t)=>(0,n.jsx)(a.qr,{children:(0,n.jsx)(m,{slide:e,height:r,overlayOpacity:l})},t))})})}},16010:(e,t,r)=>{"use strict";r.d(t,{CalendarSubscribeButton:()=>c});var n=r(29064),a=r(34340),o=r(58249),l=r(1181),s=r(22163),i=r(67604);let c=e=>{let{isDark:t=!1,className:r="",compact:c=!1}=e,[d,m]=(0,a.useState)(!1),[u,h]=(0,a.useState)(!1),p=(0,a.useRef)(null),x=()=>"".concat(window.location.origin,"/api/calendar/events.ics");(0,a.useEffect)(()=>{let e=e=>{p.current&&!p.current.contains(e.target)&&m(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]);let g=async()=>{let e=x();try{await navigator.clipboard.writeText(e),h(!0),setTimeout(()=>h(!1),2e3)}catch(r){let t=document.createElement("textarea");t.value=e,document.body.appendChild(t),t.select(),document.execCommand("copy"),document.body.removeChild(t),h(!0),setTimeout(()=>h(!1),2e3)}},f=t?"text-gray-200 hover:bg-gray-700":"text-gray-700 hover:bg-gray-50",b
1=t?"text-gray-400":"text-gray-500";return(0,n.jsxs)("div",{className:"relative inline-block ".concat(r),ref:p,children:[(0,n.jsxs)("button",{onClick:()=>m(!d),className:"inline-flex items-center gap-2 ".concat(c?"px-3 py-1.5":"px-4 py-2"," rounded-md font-medium text-sm transition-all ").concat(t?"bg-gray-700 text-white hover:bg-gray-600 border border-gray-600":"bg-white text-gray-700 hover:bg-gray-50 border border-gray-300 shadow-sm"),"aria-expanded":d,"aria-haspopup":"true",children:[(0,n.jsx)(o.A,{className:"h-4 w-4"}),c?(0,n.jsx)("span",{className:"hidden sm:inline",children:"Subscribe"}):(0,n.jsx)("span",{children:"Subscribe to Calendar"}),(0,n.jsx)(l.A,{className:"h-4 w-4 transition-transform ".concat(d?"rotate-180":"")})]}),d&&(0,n.jsx)("div",{className:"absolute z-50 mt-2 w-64 rounded-lg shadow-lg ring-1 ring-black ring-opacity-5 overflow-hidden ".concat(c?"right-0":"left-0"," ").concat(t?"bg-gray-800":"bg-white"),children:(0,n.jsxs)("div",{className:"py-1",children:[(0,n.jsxs)("button",{onClick:()=>{let e=x().replace(/^https?:/,"webcal:");window.open(e,"_blank"),m(!1)},className:"w-full px-4 py-3 text-left flex items-center gap-3 transition-colors ".concat(f),children:[(0,n.jsx)("svg",{className:"h-5 w-5",viewBox:"0 0 24 24",fill:"currentColor",children:(0,n.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,n.jsxs)("div",{children:[(0,n.jsx)("div",{className:"font-medium",children:"Apple Calendar"}),(0,n.jsx)("div",{className:"text-xs ".concat(b),children:"iPhone, iPad, Mac"})]})]}),(0,n.jsxs)("button",{onClick:()=>{let e=x(),t="https://calendar.google.com/calendar/r?cid=".concat(encodeURIComponent(e));window.open(t,"_blank"),m(!1)},className:"w-full px-4 py-3 text-left flex items-center gap-3 transition-colors ".concat(f),children:[(0,n.jsxs)("svg",{className:"h-5 w-5",viewBox:"0 0 24 24",children:[(0,n.jsx)("path",{fill:"#4285F4",d:"M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92c-.26 1.37-1.04 2.53-2.21 3.31v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.09z"}),(0,n.jsx)("path",{fill:"#34A853",d:"M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23z"}),(0,n.jsx)("path",{fill:"#FBBC05",d:"M5.84 14.09c-.22-.66-.35-1.36-.35-2.09s.13-1.43.35-2.09V7.07H2.18C1.43 8.55 1 10.22 1 12s.43 3.45 1.18 4.93l2.85-2.22.81-.62z"}),(0,n.jsx)("path",{fill:"#EA4335",d:"M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.07l3.66 2.84c.87-2.6 3.3-4.53 6.16-4.53z"})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)("div",{className:"font-medium",children:"Google Calendar"}),(0,n.jsx)("div",{className:"text-xs ".concat(b),children:"Gmail, Android"})]})]}),(0,n.jsxs)("button",{onClick:()=>{let e=x(),t="https://outlook.live.com/calendar/0/addfromweb?url=".concat(encodeURIComponent(e));window.open(t,"_blank"),m(!1)},className:"w-full px-4 py-3 text-left flex items-center gap-3 transition-colors ".concat(f),children:[(0,n.jsxs)("svg",{className:"h-5 w-5",viewBox:"0 0 24 24",children:[(0,n.jsx)("path",{fill:"#0078D4",d:"M24 7.387v10.478c0 .23-.08.424-.238.576-.158.152-.362.228-.61.228h-8.608v-8.07l1.2.98c.158.127.315.19.472.19.157 0 .315-.063.472-.19l7.074-5.74c.157-.128.238-.032.238.288v1.26zm-.847-1.564c0 .255-.086.478-.257.668l-7.074 5.727c-.172.14-.343.21-.515.21-.171 0-.343-.07-.514-.21l-7.075-5.727c-.17-.19-.256-.413-.256-.668 0-.254.086-.478.256-.668.171-.19.371-.285.6-.285h14.234c.228 0 .429.095.601.285z"}),(0,n.jsx)("path",{fill:"#0078D4",d:"M8.608 8.53v9.317c0 .253.097.483.291.688.195.206.432.308.712.308h4.933V8.6h-3.76l-2.175 1.76
15v-1.834h-.001z"}),(0,n.jsx)("path",{fill:"#0078D4",d:"M0 5.5v13c0 .414.336.75.75.75h7.108v-9.638L5.61 7.828v2.59H2.89l-.001-5.668H.75A.75.75 0 000 5.5z"}),(0,n.jsx)("path",{fill:"#28A8EA",d:"M8.608 8.53l-.001 10.313h5.937V8.601h-3.76l-2.176 1.764V8.53z"})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)("div",{className:"font-medium",children:"Outlook"}),(0,n.jsx)("div",{className:"text-xs ".concat(b),children:"Microsoft 365, Outlook.com"})]})]}),(0,n.jsx)("div",{className:"border-t my-1 ".concat(t?"border-gray-700":"border-gray-200")}),(0,n.jsxs)("button",{onClick:g,className:"w-full px-4 py-3 text-left flex items-center gap-3 transition-colors ".concat(f),children:[u?(0,n.jsx)(s.A,{className:"h-5 w-5 text-green-500"}):(0,n.jsx)(i.A,{className:"h-5 w-5"}),(0,n.jsxs)("div",{children:[(0,n.jsx)("div",{className:"font-medium",children:u?"Copied!":"Copy Calendar Link"}),(0,n.jsx)("div",{className:"text-xs ".concat(b),children:"For other calendar apps"})]})]})]})})]})}},16426:(e,t,r)=>{"use strict";r.d(t,{BayListBlock:()=>b});var n=r(29064),a=r(34340),o=r(87482);let l=e=>{let{className:t}=e;return(0,n.jsxs)("svg",{className:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,n.jsx)("path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2"}),(0,n.jsx)("circle",{cx:"9",cy:"7",r:"4"}),(0,n.jsx)("path",{d:"M22 21v-2a4 4 0 0 0-3-3.87"}),(0,n.jsx)("path",{d:"M16 3.13a4 4 0 0 1 0 7.75"})]})},s=e=>{let{className:t}=e;return(0,n.jsxs)("svg",{className:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,n.jsx)("rect",{width:"20",height:"14",x:"2",y:"3",rx:"2"}),(0,n.jsx)("line",{x1:"8",x2:"16",y1:"21",y2:"21"}),(0,n.jsx)("line",{x1:"12",x2:"12",y1:"17",y2:"21"})]})},i=e=>{let{className:t}=e;return(0,n.jsxs)("svg",{className:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,n.jsx)("circle",{cx:"12",cy:"12",r:"10"}),(0,n.jsx)("circle",{cx:"12",cy:"12",r:"6"}),(0,n.jsx)("circle",{cx:"12",cy:"12",r:"2"})]})},c=e=>{let{className:t}=e;return(0,n.jsx)("svg",{className:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:(0,n.jsx)("path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z"})})},d=e=>{let{className:t}=e;return(0,n.jsx)("svg",{className:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:(0,n.jsx)("path",{d:"m15 18-6-6 6-6"})})},m=e=>{let{className:t}=e;return(0,n.jsx)("svg",{className:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:(0,n.jsx)("path",{d:"m9 18 6-6-6-6"})})},u=e=>{let{className:t}=e;return(0,n.jsxs)("svg",{className:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,n.jsx)("circle",{cx:"12",cy:"12",r:"10"}),(0,n.jsx)("line",{x1:"12",x2:"12",y1:"8",y2:"12"}),(0,n.jsx)("line",{x1:"12",x2:"12.01",y1:"16",y2:"16"})]})},h={simulator:{label:"Simulator",className:"bg-green-600 text-white"},range:{label:"Range",className:"bg-blue-600 text-white"},hybrid:{label:"Hybrid",className:"bg-purple-600 text-white"}};function p(e){let{type:t}=e,r=h[t]||{label:t,className:"bg-gray-600 text-white"};return(0,n.jsxs)("span",{className:(0,o.cn)("inline-flex items-center gap-1 px-2.5 py-0.5 rounded-full text-xs font-medium",r.className),children:["simulator"===t&&(0,n.jsx)(s,{className:"h-3 w-3"}),"range"===t&&(0,n.jsx)(i,{className:"h-3 w-3"}),"hybrid"===t&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(s,{className:"h-3 w-3"}),(0,n.jsx)(i,{className:"h-3 w-3"})]}),r.label]})}function x(e){let{bay:t,showEquipment:r,showBookButton:a,bookingPageSlug:i,layout:d}=e,m="list"===d;return(0,n.jsxs)("div",{className:(0,o.cn)("bg-white border border-gray-200 rounded-xl shadow-sm hover:shadow-md transition-shadow duration-200 overflow-hidden flex flex-col",m&&"md:flex-row"),children:[(0,n.jsxs)("div",{className:(0,o.cn)("relative bg-gray-100 flex items-center justify-center",m?"w-full md:w-64 h-48 md:h-auto flex-shrink-0":"h-48"),children:[t.image_url?(0,n.jsx)("img",{src:t.image_url,alt:t.name,className:"w-full h-full object-cover"}):(0,n.jsxs)("div",{className:"flex flex-col items-center justify-center text-gray-400",children:[(0,n.jsx)(s,{className:"h-12 w-12 mb-2"}),(0,n.jsx)("span",{className:"text-xs font-medium",children:"No Image"})]}),(0,n.jsx)("div",{className:"absolute top-3 left-3",children:(0,n.jsx)(p,{type:t.bay_type})})]}),(0,n.jsxs)("div",{className:"flex flex-col flex-1 p-5",children:[(0,n.jsx)("h3",{className:"text-lg font-semibold text-gray-900 mb-1",children:t.name}),t.description&&(0,n.jsx)("p",{className:"text-sm text-gray-600 mb-3 line-clamp-2",children:t.description}),(0,n.jsxs)("div",{className:"flex items-center gap-1.5 text-sm text-gray-500 mb-3",children:[(0,n.jsx)(l,{className:"h-4 w-4"}),(0,n.jsxs)("span",{children:["Up to ",t.max_players," player",1!==t.max_players?"s":""]})]}),r&&t.equipment&&t.equipment.length>0&&(0,n.jsx)("div",{className:"flex flex-wrap gap-1.5 mb-4",children:t.equipment.map(e=>(0,n.jsxs)("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 bg-gray-100 text-gray-700 text-xs rounded-md font-medium",children:[(0,n.jsx)(c,{className:"h-3 w-3 text-gray-400"}),e]},e))}),(0,n.jsx)("div",{className:"flex-1"}),a&&(0,n.jsx)("a",{href:"/".concat(i||"book","?bay=").concat(t.id),className:"mt-2 inline-flex items-center justify-center w-full px-4 py-2.5 bg-blue-600 text-white text-sm font-medium rounded-lg hover:bg-blue-700 transition-colors duration-200",children:"Book This Bay"})]})]})}function g(e){let{layout:t}=e,r="list"===t;return(0,n.jsxs)("div",{className:(0,o.cn)("bg-white border border-gray-200 rounded-xl overflow-hidden animate-pulse flex flex-col",r&&"md:flex-row"),children:[(0,n.jsx)("div",{className:(0,o.cn)("bg-gray-200",r?"w-full md:w-64 h-48 md:h-auto":"h-48")}),(0,n.jsxs)("div",{className:"flex flex-col flex-1 p-5 space-y-3",children:[(0,n.jsx)("div",{className:"h-5 w-3/4 bg-gray-200 rounded"}),(0,n.jsx)("div",{className:"h-4 w-full bg-gray-200 rounded"}),(0,n.jsx)("div",{className:"h-4 w-1/2 bg-gray-200 rounded"}),(0,n.jsxs)("div",{className:"flex gap-2 mt-2",children:[(0,n.jsx)("div",{className:"h-6 w-16 bg-gray-200 rounded"}),(0,n.jsx)("div",{className:"h-6 w-20 bg-gray-200 rounded"})]}),(0,n.jsx)("div",{className:"flex-1"}),(0,n.jsx)("div",{className:"h-10 w-full bg-gray-200 rounded-lg mt-2"})]})]})}function f(e){let{children:t}=e,r=(0,a.useRef)(null),[o,l]=(0,a.useState)(!1),[s,i]=(0,a.useState)(!1),c=(0,a.useCallback)(()=>{let e=r.current;e&&(l(e.scrollLeft>0),i(e.scrollLeft+e.clientWidth<e.scrollWidth-1))},[]);function u(e){var t;let n=r.current;if(!n)return;let a=(null==(t=n.querySelector(":scope > *"))?void 0:t.clientWidth)||300;n.scrollBy({left:"left"===e?-(a+24):a+24,behavior:"smooth"})}return(0,a.useEffect)(()=>{c();let e=r.current;if(!e)return;e.addEventListener("scroll",c,{passive:!0});let t=new ResizeObserver(c);return t.observe(e),()=>{e.removeEventListener("scroll",c),t.disconnect()}},[c]),(0,n.jsxs)("div",{className:"relative",children:[o&&(0,n.jsx)("button",{onClick:()=>u("left"),className:"absolute -left-4 top-1/2 -translate-y-1/2 z-10 w-10 h-10 rounded-full bg-white border border-gray-200 shadow-md flex items-center justify-center hover:bg-gray-50 transition-colors","aria-label":"Scroll left",children:(0,n.jsx)(d,{className:"h-5 w-5 text-gray-700"})}),s&&(0,n.jsx)("button",{onClick:()=>u("right"),className:"absolute -right-4 top-1/2 -translate-y-1/2 z-10 w-10 h-10 rounded-full bg-white border border-gray-200 shadow-md flex items-center justify-center hover:bg-gray-50 transition-colors","aria-label":"Scroll right",children:(0,n.jsx)(m,{className:"h-5 w-5 text-gray-700"})}),(0,n.jsxs)("div",{ref:r,className:"flex gap-6 overflow-x-auto snap-x snap-mandatory scroll-smooth pb-2 -mb-2",style:{scrollbarWidth:"none",msOverflowStyle:"none"},children:[(0,n.jsx)("style",{children:"[data-bay-carousel]::-webkit-scrollbar { display: none; }"}),a.Children.map(t,e=>(0,n.jsx)("div",{className:"snap-start flex-shrink-0 w-[calc(100vw-3rem)] sm:w-80 md:w-96","data-bay-carousel":!0,children:e}))]})]})}let b=e=>{let{heading:t,layout:r="grid",showEquipment:l=!0,showBookButton:i=!0,bookingPageSlug:c,className:d}=e,[m,h]=(0,a.useState)([]),[p,b]=(0,a.useState)(!0),[y,v]=(0,a.useState)(null),j=r||"grid",w=(0,a.useCallback)(async()=>{b(!0),v(null);try{let e=await fetch("/api/simulator/bays");if(!e.ok)throw Error("Failed to load bays (".concat(e.status,")"));let t=await e.json();h(t.bays||[])}catch(e){v(e instanceof Error?e.message:"Failed to load simulator bays")}finally{b(!1)}},[]);if((0,a.useEffect)(()=>{w()},[w]),p)return(0,n.jsx)("section",{className:(0,o.cn)("py-12 px-4 sm:px-6 lg:px-8",d),children:(0,n.jsxs)("div",{className:"mx-auto max-w-7xl",children:[t&&(0,n.jsx)("h2",{className:"text-2xl sm:text-3xl font-bold text-gray-900 mb-8 text-center",children:t}),(0,n.jsx)("div",{className:(0,o.cn)("grid"===j&&"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6","list"===j&&"flex flex-col gap-6","carousel"===j&&"flex gap-6 overflow-hidden"),children:[1,2,3].map(e=>(0,n.jsx)(g,{layout:j},e))})]})});if(y)return(0,n.jsx)("section",{className:(0,o.cn)("py-12 px-4 sm:px-6 lg:px-8",d),children:(0,n.jsxs)("div",{className:"mx-auto max-w-7xl",children:[t&&(0,n.jsx)("h2",{className:"text-2xl sm:text-3xl font-bold text-gray-900 mb-8 text-center",children:t}),(0,n.jsxs)("div",{className:"text-center py-12 bg-gray-50 rounded-lg",children:[(0,n.jsx)(u,{className:"h-12 w-12 text-red-400 mx-auto mb-3"}),(0,n.jsx)("p",{className:"text-red-600 font-medium mb-4",children:y}),(0,n.jsx)("button",{onClick:w,className:"px-4 py-2 text-sm font-medium text-white bg-blue-600 rounded-lg hover:bg-blue-700 transition-colors",children:"Try Again"})]})]})});if(0===m.length)return(0,n.jsx)("section",{className:(0,o.cn)("py-12 px-4 sm:px-6 lg:px-8",d),children:(0,n.jsxs)("div",{className:"mx-auto max-w-7xl",children:[t&&(0,n.jsx)("h2",{className:"text-2xl sm:text-3xl font-bold text-gray-900 mb-8 text-center",children:t}),(0,n.jsxs)("div",{className:"text-center py-16",children:[(0,n.jsx)(s,{className:"h-16 w-16 text-gray-300 mx-auto mb-4"}),(0,n.jsx)("p",{className:"text-gray-500 text-lg",children:"No simulator bays available"}),(0,n.jsx)("p",{className:"text-gray-400 text-sm mt-2",children:"Check back soon for available bays"})]})]})});let k=m.map(e=>(0,n.jsx)(x,{bay:e,showEquipment:!!l,showBookButton:!!i,bookingPageSlug:c,layout:j},e.id));return(0,n.jsx)("section",{className:(0,o.cn)("py-12 px-4 sm:px-6 lg:px-8",d),children:(0,n.jsxs)("div",{className:"mx-auto max-w-7xl",children:[t&&(0,n.jsx)("h2",{className:"text-2xl sm:text-3xl font-bold text-gray-900 mb-8 text-center",children:t}),"grid"===j&&(0,n.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:k}),"carousel"===j&&(0,n.jsx)(f,{children:k}),"list"===j&&(0,n.jsx)("div",{className:"flex flex-col gap-6 max-w-3xl mx-auto",children:k})]})})}},18174:(e,t,r)=>{"use strict";r.d(t,{AutoResizeIframe:()=>o});
1var n=r(29064),a=r(34340);let o=e=>{let{src:t,title:r,allowOrigin:o,initialHeight:l,launchGrant:s,className:i}=e,c=(0,a.useRef)(null),[d,m]=(0,a.useState)(l);return(0,a.useEffect)(()=>{function e(e){if(o&&e.origin!==o)return;let t=e.data;t&&"nooq:resize"===t.type&&"number"==typeof t.height&&t.height>0&&m("".concat(Math.min(Math.ceil(t.height),2e4),"px"))}return window.addEventListener("message",e),()=>window.removeEventListener("message",e)},[o]),(0,n.jsx)("iframe",{ref:c,src:t,title:r,width:"100%",height:"100%",frameBorder:"0",style:{border:"none",display:"block",width:"100%",height:d},className:i,onLoad:function(){var e,t;s&&o&&(null==(t=c.current)||null==(e=t.contentWindow)||e.postMessage({type:"nooq:launch-grant",token:s},o))}})}},20876:(e,t,r)=>{"use strict";r.d(t,{GolfGeniusCompetitionReportBlock:()=>p});var n=r(29064),a=r(34340),o=r(87482),l=r(10021);let s=e=>{let{className:t}=e;return(0,n.jsxs)("svg",{className:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,n.jsx)("path",{d:"M6 9H4.5a2.5 2.5 0 0 1 0-5H6"}),(0,n.jsx)("path",{d:"M18 9h1.5a2.5 2.5 0 0 0 0-5H18"}),(0,n.jsx)("path",{d:"M4 22h16"}),(0,n.jsx)("path",{d:"M10 14.66V17c0 .55-.47.98-.97 1.21C7.85 18.75 7 20.24 7 22"}),(0,n.jsx)("path",{d:"M14 14.66V17c0 .55.47.98.97 1.21C16.15 18.75 17 20.24 17 22"}),(0,n.jsx)("path",{d:"M18 2H6v7a6 6 0 0 0 12 0V2Z"})]})},i=e=>{let{className:t}=e;return(0,n.jsx)("svg",{className:t,viewBox:"0 0 24 24",fill:"currentColor",stroke:"currentColor",strokeWidth:"2",children:(0,n.jsx)("polygon",{points:"12,2 15.09,8.26 22,9.27 17,14.14 18.18,21.02 12,17.77 5.82,21.02 7,14.14 2,9.27 8.91,8.26"})})},c=e=>{let{className:t}=e;return(0,n.jsxs)("svg",{className:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,n.jsx)("path",{d:"m12 3-1.912 5.813a2 2 0 0 1-1.275 1.275L3 12l5.813 1.912a2 2 0 0 1 1.275 1.275L12 21l1.912-5.813a2 2 0 0 1 1.275-1.275L21 12l-5.813-1.912a2 2 0 0 1-1.275-1.275L12 3Z"}),(0,n.jsx)("path",{d:"M5 3v4"}),(0,n.jsx)("path",{d:"M19 17v4"}),(0,n.jsx)("path",{d:"M3 5h4"}),(0,n.jsx)("path",{d:"M17 19h4"})]})},d=e=>{let{className:t}=e;return(0,n.jsxs)("svg",{className:(0,o.cn)("animate-spin",t),viewBox:"0 0 24 24",fill:"none",children:[(0,n.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),(0,n.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"})]})};function m(e){return new Date(e).toLocaleDateString("en-GB",{day:"numeric",month:"long",year:"numeric"})}let u=e=>{let{competitions:t,selectedEvent:r,onEventChange:o,loading:l}=e,s=(0,a.useMemo)(()=>t.filter(e=>e.has_ai_report),[t]),i=(0,a.useMemo)(()=>[...new Set(s.map(e=>e.season))].sort().reverse(),[s]),[c,d]=(0,a.useState)("all"),u=(0,a.useMemo)(()=>"all"===c?s:s.filter(e=>e.season===c),[s,c]);return(0,n.jsxs)("div",{className:"flex flex-wrap items-center gap-4 mb-8 p-4 bg-gray-50 rounded-lg",children:[(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)("label",{className:"text-sm font-medium text-gray-600",children:"Season:"}),(0,n.jsxs)("select",{value:c,onChange:e=>d(e.target.value),className:"px-3 py-1.5 text-sm rounded-md border border-gray-300 bg-white",children:[(0,n.jsx)("option",{value:"all",children:"All Seasons"}),i.map(e=>(0,n.jsx)("option",{value:e,children:e},e))]})]}),(0,n.jsxs)("div",{className:"flex items-center gap-2 flex-1 min-w-[300px]",children:[(0,n.jsx)("label",{className:"text-sm font-medium text-gray-600",children:"Report:"}),(0,n.jsxs)("select",{value:r||"",onChange:e=>o(e.target.value),disabled:l,className:"flex-1 px-3 py-1.5 text-sm rounded-md border border-gray-300 bg-white disabled:opacity-50",children:[(0,n.jsx)("option",{value:"",children:"Select an event to view report..."}),u.map(e=>(0,n.jsxs)("option",{value:e.id,children:[e.name," (",m(e.date),")"]},e.id))]})]}),0===s.length&&(0,n.jsx)("p",{className:"text-sm text-gray-500",children:"No AI reports available yet"})]})},h=e=>{let{report:t,showSummaryOnly:r,showWinnerCard:a,showHighlights:o,showNotablePerformances:l,showCourseConditions:d,showMetadata:u}=e;return(0,n.jsxs)("div",{className:"space-y-8",children:[(0,n.jsxs)("div",{className:"text-center border-b border-gray-200 pb-6",children:[(0,n.jsxs)("div",{className:"flex items-center justify-center gap-2 mb-2",children:[(0,n.jsx)(c,{className:"h-5 w-5 text-amber-500"}),(0,n.jsx)("span",{className:"text-sm font-medium text-amber-600 uppercase tracking-wide",children:"AI-Generated Report"})]}),(0,n.jsx)("h2",{className:"text-3xl font-bold text-gray-900 mb-2",children:t.event_name}),(0,n.jsx)("p",{className:"text-gray-500",children:m(t.event_date)})]}),a&&t.winner&&(0,n.jsx)("div",{className:"bg-gradient-to-r from-amber-500 to-yellow-500 text-white rounded-xl p-6 shadow-lg",children:(0,n.jsxs)("div",{className:"flex items-center gap-6",children:[(0,n.jsx)("div",{className:"w-20 h-20 rounded-full bg-white/20 flex items-center justify-center",children:(0,n.jsx)(s,{className:"h-10 w-10 text-white"})}),(0,n.jsxs)("div",{className:"flex-1",children:[(0,n.jsx)("p",{className:"text-sm font-medium text-white/80 uppercase tracking-wide mb-1",children:"Winner"}),(0,n.jsx)("h3",{className:"text-2xl font-bold",children:t.winner.name}),(0,n.jsx)("p",{className:"text-lg text-white/90",children:t.winner.score}),t.winner.margin&&(0,n.jsxs)("p",{className:"text-sm text-white/70",children:["by ",t.winner.margin]})]})]})}),(0,n.jsx)("div",{className:"prose prose-lg max-w-none",children:(0,n.jsx)("p",{className:"text-xl text-gray-600 leading-relaxed",children:t.summary})}),o&&t.highlights&&t.highlights.length>0&&(0,n.jsxs)("div",{className:"bg-gray-50 rounded-xl p-6",children:[(0,n.jsxs)("h3",{className:"text-xl font-bold text-gray-900 mb-4 flex items-center gap-2",children:[(0,n.jsx)(i,{className:"h-5 w-5 text-amber-500"}),"Highlights"]}),(0,n.jsx)("ul",{className:"space-y-3",children:t.highlights.map((e,t)=>(0,n.jsxs)("li",{className:"flex items-start gap-3 text-gray-700",children:[(0,n.jsx)("span",{className:"w-6 h-6 rounded-full bg-amber-100 text-amber-700 flex items-center justify-center text-sm font-medium flex-shrink-0",children:t+1}),(0,n.jsx)("span",{children:e})]},t))})]}),l&&t.notable_performances&&t.notable_performances.length>0&&(0,n.jsxs)("div",{className:"bg-white border border-gray-200 rounded-xl p-6",children:[(0,n.jsx)("h3",{className:"text-xl font-bold text-gray-900 mb-4",children:"Notable Performances"}),(0,n.jsx)("ul",{className:"space-y-2",children:t.notable_performances.map((e,t)=>(0,n.jsxs)("li",{className:"flex items-start gap-2 text-gray-700",children:[(0,n.jsx)("span",{className:"text-amber-500",children:"•"}),(0,n.jsx)("span",{children:e})]},t))})]}),d&&t.course_conditions&&(0,n.jsxs)("div",{className:"bg-green-50 border border-green-200 rounded-xl p-6",children:[(0,n.jsx)("h3",{className:"text-lg font-bold text-green-900 mb-2",children:"Course Conditions"}),(0,n.jsx)("p",{className:"text-green-800",children:t.course_conditions})]}),!r&&t.full_report&&(0,n.jsxs)("div",{className:"prose prose-lg max-w-none",children:[(0,n.jsx)("h3",{className:"text-xl font-bold text-gray-900 mb-4",children:"Full Report"}),(0,n.jsx)("div",{className:"text-gray-700 leading-relaxed",dangerouslySetInnerHTML:{__html:t.full_report.replace(/^### (.*$)/gim,'<h3 class="text-xl font-bold text-gray-900 mt-6 mb-3">$1</h3>').replace(/^## (.*$)/gim,'<h2 class="text-2xl font-bold text-gray-900 mt-8 mb-4">$1</h2>').replace(/^# (.*$)/gim,'<h1 class="text-3xl font-bold text-gray-900 mt-8 mb-4">$1</h1>').replace(/\*\*(.*)\*\*/gim,"<strong>$1</strong>").replace(/\*(.*)\*/gim,"<em>$1</em>").replace(/^\- (.*$)/gim,'<li class="ml-4">$1</li>').replace(/\n/gim,"<br />")}})]}),u&&(0,n.jsx)("div",{className:"text-center pt-6 border-t border-gray-200",children:(0,n.jsxs)("p",{className:"text-xs text-gray-400",children:["Generated: ",new Date(t.generated_at).toLocaleStr
1ing("en-GB",{day:"numeric",month:"short",year:"numeric",hour:"2-digit",minute:"2-digit"}),t.model_version&&" • Model: ".concat(t.model_version)]})})]})},p=e=>{let{heading:t,eyebrow:r,displayMode:s="selector",eventId:i,eventName:p,eventDate:x,reportOptions:g,displayOptions:f,className:b,orgCode:y,apiBaseUrl:v,tenantId:j}=e,[w,k]=(0,a.useState)([]),[N,C]=(0,a.useState)(null),[S,_]=(0,a.useState)("specific"===s&&i||null),[T,q]=(0,a.useState)(!0),[B,z]=(0,a.useState)(!1),[M,P]=(0,a.useState)(null),[L,D]=(0,a.useState)(y||null),W=(null==g?void 0:g.showSummaryOnly)===!0,A=(null==g?void 0:g.showWinnerCard)!==!1,E=(null==g?void 0:g.showHighlights)!==!1,F=(null==g?void 0:g.showNotablePerformances)!==!1,R=(null==g?void 0:g.showCourseConditions)!==!1,I=(null==g?void 0:g.showMetadata)===!0,H=(null==f?void 0:f.showHeader)!==!1,G=(0,l.DM)(null==f?void 0:f.iconColor,null==f?void 0:f.iconColorCustom),U=(0,l.DM)(null==f?void 0:f.headingColor,null==f?void 0:f.headingColorCustom),O=(0,l.DM)(null==f?void 0:f.textColor,null==f?void 0:f.textColorCustom);return((0,a.useEffect)(()=>{if(y)return void D(y);async function e(){try{let e=await fetch("/api/golf-genius/settings?tenantId=".concat(j));if(e.ok){let t=await e.json();t.orgCode&&D(t.orgCode)}}catch(e){console.error("Error fetching Golf Genius settings:",e)}}j&&e()},[y,j]),(0,a.useEffect)(()=>{if(!L){y||j||P("Organization code not configured"),q(!1);return}if("specific"===s&&i){_(i),q(!1);return}!async function(){try{let e="/api/unified-competitions/organizations/".concat(L,"/competitions-list?include_metadata=true&has_ai_report=true"),t=await fetch(e);if(!t.ok)throw Error("Failed to fetch: ".concat(t.status));let r=await t.json();if(k(r.competitions||[]),"latest"===s){let e=r.competitions.filter(e=>e.has_ai_report).sort((e,t)=>new Date(t.date).getTime()-new Date(e.date).getTime());e.length>0&&_(e[0].id)}}catch(e){console.error("Error fetching competitions:",e),P(e instanceof Error?e.message:"Failed to load competitions")}finally{q(!1)}}()},[L,s,i,y,j]),(0,a.useEffect)(()=>{S&&L&&e();async function e(){z(!0);try{let e="/api/analytics/".concat(L,"/competitions/").concat(S,"/full-report"),t=await fetch(e);if(!t.ok)throw Error("Failed to fetch report: ".concat(t.status));let r=await t.json();C(r)}catch(e){console.error("Error fetching report:",e),C(null)}finally{z(!1)}}},[S,L]),M)?(0,n.jsx)("section",{className:(0,o.cn)("py-8 sm:py-16 lg:py-24 bg-white",b),children:(0,n.jsx)("div",{className:"mx-auto max-w-4xl px-4 sm:px-6 lg:px-8",children:(0,n.jsx)("div",{className:"text-center py-12 bg-gray-50 rounded-lg",children:(0,n.jsx)("p",{className:"text-red-600 font-medium",children:M})})})}):(0,n.jsx)("section",{className:(0,o.cn)("py-8 sm:py-16 lg:py-24 bg-white",b),children:(0,n.jsxs)("div",{className:"mx-auto max-w-4xl px-4 sm:px-6 lg:px-8",children:[H&&(t||r)&&(0,n.jsxs)("div",{className:"text-center mb-6 sm:mb-10",children:[r&&(0,n.jsx)("p",{className:"font-medium tracking-widest uppercase text-sm mb-2",style:G?{color:G}:void 0,children:r}),t&&(0,n.jsx)("h1",{className:"text-2xl sm:text-3xl lg:text-4xl font-bold mb-2 sm:mb-4",style:U?{color:U}:void 0,children:t}),"specific"===s&&p&&(0,n.jsx)("h2",{className:"text-2xl mb-2",style:O?{color:O}:void 0,children:p}),"specific"===s&&x&&(0,n.jsx)("p",{className:"text-gray-500",children:m(x)})]}),"selector"===s&&!T&&(0,n.jsx)(u,{competitions:w,selectedEvent:S,onEventChange:_,loading:B}),(T||B)&&(0,n.jsxs)("div",{className:"flex items-center justify-center py-16",children:[(0,n.jsx)(d,{className:"h-8 w-8 text-gray-400"}),(0,n.jsx)("span",{className:"ml-3 text-gray-500",children:T?"Loading events...":"Loading report..."})]}),!T&&!B&&N&&(0,n.jsx)(h,{report:N,showSummaryOnly:W,showWinnerCard:A,showHighlights:E,showNotablePerformances:F,showCourseConditions:R,showMetadata:I}),!T&&!B&&!N&&S&&(0,n.jsxs)("div",{className:"text-center py-16",children:[(0,n.jsx)(c,{className:"h-16 w-16 text-gray-300 mx-auto mb-4"}),(0,n.jsx)("p",{className:"text-gray-500 text-lg",children:"AI Report not available yet"}),(0,n.jsx)("p",{className:"text-gray-400 text-sm mt-2",children:"Reports are generated after the event concludes"})]}),!T&&!S&&"selector"===s&&(0,n.jsxs)("div",{className:"text-center py-16",children:[(0,n.jsx)(c,{className:"h-16 w-16 text-gray-300 mx-auto mb-4"}),(0,n.jsx)("p",{className:"text-gray-500 text-lg",children:"Select an event to view the AI report"})]})]})})}},23500:(e,t,r)=>{"use strict";r.d(t,{ClubsMapBlock:()=>g});
1var n=r(29064),a=r(34340),o=r(83863);let l={small:400,medium:500,large:600,xlarge:700},s=(0,o.default)(()=>r.e(6829).then(r.bind(r,36829)).then(e=>e.MapboxMap),{loadableGenerated:{webpack:()=>[36829]},ssr:!1,loading:()=>(0,n.jsx)("div",{style:{height:"100%",backgroundColor:"var(--color-bg-subtle)",display:"flex",alignItems:"center",justifyContent:"center"},children:(0,n.jsx)("p",{style:{color:"var(--color-text-muted)"},children:"Loading map..."})})}),i=(0,o.default)(()=>Promise.all([r.e(8550),r.e(9841)]).then(r.bind(r,32222)).then(e=>e.MapContainer),{loadableGenerated:{webpack:()=>[32222]},ssr:!1}),c=(0,o.default)(()=>Promise.all([r.e(8550),r.e(9841)]).then(r.bind(r,32222)).then(e=>e.TileLayer),{loadableGenerated:{webpack:()=>[32222]},ssr:!1}),d=(0,o.default)(()=>Promise.all([r.e(8550),r.e(9841)]).then(r.bind(r,32222)).then(e=>e.Marker),{loadableGenerated:{webpack:()=>[32222]},ssr:!1}),m=(0,o.default)(()=>Promise.all([r.e(8550),r.e(9841)]).then(r.bind(r,32222)).then(e=>e.Popup),{loadableGenerated:{webpack:()=>[32222]},ssr:!1});function u(e){let{clubs:t=[],heading:o,description:i,centerLatitude:c,centerLongitude:d,defaultZoom:m=9,mapHeight:u="medium",mapProvider:p="mapbox",mapStyle:x="streets",markerStyle:g="logos",markerSize:f="medium",markerColor:b="primary",clusterRadius:y=50,showCountyCardFilter:v=!0,showSearch:j=!0,showClubList:w=!0,listPosition:k="below",showLogo:N=!0,showAddress:C=!0,showPhone:S=!0,showWebsite:_=!0,showCountyCard:T=!0,showEstablished:q=!1,listShowLogo:B=!0,listShowAddress:z=!0,listShowPhone:M=!1,listShowWebsite:P=!0,listShowCountyCard:L=!0,listShowHoles:D=!0,backgroundColor:W="default"}=e,[A,E]=(0,a.useState)(!1),[F,R]=(0,a.useState)(""),[I,H]=(0,a.useState)(!1),[G,U]=(0,a.useState)(null);(0,a.useEffect)(()=>{E(!0),"leaflet"===p&&Promise.all([r.e(7489),r.e(4586)]).then(r.t.bind(r,44586,23))},[p]);let O=(0,a.useMemo)(()=>t.filter(e=>{var t;let r=!F||e.name.toLowerCase().includes(F.toLowerCase())||(null==(t=e.address)?void 0:t.toLowerCase().includes(F.toLowerCase())),n=!I||!0===e.countyCard;return r&&n}),[t,F,I]),Y=(0,a.useMemo)(()=>O.filter(e=>e.latitude&&e.longitude),[O]),V=(0,a.useMemo)(()=>c&&d?[c,d]:Y.length>0?[Y.reduce((e,t)=>e+(t.latitude||0),0)/Y.length,Y.reduce((e,t)=>e+(t.longitude||0),0)/Y.length]:[54.5,-2.5],[c,d,Y]),J=l[u]||l.medium,Z={default:"var(--color-bg)",subtle:"var(--color-bg-subtle)",muted:"var(--color-bg-muted)"};return A?(0,n.jsx)("section",{style:{backgroundColor:Z[W]||Z.default,padding:"var(--section-spacing, 2rem) 0"},children:(0,n.jsxs)("div",{className:"container",children:[(o||i)&&(0,n.jsxs)("div",{style:{marginBottom:"2rem"},children:[o&&(0,n.jsx)("h2",{style:{fontSize:"2rem",fontWeight:700,marginBottom:"0.5rem"},children:o}),i&&(0,n.jsx)("p",{style:{color:"var(--color-text-muted)"},children:i})]}),(j||v)&&(0,n.jsxs)("div",{style:{display:"flex",gap:"1rem",marginBottom:"1.5rem",flexWrap:"wrap"},children:[j&&(0,n.jsx)("input",{type:"text",placeholder:"Search clubs...",value:F,onChange:e=>R(e.target.value),style:{padding:"0.5rem 1rem",borderRadius:"4px",border:"1px solid var(--color-border)",minWidth:"200px",flex:"1",maxWidth:"300px"}}),v&&(0,n.jsxs)("label",{style:{display:"flex",alignItems:"center",gap:"0.5rem",cursor:"pointer"},children:[(0,n.jsx)("input",{type:"checkbox",checked:I,onChange:e=>H(e.target.checked),style:{width:"18px",height:"18px"}}),(0,n.jsx)("span",{children:"County Card clubs only"})]}),(0,n.jsxs)("span",{style:{color:"var(--color-text-muted)",marginLeft:"auto"},children:[O.length," club",1!==O.length?"s":""]})]}),(0,n.jsxs)("div",{style:{display:"right"===k&&w?"grid":"block",gridTemplateColumns:"right"===k?"2fr 1fr":"1fr",gap:"2rem"},children:[(0,n.jsx)("div",{style:{borderRadius:"8px",overflow:"hidden",height:"".concat(J,"px")},children:"mapbox"===p?(0,n.jsx)(s,{clubs:O,center:V,zoom:m,height:J,mapStyle:x,markerStyle:g,markerSize:f,markerColor:b,clusterRadius:y,showLogo:N,showAddress:C,showPhone:S,showWebsite:_,showCountyCard:T,showEstablished:q,selectedClubId:G,onClubSelect:U}):(0,n.jsx)(h,{clubs:O,center:V,zoom:m,height:J,showLogo:N,showAddress:C,showPhone:S,showWebsite:_,showCountyCard:T,showEstablished:q,selectedClub:G,onSelectClub:U})}),w&&(0,n.jsx)("div",{style:{marginTop:"below"===k?"2rem":0,maxHeight:"right"===k?"".concat(J,"px"):"none",overflowY:"right"===k?"auto":"visible"},children:(0,n.jsx)("div",{style:{display:"grid",gridTemplateColumns:"right"===k?"1fr":"repeat(auto-fill, minmax(280px, 1fr))",gap:"1rem"},children:O.map(e=>{var t;return(0,n.jsx)("div",{style:{padding:"1rem",backgroundColor:G===e.id?"var(--color-bg-subtle)":"white",border:"1px solid var(--color-border)",borderRadius:"8px",cursor:"pointer",transition:"background-color 0.2s"},onClick:()=>U(e.id),children:(0,n.jsxs)("div",{style:{display:"flex",gap:"1rem",alignItems:"flex-start"},children:[B&&(null==(t=e.logo)?void 0:t.url)&&(0,n.jsx)("img",{src:e.logo.url,alt:e.logo.alt||e.name,style:{width:"50px",height:"50px",objectFit:"contain",flexShrink:0}}),(0,n.jsxs)("div",{style:{flex:1,minWidth:0},children:[(0,n.jsx)("h4",{style:{fontWeight:600,marginBottom:"0.25rem",fontSize:"clamp(0.875rem, 2.5vw, 1rem)"},children:e.name}),z&&e.address&&(0,n.jsx)("p",{style:{fontSize:"clamp(0.75rem, 2vw, 0.875rem)",color:"var(--color-text-muted)",marginBottom:"0.25rem"},children:e.address}),(0,n.jsxs)("div",{style:{display:"flex",gap:"0.5rem",alignItems:"center",flexWrap:"wrap"},children:[L&&(0,n.jsx)("span",{style:{padding:"2px 6px",borderRadius:"4px",fontSize:"clamp(0.6rem, 1.5vw, 0.7rem)",fontWeight:600,backgroundColor:e.countyCard?"#D1FAE5":"#F3F4F6",color:e.countyCard?"#065F46":"#6B7280"},children:e.countyCard?"County Card":"No CC"}),D&&e.holes&&(0,n.jsxs)("span",{style:{fontSize:"clamp(0.65rem, 1.5vw, 0.75rem)",color:"var(--color-text-muted)"},children:[e.holes," holes"]})]}),M&&e.phone&&(0,n.jsx)("p",{style:{fontSize:"clamp(0.75rem, 2vw, 0.875rem)",marginTop:"0.25rem"},children:(0,n.jsx)("a",{href:"tel:".concat(e.phone),style:{color:"var(--color-primary)"},children:e.phone})}),P&&e.website&&(0,n.jsx)("a",{href:e.website,target:"_blank",rel:"noopener noreferrer",onClick:e=>e.stopPropagation(),style:{display:"inline-block",marginTop:"0.5rem",color:"var(--color-primary)",textDecoration:"none",fontWeight:500,fontSize:"clamp(0.75rem, 2vw, 0.875rem)"},children:"Visit Website →"})]})]})},e.id)})})})]})]})}):(0,n.jsx)("section",{style:{backgroundColor:Z[W]||Z.default,padding:"var(--section-spacing, 2rem) 0"},children:(0,n.jsxs)("div",{className:"container",children:[o&&(0,n.jsx)("h2",{style:{fontSize:"2rem",fontWeight:700,marginBottom:"1rem"},children:o}),i&&(0,n.jsx)("p",{style:{color:"var(--color-text-muted)",marginBottom:"2rem"},children:i}),(0,n.jsx)("div",{style:{height:"".concat(J,"px"),backgroundColor:"var(--color-bg-subtle)",borderRadius:"8px",display:"flex",alignItems:"center",justifyContent:"center"},children:(0,n.jsx)("p",{style:{color:"var(--color-text-muted)"},children:"Loading map..."})})]})})}function h(e){let{clubs:t,center:r,zoom:a,height:o,showLogo:l,showAddress:s,showPhone:u,showWebsite:h,showCountyCard:p,showEstablished:x,selectedClub:g,onSelectClub:f}=e,b=t.filter(e=>e.latitude&&e.longitude);return(0,n.jsxs)(i,{center:r,zoom:a,style:{height:"100%",width:"100%"},scrollWheelZoom:!0,children:[(0,n.jsx)(c,{attribution:'\xa9 <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a>',url:"https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png"}),b.map(e=>{var t;return(0,n.jsx)(d,{position:[e.latitude,e.longitude],eventHandlers:{click:()=>f(e.id)},children:(0,n.jsx)(m,{children:(0,n.jsxs)("div",{style:{minWidth:"200px"},children:[l&&(null==(t=e.logo)?void 0:t.url)&&(0,n.jsx)("img",{src:e.logo.url,alt:e.logo.alt||e.name,style:{width:"60px",height:"60px",objectFit:"contain",marginBottom:"0.5rem"}}),(0,n.jsx)("h3",{style:{fontWeight:700,marginBottom:"0.25rem"},children:e.name}),p&&(0,n.jsx)("span",{style:{display:"inline-block",padding:"2px 8px",borderRadius:"4px",fontSize:"0.75rem",fontWeight:600,backgroundColor:e.countyCard?"#10B981":"#6B7280",color:"white",marginBottom:"0.5rem"},children:e.countyCard?"County Card":"No County Card"}),s&&e.address&&(0,n.jsx)("p",{style:{fontSize:"0.875rem",color:"#666",marginBottom:"0.25rem"},children:e.address}),u&&e.phone&&(0,n.jsx)("p",{style:{fontSize:"0.875rem",marginBottom:"0.25rem"},children:(0,n.jsx)("a",{href:"tel:".concat(e.phone),children:e.phone})}),x&&e.established&&(0,n.jsxs)("p",{style:{fontSize:"0.75rem",color:"#888"},children:["Est. ",e.established]}),h&&e.website&&(0,n.jsx)("a",{href:e.website,target:"_blank",rel:"noopener noreferrer",style:{display:"inline-block",marginTop:"0.5rem",color:"var(--color-primary)",textDecoration:"none",fontWeight:500},children:"Visit Website →"})]})})},e.id)})]})}var p=r(90420);let x=new Map;function g(e){let{heading:t,description:r,counties:o=[],mapProvider:l="mapbox",centerLatitude:s,centerLongitude:i,defaultZoom:c=9,mapHeight:d="medium",mapStyle:m="streets",markerStyle:h="logos",markerSize:g="medium",markerColor:f="primary",clusterRadius:b=50,showCountyCardFilter:y=!0,showSearch:v=!0,showClubList:j=!0,listPosition:w="below",showLogo:k=!0,showAddress:N=!0,showPhone:C=!0,showWebsite:S=!0,showCountyCard:_=!0,showEstablished:T=!1,backgroundColor:q="default"}=e,[B,z]=(0,a.useState)([]),[M,P]=(0,a.useState)(!0),[L,D]=(0,a.useState)(null),W=(0,a.useRef)(!1);(0,a.useEffect)(()=>{W.current||(async()=>
1{if(0===o.length)return P(!1);let e=o.sort().join(","),t=function(e){let t=x.get(e);return t&&Date.now()-t.timestamp<36e5?t.data:null}(e);if(t){z(t),P(!1),W.current=!0;return}try{let t=await (0,p.i)(o);z(t),x.set(e,{data:t,timestamp:Date.now()})}catch(e){D(e instanceof Error?e.message:"Failed to load clubs")}finally{P(!1),W.current=!0}})()},[o]);let A={small:400,medium:500,large:600,xlarge:700},E=A[d]||A.medium,F={default:"var(--color-bg)",subtle:"var(--color-bg-subtle)",muted:"var(--color-bg-muted)"};return M?(0,n.jsx)("section",{style:{backgroundColor:F[q]||F.default,padding:"var(--section-spacing, 2rem) 0"},children:(0,n.jsxs)("div",{className:"container",children:[t&&(0,n.jsx)("h2",{style:{fontSize:"2rem",fontWeight:700,marginBottom:"0.5rem"},children:t}),r&&(0,n.jsx)("p",{style:{color:"var(--color-text-muted)",marginBottom:"2rem"},children:r}),(0,n.jsx)("div",{style:{height:"".concat(E,"px"),backgroundColor:"var(--color-bg-subtle)",borderRadius:"8px",display:"flex",alignItems:"center",justifyContent:"center"},children:(0,n.jsx)("p",{style:{color:"var(--color-text-muted)"},children:"Loading map..."})})]})}):L?(0,n.jsx)("section",{style:{padding:"var(--section-spacing, 2rem) 0"},children:(0,n.jsx)("div",{className:"container",children:(0,n.jsx)("div",{style:{textAlign:"center",padding:"2rem",backgroundColor:"#fee2e2",borderRadius:"8px"},children:(0,n.jsxs)("p",{style:{color:"#dc2626"},children:["Error loading clubs: ",L]})})})}):0===o.length?(0,n.jsx)("section",{style:{padding:"var(--section-spacing, 2rem) 0"},children:(0,n.jsx)("div",{className:"container",children:(0,n.jsx)("div",{style:{textAlign:"center",padding:"2rem",backgroundColor:"#fef3c7",borderRadius:"8px"},children:(0,n.jsx)("p",{style:{color:"#92400e"},children:"No counties selected. Please configure this block to select counties."})})})}):(0,n.jsx)(u,{clubs:B,heading:t,description:r,centerLatitude:s,centerLongitude:i,defaultZoom:c,mapHeight:d,mapProvider:l,mapStyle:m,markerStyle:h,markerSize:g,markerColor:f,clusterRadius:b,showCountyCardFilter:y,showSearch:v,showClubList:j,listPosition:w,showLogo:k,showAddress:N,showPhone:C,showWebsite:S,showCountyCard:_,showEstablished:T,backgroundColor:q})}},23554:(e,t,r)=>{"use strict";r.d(t,{C:()=>a});var n=r(29064);r(34340);let a=e=>{let{className:t}=e;return(0,n.jsxs)("p",{role:"status",className:"mb-2 rounded border border-amber-400 bg-amber-50 px-3 py-2 text-sm text-amber-900 ".concat(t||""),children:[(0,n.jsx)("strong",{children:"Test mode."})," No real payment is taken and nothing is reserved."]})}},24557:(e,t,r)=>{"use strict";r.d(t,{DataTableClient:()=>l});var n=r(29064),a=r(34340),o=r(59572);function l(e){let{title:t,description:r,showTitle:l,showDescription:i,data:c,columns:d,settings:m,styling:u,overrides:h}=e,[p,x]=(0,a.useState)(""),[g,f]=(0,a.useState)(m.defaultSortColumn||null),[b,y]=(0,a.useState)(m.defaultSortDirection||"asc"),[v,j]=(0,a.useState)(1),[w,k]=(0,a.useState)((null==h?void 0:h.pageSize)||m.pageSize||"25"),N=null==u?void 0:u.useCustomStyles,C={headerBg:N&&(null==u?void 0:u.headerBackgroundColor)?u.headerBackgroundColor:"var(--table-header-bg, var(--color-primary))",headerText:N&&(null==u?void 0:u.headerTextColor)?u.headerTextColor:"var(--table-header-text, var(--color-text-inverse, #ffffff))",headerFontWeight:N&&(null==u?void 0:u.headerFontWeight)?u.headerFontWeight:"var(--table-header-font-weight, 600)",headerFontSize:N&&(null==u?void 0:u.headerFontSize)?u.headerFontSize:"var(--table-header-font-size, 14px)",headerTextTransform:N&&(null==u?void 0:u.headerTextTransform)?u.headerTextTransform:"var(--table-header-text-transform, none)",headerPadding:N&&(null==u?void 0:u.headerPadding)?u.headerPadding:"var(--table-header-padding, 0.75rem 1rem)",cellBg:N&&(null==u?void 0:u.cellBackgroun
1dColor)?u.cellBackgroundColor:"var(--table-cell-bg, var(--color-bg))",cellBgAlt:N&&(null==u?void 0:u.cellBackgroundColorAlt)?u.cellBackgroundColorAlt:"var(--table-cell-bg-alt, var(--color-bg-subtle))",cellText:N&&(null==u?void 0:u.cellTextColor)?u.cellTextColor:"var(--table-cell-text, var(--color-text-body))",cellFontSize:N&&(null==u?void 0:u.cellFontSize)?u.cellFontSize:"var(--table-cell-font-size, 14px)",cellPadding:N&&(null==u?void 0:u.cellPadding)?u.cellPadding:"var(--table-cell-padding, 0.75rem 1rem)",cellLineHeight:N&&(null==u?void 0:u.cellLineHeight)?u.cellLineHeight:"var(--table-cell-line-height, 1.5)",borderColor:N&&(null==u?void 0:u.borderColor)?u.borderColor:"var(--table-border-color, var(--color-border))",borderWidth:N&&(null==u?void 0:u.borderWidth)?u.borderWidth:"var(--table-border-width, 1px)",borderRadius:N&&(null==u?void 0:u.borderRadius)?u.borderRadius:"var(--table-border-radius, 8px)",hoverBg:N&&(null==u?void 0:u.hoverBackgroundColor)?u.hoverBackgroundColor:"var(--table-hover-bg, var(--color-bg-subtle))"},S=(0,a.useMemo)(()=>{if(!p||!m.enableGlobalSearch)return c;let e=p.toLowerCase();return c.filter(t=>d.some(r=>{let n=t[r.key];return null!=n&&(0,o.aD)(n,r.type).includes(e)}))},[c,p,d,m.enableGlobalSearch]),_=(0,a.useMemo)(()=>{var e;if(!g||!m.enableSorting)return S;
1let t=null==(e=d.find(e=>e.key===g))?void 0:e.type;return[...S].sort((e,r)=>{let n=e[g],a=r[g];if(null==n&&null==a)return 0;if(null==n)return"asc"===b?1:-1;if(null==a)return"asc"===b?-1:1;if("link"!==t){let e=Number(n),t=Number(a);if(!isNaN(e)&&!isNaN(t))return"asc"===b?e-t:t-e}let l=(0,o.iT)(n,t),s=(0,o.iT)(a,t);return"asc"===b?l<s?-1:+(l>s):l>s?-1:+(l<s)})},[S,g,b,m.enableSorting,d]),T="all"===w?_.length:parseInt(w,10),q=Math.ceil(_.length/T),B=(0,a.useMemo)(()=>{if(!m.enablePagination||"all"===w)return _;let e=(v-1)*T;return _.slice(e,e+T)},[_,v,T,m.enablePagination,w]),z=(0,a.useCallback)(e=>{m.enableSorting&&(g===e?y(e=>"asc"===e?"desc":"asc"):(f(e),y("asc")))},[g,m.enableSorting]),M=(0,a.useCallback)(e=>{x(e.target.value),j(1)},[]),P=(0,a.useCallback)(e=>{k(e.target.value),j(1)},[]),L=d.filter(e=>!e.hidden),D=(null==h?void 0:h.maxHeight)||m.maxHeight;return(0,n.jsx)("section",{style:{padding:"var(--section-spacing) var(--container-padding)"},children:(0,n.jsxs)("div",{className:"container",children:[l&&t?(0,n.jsx)("h2",{style:{marginBottom:"0.5rem"},children:t}):null,i&&r?(0,n.jsx)("p",{style:{color:"var(--color-text-muted)",marginBottom:"1rem"},children:r}):null,m.enableGlobalSearch&&(0,n.jsxs)("div",{style:{marginBottom:"1rem",display:"flex",gap:"1rem",flexWrap:"wrap",alignItems:"center"},children:[(0,n.jsxs)("div",{style:{position:"relative",flex:"1 1 250px",maxWidth:"400px"},children:[(0,n.jsx)("input",{type:"text",placeholder:"Search...",value:p,onChange:M,style:{width:"100%",padding:"0.5rem 0.75rem 0.5rem 2.25rem",border:"1px solid ".concat(C.borderColor),borderRadius:"6px",fontSize:"14px",backgroundColor:"var(--color-bg)",color:"var(--color-text-body)"}}),(0,n.jsx)("svg",{style:{position:"absolute",left:"0.75rem",top:"50%",transform:"translateY(-50%)",width:"16px",height:"16px",color:"var(--color-text-muted)"},fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})})]}),p&&(0,n.jsxs)("span",{style:{color:"var(--color-text-muted)",fontSize:"14px"},children:[S.length," result",1!==S.length?"s":""]})]}),(0,n.jsx)("div",{style:{overflowX:"auto",border:"".concat(C.borderWidth," solid ").concat(C.borderColor),borderRadius:C.borderRadius,...D?{maxHeight:"".concat(D,"px"),overflowY:"auto"}:{}},children:(0,n.jsxs)("table",{style:{width:"100%",borderCollapse:"collapse"},children:[!1!==m.showHeader&&(0,n.jsx)("thead",{style:m.fixedHeader&&D?{position:"sticky",top:0,zIndex:1}:{},children:(0,n.jsxs)("tr",{children:[m.showRowNumbers&&(0,n.jsx)("th",{style:{backgroundColor:C.headerBg,color:C.headerText,padding:C.headerPadding,fontWeight:C.headerFontWeight,fontSize:C.headerFontSize,textTransform:C.headerTextTransform,width:"50px",textAlign:"center"},children:"#"}),L.map((e,t)=>{let r=m.enableSorting&&!1!==e.sortable,a=g===e.key;return(0,n.jsx)("th",{onClick:r?()=>z(e.key):void 0,style:{backgroundColor:C.headerBg,color:C.headerText,padding:C.headerPadding,textAlign:e.align||"left",fontWeight:C.headerFontWeight,fontSize:C.headerFontSize,textTransform:C.headerTextTransform,cursor:r?"pointer":"default",userSelect:r?"none":"auto",whiteSpace:"nowrap"},children:(0,n.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:"0.5rem"},children:[e.label||e.key,r&&(0,n.jsxs)("span",{style:{display:"inline-flex",flexDirection:"column",fontSize:"10px",lineHeight:1,opacity:a?1:.4},children:[(0,n.jsx)("span",{style:{opacity:a&&"asc"===b?1:.4},children:"▲"}),(0,n.jsx)("span",{style:{opacity:a&&"desc"===b?1:.4},children:"▼"})]})]})},t)})]})}),(0,n.jsx)("tbody",{children:0===B.length?(0,n.jsx)("tr",{children:(0,n.jsx)("td",{colSpan:L.length+ +!!m.showRowNumbers,style:{padding:"2rem",textAlign:"center",color:"var(--color-text-muted)"},children:p?"No results found.":"No data available."})}):B.map((e,t)=>{let r=m.enablePagination&&"all"!==w?(v-1)*T+t:t,a=!1!==m.stripedRows&&r%2==1?C.cellBgAlt:C.cellBg;return(0,n.jsxs)("tr",{style:{backgroundColor:a,transition:"background-color 0.15s"},onMouseEnter:e=>{e.currentTarget.style.backgroundColor=C.hoverBg},onMouseLeave:e=>{e.currentTarget.style.backgroundColor=a},children:[m.showRowNumbers&&(0,n.jsx)("td",{style:{color:"var(--color-text-muted)",fontSize:C.cellFontSize,padding:C.cellPadding,borderTop:"".concat(C.borderWidth," solid ").concat(C.borderColor),textAlign:"center"},children:r+1}),L.map((t,r)=>(0,n.jsx)("td",{style:{color:C.cellText,fontSize:C.cellFontSize,lineHeight:C.cellLineHeight,padding:C.cellPadding,borderTop:"".concat(C.borderWidth," solid ").concat(C.borderColor),textAlign:t.align||"left"},children:function(e,t){if(null==e)return"";switch(t){case"link":{let t=(0,o.nm)(e);if(!t)return"string"==typeof e?e:"";let r=/^https?:\/\//i.test(t.url);return(0,n.jsx)("a",{href:t.url,...r?{target:"_blank",rel:"noopener noreferrer"}:{},style:{color:"var(--color-primary)"},children:(0,o.uB)(t)})}case"email":return(0,n.jsx)("a",{href:"mailto:".concat(e),style:{color:"var(--color-primary)"},children:String(e)});case"boolean":return!0===e||"true"===e||"yes"===e||"1"===e?"Yes":"No";case"html":return(0,n.jsx)("span",{dangerouslySetInnerHTML:{__html:String(e)}});default:return String(e)}}(e[t.key],t.type)},r))]},t)})})]})}),m.enablePagination&&_.length>0&&(0,n.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginTop:"1rem",flexWrap:"wrap",gap:"1rem",fontSize:"14px"},children:[(0,n.jsxs)("div",{style:{color:"var(--color-text-muted)"},children:["Showing ",0===B.length?0:(v-1)*T+1," -"," ",Math.min(v*T,_.length)," of ",_.length]}),(0,n.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"1rem"},children:[m.showPageSizeSelector&&(0,n.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"0.5rem"},children:[(0,n.jsx)("label",{htmlFor:"pageSize",style:{color:"var(--color-text-muted)"},children:"Show:"}),(0,n.jsxs)("select",{id:"pageSize",value:w,onChange:P,style:{padding:"0.25rem 0.5rem",border:"1px solid ".concat(C.borderColor),borderRadius:"4px",backgroundColor:"var(--color-bg)",color:"var(--color-text-body)"},children:[(0,n.jsx)("option",{value:"10",children:"10"}),(0,n.jsx)("option",{value:"25",children:"25"}),(0,n.jsx)("option",{value:"50",children:"50"}),(0,n.jsx)("option",{value:"100",children:"100"}),(0,n.jsx)("option",{value:"all",children:"All"})]})]}),"all"!==w&&q>1&&(0,n.jsxs)("div",{style:{display:"flex",gap:"0.25rem"},children:[(0,n.jsx)("button",{onClick:()=>j(1),disabled:1===v,style:s(1===v,C.borderColor),title:"First page",children:"\xab\xab"}),(0,n.jsx)("button",{onClick:()=>j(e=>Math.max(1,e-1)),disabled:1===v,style:s(1===v,C.borderColor),title:"Previous page",children:"\xab"}),(0,n.jsxs)("span",{style:{padding:"0.25rem 0.75rem",color:"var(--color-text-body)"},children:[v," / ",q]}),(0,n.jsx)("button",{onClick:()=>j(e=>Math.min(q,e+1)),disabled:v===q,style:s(v===q,C.borderColor),title:"Next page",children:"\xbb"}),(0,n.jsx)("button",{onClick:()=>j(q),disabled:v===q,style:s(v===q,C.borderColor),title:"Last page",children:"\xbb\xbb"})]})]})]})]})})}function s(e,t){return{padding:"0.25rem 0.5rem",border:"1px solid ".concat(t),borderRadius:"4px",backgroundColor:e?"transparent":"var(--color-bg)",color:e?"var(--color-text-muted)":"var(--color-text-body)",cursor:e?"not-allowed":"pointer",opacity:e?.5:1}}},25221:(e,t,r)=>{"use strict";r.d(t,{GolfGeniusStartingTimesBlock:()=>p});
1var n=r(29064),a=r(34340),o=r(87482),l=r(10021);let s=e=>{let{className:t}=e;return(0,n.jsxs)("svg",{className:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,n.jsx)("circle",{cx:"12",cy:"12",r:"10"}),(0,n.jsx)("polyline",{points:"12 6 12 12 16 14"})]})},i=e=>{let{className:t}=e;return(0,n.jsxs)("svg",{className:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,n.jsx)("path",{d:"M20 10c0 6-8 12-8 12s-8-6-8-12a8 8 0 0 1 16 0Z"}),(0,n.jsx)("circle",{cx:"12",cy:"10",r:"3"})]})},c=e=>{let{className:t}=e;return(0,n.jsxs)("svg",{className:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,n.jsx)("path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2"}),(0,n.jsx)("circle",{cx:"9",cy:"7",r:"4"}),(0,n.jsx)("path",{d:"M22 21v-2a4 4 0 0 0-3-3.87"}),(0,n.jsx)("path",{d:"M16 3.13a4 4 0 0 1 0 7.75"})]})},d=e=>{let{className:t}=e;return(0,n.jsxs)("svg",{className:(0,o.cn)("animate-spin",t),viewBox:"0 0 24 24",fill:"none",children:[(0,n.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),(0,n.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"})]})};function m(e){return new Date(e).toLocaleDateString("en-GB",{day:"numeric",month:"long",year:"numeric"})}let u=e=>{let{competitions:t,selectedEvent:r,onEventChange:o,loading:l}=e,[s,i]=(0,a.useState)("all"),[c,d]=(0,a.useState)("all"),u=(0,a.useMemo)(()=>[...new Set(t.map(e=>e.season))].sort().reverse(),[t]),h=(0,a.useMemo)(()=>{let e=new Set;return t.forEach(t=>{t.competition_type&&e.add(t.competition_type)}),Array.from(e).sort()},[t]),p=(0,a.useMemo)(()=>{let e=[...t];return"all"!==s&&(e=e.filter(e=>e.season===s)),"all"!==c&&(e=e.filter(e=>e.competition_type===c)),e.sort((e,t)=>new Date(e.date).getTime()-new Date(t.date).getTime())},[t,s,c]);return(0,n.jsxs)("div",{className:"flex flex-wrap items-center gap-4 mb-6 p-4 bg-gray-50 rounded-lg",children:[(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)("label",{className:"text-sm font-medium text-gray-600",children:"Season:"}),(0,n.jsxs)("select",{value:s,onChange:e=>i(e.target.value),className:"px-3 py-1.5 text-sm rounded-md border border-gray-300 bg-white",children:[(0,n.jsx)("option",{value:"all",children:"All Seasons"}),u.map(e=>(0,n.jsx)("option",{value:e,children:e},e))]})]}),h.length>0&&(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)("label",{className:"text-sm font-medium text-gray-600",children:"Category:"}),(0,n.jsxs)("select",{value:c,onChange:e=>d(e.target.value),className:"px-3 py-1.5 text-sm rounded-md border border-gray-300 bg-white",children:[(0,n.jsx)("option",{value:"all",children:"All Categories"}),h.map(e=>(0,n.jsx)("option",{value:e,children:e},e))]})]}),(0,n.jsxs)("div",{className:"flex items-center gap-2 flex-1 min-w-[250px]",children:[(0,n.jsx)("label",{className:"text-sm font-medium text-gray-600",children:"Event:"}),(0,n.jsxs)("select",{value:r||"",onChange:e=>o(e.target.value),disabled:l,className:"flex-1 px-3 py-1.5 text-sm rounded-md border border-gray-300 bg-white disabled:opacity-50",children:[(0,n.jsx)("option",{value:"",children:"Select an event..."}),p.map(e=>(0,n.jsxs)("option",{value:e.id,children:[e.name," (",m(e.date),")"]},e.id))]})]})]})},h=e=>{let{teeTimes:t,displayFormat:r,showHandicaps:o,showTee:l,eventName:d,printable:m}=e;return 0===t.length?(0,n.jsxs)("div",{className:"text-center py-12",children:[(0,n.jsx)(s,{className:"h-16 w-16 text-gray-300 mx-auto mb-4"}),(0,n.jsx)("p",{className:"text-gray-500 text-lg",children:"Starting times not available yet. Check back closer to the event date."})]}):(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("div",{className:"bg-white rounded-lg shadow-lg overflow-hidden",children:[(0,n.jsx)("div",{className:"bg-gray-900 text-white p-4",children:(0,n.jsxs)("div",{className:"flex items-center justify-between",children:[(0,n.jsxs)("h3",{className:"flex items-center gap-2 text-lg font-semibold",children:[(0,n.jsx)(s,{className:"h-5 w-5"}),"Starting Times",d&&(0,n.jsxs)("span",{className:"font-normal text-gray-300 ml-2",children:["- ",d]})]}),m&&(0,n.jsx)("button",{onClick:()=>window.print(),className:"px-3 py-1 text-sm bg-white/10 hover:bg-white/20 rounded transition-colors print:hidden",children:"Print"})]})}),(0,n.jsx)("div",{children:"table"===r?(0,n.jsx)("div",{className:"overflow-x-auto",children:(0,n.jsxs)("table",{className:"w-full",children:[(0,n.jsx)("thead",{className:"bg-gray-50 border-b border-gray-200",children:(0,n.jsxs)("tr",{children:[(0,n.jsx)("th",{className:"px-6 py-3 text-left text-xs font-semibold text-gray-600 uppercase tracking-wider",children:"Time"}),l&&(0,n.jsx)("th",{className:"px-6 py-3 text-left text-xs font-semibold text-gray-600 uppercase tracking-wider",children:"Tee"}),(0,n.jsx)("th",{className:"px-6 py-3 text-left text-xs font-semibold text-gray-600 uppercase tracking-wider",children:"Players"})]})}),(0,n.jsx)("tbody",{className:"divide-y divide-gray-100",children:t.map((e,t)=>(0,n.jsxs)("tr",{className:"hover:bg-gray-50 transition-colors",children:[(0,n.jsx)("td",{className:"px-6 py-4 whitespace-nowrap",children:(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)(s,{className:"h-4 w-4 text-amber-600"}),(0,n.jsx)("span",{className:"font-medium text-gray-900",children:e.time})]})}),l&&(0,n.jsx)("td",{className:"px-6 py-4 whitespace-nowrap",children:e.tee&&(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)(i,{className:"h-4 w-4 text-gray-500"}),(0,n.jsx)("span",{className:"text-gray-600",children:e.tee})]})}),(0,n.jsx)("td",{className:"px-6 py-4",children:(0,n.jsx)("div",{className:"flex flex-wrap gap-2",children:e.players.map((e,t)=>(0,n.jsxs)("div",{className:"inline-flex flex-col items-start px-3 py-1 bg-gray-100 rounded-full",children:[(0,n.jsxs)("div",{className:"inline-flex items-center gap-1",children:[(0,n.jsx)("span",{className:"text-gray-900",children:e.name}),o&&void 0!==e.handicap&&(0,n.jsxs)("span",{className:"text-xs text-gray-500",children:["(",e.handicap,")"]})]}),e.affiliation&&(0,n.jsx)("span",{className:"text-[11px] text-gray-500 leading-tight",children:e.affiliation})]},t))})})]},t))})]})}):"cards"===r?(0,n.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4 p-4",children:t.map((e,t)=>(0,n.jsxs)("div",{className:"border border-gray-200 rounded-lg p-4 hover:shadow-md transition-shadow",children:[(0,n.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,n.jsxs)("div",{className:"flex items-center gap-2 text-amber-600 font-semibold",children:[(0,n.jsx)(s,{className:"h-5 w-5"}),(0,n.jsx)("span",{children:e.time})]}),l&&e.tee&&(0,n.jsxs)("div",{className:"flex items-center gap-1 text-gray-500 text-sm",children:[(0,n.jsx)(i,{className:"h-3 w-3"}),(0,n.jsx)("span",{children:e.tee})]})]}),(0,n.jsx)("div",{className:"space-y-1.5",children:e.players.map((e,t)=>(0,n.jsxs)("div",{className:"flex items-start justify-between text-sm gap-2",children:[(0,n.jsxs)("div",{className:"flex flex-col",children:[(0,n.jsx)("span",{className:"text-gray-900",children:e.name}),e.affiliation&&(0,n.jsx)("span",{className:"text-xs text-gray-500 leading-tight",children:e.affiliation})]}),o&&void 0!==e.handicap&&(0,n.jsxs)("span",{className:"text-gray-500 whitespace-nowrap",children:["(",e.handicap,")"]})]},t))})]},t))}):(0,n.jsx)("div",{className:"divide-y divide-gray-100",children:t.map((e,t)=>(0,n.jsxs)("div",{className:"p-6 hover:bg-gray-50 transition-colors",children:[(0,n.jsxs)("div",{className:"flex items-center gap-4 mb-3",children:[(0,n.jsxs)("div",{className:"flex items-center gap-2 text-amber-600 font-semibold",children:[(0,n.jsx)(s,{className:"h-5 w-5"}),(0,n.jsx)("span",{children:e.time})]}),l&&e.tee&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("span",{className:"text-gray-400",children:"-"}),(0,n.jsxs)("div",{className:"flex items-center gap-2 text-gray-500",children:[(0,n.jsx)(i,{className:"h-4 w-4"}),(0,n.jsx)("span",{children:e.tee})]})]})]}),(0,n.jsxs)("div",{className:"flex items-center gap-2 flex-wrap",children:[(0,n.jsx)(c,{className:"h-4 w-4 text-gray-400"}),e.players.map((t,r)=>(0,n.jsxs)(a.Fragment,{children:[(0,n.jsxs)("span",{className:"inline-flex flex-col",children:[(0,n.jsxs)("span",{className:"text-gray-900",children:[t.name,o&&void 0!==t.handicap&&(0,n.jsxs)("span",{className:"text-gray-500",children:[" (",t.handicap,")"]})]}),t.affiliation&&(0,n.jsx)("span",{className:"text-xs text-gray-500 leading-tight",children:t.affiliation})]}),r<e.players.length-1&&(0,n.jsx)("span",{className:"text-gray-400",children:"-"})]},r))]})]},t))})})]}),(0,n.jsxs)("div",{className:"mt-4 text-center text-sm text-gray-500",children:["Total groups: ",t.length]})]})},p=e=>{let{heading:t,eyebrow:r,displayMode:i="selector",eventId:c,eventName:p,eventDate:x,roundId:g,teeSheetOptions:f,displayOptions:b,className:y,tenantId:v}=e,[j,w]=(0,a.useState)([]),[k,N]=(0,a.useState)([]),[C,S]=(0,a.useState)("specific"===i&&c||null),[_,T]=(0,a.useState)(!0),[q,B]=(0,a.useState)(!1),[z,M]=(0,a.useState)(null),[P,L]=(0,a.useState)(null),[D,W]=(0,a.useState)(null),[A,E]=(0,a.useState)(null),F=(null==f?void 0:f.showHandicaps)!==!1,R=(null==f?void 0:f.showTee)!==!1,I=(null==f?void 0:f.displayFormat)||"table",H=(null==b?void 0:b.showHeader)!==!1,G=(null==b?void 0:b.printable)!==!1,U=(null==b?void 0:b.height)||"600px",O=(0,l.DM)(null==b?void 0:b.iconColor,null==b?void 0:b.iconColorCustom),Y=(0,l.DM)(null==b?void 0:b.headingColor,null==b?void 0:b.headingColorCustom),V=(0,l.DM)(null==b?void 0:b.textColor,null==b?void 0:b.textColorCustom);if((0,a.useEffect)(()=>{v&&e();async function e(){try{let e=await fetch("/api/golf-genius/settings?tenantId=".concat(v));if(e.ok){let t=await e.json();t.orgCode&&L(t.orgCode)}}catch(e){console.error("Error fetching Golf Genius settings:",e)}}},[v]),(0,a.useEffect)(()=>
1{if(!P){v||M("Organization code not configured"),T(!1);return}if("specific"===i&&c){S(c),T(!1);return}!async function(){try{let e="/api/unified-competitions/organizations/".concat(P,"/competitions-list?include_metadata=true"),t=await fetch(e);if(!t.ok)throw Error("Failed to fetch: ".concat(t.status));let r=await t.json();if(w(r.competitions||[]),"latest"===i){let e=new Date,t=(r.competitions||[]).filter(t=>new Date(t.date)>=e).sort((e,t)=>new Date(e.date).getTime()-new Date(t.date).getTime());if(t.length>0)S(t[0].id);else{let e=(r.competitions||[]).sort((e,t)=>new Date(t.date).getTime()-new Date(e.date).getTime());e.length>0&&S(e[0].id)}}}catch(e){console.error("Error fetching competitions:",e),M(e instanceof Error?e.message:"Failed to load competitions")}finally{T(!1)}}()},[P,i,c,v]),(0,a.useEffect)(()=>{C&&P&&e();async function e(){B(!0),W(null);try{let e="/api/unified-competitions/organizations/".concat(P,"/events/").concat(C,"/tee-times?round=").concat(g||"1"),t=await fetch(e);if(!t.ok){if(404===t.status){N([]),W("https://www.golfgenius.com/ggid/".concat(C));return}throw Error("Failed to fetch tee times: ".concat(t.status))}let r=await t.json(),n=r.tee_times||r.teeTimes||[];N(n),(r.event_name||r.eventName)&&E(r.event_name||r.eventName)}catch(e){console.error("Error fetching tee times:",e),N([]),W("https://www.golfgenius.com/ggid/".concat(C))}finally{B(!1)}}},[C,P,g]),z)return(0,n.jsx)("section",{className:(0,o.cn)("py-8 sm:py-16 lg:py-24 bg-gray-50",y),children:(0,n.jsx)("div",{className:"mx-auto max-w-7xl px-4 sm:px-6 lg:px-8",children:(0,n.jsx)("div",{className:"text-center py-12 bg-white rounded-lg",children:(0,n.jsx)("p",{className:"text-red-600 font-medium",children:z})})})});let J=A||p||null;return(0,n.jsx)("section",{className:(0,o.cn)("py-8 sm:py-16 lg:py-24 bg-gray-50",y),children:(0,n.jsxs)("div",{className:"mx-auto max-w-7xl px-4 sm:px-6 lg:px-8",children:[H&&(t||r)&&(0,n.jsxs)("div",{className:"text-center mb-6 sm:mb-10",children:[r&&(0,n.jsx)("p",{className:"font-medium tracking-widest uppercase text-sm mb-2",style:O?{color:O}:void 0,children:r}),t&&(0,n.jsx)("h2",{className:"text-2xl sm:text-3xl lg:text-4xl font-bold mb-2",style:Y?{color:Y}:void 0,children:t}),"specific"===i&&J&&(0,n.jsx)("h3",{className:"text-xl mb-2",style:V?{color:V}:void 0,children:J}),"specific"===i&&x&&(0,n.jsx)("p",{style:V?{color:V}:void 0,children:m(x)})]}),"selector"===i&&!_&&(0,n.jsx)(u,{competitions:j,selectedEvent:C,onEventChange:S,loading:q}),(_||q)&&(0,n.jsxs)("div",{className:"flex items-center justify-center py-16",children:[(0,n.jsx)(d,{className:"h-8 w-8 text-gray-400"}),(0,n.jsx)("span",{className:"ml-3 text-gray-500",children:_?"Loading competitions...":"Loading starting times..."})]}),!_&&!q&&C&&(0,n.jsx)("div",{style:{maxHeight:U,overflow:"auto"},children:k.length>0?(0,n.jsx)(h,{teeTimes:k,displayFormat:I,showHandicaps:F,showTee:R,eventName:J||void 0,printable:G}):D?(0,n.jsxs)("div",{className:"text-center py-12",children:[(0,n.jsx)(s,{className:"h-16 w-16 text-gray-300 mx-auto mb-4"}),(0,n.jsx)("p",{className:"text-gray-500 text-lg mb-4",children:"Starting times not available in our system yet."}),(0,n.jsx)("a",{href:D,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-2 px-4 py-2 bg-gray-900 text-white rounded-lg hover:bg-gray-800 transition-colors",children:"View on Golf Genius"})]}):(0,n.jsx)(h,{teeTimes:[],displayFormat:I,showHandicaps:F,showTee:R})}),!_&&!C&&"selector"===i&&(0,n.jsxs)("div",{className:"text-center py-16",children:[(0,n.jsx)(s,{className:"h-16 w-16 text-gray-300 mx-auto mb-4"}),(0,n.jsx)("p",{className:"text-gray-500 text-lg",children:"Select an event to view starting times"})]})]})})}},26216:(e,t,r)=>{"use strict";r.d(t,{KnockoutBracketClient:()=>l});var n=r(29064),a=r(34340);let o=new Map;function l(e){let{drawState:t,backgroundColor:r,textColor:l,scriptUrl:s,hideConnectors:i=!0}=e,c=(0,a.useRef)(null);return(0,a.useEffect)(()=>{let e=!1;return(function(e){if(window.NooqKnockoutBracket)return Promise.resolve();let t=o.get(e);return t||(t=new Promise((t,r)=>{let n=document.createElement("script");n.src=e,n.async=!0,n.onload=()=>t(),n.onerror=()=>r(Error("Failed to load ".concat(e))),document.head.appendChild(n)}),o.set(e,t)),t})(s).then(()=>{!e&&c.current&&window.NooqKnockoutBracket&&window.NooqKnockoutBracket.renderBracket(c.current,t,{backgroundColor:r,textColor:l,emptyMessage:"No bracket data available.",hideConnectors:i})}).catch(()=>{!e&&c.current&&(c.current.textContent="Knockout draw unavailable")}),()=>{e=!0}},[t,r,l,s]),(0,n.jsx)("div",{ref:c,className:"nooq-ko-bracket w-full"})}},26739:(e,t,r)=>{"use strict";r.d(t,{BookingBlock:()=>T});
1var n=r(29064),a=r(34340),o=r(87482),l=r(10021),s=r(29599),i=r(36015);let c=e=>{let{className:t,style:r}=e;return(0,n.jsxs)("svg",{className:(0,o.cn)("animate-spin",t),style:r,viewBox:"0 0 24 24",fill:"none",children:[(0,n.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),(0,n.jsx)("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})]})},d=e=>{let{className:t}=e;return(0,n.jsxs)("svg",{className:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,n.jsx)("rect",{width:"18",height:"18",x:"3",y:"4",rx:"2"}),(0,n.jsx)("line",{x1:"16",x2:"16",y1:"2",y2:"6"}),(0,n.jsx)("line",{x1:"8",x2:"8",y1:"2",y2:"6"}),(0,n.jsx)("line",{x1:"3",x2:"21",y1:"10",y2:"10"})]})},m=e=>{let{className:t}=e;return(0,n.jsx)("svg",{className:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:(0,n.jsx)("path",{d:"m15 18-6-6 6-6"})})},u=e=>{let{className:t}=e;return(0,n.jsx)("svg",{className:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:(0,n.jsx)("path",{d:"m9 18 6-6-6-6"})})},h=e=>{let{className:t}=e;return(0,n.jsxs)("svg",{className:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,n.jsx)("path",{d:"M22 11.08V12a10 10 0 1 1-5.93-9.14"}),(0,n.jsx)("polyline",{points:"22 4 12 14.01 9 11.01"})]})},p=e=>{let{className:t}=e;return(0,n.jsxs)("svg",{className:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,n.jsx)("circle",{cx:"12",cy:"12",r:"10"}),(0,n.jsx)("line",{x1:"12",x2:"12",y1:"8",y2:"12"}),(0,n.jsx)("line",{x1:"12",x2:"12.01",y1:"16",y2:"16"})]})},x=e=>{let{className:t}=e;return(0,n.jsxs)("svg",{className:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,n.jsx)("path",{d:"M5 21V3"}),(0,n.jsx)("path",{d:"M5 3h11l-2.5 4L16 11H5"}),(0,n.jsx)("circle",{cx:"5",cy:"21",r:"0.5",fill:"currentColor"})]})},g=e=>{let{className:t}=e;return(0,n.jsx)("svg",{className:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:(0,n.jsx)("path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76Z"})})},f=e=>{let{className:t}=e;return(0,n.jsxs)("svg",{className:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,n.jsx)("rect",{width:"20",height:"14",x:"2",y:"3",rx:"2"}),(0,n.jsx)("line",{x1:"8",x2:"16",y1:"21",y2:"21"}),(0,n.jsx)("line",{x1:"12",x2:"12",y1:"17",y2:"21"})]})},b=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],y=["January","February","March","April","May","June","July","August","September","October","November","December"];function v(e){return String(e).padStart(2,"0")}function j(e){return"".concat(e.getFullYear(),"-").concat(v(e.getMonth()+1),"-").concat(v(e.getDate()))}function w(e){return new Date(e+"T00:00:00").toLocaleDateString("en-GB",{weekday:"long",day:"numeric",month:"long",year:"numeric"})}function k(e,t){return new Intl.NumberFormat("en-GB",{style:"currency",currency:t||"GBP"}).format(e)}function N(e,t){var r,n;if(!e)return 0;let a=e.prices.find(e=>e.professional_id===t);if(a)return a.price;let o=e.prices.find(e=>null==e.professional_id);return o?o.price:null!=(n=null==(r=e.prices[0])?void 0:r.price)?n:0}let C=e=>{let{selected:t,onSelect:r,maxAdvanceDays:l,a:s,dayCounts:i}=e,c=(0,a.useMemo)(()=>new Date,[]),h=(0,a.useMemo)(()=>{let e=new Date(c);return e.setDate(e.getDate()+l),e},[c,l]),[p,x]=(0,a.useState)(c.getFullYear()),[g,f]=(0,a.useState)(c.getMonth()),w=new Date(p,g+1,0).getDate(),k=new Date(p,g,1).getDay(),N=p>c.getFullYear()||g>c.getMonth(),C=new Date(p,g+1,1)<=h,S=[];for(let e=0;e<k;e++)S.push(null);for(let e=1;e<=w;e++)S.push(e);let _=j(c);return(0,n.jsxs)("div",{className:"w-full",children:[(0,n.jsxs)("div",{className:"flex items-center gap-2 mb-5",children:[(0,n.jsx)("span",{className:"bkg-step-badge inline-flex h-9 w-9 items-center justify-center rounded-xl",children:(0,n.jsx)(d,{className:"w-5 h-5"})}),(0,n.jsx)("h3",{className:"text-lg font-semibold",style:{color:s.cardText},children:"Select a date"})]}),(0,n.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,n.jsx)("button",{type:"button",onClick:()=>{N&&(0===g?(x(p-1),f(11)):f(g-1))},disabled:!N,className:"bkg-ghost-btn flex h-9 w-9 items-center justify-center rounded-full disabled:opacity-30 disabled:cursor-not-allowed","aria-label":"Previous month",children:(0,n.jsx)(m,{className:"w-5 h-5"})}),(0,n.jsxs)("span",{className:"text-base font-semibold",style:{color:s.cardText},children:[y[g]," ",p]}),(0,n.jsx)("button",{type:"button",onClick:()=>{C&&(11===g?(x(p+1),f(0)):f(g+1))},disabled:!C,className:"bkg-ghost-btn flex h-9 w-9 items-center justify-center rounded-full disabled:opacity-30 disabled:cursor-not-allowed","aria-label":"Next month",children:(0,n.jsx)(u,{className:"w-5 h-5"})})]}),(0,n.jsx)("div",{className:"grid grid-cols-7 gap-1.5 mb-1.5",children:b.map(e=>(0,n.jsx)("div",{className:"text-center text-[11px] font-semibold uppercase tracking-wide py-1",style:{color:s.mutedText},children:e},e))}),(0,n.jsx)("div",{className:"grid grid-cols-7 gap-1.5",children:S.map((e,a)=>{if(null===e)return(0,n.jsx)("div",{className:"aspect-square"},"e-".concat(a));let l="".concat(p,"-").concat(v(g+1),"-").concat(v(e)),d=null!=i&&0===i[l],m=(e=>{let t=new Date(p,g,e);return j(t)<j(c)||t>h})(e)||d,u=t===l,x=l===_;return(0,n.jsx)("button",{type:"button",disabled:m,"aria-label":d?"".concat(l," — no times available"):l,onClick:()=>r(l),className:(0,o.cn)("bkg-day relative aspect-square rounded-xl text-sm font-medium flex items-center justify-center border transition",u&&"bkg-day--selected",m&&"opacity-30 curs
1or-not-allowed"),style:u?{backgroundColor:s.primaryAction,borderColor:s.primaryAction,color:s.onPrimary}:{borderColor:"transparent",color:s.cardText,...x?{boxShadow:"inset 0 0 0 1px ".concat(s.accent)}:{}},children:e},e)})})]})},S=e=>{let{packageName:t,lessonsRemaining:r,mutedTextColor:a}=e;if(!t)return null;let o="number"!=typeof r?null:0===r?"No lessons remaining":"".concat(r," lesson").concat(1===r?"":"s"," remaining");return(0,n.jsxs)("p",{className:"text-xs mt-2",style:{color:a},children:["This lesson has been taken off your ",t,".",o?" ".concat(o,"."):""]})},_=e=>{let{lessonBookingId:t,packagesPageUrl:r,mutedTextColor:a,linkColor:o}=e;if(!t)return null;let l=r?"".concat(r,"?booking=").concat(encodeURIComponent(t)):null;return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("p",{className:"text-xs mt-2",style:{color:a},children:"Check your email — if you hold a package with us you'll be able to put this lesson on it."}),l&&(0,n.jsx)("a",{href:l,className:"mt-3 inline-block text-sm underline",style:{color:o},children:"Buy a lesson package — and this booking comes off it"})]})},T=e=>{var t,r,d,b,y,v,T,q,B,z,M,P,L,D,W,A;let{heading:E="Book Now",subheading:F,maxAdvanceDays:R,className:I}=e,H=(0,a.useMemo)(()=>(function(e){let t,r=e.appearance||{},n="dark"===e.surfaceMode,a=(0,l.DM)(r.primaryActionColor,r.primaryActionColorCustom)||"var(--color-primary)",o=(0,l.DM)(r.accentColor,r.accentColorCustom)||"var(--color-accent)",s=(0,l.DM)(r.surfaceColor,r.surfaceColorCustom)||(n?"#0f172a":"#ffffff"),i=r.backgroundType||"none";if("color"===i)t=(0,l.DM)(r.backgroundColor,r.backgroundColorCustom);else if("gradient"===i){let e=(0,l.DM)(r.backgroundColor,r.backgroundColorCustom)||"var(--color-primary)",n=(0,l.DM)(r.gradientEndColor,r.gradientEndColorCustom)||"var(--color-primary-dark)";t="linear-gradient(to bottom right, ".concat(e,", ").concat(n,")")}return{accent:o,onAccent:"#ffffff",primaryAction:a,onPrimary:"#ffffff",surface:s,surfaceSubtle:n?"rgba(148,163,184,0.08)":"rgba(15,23,42,0.035)",cardText:n?"#f1f5f9":"#0f172a",mutedText:n?"#94a3b8":"#64748b",border:n?"rgba(148,163,184,0.22)":"rgba(15,23,42,0.10)",borderStrong:n?"rgba(148,163,184,0.4)":"rgba(15,23,42,0.18)",sectionBg:t,dark:n}})(e),[e]),G="bkg-"+(0,a.useId)().replace(/[^a-zA-Z0-9_-]/g,""),U=R||14,[O,Y]=(0,a.useState)([]),[V,J]=(0,a.useState)([]),[Z,$]=(0,a.useState)([]),[X,K]=(0,a.useState)([]),[Q,ee]=(0,a.useState)(!0),[et,er]=(0,a.useState)(null),[en,ea]=(0,a.useState)(null),[eo,el]=(0,a.useState)(null),[es,ei]=(0,a.useState)(null),[ec,ed]=(0,a.useState)(null),[em,eu]=(0,a.useState)(1),[eh,ep]=(0,a.useState)(null),[ex,eg]=(0,a.useState)(""),[ef,eb]=(0,a.useState)(null),[ey,ev]=(0,a.useState)(null),[ej,ew]=(0,a.useState)(!1),[ek,eN]=(0,a.useState)(null),[eC,eS]=(0,a.useState)(null),[e_,eT]=(0,a.useState)(null),[eq,eB]=(0,a.useState)(!1),[ez,eM]=(0,a.useState)([]),[eP,eL]=(0,a.useState)(!1),[eD,eW]=(0,a.useState)(null),[eA,eE]=(0,a.useState)(0),[eF,eR]=(0,a.useState)(null),[eI,eH]=(0,a.useState)(""),[eG,eU]=(0,a.useState)(""),[eO,eY]=(0,a.useState)(""),[eV,eJ]=(0,a.useState)(!1),[eZ,e$]=(0,a.useState)(null),[eX,eK]=(0,a.useState)(null),[eQ,e0]=(0,a.useState)(0);(0,a.useEffect)(()=>{let e=!1;return async function(){try{let[t,r,n]=await Promise.all([fetch("/api/lessons/booking-categories?active_only=true"),fetch("/api/lessons/lessons?active_only=true"),fetch("/api/lessons/professionals?active_only=true")]);if(!r.ok)throw Error("Failed to load booking options (".concat(r.status,")"));let a=t.ok?await t.json():{categories:[]},o=await r.json(),l=n.ok?await n.json():{professionals:[]};if(e)return;Y((a.categories||[]).filter(e=>!1!==e.is_active)),J(o.lessons||o||[]),$((l.professionals||l||[]).filter(e=>e.is_active&&e.accepts_online_booking))}catch(t){e||er(t instanceof Error?t.message:"Failed to load booking options")}finally{e||ee(!1)}}(),()=>{e=!0}},[]);let e1=(0,a.useMemo)(()=>O.some(e=>"simulator"===e.kind||"range"===e.kind),[O]);(0,a.useEffect)(()=>{if(!e1)return;let e=!1;return async function(){try{let t=await fetch("/api/simulator/price-labels");if(!t.ok)return;let r=await t.json();if(e)return;let n=Array.isArray(r)?r:r.price_labels||r.products||[];K(n)}catch(e){}}(),()=>{e=!0}},[e1]),(0,a.useEffect)(()=>
1{if((null==en?void 0:en.kind)!=="simulator"&&(null==en?void 0:en.kind)!=="range"||!ec)return void ep(null);let e=!1;return async function(){try{let t=await fetch("/api/simulator/quote",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({price_label_id:ec.id,num_players:em,duration_minutes:ec.duration_minutes})});if(!t.ok){e||ep(null);return}let r=await t.json();e||ep(r)}catch(t){e||ep(null)}}(),()=>{e=!0}},[en,ec,em]),(0,a.useEffect)(()=>{eb(null),ev(null)},[ec,em]);let e2=(0,a.useMemo)(()=>{let e=V.filter(e=>e.show_on_public);return e.length>0?e:V},[V]),e5=(0,a.useMemo)(()=>{switch(e.show||"everything"){case"lessons":return["lesson"];case"bays":return["simulator","range"];case"fitting":return["fitting"];default:return null}},[e.show]),e4=(0,a.useMemo)(()=>{let t=(e.categoryNames||"").split(",").map(e=>e.trim().toLowerCase()).filter(Boolean);return t.length>0?new Set(t):null},[e.categoryNames]),e3=(0,a.useMemo)(()=>{let e=e=>(!e5||e5.includes(e.kind))&&(!e4||e4.has(e.name.toLowerCase()));if(O.length>0){let t=new Set(e2.map(e=>e.category_id).filter(Boolean));return O.filter(e=>(e=>"simulator"===e||"range"===e)(e.kind)?X.length>0:t.has(e.id)).filter(e).sort((e,t)=>{var r,n;return(null!=(r=e.sort_order)?r:0)-(null!=(n=t.sort_order)?n:0)})}let t=new Map;for(let e of e2){let r=e.lesson_type||"private";t.has(r)||t.set(r,{id:"type:".concat(r),name:(r||"").split(/[_\s]+/).filter(Boolean).map(e=>e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()).join(" ")||"Lesson",kind:"lesson"})}return Array.from(t.values()).filter(e)},[O,e2,X,e5,e4]),e6=(0,a.useMemo)(()=>{if(!en||"lesson"!==en.kind&&"fitting"!==en.kind)return[];if(en.id.startsWith("type:")){let e=en.id.slice(5);return e2.filter(t=>(t.lesson_type||"private")===e)}return e2.filter(e=>e.category_id===en.id)},[en,e2]),e8=(0,a.useMemo)(()=>{if(!eo||!eo.professional_ids||0===eo.professional_ids.length)return Z;let e=new Set(eo.professional_ids);return Z.filter(t=>e.has(t.id))},[eo,Z]),e7=(null==en?void 0:en.kind)==="simulator"||(null==en?void 0:en.kind)==="range",e9=(null==en?void 0:en.kind)==="range"?"range":"simulator",te=!Q&&1===e3.length,tt=null!==en&&!e7&&1===e6.length,tr=e7?1===X.length:null!==eo&&1===(eo.durations||[]).length,tn=!e7&&null!==eo&&1===e8.length,ta=(0,a.useMemo)(()=>(e7?["category","length","when","details","confirm"]:["category","lesson","length","professional","when","details","confirm"]).filter(e=>"category"===e?!te:"lesson"===e?!tt:"length"===e?!tr:"professional"!==e||!tn),[e7,te,tt,tr,tn]),to=null!=(v=null!=(y=ta[eQ])?y:ta[0])?v:"category";(0,a.useEffect)(()=>{Q||en||1!==e3.length||tg(e3[0])},[Q,en,e3]),(0,a.useEffect)(()=>{!en||e7||eo||1!==e6.length||tf(e6[0])},[en,e7,eo,e6]),(0,a.useEffect)(()=>{eo&&!es&&1===(eo.durations||[]).length&&ei(eo.durations[0])},[eo,es]),(0,a.useEffect)(()=>{e7&&!ec&&1===X.length&&ed(X[0])},[e7,ec,X]),(0,a.useEffect)(()=>{!eo||e7||ek||1!==e8.length||eN(e8[0].id)},[eo,e7,ek,e8]);let tl=(0,a.useRef)(null),ts=(0,a.useRef)(!1);(0,a.useEffect)(()=>{var e;if(!ts.current){ts.current=!0;return}null==(e=tl.current)||e.scrollIntoView({behavior:"smooth",block:"start"})},[eQ,eX]),(0,a.useEffect)(()=>{var e;"details"===to&&(0,s.s)("booking_started",{product:null!=(e=null==en?void 0:en.kind)?e:"other"})},[to,en]);let ti=(0,a.useMemo)(()=>Z.find(e=>e.id===ek)||null,[Z,ek]),tc=ti?ti.display_name||"".concat(ti.first_name," ").concat(ti.last_name):"",td=e7?null!=(T=null==ec?void 0:ec.duration_minutes)?T:0:null!=(q=null==es?void 0:es.minutes)?q:0,tm=e7?null!=(z=null!=(B=null==eh?void 0:eh.breakdown.total)?B:null==ec?void 0:ec.price)?z:0:N(es,ek),tu=ef?ef.final:tm;async function th(){let e=ex.trim();if(e&&(!e7||ec)){ew(!0),ev(null);try{let r=await fetch("/api/vouchers/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({code:e,booking_type:e7?"simulator":"lesson",booking_amount:tm,...e7&&ec?{product_id:ec.id}:{}})}),n=await r.json();if(null==n?void 0:n.valid){var t;let r=Number(null!=(t=n.final_amount)?t:tm);if(!e7){let e=function(e){let{final:t,price:r}=e;return t<=.005?{ok:!0}:{ok:!1,shortfall:t}}({final:r,price:tm});if(!e.ok){eb(null),ev("That voucher is ".concat(k(e.shortfall,tp)," short of the ")+"".concat(k(tm,tp)," lesson — a gift voucher has to cover the whole lesson."));return}}eb({code:e,discount:Number(n.discount_amount||0),final:r})}else eb(null),ev((null==n?void 0:n.error_message)||"That code is not val
1id")}catch(e){eb(null),ev("Could not check that code — please try again")}finally{ew(!1)}}}let tp=e7?(null==ec?void 0:ec.currency)||"GBP":(null==es||null==(t=es.prices[0])?void 0:t.currency)||"GBP",tx=(0,a.useMemo)(()=>{switch(to){case"category":return null!==en;case"lesson":return null!==eo;case"length":return e7?null!==ec:null!==es;case"professional":return null!==ek;case"when":return null!==eF;case"details":return eI.trim().length>0&&eG.trim().length>0;default:return!1}},[to,en,eo,e7,ec,es,ek,eC,eF,eI,eG]);function tg(e){ea(e),el(null),ei(null),ed(null),eN(null),eS(null),eR(null)}function tf(e){el(e),ei(null),eN(null),eS(null),eR(null)}(0,a.useEffect)(()=>{eR(null)},[eC,es,ec,ek]);let tb=e7?"bay:".concat(null!=(M=null==ec?void 0:ec.id)?M:"",":").concat(e9):"pro:".concat(null!=ek?ek:"",":").concat(null!=(P=null==es?void 0:es.minutes)?P:"",":").concat(null!=(L=null==eo?void 0:eo.location_type)?L:""),ty=(0,a.useRef)(null);async function tv(){var e,t;if(!eV&&!eX&&eF&&eC){(0,s.s)("book_click",{product:null!=(e=null==en?void 0:en.kind)?e:"other",play_date:eC,tee_time:eF.start_time}),eJ(!0),e$(null);try{let e,r;if(e7){if(!ec)return;e="/api/simulator/book",r={bay_type:e9,booking_date:eC,start_time:eF.start_time,end_time:eF.end_time,duration_minutes:ec.duration_minutes,member_name:eI,member_email:eG,phone:eO||void 0,num_players:em,price_label_id:ec.id,total_price:tu,voucher_code:null==ef?void 0:ef.code,payment_method:"cash"}}else{if(!ti||!es||!eo)return;e="/api/lesson-booking/book",r={professional_id:ek,professional_name:tc,professional_email:ti.email,member_name:eI,member_email:eG,phone:eO||void 0,booking_date:eC,start_time:eF.start_time,end_time:eF.end_time,duration_minutes:es.minutes,lesson_type:eo.lesson_type,location_type:eo.location_type||void 0,lesson_id:eo.id,category_id:en&&!en.id.startsWith("type:")?en.id:void 0,total_price:N(es,ek),payment_method:ef?"voucher":"cash",voucher_code:null==ef?void 0:ef.code}}r.utm=(0,i.hB)();let n=await fetch(e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(r)});if(409===n.status)throw Error("That time has just been booked. Please pick another.");if(!n.ok){let e=await n.json().catch(()=>null);throw Error((null==e?void 0:e.message)||(null==e?void 0:e.detail)||"Booking failed (".concat(n.status,")"))}let a=await n.json();eK(function(e,t){var r;let{isBayKind:n,fallbackEmail:a}=t,o=null!=(r=e.booking)?r:{},l=e.booking_reference||o.booking_ref||o.booking_reference||e.booking_ref,s=n?void 0:e.id,i=n?void 0:e.package_name,c=e.package_lessons_remaining;return{booking_reference:l,member_email:e.member_email||a,...s?{lessonBookingId:s}:{},...i?{packageName:i}:{},...i&&"number"==typeof c?{packageLessonsRemaining:c}:{}}}(a,{isBayKind:e7,fallbackEmail:eG})),(0,s.s)("booking_completed",{product:null!=(t=null==en?void 0:en.kind)?t:"other"})}catch(e){e$(e instanceof Error?e.message:"An unexpected error occurred")}finally{eJ(!1)}}}(0,a.useEffect)(()=>{if("when"!==to||(e7?!ec:!ek||!es)||ty.current===tb)return;ty.current=tb;let e=(null==ti?void 0:ti.max_advance_booking_days)||U,t=new Date,r=new Date(t);r.setDate(r.getDate()+Math.max(0,Math.min(e,61)));let n=j(t),a=j(r),o=!1;return eB(!0),async function(){let e=null;try{let t;e7?t="/api/simulator/availability-summary?start_date=".concat(n,"&end_date=").concat(a,"&duration_minutes=").concat(ec.duration_minutes,"&bay_type=").concat(e9,"&price_label_id=").concat(encodeURIComponent(ec.id)):(t="/api/lessons/professionals/".concat(ek,"/availability-summary?start_date=").concat(n,"&end_date=").concat(a,"&duration_minutes=").concat(es.minutes),(null==eo?void 0:eo.location_type)&&(t+="&location_type=".concat(encodeURIComponent(eo.location_type))),(null==eo?void 0:eo.id)&&(t+="&lesson_id=".concat(encodeURIComponent(eo.id))));let r=await fetch(t);if(r.ok){let t=await r.json(),n=(null==t?void 0:t.days)||[];if(n.length>0)for(let t of(e={},n))e[t.date]=Number(t.available_count)||0}}catch(e){}if(o)return;eT(e),eB(!1);let t=e?Object.keys(e).sort().find(t=>e[t]>0):void 0;eS(e=>{var r;return null!=(r=null!=e?e:t)?r:n})}(),()=>{o=!0}},[to,tb,e7,ec,ek,es,eo,e9,ti,U]),(0,a.useEffect)(()=>
1{if("when"!==to||!eC||(e7?!ec:!ek||!es))return;let e=!1;return eL(!0),eW(null),async function(){try{var t;let r,n;e7?r="/api/simulator/availability/".concat(eC,"?duration_minutes=").concat(ec.duration_minutes,"&bay_type=").concat(e9,"&price_label_id=").concat(encodeURIComponent(ec.id)):(r="/api/lessons/professionals/".concat(ek,"/availability/").concat(eC,"?duration_minutes=").concat(es.minutes),(null==eo?void 0:eo.location_type)&&(r+="&location_type=".concat(encodeURIComponent(eo.location_type))),(null==eo?void 0:eo.id)&&(r+="&lesson_id=".concat(encodeURIComponent(eo.id))));let a=await fetch(r);if(!a.ok)throw Error("Failed to fetch availability (".concat(a.status,")"));let o=await a.json();if(e)return;e7?(n=(o.windows||[]).map((e,t)=>({id:"".concat(e.start_time,"-").concat(t),start_time:e.start_time,end_time:e.end_time,duration_minutes:e.duration_minutes,available_spots:e.available_spots,status:e.status||"available",preferred:e.preferred})).filter(e=>"available"===e.status)).sort((e,t)=>e.preferred===t.preferred?0:e.preferred?-1:1):n=(o.slots||[]).filter(e=>"available"===e.status),eM(n),(0,s.s)("tee_sheet_view",{product:null!=(t=null==en?void 0:en.kind)?t:"other",play_date:null!=eC?eC:void 0})}catch(t){e||eW(t instanceof Error?t.message:"Failed to load availability")}finally{e||eL(!1)}}(),()=>{e=!0}},[to,eC,ek,es,ec,e7,e9,eo,eA]);let tj={background:H.surface,color:H.cardText,borderRadius:"22px",border:"1px solid ".concat(H.border),boxShadow:H.dark?"0 24px 60px -28px rgba(0,0,0,0.7)":"0 24px 60px -30px rgba(15,23,42,0.45), 0 0 0 1px rgba(15,23,42,0.04)",padding:"clamp(1.25rem, 3.2vw, 2.5rem)"},tw={};H.sectionBg&&(tw.background=H.sectionBg);let tk={background:H.dark?"rgba(148,163,184,0.06)":"#ffffff",border:"1px solid ".concat(H.borderStrong),color:H.cardText},tN="\n#".concat(G," .bkg-step-badge{background:color-mix(in srgb, ").concat(H.accent," 14%, transparent);color:").concat(H.accent,";}\n#").concat(G," .bkg-ghost-btn{color:").concat(H.mutedText,";transition:background .15s ease,color .15s ease;}\n#").concat(G," .bkg-ghost-btn:not(:disabled):hover{background:").concat(H.surfaceSubtle,";color:").concat(H.cardText,";}\n#").concat(G," .bkg-card{background:").concat(H.surfaceSubtle,";border:1px solid ").concat(H.border,";color:").concat(H.cardText,";transition:transform .15s ease, box-shadow .15s ease, border-color .15s ease, background .15s ease;}\n#").concat(G," .bkg-card:not(.bkg-card--sel):hover{transform:translateY(-2px);border-color:").concat(H.accent,";box-shadow:0 12px 28px -16px ").concat(H.dark?"rgba(0,0,0,0.65)":"rgba(15,23,42,0.28)",";}\n#").concat(G," .bkg-card--sel{background:color-mix(in srgb, ").concat(H.primaryAction," 10%, ").concat(H.surface,");border-color:").concat(H.primaryAction,";box-shadow:0 0 0 2px color-mix(in srgb, ").concat(H.accent," 55%, transparent), 0 14px 30px -18px ").concat(H.dark?"rgba(0,0,0,0.7)":"rgba(15,23,42,0.32)",";}\n#").concat(G," .bkg-icon-wrap{background:color-mix(in srgb, ").concat(H.accent," 13%, transparent);color:").concat(H.accent,";transition:background .15s ease,color .15s ease;}\n#").concat(G," .bkg-card--sel .bkg-icon-wrap{background:").concat(H.primaryAction,";color:").concat(H.onPrimary,";}\n#").concat(G," .bkg-day:not(.bkg-day--selected):not(:disabled):hover{border-color:").concat(H.accent,"!important;color:").concat(H.accent,"!important;background:color-mix(in srgb, ").concat(H.accent," 12%, transparent);}\n#").concat(G," .bkg-pill{border:1px solid ").concat(H.borderStrong,";color:").concat(H.cardText,";background:").concat(H.surface,";transition:border-color .15s ease, color .15s ease, background .15s ease;}\n#").concat(G," .bkg-pill:not(.bkg-pill--sel):not(:disabled):hover{border-color:").concat(H.accent,";color:").concat(H.accent,";}\n#").concat(G," .bkg-pill--sel{background:").concat(H.primaryAction,";border-color:").concat(H.primaryAction,";color:").concat(H.onPrimary,";box-shadow:0 8px 18px -10px color-mix(in srgb, ").concat(H.primaryAction," 70%, transparent);}\n#").concat(G," .bkg-input{transition:border-color .15s ease, box-shadow .15s ease;}\n#").concat(G," .bkg-input::placeholder{color:").concat(H.mutedText,";}\n#").concat(G," .bkg-input:focus{outline:none;border-color:").concat(H.accent,";box-shadow:0 0 0 3px color-mix(in srgb, ").concat(H.accent," 24%, transparent);}\n#").concat(G," .bkg-cta{background:").concat(H.primaryAction,";color:").concat(H.onPrimary,";transition:filter .15s ease, box-shadow .15s ease;}\n#").concat(G," .bkg-cta:not(:disabled):hover{filter:brightness(0.94);}\n#").concat(G," .bkg-cta:focus-visible{outline:none;box-shadow:0 0 0 3px color-mix(in srgb, ").concat(H.primaryAction," 35%, transparent);}\n#").concat(G," .bkg-secondary{border:1px solid ").concat(H.borderStrong,";color:").concat(H.cardText,";background:transparent;transition:background .15s ease, border-color .15s ease;}\n#").concat(G," .bkg-secondary:not(:disabled):hover{background:").concat(H.surfaceSubtle,";border-color:").concat(H.accent,";}\n#").concat(G," a:focus-visible, #").concat(G," button:focus-visible{outline:none;box-shadow:0 0 0 3px color-mix(in srgb, ").concat(H.accent," 35%, transparent);}\n").trim(),tC=(0,n.jsx)("div",{className:"flex items-center justify-center gap-1.5 mb-7","aria-hidden":!0,
1children:ta.map((e,t)=>(0,n.jsx)("span",{className:"h-1.5 rounded-full transition-all",style:{width:t===eQ?"1.75rem":"0.5rem",background:t<=eQ?H.primaryAction:H.border}},t))}),tS=E||F?(0,n.jsxs)("div",{className:"text-center mb-8 sm:mb-10",children:[E&&(0,n.jsx)("h2",{className:"text-3xl sm:text-4xl font-bold tracking-tight",style:H.sectionBg?{color:"#ffffff"}:void 0,children:E}),F&&(0,n.jsx)("p",{className:"mt-3 text-base sm:text-lg max-w-2xl mx-auto opacity-90",style:H.sectionBg?{color:"rgba(255,255,255,0.85)"}:{color:H.mutedText},children:F})]}):null,t_=e=>(0,n.jsx)("span",{className:"inline-flex items-center rounded-full px-2.5 py-1 text-xs font-bold",style:{background:"color-mix(in srgb, ".concat(H.accent," 14%, transparent)"),color:H.accent},children:e}),tT=e7?"".concat((null==en?void 0:en.name)||"Simulator"," — ").concat(null!=(D=null==ec?void 0:ec.name)?D:"".concat(td," mins")):"".concat(null!=(W=null==eo?void 0:eo.name)?W:"");return(0,n.jsxs)("section",{className:(0,o.cn)("py-12 px-4 sm:px-6 lg:px-8",I),style:tw,children:[(0,n.jsx)("style",{dangerouslySetInnerHTML:{__html:tN}}),(0,n.jsxs)("div",{className:"mx-auto max-w-5xl",children:[tS,(0,n.jsxs)("div",{id:G,ref:tl,style:tj,children:[!eX&&tC,(0,n.jsxs)("div",{className:"min-h-[360px]",children:["category"===to&&(Q?(0,n.jsxs)("div",{className:"flex items-center justify-center py-16",children:[(0,n.jsx)(c,{className:"h-7 w-7",style:{color:H.accent}}),(0,n.jsx)("span",{className:"ml-3",style:{color:H.mutedText},children:"Loading…"})]}):et?(0,n.jsxs)("div",{className:"text-center py-12",children:[(0,n.jsx)(p,{className:"h-12 w-12 text-red-400 mx-auto mb-3"}),(0,n.jsx)("p",{className:"text-red-600 font-medium",children:"Booking is temporarily unavailable."})]}):0===e3.length?(0,n.jsx)("div",{className:"text-center py-12",children:(0,n.jsx)("p",{style:{color:H.mutedText},children:"No booking options available."})}):(0,n.jsxs)("div",{children:[(0,n.jsx)("h3",{className:"text-xl font-semibold mb-6",style:{color:H.cardText},children:"What would you like to book?"}),(0,n.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-4",children:e3.map(e=>{let t=(null==en?void 0:en.id)===e.id,r="simulator"===e.kind||"range"===e.kind?X.length:e.id.startsWith("type:")?e2.filter(t=>(t.lesson_type||"private")===e.id.slice(5)).length:e2.filter(t=>t.category_id===e.id).length;return(0,n.jsxs)("button",{type:"button",onClick:()=>tg(e),"aria-pressed":t,className:(0,o.cn)("bkg-card text-left rounded-2xl p-5 flex flex-col gap-3",t&&"bkg-card--sel"),children:[(0,n.jsx)("span",{className:"bkg-icon-wrap inline-flex h-11 w-11 items-center justify-center rounded-xl",children:function(e,t){return"simulator"===e.kind||"range"===e.kind?(0,n.jsx)(f,{className:t}):"fitting"===e.kind||(e.name||"").toLowerCase().includes("fitting")?(0,n.jsx)(g,{className:t}):(0,n.jsx)(x,{className:t})}(e,"w-6 h-6")}),(0,n.jsxs)("div",{children:[(0,n.jsx)("p",{className:"font-semibold text-lg leading-tight",style:{color:H.cardText},children:e.name}),(0,n.jsxs)("p",{className:"text-sm mt-1",style:{color:H.mutedText},children:[r," option",1===r?"":"s"," available"]})]})]},e.id)})})]})),"lesson"===to&&(0===e6.length?(0,n.jsx)("div",{className:"text-center py-12",children:(0,n.jsx)("p",{style:{color:H.mutedText},children:"No options available."})}):(0,n.jsxs)("div",{children:[(0,n.jsxs)("h3",{className:"text-xl font-semibold mb-6",style:{color:H.cardText},children:["Choose a ",((null==en?void 0:en.name)||"lesson").toLowerCase()]}),(0,n.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4",children:e6.map(e=>{let t=(null==eo?void 0:eo.id)===e.id;return(0,n.jsxs)("button",{type:"button",onClick:()=>tf(e),"aria-pressed":t,className:(0,o.cn)("bkg-card text-left rounded-2xl p-5 flex flex-col gap-2",t&&"bkg-card--sel"),children:[(0,n.jsx)("p",{className:"font-semibold leading-tight",style:{color:H.cardText},children:e.name}),e.description&&(0,n.jsx)("p",{className:"text-sm",style:{color:H.mutedText},children:e.description}),(0,n.jsxs)("p",{className:"text-xs",style:{color:H.mutedText},children:[e.durations.length," length",1===e.durations.length?"":"s"]})]},e.id)})})]})),"length"===to&&(0,n.jsxs)("div",{children:[(0,n.jsx)("h3",{className:"text-xl font-semibold mb-6",style:{color:H.cardText},children:"Choose a length"}),(0,n.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4",children:e7?X.map(e=>{let t=(null==ec?void 0:ec.id)===e.id;return(0,n.jsxs)("button",{type:"button",onClick:()=>ed(e),"aria-pressed":t,className:(0,o.cn)("bkg-card text-left rounded-2xl p-5 flex flex-col gap-2",t&&"bkg-card--sel"),children:[(0,n.jsx)("p",{className:"font-semibold leading-tight",style:{color:H.cardText},children:e.name||"".concat(e.duration_minutes," mins")}),(0,n.jsxs)("p",{className:"text-sm",style:{color:H.mutedText},children:[e.duration_minutes," mins"]}),(0,n.jsx)("div",{className:"mt-1",children:t_(k(e.price,e.currency))})]},e.id)}):((null==eo?void 0:eo.durations)||[]).map(e=>{let t=(null==es?void 0:es.minutes)===e.minutes;return(0,n.jsxs)("button",{type:"button",onClick:()=>ei(e),"aria-pressed":t,className:(0,o.cn)("bkg-card text-left rounded-2xl p-5 flex flex-col gap-2",t&&"bkg-card--sel"),children:[(0,n.jsxs)("p",{className:"font-semibold leading-tight",style:{color:H.cardText},children:[e.minutes," mins"]}),(0,n.jsx)("div",{className:"mt-1",children:t_(function(e){var t,r;let n=Array.from(new Set(e.prices.map(e=>e.price))),a=(null==(t=e.prices[0])?void 0:t.currency)||"GBP";if(n.length<=1)return k(null!=(r=n[0])?r:0,a);let o=Math.min(...n),l=Math.max(...n);return"".concat(k(o,a),"–").concat(k(l,a))}(e))})]},e.minutes)})}),!e7&&es&&es.prices.length>1&&(0,n.jsx)("p",{className:"text-xs mt-4",style:{color:H.mutedText},children:"Price depends on the professional you choose next."})]}),"professional"===to&&(0===e8.length?(0,n.jsx)("div",{className:"text-center py-12",children:(0,n.jsx)("p",{style:{color:H.mutedText},children:"No professionals available for online booking."})}):(0,n.jsxs)("div",{children:[(0,n.jsx)("h3",{className:"text-xl font-semibold mb-6",style:{color:H.cardText},children:"Choose your professional"}),(0,n.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4",children:e8.map(e=>{var t,r,a,l,s;let i=e.display_name||"".concat(e.first_name," ").concat(e.last_name),c=ek===e.id,d="".concat(null!=(l=null==(t=e.first_name)?void 0:t[0])?l:"").concat(null!=(s=null==(r=e.last_name)?void 0:r[0])?s:"").toUpperCase(),m=es?N(e
1s,e.id):0;return(0,n.jsxs)("button",{type:"button",onClick:()=>eN(e.id),"aria-pressed":c,className:(0,o.cn)("bkg-card text-left rounded-2xl p-5 flex items-start gap-3.5",c&&"bkg-card--sel"),children:[(0,n.jsx)("span",{className:"bkg-icon-wrap inline-flex h-11 w-11 shrink-0 items-center justify-center rounded-full text-sm font-bold overflow-hidden",children:e.photo_url?(0,n.jsx)("img",{src:e.photo_url,alt:i,className:"h-full w-full object-cover"}):d||"\xb7"}),(0,n.jsxs)("div",{className:"min-w-0",children:[(0,n.jsx)("p",{className:"font-semibold leading-tight",style:{color:H.cardText},children:i}),(null==(a=e.specialties)?void 0:a.length)>0&&(0,n.jsx)("p",{className:"text-xs mt-1",style:{color:H.mutedText},children:e.specialties.slice(0,3).join(" \xb7 ")}),es&&(0,n.jsx)("div",{className:"mt-2",children:t_(k(m,tp))})]})]},e.id)})})]})),"when"===to&&(0,n.jsxs)("div",{className:"grid gap-6 md:gap-8 md:grid-cols-[minmax(0,20rem)_minmax(0,1fr)]",children:[(0,n.jsxs)("div",{className:"md:border-r md:pr-8",style:{borderColor:H.border},children:[(0,n.jsx)(C,{selected:eC,onSelect:eS,maxAdvanceDays:(null==ti?void 0:ti.max_advance_booking_days)||U,a:H,dayCounts:e_}),e_&&(0,n.jsx)("p",{className:"text-xs mt-4",style:{color:H.mutedText},children:"Dimmed dates have no times available."})]}),(0,n.jsxs)("div",{className:"min-w-0",children:[(0,n.jsx)("h3",{className:"text-lg font-semibold mb-1.5",style:{color:H.cardText},children:"Select a time"}),(0,n.jsx)("p",{className:"text-sm mb-5",style:{color:H.mutedText},children:eC?"".concat(e7?(null==en?void 0:en.name)||"Simulator":tc," \xb7 ").concat(w(eC)):"Pick a date to see the available times."}),eq&&!eC||eC&&eP?(0,n.jsxs)("div",{className:"flex items-center justify-center py-16",children:[(0,n.jsx)(c,{className:"h-7 w-7",style:{color:H.accent}}),(0,n.jsx)("span",{className:"ml-3",style:{color:H.mutedText},children:"Loading available times…"})]}):eC&&eD?(0,n.jsxs)("div",{className:"text-center py-12",children:[(0,n.jsx)(p,{className:"h-12 w-12 text-red-400 mx-auto mb-3"}),(0,n.jsx)("p",{className:"text-red-600 font-medium mb-3",children:eD}),(0,n.jsx)("button",{type:"button",onClick:()=>eE(e=>e+1),className:"bkg-cta px-4 py-2 rounded-lg text-sm font-semibold",children:"Retry"})]}):eC&&0===ez.length?(0,n.jsx)("div",{className:"text-center py-12",children:(0,n.jsx)("p",{style:{color:H.mutedText},children:"No available times on this date. Try another date on the calendar."})}):eC?(0,n.jsx)("div",{className:"grid grid-cols-2 sm:grid-cols-3 gap-3",children:ez.map(e=>{let t=(null==eF?void 0:eF.id)===e.id;return(0,n.jsxs)("button",{type:"button",onClick:()=>{var t;(0,s.s)("slot_click",{product:null!=(t=null==en?void 0:en.kind)?t:"other",play_date:null!=eC?eC:void 0,tee_time:e.start_time,players_shown:em}),eR(e)},"aria-pressed":t,className:(0,o.cn)("bkg-card rounded-xl p-4 text-center",t&&"bkg-card--sel"),children:[(0,n.jsx)("p",{className:"text-lg font-bold",style:{color:H.cardText},children:e.start_time}),(0,n.jsxs)("p",{className:"text-xs mt-0.5",style:{color:H.mutedText},children:[td||e.duration_minutes," mins"]}),e.preferred&&(0,n.jsx)("p",{className:"text-[10px] font-semibold mt-0.5",style:{color:H.accent},children:"On the hour"}),(0,n.jsx)("div",{className:"mt-1.5 flex justify-center",children:t_(k(tm,tp))})]},e.id)})}):null]})]}),"details"===to&&(0,n.jsxs)("div",{className:"max-w-lg mx-auto space-y-4",children:[(0,n.jsx)("h3",{className:"text-xl font-semibold mb-2",style:{color:H.cardText},children:"Your details"}),(0,n.jsxs)("div",{children:[(0,n.jsxs)("label",{className:"block text-sm font-medium mb-1.5",style:{color:H.cardText},children:["Full name ",(0,n.jsx)("span",{style:{color:H.accent},children:"*"})]}),(0,n.jsx)("input",{type:"text",value:eI,onChange:e=>eH(e.target.value),className:"bkg-input w-full px-4 py-2.5 rounded-lg text-sm",style:tk})]}),(0,n.jsxs)("div",{children:[(0,n.jsxs)("label",{className:"block text-sm font-medium mb-1.5",style:{color:H.cardText},children:["Email ",(0,n.jsx)("span",{style:{color:H.accent},children:"*"})]}),(0,n.jsx)("input",{type:"email",value:eG,onChange:e=>eU(e.target.value),className:"bkg-input w-full px-4 py-2.5 rounded-lg text-sm",style:tk})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)("label",{className:"block text-sm font-medium mb-1.5",style:{color:H.cardText},children:"Phone"}
1),(0,n.jsx)("input",{type:"tel",value:eO,onChange:e=>eY(e.target.value),className:"bkg-input w-full px-4 py-2.5 rounded-lg text-sm",style:tk})]})]}),"confirm"===to&&eF&&(eX?(0,n.jsxs)("div",{className:"max-w-md mx-auto text-center py-4",children:[(0,n.jsx)("div",{className:"mx-auto mb-5 flex h-16 w-16 items-center justify-center rounded-full",style:{background:"color-mix(in srgb, ".concat(H.accent," 16%, transparent)"),color:H.accent},children:(0,n.jsx)(h,{className:"w-9 h-9"})}),(0,n.jsx)("h3",{className:"text-2xl font-bold mb-2",style:{color:H.cardText},children:"You’re booked in"}),eX.booking_reference&&(0,n.jsxs)("div",{className:"mt-4 rounded-2xl px-5 py-4",style:{background:H.surfaceSubtle,border:"1px solid ".concat(H.border)},children:[(0,n.jsx)("p",{className:"text-xs uppercase tracking-wide mb-1",style:{color:H.mutedText},children:"Reference"}),(0,n.jsx)("p",{className:"text-2xl font-mono font-bold",style:{color:H.cardText},children:eX.booking_reference})]}),eX.member_email&&(0,n.jsxs)("p",{className:"text-xs mt-3",style:{color:H.mutedText},children:["Confirmation sent to ",eX.member_email]}),eX.packageName?(0,n.jsx)(S,{packageName:eX.packageName,lessonsRemaining:eX.packageLessonsRemaining,mutedTextColor:H.mutedText}):(0,n.jsx)(_,{lessonBookingId:eX.lessonBookingId,packagesPageUrl:e.packagesPageUrl,mutedTextColor:H.mutedText,linkColor:H.accent})]}):(0,n.jsxs)("div",{className:"max-w-lg mx-auto",children:[(0,n.jsx)("h3",{className:"text-xl font-semibold mb-6",style:{color:H.cardText},children:"Confirm your booking"}),(0,n.jsxs)("div",{className:"rounded-2xl divide-y overflow-hidden",style:{border:"1px solid ".concat(H.border),background:H.surfaceSubtle},children:[(0,n.jsxs)("div",{className:"p-4",style:{borderColor:H.border},children:[(0,n.jsx)("p",{className:"font-semibold",style:{color:H.cardText},children:tT}),!e7&&(0,n.jsx)("p",{className:"text-sm mt-0.5",style:{color:H.mutedText},children:tc}),(0,n.jsxs)("p",{className:"text-sm",style:{color:H.mutedText},children:[w(eC)," at ",eF.start_time," (",td," mins)"]})]}),(0,n.jsxs)("div",{className:"p-4",style:{borderColor:H.border},children:[(0,n.jsx)("p",{className:"font-semibold",style:{color:H.cardText},children:eI}),(0,n.jsx)("p",{className:"text-sm",style:{color:H.mutedText},children:eG}),eO&&(0,n.jsx)("p",{className:"text-sm",style:{color:H.mutedText},children:eO})]}),e7&&(null==ec||null==(r=ec.price_tiers)?void 0:r.length)?(0,n.jsxs)("div",{className:"p-4",style:{borderColor:H.border},children:[(0,n.jsx)("p",{className:"font-semibold mb-2",style:{color:H.cardText},children:"Players"}),(0,n.jsx)("div",{className:"flex gap-2 flex-wrap",children:(null!=(A=null==eh||null==(d=eh.price_matrix)?void 0:d.map(e=>e.players))?A:[1,2,3,4]).map(e=>(0,n.jsx)("button",{type:"button",onClick:()=>eu(e),"aria-pressed":em===e,className:(0,o.cn)("px-3.5 py-1.5 rounded-lg text-sm font-semibold border",em===e&&"bkg-card--sel"),style:{borderColor:H.border,color:H.cardText},children:e},e))}),(null==eh||null==(b=eh.price_matrix)?void 0:b.length)?(0,n.jsx)("div",{className:"mt-3 space-y-1",children:eh.price_matrix.map(e=>(0,n.jsxs)("div",{className:"flex justify-between text-sm",style:{color:e.players===em?H.cardText:H.mutedText,fontWeight:e.players===em?600:400},children:[(0,n.jsxs)("span",{children:[e.players," player",e.players>1?"s":""]}),(0,n.jsxs)("span",{children:[k(e.total,tp),null!=e.price_per_person?" \xb7 ".concat(k(e.price_per_person,tp),"/ea"):""]})]},e.players))}):null]}):null,(0,n.jsxs)("div",{className:"p-4",style:{borderColor:H.border},children:[(0,n.jsx)("label",{className:"text-sm font-medium",style:{color:H.cardText},children:e7?"Discount code":"Gift voucher"}),!e7&&(0,n.jsx)("p",{className:"text-xs mt-0.5",style:{color:H.mutedText},children:"A gift voucher pays for the whole lesson."}),(0,n.jsxs)("div",{className:"flex gap-2 mt-1.5",children:[(0,n.jsx)("input",{type:"text",value:ex,onChange:e=>{eg(e.target.value),ev(null)},placeholder:"Enter code",className:"flex-1 rounded-lg px-3 py-2 text-sm border",style:{borderColor:H.border,background:H.surfaceSubtle,color:H.cardText}}),(0,n.jsx)("button",{type:"button",onClick:th,disabled:ej||!ex.trim(),className:"px-4 py-2 rounded-lg text-sm font-semibold border disabled:opacity-50",style:{borderColor:H.border,color:H.cardText}
1,children:ej?"…":ef?"Applied":"Apply"})]}),ey&&(0,n.jsx)("p",{className:"text-xs mt-1.5",style:{color:"#dc2626"},children:ey}),ef&&(0,n.jsxs)("p",{className:"text-xs mt-1.5",style:{color:H.accent},children:["Code ",ef.code," applied"]})]}),ef&&ef.discount>0&&(0,n.jsx)("div",{className:"p-4",style:{borderColor:H.border},children:(0,n.jsxs)("div",{className:"flex justify-between text-sm",style:{color:H.mutedText},children:[(0,n.jsx)("span",{children:"Discount"}),(0,n.jsxs)("span",{children:["−",k(ef.discount,tp)]})]})}),(0,n.jsx)("div",{className:"p-4",style:{borderColor:H.border},children:(0,n.jsxs)("div",{className:"flex justify-between items-center font-bold",style:{color:H.cardText},children:[(0,n.jsx)("span",{children:"Total"}),(0,n.jsx)("span",{className:"text-lg",children:k(tu,tp)})]})})]}),eZ&&(0,n.jsx)("div",{className:"mt-4 p-3 rounded-lg bg-red-50 border border-red-200",children:(0,n.jsx)("p",{className:"text-sm font-medium text-red-700",children:eZ})}),(0,n.jsx)("button",{type:"button",onClick:tv,disabled:eV,className:"bkg-cta w-full mt-6 py-3.5 rounded-xl text-base font-semibold disabled:opacity-60",children:eV?"Processing…":"Confirm & Book — ".concat(k(tu,tp))})]}))]}),!eX&&(0,n.jsxs)("div",{className:"flex items-center justify-between mt-8 pt-6",style:{borderTop:"1px solid ".concat(H.border)},children:[(0,n.jsxs)("button",{type:"button",onClick:function(){eQ>0&&(e0(eQ-1),e$(null))},disabled:0===eQ,className:(0,o.cn)("bkg-secondary flex items-center gap-2 px-5 py-2.5 rounded-lg text-sm font-medium",0===eQ&&"opacity-0 pointer-events-none"),children:[(0,n.jsx)(m,{className:"w-4 h-4"})," Back"]}),"confirm"!==to&&(0,n.jsxs)("button",{type:"button",onClick:function(){tx&&eQ<ta.length-1&&e0(eQ+1)},disabled:!tx,className:"bkg-cta flex items-center gap-2 px-6 py-2.5 rounded-lg text-sm font-semibold disabled:opacity-40 disabled:cursor-not-allowed",children:["Next ",(0,n.jsx)(u,{className:"w-4 h-4"})]})]}),eX&&(0,n.jsx)("div",{className:"text-center mt-8",children:(0,n.jsx)("button",{type:"button",onClick:function(){e0(0),ea(null),el(null),ei(null),ed(null),eN(null),eS(null),eM([]),eR(null),eT(null),eH(""),eU(""),eY(""),e$(null),eK(null)},className:"bkg-secondary px-6 py-3 rounded-lg text-sm font-medium",children:"Start again"})})]})]})]})}},27880:(e,t,r)=>{"use strict";r.d(t,{RepeaterField:()=>o});var n=r(29064),a=r(34340);function o(e){let{name:t,label:r,singularLabel:o="Item",fields:l,minRows:s=1,maxRows:i=10,addButtonText:c,showRowNumbers:d=!0,rowStyle:m="card",marginTop:u="medium",marginBottom:h="medium"}=e,p=(0,a.useCallback)(()=>{let e={};return l.forEach(t=>{e[t.name]=t.defaultValue||"checkbox"!==t.fieldType&&""}),e},[l]),[x,g]=(0,a.useState)(()=>{let e=[];for(let t=0;t<Math.max(1,s);t++)e.push(p());return e}),f=(e,t,r)=>{g(x.map((n,a)=>a===e?{...n,[t]:r}:n))},b={none:"0",small:"0.5rem",medium:"1rem",large:"1.5rem"},y={card:{backgroundColor:"var(--color-bg-subtle, #f8f9fa)",border:"1px solid var(--color-border, #e5e7eb)",borderRadius:"var(--radius-default, 6px)",padding:"1rem",marginBottom:"0.75rem"},simple:{borderBottom:"1px solid var(--color-border, #e5e7eb)",paddingBottom:"1rem",marginBottom:"1rem"},compact:{marginBottom:"0.5rem"}},v={width:"100%",padding:"0.5rem 0.75rem",borderRadius:"var(--radius-default, 6px)",border:"1px solid var(--color-border, #e5e7eb)",fontSize:"0.9rem"};return(0,n.jsxs)("div",{style:{width:"100%",marginTop:b[u],marginBottom:b[h]},children:[(0,n.jsx)("label",{style:{display:"block",marginBottom:"0.75rem",fontWeight:600,fontSize:"1rem"},children:r}),(0,n.jsx)("div",{children:x.map((e,r)=>(0,n.jsxs)("div",{style:y[m],children:[(0,n.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"0.75rem"},children:[d&&(0,n.jsxs)("span",{style:{fontSize:"0.8rem",fontWeight:600,color:"var(--color-text-muted, #6b7280)",backgroundColor:"var(--color-bg, #fff)",padding:"0.25rem 0.5rem",borderRadius:"var(--radius-sm, 4px)"},children:[o," ",r+1]}),x.length>s&&(0,n.jsx)("button",{type:"button",onClick:()=>{x.length>s&&g(x.filter((e,t)=>t!==r))},style:{padding:"0.25rem 0.5rem",fontSize:"0.75rem",color:"var(--color-error, #dc2626)",backgroundColor:"transparent",border:"1px solid var(--color-error, #dc2626)",borderRadius:"var(--radius-sm, 4px)",cursor:"pointer",transition:"all 0.2s"},onMouseOver:e=>{e.currentTarget.style.backgroundColor="var(--color-error, #dc2626)",e.currentTarget.style.color="white"},onMouseOut:e=>{e.currentTarget.style.backgroundColor="transparent",e.currentTarget.style.color="var(--color-error, #dc2626)"},children:"Remove"})]}),(0,n.jsx)("div",{style:{display:"flex",flexWrap:"wrap",gap:"0.75rem",alignItems:"flex-start"},children:l.map(e=>((e,r)=>{let a,o="".concat(t,"_").concat(r,"_").concat(e.name),l=x[r][e.name],s=e.width?parseInt(e.width,10):100;if(s>=100)a="100%";else{let e=Math.floor(100/s);a="calc(".concat(s,"% - ").concat((e-1)/e*.75,"rem)")}let i={width:a,minWidth:"compact"===m?"100px":"120px",flex:"compact"===m?"0 0 ".concat(a):void 0};switch(e.fieldType){case"text":case"email":return(0,n.jsxs)("div",{style:i,children:[(0,n.jsxs)("label",{style:{display:"block",marginBottom:"0.25rem",fontSize:"0.8rem",fontWeight:500},children:[e.label," ",e.required&&(0,n.jsx)("span",{style:{color:"var(--color-error, #dc2626)"},children:"*"})]}
1),(0,n.jsx)("input",{type:e.fieldType,name:o,value:l,onChange:t=>f(r,e.name,t.target.value),required:e.required,placeholder:e.placeholder,style:v})]},o);case"number":return(0,n.jsxs)("div",{style:i,children:[(0,n.jsxs)("label",{style:{display:"block",marginBottom:"0.25rem",fontSize:"0.8rem",fontWeight:500},children:[e.label," ",e.required&&(0,n.jsx)("span",{style:{color:"var(--color-error, #dc2626)"},children:"*"})]}),(0,n.jsx)("input",{type:"number",name:o,value:l,onChange:t=>f(r,e.name,t.target.value),required:e.required,placeholder:e.placeholder,style:v})]},o);case"textarea":return(0,n.jsxs)("div",{style:i,children:[(0,n.jsxs)("label",{style:{display:"block",marginBottom:"0.25rem",fontSize:"0.8rem",fontWeight:500},children:[e.label," ",e.required&&(0,n.jsx)("span",{style:{color:"var(--color-error, #dc2626)"},children:"*"})]}),(0,n.jsx)("textarea",{name:o,value:l,onChange:t=>f(r,e.name,t.target.value),required:e.required,placeholder:e.placeholder,rows:2,style:{...v,resize:"vertical"}})]},o);case"select":var c;return(0,n.jsxs)("div",{style:i,children:[(0,n.jsxs)("label",{style:{display:"block",marginBottom:"0.25rem",fontSize:"0.8rem",fontWeight:500},children:[e.label," ",e.required&&(0,n.jsx)("span",{style:{color:"var(--color-error, #dc2626)"},children:"*"})]}),(0,n.jsxs)("select",{name:o,value:l,onChange:t=>f(r,e.name,t.target.value),required:e.required,style:{...v,backgroundColor:"white"},children:[(0,n.jsx)("option",{value:"",children:"Select..."}),null==(c=e.options)?void 0:c.map((e,t)=>(0,n.jsx)("option",{value:e.value,children:e.label},t))]})]},o);case"checkbox":return(0,n.jsx)("div",{style:{...i,display:"flex",alignItems:"center",paddingTop:"1.5rem"},children:(0,n.jsxs)("label",{style:{display:"flex",alignItems:"center",gap:"0.5rem",cursor:"pointer",fontSize:"0.9rem"},children:[(0,n.jsx)("input",{type:"checkbox",name:o,checked:l,onChange:t=>
1f(r,e.name,t.target.checked),style:{width:"1rem",height:"1rem"}}),e.label," ",e.required&&(0,n.jsx)("span",{style:{color:"var(--color-error, #dc2626)"},children:"*"})]})},o);case"date":return(0,n.jsxs)("div",{style:i,children:[(0,n.jsxs)("label",{style:{display:"block",marginBottom:"0.25rem",fontSize:"0.8rem",fontWeight:500},children:[e.label," ",e.required&&(0,n.jsx)("span",{style:{color:"var(--color-error, #dc2626)"},children:"*"})]}),(0,n.jsx)("input",{type:"date",name:o,value:l,onChange:t=>f(r,e.name,t.target.value),required:e.required,style:v})]},o);default:return null}})(e,r))}),(0,n.jsx)("input",{type:"hidden",name:"".concat(t,"[").concat(r,"]"),value:JSON.stringify(x[r])})]},r))}),x.length<i&&(0,n.jsxs)("button",{type:"button",onClick:()=>{x.length<i&&g([...x,p()])},style:{display:"flex",alignItems:"center",gap:"0.5rem",padding:"0.5rem 1rem",fontSize:"0.9rem",fontWeight:500,color:"var(--color-primary, #2563eb)",backgroundColor:"transparent",border:"1px dashed var(--color-primary, #2563eb)",borderRadius:"var(--radius-default, 6px)",cursor:"pointer",transition:"all 0.2s",marginTop:"0.5rem"},onMouseOver:e=>{e.currentTarget.style.backgroundColor="var(--color-primary-light, #dbeafe)"},onMouseOut:e=>{e.currentTarget.style.backgroundColor="transparent"},children:[(0,n.jsx)("span",{style:{fontSize:"1.2rem",lineHeight:1},children:"+"}),c||"Add ".concat(o)]}),i>1&&(0,n.jsxs)("div",{style:{marginTop:"0.5rem",fontSize:"0.75rem",color:"var(--color-text-muted, #6b7280)"},children:[x.length," of ",i," ",1===x.length?o.toLowerCase():"".concat(o.toLowerCase(),"s"),s>0&&" (minimum ".concat(s,")")]})]})}},29033:(e,t,r)=>{"use strict";r.d(t,{InlineChat:()=>l});var n=r(29064),a=r(34340),o=r(75936);function l(e){let{heading:t,eyebrow:r,subheading:l,height:s,colorScheme:i,mode:c,corpusCategory:d}=e,[m,u]=(0,a.useState)([]),[h,p]=(0,a.useState)(""),[x,g]=(0,a.useState)(null),[f,b]=(0,a.useState)(null),[y,v]=(0,a.useState)(!1),[j,w]=(0,a.useState)(!0),k=(0,a.useRef)(null),N=(0,a.useRef)(null),C=(0,a.useMemo)(()=>(function(e){switch(e){case"primary-dark":return{bg:"var(--color-primary-dark)",fg:"var(--color-text-inverse)",accent:"var(--color-primary)"};case"accent":return{bg:"var(--color-accent)",fg:"var(--color-text-inverse)",accent:"var(--color-accent-dark)"};case"accent-dark":return{bg:"var(--color-accent-dark)",fg:"var(--color-text-inverse)",accent:"var(--color-accent)"};case"black":return{bg:"#0a0a0a",fg:"#ffffff",accent:"#374151"};default:return{bg:"var(--color-primary)",fg:"var(--color-text-inverse)",accent:"var(--color-primary-dark)"}}})(i),[i]),S=(0,a.useMemo)(()=>(function(e){if("vh"===e)return"85vh";let t=e?parseInt(e,10):NaN;return Number.isFinite(t)&&t>0?"".concat(t,"px"):"650px"})(s),[s]);(0,a.useEffect)(()=>{let e=!1;return fetch("/api/chat-widget".concat("public"===c?"?mode=public":"")).then(e=>e.json()).then(t=>{e||((null==t?void 0:t.error)?u([{id:"welcome",role:"assistant",content:"Hi! How can I help you today?"}]):(b(t),u([{id:"welcome",role:"assistant",content:t.welcome_message||"Hi! How can I help you today?"}])))}).catch(()=>{e||u([{id:"welcome",role:"assistant",content:"Hi! How can I help you today?"}])}).finally(()=>{e||w(!1)}),()=>{e=!0}},[c]),(0,a.useEffect)(()=>{let e=k.current;e&&(e.scrollTop=e.scrollHeight)},[m,y]);let _=(0,a.useCallback)(async e=>{let t=e.trim();if(t&&!y){u(e=>[...e,{id:"user-".concat(Date.now()),role:"user",content:t}]),p(""),v(!0);try{let e=await fetch("/api/chat-widget",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({message:t,session_id:x,..."public"===c?{force_public:!0}:{},...d?{corpus_category:d}:{}})}),r=await e.json();r.session_id&&g(r.session_id),u(e=>[...e,{id:"ai-".concat(Date.now()),role:"assistant",content:r.response||r.error||"Sorry, I could not process that."}])}catch(e){u(e=>[...e,{id:"err-".concat(Date.now()),role:"assistant",content:"Sorry, the chat is offline right now. Please try again in a moment."}])}finally{v(!1),setTimeout(()=>{var e;return null==(e=N.current)?void 0:e.focus()},50)}}},[y,x,c,d]),T=(0,a.useCallback)(e=>{e.preventDefault(),_(h)},[h,_]),q=(0,o.G)(null==f?void 0:f.suggested_prompts);return(0,n.jsx)("section",{className:"inline-chat-block",style:{padding:"2rem 1rem",backgroundColor:"var(--color-bg, #ffffff)"},children:(0,n.jsxs)("div",{style:{maxWidth:880,margin:"0 auto"},children:[(r||t||l)&&(0,n.jsxs)("div",{style:{textAlign:"center",marginBottom:"1.5rem"},children:[r&&(0,n.jsx)("p",{style:{fontSize:"0.75rem",textTransform:"uppercase",letterSpacing:"0.12em",fontWeight:600,color:C.bg,marginBottom:"0.5rem"},children:r}),t&&(0,n.jsx)("h2",{style:{fontSize:"2rem",fontWeight:700,margin:0,color:"var(--color-text-heading, var(--color-text-body))"},children:t}),l&&(0,n.jsx)("p",{style:{fontSize:"1rem",marginTop:"0.75rem",color:"var(--color-text-muted, #64748b)",lineHeight:1.6},children:l})]}),(0,n.jsxs)("div",{style:{display:"flex",flexDirection:"column",height:S,border:"1px solid var(--color-border, #e5e7eb)",borderRadius:12,overflow:"hidden",backgroundColor:"var(--color-bg, #ffffff)",boxShadow:"0 4px 24px rgba(0,0,0,0.06)"},children:[(0,n.jsxs)("div",{style:{padding:"0.75rem 1rem",backgroundColor:C.bg,color:C.fg,dis
1play:"flex",alignItems:"center",gap:"0.75rem"},children:[(0,n.jsx)("div",{"aria-hidden":"true",style:{width:32,height:32,borderRadius:"50%",backgroundColor:"rgba(255,255,255,0.2)",display:"flex",alignItems:"center",justifyContent:"center",fontWeight:700},children:((null==f?void 0:f.chatbot_name)||"A").charAt(0).toUpperCase()}),(0,n.jsxs)("div",{style:{lineHeight:1.2},children:[(0,n.jsx)("div",{style:{fontWeight:600},children:(null==f?void 0:f.chatbot_name)||"AI assistant"}),(0,n.jsx)("div",{style:{fontSize:"0.75rem",opacity:.85},children:(null==f?void 0:f.org_name)?"".concat(f.org_name," • online"):"online"})]})]}),(0,n.jsxs)("div",{ref:k,style:{flex:1,overflowY:"auto",padding:"1rem",display:"flex",flexDirection:"column",gap:"0.75rem",backgroundColor:"var(--color-bg-subtle, #f9fafb)"},children:[j&&(0,n.jsx)("div",{style:{color:"var(--color-text-muted, #64748b)",fontSize:"0.875rem"},children:"Connecting…"}),m.map(e=>(0,n.jsx)("div",{style:{alignSelf:"user"===e.role?"flex-end":"flex-start",maxWidth:"78%",padding:"0.625rem 0.875rem",borderRadius:12,backgroundColor:"user"===e.role?C.bg:"#ffffff",color:"user"===e.role?C.fg:"var(--color-text-body, #111827)",border:"user"===e.role?"none":"1px solid var(--color-border, #e5e7eb)",whiteSpace:"pre-wrap",wordBreak:"break-word",lineHeight:1.5,fontSize:"0.95rem"},children:e.content},e.id)),y&&(0,n.jsxs)("div",{style:{alignSelf:"flex-start",padding:"0.625rem 0.875rem",borderRadius:12,backgroundColor:"#ffffff",border:"1px solid var(--color-border, #e5e7eb)",fontSize:"0.95rem",color:"var(--color-text-muted, #64748b)"},children:[(0,n.jsx)("span",{"aria-hidden":!0,children:"●"})," ",(0,n.jsx)("span",{"aria-hidden":!0,children:"●"})," ",(0,n.jsx)("span",{"aria-hidden":!0,children:"●"}),(0,n.jsx)("span",{className:"sr-only",children:"Assistant is typing…"})]})]}),q.length>0&&0===m.filter(e=>"user"===e.role).length&&(0,n.jsx)("div",{style:{padding:"0.5rem 1rem",borderTop:"1px solid var(--color-border, #e5e7eb)",backgroundColor:"var(--color-bg, #ffffff)",display:"flex",gap:"0.5rem",flexWrap:"wrap"},children:q.map(e=>(0,n.jsx)("button",{type:"button",onClick:()=>_(e),disabled:y,style:{padding:"0.375rem 0.75rem",fontSize:"0.8125rem",border:"1px solid ".concat(C.bg),color:C.bg,backgroundColor:"transparent",borderRadius:999,cursor:y?"wait":"pointer"},children:e},e))}),(0,n.jsxs)("form",{onSubmit:T,style:{display:"flex",gap:"0.5rem",padding:"0.75rem 1rem",borderTop:"1px solid var(--color-border, #e5e7eb)",backgroundColor:"var(--color-bg, #ffffff)"},children:[(0,n.jsx)("input",{ref:N,type:"text",value:h,onChange:e=>p(e.target.value),placeholder:"Type your message…",disabled:y||j,autoComplete:"off","aria-label":"Message",style:{flex:1,padding:"0.625rem 0.875rem",border:"1px solid var(--color-border, #e5e7eb)",borderRadius:8,fontSize:"0.95rem",backgroundColor:"var(--color-bg, #ffffff)",color:"var(--color-text-body, #111827)"}}),(0,n.jsx)("button",{type:"submit",disabled:y||j||!h.trim(),style:{padding:"0.625rem 1.25rem",backgroundColor:C.bg,color:C.fg,border:"none",borderRadius:8,fontWeight:600,fontSize:"0.95rem",cursor:y||j||!h.trim()?"not-allowed":"pointer",opacity:y||j||!h.trim()?.6:1},children:"Send"})]})]}),(0,n.jsx)("p",{style:{textAlign:"center",fontSize:"0.75rem",color:"var(--color-text-muted, #94a3b8)",marginTop:"0.75rem"},children:"Powered by nooQ AI \xb7 Conversations are processed to help us serve you."})]})})}},36645:(e,t,r)=>{"use strict";r.d(t,{ClubsDirectoryBlock:()=>s});var n=r(29064),a=r(34340);function o(e){let{clubs:t=[],heading:r,description:o,layout:l="grid",columns:s="3",showCountyCardFilter:i=!0,showSearch:c=!0,sortBy:d="name",showLogo:m=!0,showAddress:u=!0,showPhone:h=!0,showWebsite:p=!0,showCountyCard:x=!0,showEstablished:g=!0,showHoles:f=!0,showCourseType:b=!1,backgroundColor:y="default",cardStyle:v="bordered"}=e,[j,w]=(0,a.useState)(""),[k,N]=(0,a.useState)(!1),C=(0,a.useMemo)(()=>{let e=t.filter(e=>{var t;let r=!j||e.name.toLowerCase().includes(j.toLowerCase())||(null==(t=e.address)?void 0:t.toLowerCase().includes(j.toLowerCase())),n=!k||!0===e.countyCard;return r&&n});return"name"===d?e=e.sort((e,t)=>
1e.name.localeCompare(t.name)):"established-asc"===d?e=e.sort((e,t)=>(e.established||"9999").localeCompare(t.established||"9999")):"established-desc"===d&&(e=e.sort((e,t)=>(t.established||"0000").localeCompare(e.established||"0000"))),e},[t,j,k,d]),S={default:"var(--color-bg)",subtle:"var(--color-bg-subtle)",muted:"var(--color-bg-muted)"},_={bordered:{border:"1px solid var(--color-border)",borderRadius:"8px"},shadow:{boxShadow:"0 2px 8px rgba(0,0,0,0.1)",borderRadius:"8px"},flat:{backgroundColor:"var(--color-bg-subtle)",borderRadius:"8px"}},T={2:"repeat(2, 1fr)",3:"repeat(3, 1fr)",4:"repeat(4, 1fr)"},q={parkland:"Parkland",links:"Links",heathland:"Heathland",moorland:"Moorland",downland:"Downland",mixed:"Mixed"};return(0,n.jsx)("section",{style:{backgroundColor:S[y]||S.default,padding:"var(--section-spacing, 2rem) 0"},children:(0,n.jsxs)("div",{className:"container",children:[(r||o)&&(0,n.jsxs)("div",{style:{marginBottom:"2rem"},children:[r&&(0,n.jsx)("h2",{style:{fontSize:"2rem",fontWeight:700,marginBottom:"0.5rem"},children:r}),o&&(0,n.jsx)("p",{style:{color:"var(--color-text-muted)"},children:o})]}),(c||i)&&(0,n.jsxs)("div",{style:{display:"flex",gap:"1rem",marginBottom:"1.5rem",flexWrap:"wrap",alignItems:"center"},children:[c&&(0,n.jsx)("input",{type:"text",placeholder:"Search clubs...",value:j,onChange:e=>w(e.target.value),style:{padding:"0.5rem 1rem",borderRadius:"4px",border:"1px solid var(--color-border)",minWidth:"200px",flex:"1",maxWidth:"300px"}}),i&&(0,n.jsxs)("label",{style:{display:"flex",alignItems:"center",gap:"0.5rem",cursor:"pointer"},children:[(0,n.jsx)("input",{type:"checkbox",checked:k,onChange:e=>N(e.target.checked),style:{width:"18px",height:"18px"}}),(0,n.jsx)("span",{children:"County Card clubs only"})]}),(0,n.jsxs)("span",{style:{color:"var(--color-text-muted)",marginLeft:"auto"},children:[C.length," club",1!==C.length?"s":""]})]}),"grid"===l&&(0,n.jsx)("div",{style:{display:"grid",gridTemplateColumns:T[s]||T["3"],gap:"1.5rem"},children:C.map(e=>{var t;return(0,n.jsxs)("div",{style:{padding:"1.5rem",backgroundColor:"white",..._[v]},children:[m&&(null==(t=e.logo)?void 0:t.url)&&(0,n.jsx)("img",{src:e.logo.url,alt:e.logo.alt||e.name,loading:"lazy",style:{width:"80px",height:"80px",objectFit:"contain",marginBottom:"1rem"}}),(0,n.jsx)("h3",{style:{fontWeight:600,fontSize:"clamp(0.938rem, 2.5vw, 1.125rem)",marginBottom:"0.5rem"},children:e.name}),x&&(0,n.jsx)("span",{style:{display:"inline-block",padding:"2px 8px",borderRadius:"4px",fontSize:"0.75rem",fontWeight:600,backgroundColor:e.countyCard?"#D1FAE5":"#F3F4F6",color:e.countyCard?"#065F46":"#6B7280",marginBottom:"0.75rem"},children:e.countyCard?"County Card":"No County Card"}),u&&e.address&&(0,n.jsx)("p",{style:{fontSize:"clamp(0.75rem, 2vw, 0.875rem)",color:"var(--color-text-muted)",marginBottom:"0.5rem"},children:e.address}),(0,n.jsxs)("div",{style:{display:"flex",flexWrap:"wrap",gap:"0.5rem",marginBottom:"0.75rem",fontSize:"clamp(0.7rem, 1.8vw, 0.8rem)",color:"var(--color-text-muted)"},children:[g&&e.established&&(0,n.jsxs)("span",{children:["Est. ",e.established]}),f&&e.holes&&(0,n.jsxs)("span",{children:[e.holes," holes"]}),b&&e.courseType&&(0,n.jsx)("span",{children:q[e.courseType]||e.courseType})]}),h&&e.phone&&(0,n.jsx)("p",{style:{fontSize:"clamp(0.75rem, 2vw, 0.875rem)",marginBottom:"0.25rem"},children:(0,n.jsx)("a",{href:"tel:".concat(e.phone),style:{color:"inherit"},children:e.phone})}),p&&e.website&&(0,n.jsx)("a",{href:e.website,target:"_blank",rel:"noopener noreferrer",style:{display:"inline-block",marginTop:"0.5rem",color:"var(--color-primary)",textDecoration:"none",fontWeight:500,fontSize:"clamp(0.75rem, 2vw, 0.875rem)"},children:"Visit Website →"})]},e.id)})}),"list"===l&&(0,n.jsx)("div",{style:{display:"flex",flexDirection:"column",gap:"1rem"},children:C.map(e=>{var t;return(0,n.jsxs)("div",{style:{display:"flex",gap:"1.5rem",padding:"1.5rem",backgroundColor:"white",alignItems:"center",..._[v]},children:[m&&(null==(t=e.logo)?void 0:t.url)&&(0,n.jsx)("img",{src:e.logo.url,alt:e.logo.alt||e.name,loading:"lazy",style:{width:"80px",height:"80px",objectFit:"contain",flexShrink:0}}),(0,n.jsxs)("div",{style:{flex:1},children:[(0,n.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"1rem",marginBottom:"0.25rem"},children:[(0,n.jsx)("h3",{style:{fontWeight:600,fontSize:"clamp(0.938rem, 2.5vw, 1.125rem)",margin:0},children:e.name}),x&&(0,n.jsx)("span",{style:{padding:"2px 8px",borderRadius:"4px",fontSize:"0.75rem",fontWeight:600,backgroundColor:e.countyCard?"#D1FAE5":"#F3F4F6",color:e.countyCard?"#065F46":"#6B7280"},children:e.countyCard?"County Card":"No CC"})]}),u&&e.address&&(0,n.jsx)("p",{style:{fontSize:"0.875rem",color:"var(--color-text-muted)",margin:"0.25rem 0"},children:e.address}),(0,n.jsxs)("div",{style:{display:"flex",gap:"1rem",fontSize:"0.8rem",color:"var(--color-text-muted)"},children:[g&&e.established&&(0,n.jsxs)("span",{children:["Est. ",e.established]}),f&&e.holes&&(0,n.jsxs)("span",{children:[e.holes," holes"]}),b&&e.courseType&&(0,n.jsx)("span",{children:q[e.courseType]})]})]}),(0,n.jsxs)("div",{style:{textAlign:"right",flexShrink:0},children:[h&&e.phone&&(0,n.jsx)("p",{style:{fontSize:"0.875rem",margin:"0.25rem 0"},children:(0,n.jsx)("a",{href:"tel:".concat(e.phone),style:{color:"inherit"},children:e.phone})}),p&&e.website&&(0,n.jsx)("a",{href:e.website,target:"_blank",rel:"noopener noreferrer",style:{color:"var(--color-primary)",textDecoration:"none",fontWeight:500,fontSize:"0.875rem"},children:"Visit Website →"})]})]},e.id)})}),"table"===l&&(0,n.jsx)("div",{style:{overflowX:"auto"},children:(0,n.jsxs)("table",{style:{width:"100%",borderCollapse:"collapse",fontSize:"0.875rem"},children:[(0,n.jsx)("thead",{children:(0,n.jsxs)("tr",{style:{backgroundColor:"var(--color-bg-subtle)",textAlign:"left"},children:[m&&(0,n.jsx)("th",{style:{padding:"0.75rem",borderBottom:"2px s
1olid var(--color-border)"}}),(0,n.jsx)("th",{style:{padding:"0.75rem",borderBottom:"2px solid var(--color-border)"},children:"Club"}),u&&(0,n.jsx)("th",{style:{padding:"0.75rem",borderBottom:"2px solid var(--color-border)"},children:"Location"}),g&&(0,n.jsx)("th",{style:{padding:"0.75rem",borderBottom:"2px solid var(--color-border)"},children:"Est."}),f&&(0,n.jsx)("th",{style:{padding:"0.75rem",borderBottom:"2px solid var(--color-border)"},children:"Holes"}),x&&(0,n.jsx)("th",{style:{padding:"0.75rem",borderBottom:"2px solid var(--color-border)"},children:"CC"}),h&&(0,n.jsx)("th",{style:{padding:"0.75rem",borderBottom:"2px solid var(--color-border)"},children:"Phone"}),p&&(0,n.jsx)("th",{style:{padding:"0.75rem",borderBottom:"2px solid var(--color-border)"},children:"Website"})]})}),(0,n.jsx)("tbody",{children:C.map((e,t)=>{var r;return(0,n.jsxs)("tr",{style:{backgroundColor:t%2==0?"white":"var(--color-bg-subtle)"},children:[m&&(0,n.jsx)("td",{style:{padding:"0.75rem",borderBottom:"1px solid var(--color-border)"},children:(null==(r=e.logo)?void 0:r.url)&&(0,n.jsx)("img",{src:e.logo.url,alt:"",loading:"lazy",style:{width:"40px",height:"40px",objectFit:"contain"}})}),(0,n.jsx)("td",{style:{padding:"0.75rem",borderBottom:"1px solid var(--color-border)",fontWeight:500},children:e.name}),u&&(0,n.jsx)("td",{style:{padding:"0.75rem",borderBottom:"1px solid var(--color-border)",color:"var(--color-text-muted)"},children:e.address}),g&&(0,n.jsx)("td",{style:{padding:"0.75rem",borderBottom:"1px solid var(--color-border)"},children:e.established}),f&&(0,n.jsx)("td",{style:{padding:"0.75rem",borderBottom:"1px solid var(--color-border)"},children:e.holes}),x&&(0,n.jsx)("td",{style:{padding:"0.75rem",borderBottom:"1px solid var(--color-border)"},children:(0,n.jsx)("span",{style:{padding:"2px 6px",borderRadius:"4px",fontSize:"0.7rem",fontWeight:600,backgroundColor:e.countyCard?"#D1FAE5":"#F3F4F6",color:e.countyCard?"#065F46":"#6B7280"},children:e.countyCard?"Yes":"No"})}),h&&(0,n.jsx)("td",{style:{padding:"0.75rem",borderBottom:"1px solid var(--color-border)"},children:e.phone&&(0,n.jsx)("a",{href:"tel:".concat(e.phone),style:{color:"inherit"},children:e.phone})}),p&&(0,n.jsx)("td",{style:{padding:"0.75rem",borderBottom:"1px solid var(--color-border)"},children:e.website&&(0,n.jsx)("a",{href:e.website,target:"_blank",rel:"noopener noreferrer",style:{color:"var(--color-primary)"},children:"Visit"})})]},e.id)})})]})})]})})}var l=r(90420);function s(e){let{heading:t,description:r,counties:s=[],layout:i="grid",columns:c="3",showCountyCardFilter:d=!0,showSearch:m=!0,sortBy:u="name",limit:h,showLogo:p=!0,showAddress:x=!0,showPhone:g=!0,showWebsite:f=!0,showCountyCard:b=!0,showEstablished:y=!0,showHoles:v=!0,showCourseType:j=!1,backgroundColor:w="default",cardStyle:k="bordered"}=e,[N,C]=(0,a.useState)([]),[S,_]=(0,a.useState)(!0),[T,q]=(0,a.useState)(null);if((0,a.useEffect)(()=>{(async()=>{if(0===s.length)return _(!1);try{let e=await (0,l.i)(s,{sortBy:u,limit:h||void 0});C(e)}catch(e){q(e instanceof Error?e.message:"Failed to load clubs")}finally{_(!1)}})()},[s,u,h]),S){let e={default:"var(--color-bg)",subtle:"var(--color-bg-subtle)",muted:"var(--color-bg-muted)"};return(0,n.jsx)("section",{style:{backgroundColor:e[w]||e.default,padding:"var(--section-spacing, 2rem) 0"},children:(0,n.jsxs)("div",{className:"container",children:[t&&(0,n.jsx)("h2",{style:{fontSize:"2rem",fontWeight:700,marginBottom:"0.5rem"},children:t}),r&&(0,n.jsx)("p",{style:{color:"var(--color-text-muted)",marginBottom:"2rem"},children:r}),(0,n.jsx)("div",{style:{textAlign:"center",padding:"2rem"},children:(0,n.jsx)("p",{style:{color:"var(--color-text-muted)"},children:"Loading clubs..."})})]})})}return T?(0,n.jsx)("section",{style:{padding:"var(--section-spacing, 2rem) 0"},children:(0,n.jsx)("div",{className:"container",children:(0,n.jsx)("div",{style:{textAlign:"center",padding:"2rem",backgroundColor:"#fee2e2",borderRadius:"8px"},children:(0,n.jsxs)("p",{style:{color:"#dc2626"},children:["Error loading clubs: ",T]})})})}):0===s.length?(0,n.jsx)("section",{style:{padding:"var(--section-spacing, 2rem) 0"},children:(0,n.jsx)("div",{className:"container",children:(0,n.jsx)("div",{style:{textAlign:"center",padding:"2rem",backgroundColor:"#fef3c7",borderRadius:"8px"},children:(0,n.jsx)("p",{style:{color:"#92400e"},children:"No counties selected. Please configure this block to select counties."})})})}):(0,n.jsx)(o,{clubs:N,heading:t,description:r,layout:i,columns:c,showCountyCardFilter:d,showSearch:m,sortBy:u,showLogo:p,showAddress:x,showPhone:g,showWebsite:f,showCountyCard:b,showEstablished:y,showHoles:v,showCourseType:j,backgroundColor:w,cardStyle:k})}},39911:(e,t,r)=>{"use strict";r.r(t),r.d(t,{PurchaseConfirmation:()=>s});
1var n=r(29064),a=r(34340),o=r(23554);let l=["purchase","package","gift"],s=e=>{let{pollIntervalMs:t=2e3,timeoutMs:r=3e4}=e,[s,i]=a.useState(null),[c,d]=a.useState("pending"),[m,u]=a.useState(null);if(a.useEffect(()=>{let e=new URLSearchParams(window.location.search);if(!l.some(t=>"success"===e.get(t)))return;let t=e.get("session_id");t&&i(t)},[]),a.useEffect(()=>{let e;if(!s)return;let n=!1,a=Date.now()+r,o=async()=>{try{let e=await fetch("/api/shop/order-status?session_id=".concat(encodeURIComponent(s)),{cache:"no-store"}),t=await e.json();if(n)return;if((null==t?void 0:t.status)==="confirmed"){var r,l,i,c;u({bookingRef:null!=(r=t.bookingRef)?r:null,amount:"number"==typeof t.amount?t.amount:null,currency:null!=(l=t.currency)?l:null,isTest:!0===t.isTest,receiptByEmail:!0===t.receiptByEmail,items:Array.isArray(t.items)?t.items:[],packageName:null!=(i=t.packageName)?i:null,totalLessons:"number"==typeof t.totalLessons?t.totalLessons:null,redemptionCode:null!=(c=t.redemptionCode)?c:null}),d("confirmed");return}}catch(e){}if(!n){if(Date.now()>=a)return void d("timed-out");e=setTimeout(o,t)}};return o(),()=>{n=!0,e&&clearTimeout(e)}},[s,t,r]),!s)return null;let h=m?function(e,t){if("number"!=typeof e)return null;try{return new Intl.NumberFormat("en-GB",{style:"currency",currency:(t||"GBP").toUpperCase()}).format(e/100)}catch(e){return null}}(m.amount,m.currency):null;return(0,n.jsxs)("section",{role:"status","aria-live":"polite",className:"mb-6 rounded border border-emerald-300 bg-emerald-50 px-4 py-3 text-emerald-900",children:[(null==m?void 0:m.isTest)&&(0,n.jsx)(o.C,{}),(0,n.jsx)("p",{className:"text-base font-semibold",children:"Payment received. Thank you."}),"confirmed"===c&&m?(0,n.jsxs)("div",{className:"mt-2 text-sm",children:[m.bookingRef&&(0,n.jsxs)("p",{children:["Your reference is ",(0,n.jsx)("strong",{children:m.bookingRef}),"."]}),m.packageName&&(0,n.jsxs)("p",{children:[(0,n.jsx)("strong",{children:m.packageName}),m.totalLessons?" — ".concat(m.totalLessons," lessons"):""]}),m.redemptionCode&&(0,n.jsxs)("div",{className:"mt-2 rounded border border-emerald-400 bg-white px-3 py-2",children:[(0,n.jsx)("p",{className:"text-xs uppercase tracking-wide",children:"Your redemption code"}),(0,n.jsx)("p",{className:"font-mono text-xl font-bold tracking-wider",children:m.redemptionCode}),(0,n.jsx)("p",{className:"mt-1 text-xs",children:"Keep this — it is how your package is added to your account. Quote it to the pro shop when you book."})]}),m.items.length>0&&(0,n.jsx)("ul",{className:"mt-1 list-inside list-disc",children:m.items.map((e,t)=>(0,n.jsxs)("li",{children:[e.quantity," \xd7 ",e.title||"Item"]},t))}),h&&(0,n.jsxs)("p",{className:"mt-1",children:["Total paid: ",h]}),m.receiptByEmail?(0,n.jsx)("p",{className:"mt-2",children:"A confirmation email is on its way to you."}):(0,n.jsx)("p",{className:"mt-2",children:"It has been added to your account and is ready to book against."})]}):"pending"===c?(0,n.jsx)("p",{className:"mt-2 text-sm",children:"Confirming your order…"}):(0,n.jsxs)("div",{className:"mt-2 text-sm",children:[(0,n.jsx)("p",{children:"We haven’t been able to confirm it on your account yet. This usually sorts itself out within a few minutes."}),(0,n.jsxs)("p",{className:"mt-1",children:["If it hasn’t, contact us quoting ",(0,n.jsx)("strong",{children:s}),"."]})]})]})}},40156:(e,t,r)=>{"use strict";r.d(t,{DocumentsAccordion:()=>h});var n=r(29064),a=r(34340),o=r(35501),l=r(30953),s=r(1181),i=r(51487);let c=e=>{let{size:t=24}=e;return(0,n.jsxs)("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,n.jsx)("path",{d:"M14 2H6C4.9 2 4 2.9 4 4V20C4 21.1 4.9 22 6 22H18C19.1 22 20 21.1 20 20V8L14 2Z",fill:"#E53935"}),(0,n.jsx)("path",{d:"M14 2V8H20L14 2Z",fill:"#FFCDD2"}),(0,n.jsx)("text",{x:"12",y:"16",textAnchor:"middle",fontSize:"6",fontWeight:"bold",fill:"white",children:"PDF"})]})},d=e=>{let{size:t=24}=e;return(0,n.jsxs)("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,n.jsx)("path",{d:"M14 2H6C4.9 2 4 2.9 4 4V20C4 21.1 4.9 22 6 22H18C19.1 22 20 21.1 20 20V8L14 2Z",fill:"#1976D2"}),(0,n.jsx)("path",{d:"M14 2V8H20L14 2Z",fill:"#BBDEFB"}),(0,n.jsx)("text",{x:"12",y:"16",textAnchor:"middle",fontSize:"5",fontWeight:"bold",fill:"white",children:"DOC"})]})},m=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:40;switch(e){case"pdf":return(0,n.jsx)(c,{size:t});case"doc":case"docx":return(0,n.jsx)(d,{size:t});default:return(0,n.jsx)(o.A,{size:t,style:{color:"var(--color-primary)"}})}},u=(e,t)=>
1[...e].sort((e,r)=>{switch(t){case"name-asc":return(e.title||"").localeCompare(r.title||"");case"name-desc":return(r.title||"").localeCompare(e.title||"");case"date-desc":{let t=new Date(e.publishedAt||e.createdAt||0).getTime();return new Date(r.publishedAt||r.createdAt||0).getTime()-t}case"date-asc":return new Date(e.publishedAt||e.createdAt||0).getTime()-new Date(r.publishedAt||r.createdAt||0).getTime();default:return 0}}),h=e=>{let{documents:t,categories:r=[],filterCategories:o=[],layout:c,accordionOptions:d={},styling:h={},heading:p,headingAlignment:x="left",description:g}=e,{groupByCategory:f=!0,defaultExpanded:b="first",allowMultiple:y=!1}=d,{showIcons:v=!0,showDescriptions:j=!0,showDates:w=!1,showSort:k=!0}=h,[N,C]=(0,a.useState)("name-asc"),[S,_]=(0,a.useState)([]),[T,q]=(0,a.useState)(!1);(0,a.useEffect)(()=>{if(t.length>0||0===o.length)return;let e=o.map(e=>e.id).filter(Boolean);if(0===e.length)return;q(!0);let r=new URLSearchParams({depth:"1",limit:"200"});e.forEach(e=>r.append("where[categories][in][]",String(e))),fetch("/api/documents?".concat(r)).then(e=>e.ok?e.json():null).then(e=>{(null==e?void 0:e.docs)&&_(e.docs)}).catch(()=>{}).finally(()=>q(!1))},[t.length,o]);let B=t.length>0?t:S,z={};o.length>0&&f?(o.forEach(e=>{var t;let r=(null==(t=e.id)?void 0:t.toString())||"",n=e.title||"Uncategorized";z[r]={category:{id:e.id,title:n},docs:[]}}),B.forEach(e=>{if((e.categories||[]).forEach(t=>{var r;let n=(null==(r=t.id)?void 0:r.toString())||"";z[n]&&z[n].docs.push(e)}),e.category){var t,r;let n=o.find(t=>{var r,n;return(null==(r=t.title)?void 0:r.toLowerCase())===(null==(n=e.category)?void 0:n.toLowerCase())});n&&z[(null==(t=n.id)?void 0:t.toString())||""]&&z[(null==(r=n.id)?void 0:r.toString())||""].docs.push(e)}})):f?B.forEach(e=>{let t=e.categories||[];0===t.length?(z.uncategorized||(z.uncategorized={category:{title:"Other Documents"},docs:[]}),z.uncategorized.docs.push(e)):t.forEach(t=>{var r;let n=(null==(r=t.id)?void 0:r.toString())||t.title||"uncategorized";z[n]||(z[n]={category:t,docs:[]}),z[n].docs.push(e)})}):z.all={category:{title:""},docs:B};let M=Object.values(z).filter(e=>e.docs.length>0).map(e=>({...e,docs:u(e.docs,N)})),[P,L]=(0,a.useState)(()=>"all"===b?M.map((e,t)=>t):"first"===b&&M.length>0?[0]:[]),D=()=>(0,n.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"0.5rem",marginBottom:"1rem",fontSize:"var(--text-small)"},children:[(0,n.jsx)("span",{style:{color:"var(--color-text-muted)"},children:"Sort by:"}),(0,n.jsxs)("select",{value:N,onChange:e=>C(e.target.value),style:{padding:"0.375rem 0.75rem",borderRadius:"var(--radius-md)",border:"1px solid var(--color-border)",backgroundColor:"var(--color-bg)",color:"var(--color-text)",fontSize:"var(--text-small)",cursor:"pointer"},children:[(0,n.jsx)("option",{value:"name-asc",children:"Name (A-Z)"}),(0,n.jsx)("option",{value:"name-desc",children:"Name (Z-A)"}),(0,n.jsx)("option",{value:"date-desc",children:"Date (Newest)"}),(0,n.jsx)("option",{value:"date-asc",children:"Date (Oldest)"})]})]}),W=(e,t)=>{var r;let a=(null==(r=e.file)?void 0:r.url)||e.externalUrl||"#",o=e.fileType||(a.endsWith(".pdf")?"pdf":a.includes(".doc")?"doc":"other");return(0,n.jsxs)("a",{href:(0,i.e)(a),target:"_blank",rel:"noopener noreferrer",style:{display:"flex",alignItems:"center",gap:"1rem",padding:"0.875rem 1rem",backgroundColor:"var(--color-bg)",textDecoration:"none",color:"inherit",borderBottom:"1px solid var(--color-border)",transition:"background-color 0.2s"},className:"document-item",children:[v&&(0,n.jsx)("div",{style:{flexShrink:0},children:m(o,36)}),(0,n.jsxs)("div",{style:{flex:1,minWidth:0},children:[(0,n.jsx)("div",{style:{fontWeight:500,color:"var(--color-text)"},children:e.title}),j&&e.description&&(0,n.jsx)("p",{style:{margin:"0.25rem 0 0",fontSize:"var(--text-small)",color:"var(--color-text-muted)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e.description})]}),(0,n.jsx)(l.A,{size:18,style:{color:"var(--color-text-muted)",flexShrink:0}})]},t)};if("list"===c){let e=u(B,N);return(0,n.jsxs)("div",{children:[p&&(0,n.jsx)("h2",{style:{marginBottom:"0.5rem",textAlign:x},children:p}),g&&(0,n.jsx)("p",{style:{color:"var(--color-text-muted)",marginBottom:"1.5rem",textAlign:x},children:g}),k&&D(),(0,n.jsx)("div",{style:{border:"1px solid var(--color-border)",borderRadius:"var(--radius-lg)",overflow:"hidden"},children:e.map((e,t)=>W(e,t))})]})}if("accordion"===c)return(0,n.jsxs)("div",{children:[p&&(0,n.jsx)("h2",{style:{marginBottom:"0.5rem",textAlign:x},children:p}),g&&(0,n.jsx)("p",{style:{color:"var(--color-text-muted)",marginBottom:"1.5rem",textAlign:x},children:g}),k&&D(),(0,n.jsx)("div",{style:{display:"flex",flexDirection:"column",gap:"0.5rem"},children:M.map((e,t)=>{let r=P.includes(t);return(0,n.jsxs)("div",{style:{border:"1px solid var(--color-border)",borderRadius:"var(--radius-lg)",overflow:"hidden"},children:[(0,n.jsxs)("button",{type:"button",onClick:()=>(e=>{L(t=>t.includes(e)?t.filter(t=>t!==e):y?[...t,e]:[e])})(t),style:{width:"100%",display:"flex",alignItems:"center",justifyContent:"space-between",padding:"1rem 1.25rem",backgroundColor:"var(--color-bg-subtle)",border:"none",cursor:"pointer",textAlign:"left"},children:[(0,n.jsxs)("span",{style:{fontWeight:600,fontSize:"1.1rem"},children:[e.category.title,(0,n.jsxs)("span",{style:{fontWeight:400,color:"var(--color-text-muted)",marginLeft:"0.5rem",fontSize:"0.9rem"},children:["(",e.docs.length," ",1===e.docs.length?"document":"documents",")"]})]}),(0,n.jsx)(s.A,{size:20,style:{color:"var(--color-text-muted)",transition:"transform 0.2s",transform:r?"rotate(180deg)":"rotate(0)"}})]}),(0,n.jsx)("div",{style:{maxHeight:r?"".concat(100*e.docs.length,"px"):"0",overflow:"hidden",transition:"max-height 0.3s ease-in-out"},children:e.docs.map((e,t)=>W(e,t))})]},t)})})]});if(T)return(0,n.jsxs)("div",{children:[p&&(0,n.jsx)("h2",{style:{marginBottom:"0.5rem",textAlign:x},children:p}),g&&(0,n.jsx)("p",{style:{color:"var(--color-text-muted)",marginBottom:"1.5rem",textAlign:x},children:g}),(0,n.jsx)("p",{style:{color:"var(--color-text-muted)",padding:"2rem 0",textAlign:"center"},children:"Loading documents..."})]});let A=u(B,N);return(0,n.jsxs)("div",{children:[p&&(0,n.jsx)("h2",{style:{marginBottom:"0.5rem",textAlign:x},children:p}),g&&(0,n.jsx)("p",{style:{color:"var(--color-text-muted)",marginBottom:"1.5rem",textAlign:x},children:g}),k&&D(),(0,n.jsx)("div",{style:{display:"grid",gap:"1rem",gridTemplateColumns:"repeat(auto-fill, minmax(280px, 1fr))"},children:A.map((e,t)=>{var r;let a=(null==(r=e.file)?void 0:r.url)||e.externalUrl||"#",o=e.fileType||(a.endsWith(".pdf")?"pdf":
1a.includes(".doc")?"doc":"other");return(0,n.jsxs)("a",{href:(0,i.e)(a),target:"_blank",rel:"noopener noreferrer",style:{display:"flex",flexDirection:"column",padding:"1.5rem",backgroundColor:"var(--color-bg)",borderRadius:"var(--radius-lg)",textDecoration:"none",color:"inherit",border:"1px solid var(--color-border)",transition:"transform 0.2s, box-shadow 0.2s"},className:"document-card",children:[(0,n.jsx)("div",{style:{marginBottom:"1rem"},children:m(o,48)}),(0,n.jsx)("h4",{style:{margin:"0 0 0.5rem",fontWeight:600},children:e.title}),j&&e.description&&(0,n.jsx)("p",{style:{margin:0,fontSize:"var(--text-small)",color:"var(--color-text-muted)"},children:e.description})]},t)})}),(0,n.jsx)("style",{children:"\n        .document-item:hover {\n          background-color: var(--color-bg-subtle) !important;\n        }\n        .document-card:hover {\n          transform: translateY(-2px);\n          box-shadow: 0 4px 12px rgba(0,0,0,0.1);\n        }\n      "})]})}},42856:(e,t,r)=>{"use strict";r.d(t,{BuyPackageButton:()=>l});var n=r(29064),a=r(34340),o=r(23554);function l(e){let{packageId:t,label:r="Buy now",maxPerOrder:l=1,className:s,stripeMode:i}=e,[c,d]=a.useState(!1),[m,u]=a.useState(null),[h,p]=a.useState(1),x=Math.max(1,Math.floor(l)),g="pkg-qty-".concat(t),f=async()=>{d(!0),u(null);try{let e=function(){try{var e;let t=null==(e=new URLSearchParams(window.location.search).get("booking"))?void 0:e.trim();return t&&t.length<=64?t:void 0}catch(e){return}}(),r=await fetch("/api/shop/package-checkout",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({package_id:t,quantity:h,success_path:"".concat(window.location.pathname,"?package=success"),cancel_path:window.location.pathname,...e?{booking_id:e}:{}})});if(!r.ok){let e=await r.json().catch(()=>({}));throw Error((null==e?void 0:e.error)||"Checkout failed (".concat(r.status,")"))}let{checkoutUrl:n}=await r.json();if(n){window.location.href=n;return}throw Error("No checkout URL returned")}catch(e){u(e instanceof Error?e.message:"Checkout failed"),d(!1)}};return(0,n.jsxs)("div",{className:s,children:["test"===i&&(0,n.jsx)(o.C,{}),(0,n.jsxs)("div",{style:{display:"inline-flex",alignItems:"center",gap:"0.5rem"},children:[x>1?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("label",{htmlFor:g,style:{fontSize:"0.875rem",fontWeight:500,color:"#374151"},children:"Qty"}),(0,n.jsx)("select",{id:g,value:h,disabled:c,onChange:e=>p(Number(e.target.value)),style:{fontSize:"0.875rem",padding:"0.65rem 0.5rem",borderRadius:"0.375rem",border:"1px solid #d1d5db",backgroundColor:"#ffffff",color:"#111827",lineHeight:1.2},children:Array.from({length:x},(e,t)=>t+1).map(e=>(0,n.jsx)("option",{value:e,children:e},e))})]}):null,(0,n.jsx)("button",{type:"button",onClick:f,disabled:c,style:{display:"inline-flex",alignItems:"center",justifyContent:"center",backgroundColor:c?"#3d9140":"#4CAF50",color:"#ffffff",fontSize:"0.875rem",fontWeight:600,padding:"0.75rem 1.25rem",borderRadius:"0.375rem",border:"none",cursor:c?"not-allowed":"pointer",opacity:c?.7:1,lineHeight:1.2},children:c?"Redirecting…":r})]}),m?(0,n.jsx)("p",{style:{marginTop:"0.5rem",fontSize:"0.875rem",color:"#dc2626"},children:m}):null]})}},43047:(e,t,r)=>{"use strict";r.d(t,{GolfGeniusCompetitionListBlock:()=>D});var n=r(29064),a=r(34340),o=r(87482),l=r(10021),s=r(82326),i=r(52733);function c(e){let t=e.zone_start&&e.zone_end?"".concat(e.zone_start,"–").concat(e.zone_end):"";return t&&e.label?e.label.includes(e.zone_start)?e.label:"".concat(e.label," \xb7 ").concat(t):e.label||t}function d(e,t,r){let n=t?(e.zones||[]).find(e=>e.zone_id===t):void 0;return n?c(n):null!=r?r:null}let m={fontSize:"0.875rem",lineHeight:"1.25rem",fontWeight:500},u={...m,border:"1px solid #d1d5db"},h="/api/tee-booking/competitions",p=e=>{let{accent:t}=e;return(0,n.jsx)("a",{href:function(){let e="".concat(window.location.pathname).concat(window.location.search);return"/auth/zitadel/login?return_to=".concat(encodeURIComponent(e))}(),className:"px-3 py-1.5 text-sm font-medium rounded-md",style:{...m,backgroundColor:t,color:"#ffffff",border:"1px solid ".concat(t)},children:"Sign in to enter"})};function x(){let e=globalThis.crypto;return(null==e?void 0:e.randomUUID)?e.randomUUID():"".concat(Date.now(),"-").concat(Math.random().toString(36).slice(2))}async function g(e,t,r){let n=await fetch(e,{method:t,headers:{"Content-Type":"application/json"},credentials:"same-origin",body:JSON.stringify(r)}),a=await n.json().catch(()=>({}));if(200===n.status)return a;
1if(202===n.status&&(null==a?void 0:a.request_id)){for(let e=0;e<30;e++){await new Promise(e=>setTimeout(e,1e3));let e=await fetch("".concat(h,"/requests/").concat(encodeURIComponent(a.request_id)),{cache:"no-store",credentials:"same-origin"});if(!e.ok)continue;let t=await e.json();if(null==t?void 0:t.result)return t.result}return{status:"pending"}}if(401===n.status)return{status:"rejected",reason:"signed_out"};let o=null==a?void 0:a.detail;return{status:"rejected",reason:"object"==typeof o&&(null==o?void 0:o.reason)?o.reason:"error"}}async function f(e,t){try{let r=await fetch("".concat(h,"/").concat(encodeURIComponent(e),"/hold"),{method:"PUT",headers:{"Content-Type":"application/json"},credentials:"same-origin",body:JSON.stringify(t)}),n=await r.json().catch(()=>({}));if(r.ok&&(null==n?void 0:n.hold))return{hold:n.hold};if(401===r.status)return{reason:"signed_out"};let a=null==n?void 0:n.detail;return{reason:"object"==typeof a&&(null==a?void 0:a.reason)?a.reason:"error"}}catch(e){return{reason:"error"}}}let b={already_entered:"You're already entered.",partner_already_entered:"One of your partners is already entered.",ineligible:"You aren't eligible for this competition.",partner_ineligible:"One of your partners isn't eligible for this competition.",not_open_yet:"Entries aren't open yet.",closed:"Entries have closed.",competition_full:"This competition is full.",waitlist_full:"The competition and its waiting list are full.",zone_not_found:"That time is no longer available — please choose again.",zone_full:"That time is full — please choose another.",not_found:"This competition is no longer available.",partners_not_allowed:"This competition is entered individually.",party_too_large:"Too many players for this format.",signed_out:"Please sign in again to enter.",queue_unavailable:"Entries are busy right now — please try again in a moment.",not_entered:"You're not entered in this competition.",party_no_longer_fits:"There isn't room for that change — your entry is unchanged."};function y(e,t){let r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if("entered"===e.status&&t&&e.zone_label&&(e={...e,zone_label:d(t,e.zone_id,e.zone_label)}),r&&"entered"===e.status)return{tone:"ok",text:e.zone_label?"Entry updated — ".concat(e.zone_label,"."):"Entry updated."};if(r&&"waitlisted"===e.status)return{tone:"wait",text:"Entry updated — you're still on the waiting list."};if("entered"===e.status)return e.zone_label&&e.zone_reassigned?{tone:"ok",text:"You're entered. Your chosen time was full, so you're in ".concat(e.zone_label,".")}:{tone:"ok",text:e.zone_label?"You're entered — ".concat(e.zone_label,"."):"You're entered."};if("waitlisted"===e.status){let t=e.waitlist_position?" (position ".concat(e.waitlist_position,")"):"";return{tone:"wait",text:"The competition is full — you're on the waiting list".concat(t,".")}}return"withdrawn"===e.status?{tone:"ok",text:"You've withdrawn."}:"withdrawn_late"===e.status?{tone:"ok",text:"You've withdrawn — it's past the club's cutoff, so the pro shop has been told."}:"pending"===e.status?{tone:"wait",text:"We're still processing your entry — check back in a minute."}:{tone:"bad",text:b[e.reason||""]||"Your entry could not be made. Please try again."}}let v=e=>{let{comp:t,accent:r,onEntered:o}=e,[l,s]=(0,a.useState)(!1),[i,c]=(0,a.useState)(!1),[h,p]=(0,a.useState)(!1),x=!!t.my_entry&&"open"===t.registration.status&&(null==t.my_entry.party_role||"lead"===t.my_entry.party_role),g=null;if(t.my_entry){let e=(0,n.jsx)("span",{"data-testid":"nooq-my-entry",className:"inline-flex items-center px-2 py-0.5 text-xs font-medium rounded-full",style:"waitlisted"===t.my_entry.state?{backgroundColor:"#fef3c7",color:"#92400e"}:{backgroundColor:"#dcfce7",color:"#166534"},children:function(e){var t,r;let n=e.my_entry;if("waitlisted"===n.state)return"On the waiting list";if("promoted_pending"===n.state)return"Entered — awaiting payment";if(n.tee_time)return"Entered — tee time ".concat(n.tee_time);let a=d(e,null==(t=n.zone)?void 0:t.zone_id,null==(r=n.zone)?void 0:r.label);return a?"Entered — ".concat(a):"Entered"}(t)});g=(0,n.jsxs)(n.Fragment,{children:[e,x&&(0,n.jsx)("button",{type:"button",onClick:()=>c(!0),className:"px-3 py-1.5 text-sm font-medium rounded-md border border-gray-300 text-gray-700 hover:bg-gray-100",style:u,children:"Edit"}),t.my_entry.can_withdraw?(0,n.jsx)("button",{type:"button",onClick:()=>p(!0),className:"px-3 py-1.5 text-sm font-medium rounded-md border border-gray-300 text-gray-700 hover:bg-gray-100",style:u,children:"Withdraw"}):!1===t.my_entry.can_withdraw?(0,n.jsx)("span",{className:"text-xs text-gray-500",children:"Contact the pro shop to withdraw"}):null]})}else"open"!==t.registration.status||t.eligible?"open"===t.registration.status&&(g=(0,n.jsx)("button",{type:"button",onClick:()=>s(!0),className:"px-3 py-1.5 text-sm font-medium rounded-md border",style:{...m,backgroundColor:r,color:"#ffffff",border:"1px solid ".concat(r)},children:"Enter"})):g=(0,n.jsx)("span",{className:"text-xs text-gray-500",children:"Not eligible to enter"});return(0,n.jsxs)(n.Fragment,{children:[g,l&&(0,n.jsx)(w,{comp:t,accent:r,onClose:()=>s(!1),onEntered:o}),i&&(0,n.jsx)(w,{comp:t,accent:r,mode:"edit",onClose:()=>c(!1),onEntered:o}),h&&(0,n.jsx)(j,{comp:t,onClose:()=>p(!1),onWithdrawn:o})]})},j=e=>{var t;let{comp:r,onClose:o,onWithdrawn:l}=e,[s,i]=(0,a.useState)(!1),[c,d]=(0,a.useState)(null),p=(0,a.useRef)(null),f=(null==(t=r.my_entry)?void 0:t.party_role)==="lead";async function b(){i(!0),p.current||(p.current=x());try{var e,t;let n=await (e=r.competition_id,t=p.current,g("".concat(h,"/").concat(encodeURIComponent(e),"/entries/me"),"DELETE",{idempotency_key:t}));d(n),"pending"!==n.status&&(p.current=null),("withdrawn"===n.status||"withdrawn_late"===n.status)&&l()}catch(e){d({status:"rejected",reason:"error"})}finally{i(!1)}}let v=c?y(c,r):null,j=c&&("withdrawn"===c.status||"withdrawn_late"===c.status);return(0,n.jsx)("div",{role:"dialog","aria-modal":"true","aria-label":"Withdraw from ".concat(r.name),className:"fixed inset-0 z-50 flex items-end sm:items-center justify-center bg-black/40 p-0 sm:p-4",onClick:e=>{e.target!==e.currentTarget||s||o()},children:(0,n.jsxs)("div",{className:"w-full sm:max-w-md bg-white rounded-t-xl sm:rounded-xl shadow-xl p-5",children:[(0,n.jsxs)("h3",{className:"text-lg font-semibold text-gray-900",children:["Withdraw from ",r.n
1ame,"?"]}),!j&&(0,n.jsx)("p",{className:"mt-2 text-sm text-gray-700",children:f?"You entered as the lead — withdrawing takes your whole group out.":"Your place will be released, and the next person on the waiting list offered it."}),v&&(0,n.jsx)("p",{role:"status",className:"mt-4 rounded-md text-sm",style:{padding:"10px 12px",..."bad"===v.tone?{backgroundColor:"#fee2e2",color:"#991b1b"}:{backgroundColor:"#dcfce7",color:"#166534"}},children:v.text}),(0,n.jsxs)("div",{className:"mt-5 flex justify-end gap-2",children:[(0,n.jsx)("button",{type:"button",onClick:o,disabled:s,className:"px-3 py-1.5 text-sm font-medium rounded-md border border-gray-300 text-gray-700 hover:bg-gray-100",style:u,children:j?"Close":"Keep my entry"}),!j&&(0,n.jsx)("button",{type:"button",onClick:b,disabled:s,className:"px-3 py-1.5 text-sm font-medium rounded-md border disabled:opacity-60",style:{...m,backgroundColor:"#b91c1c",color:"#ffffff",border:"1px solid #b91c1c"},children:s?"Withdrawing…":f?"Withdraw group":"Withdraw"})]})]})})},w=e=>{var t,r,o,l,s,d,p;let{comp:v,accent:j,mode:w="enter",onClose:S,onEntered:_}=e,T="edit"===w,q="zones"===v.entry_mode&&v.zones||[],B=T&&null!=(s=null==(r=v.my_entry)||null==(t=r.zone)?void 0:t.zone_id)?s:null,[z,M]=(0,a.useState)(T?B:null!=(d=null==(o=v.my_hold)?void 0:o.zone_id)?d:null),[P,L]=(0,a.useState)(T?((null==(l=v.my_entry)?void 0:l.partners)||[]).map(e=>({...e})):[]),[D,W]=(0,a.useState)(!1),[A,E]=(0,a.useState)(null),F=(0,a.useRef)(null),R=Math.max(0,(v.max_party_size||1)-1),[I,H]=(0,a.useState)(null),[G,U]=(0,a.useState)(null),[O,Y]=(0,a.useState)(0),V=(0,a.useRef)(!1),J=P.map(e=>e.golfer_uuid).join(",");(0,a.useEffect)(()=>{if(T)return;let e=!1;return f(v.competition_id,{zone_id:"zones"===v.entry_mode?z:null,partners:J?J.split(","):[]}).then(t=>{var r,n;e||(H(null!=(r=t.hold)?r:null),U(t.hold?null:null!=(n=t.reason)?n:"error"))}),()=>{e=!0}},[T,v.competition_id,v.entry_mode,z,J,O]),(0,a.useEffect)(()=>{if(T)return;let e=v.competition_id;return()=>{V.current||function(e){try{fetch("".concat(h,"/").concat(encodeURIComponent(e),"/hold"),{method:"DELETE",credentials:"same-origin",keepalive:!0}).catch(()=>void 0)}catch(e){}}(e)}},[T,v.competition_id]);let Z=(0,i.YR)(null!=(p=null==I?void 0:I.expires_at)?p:null),$=!T&&(null!==v.places.places_left&&v.places.places_left<=0||"competition_full"===G);async function X(){W(!0),F.current||(F.current=x());let e={partners:P.map(e=>e.golfer_uuid),idempotency_key:F.current};"zones"===v.entry_mode&&(e.zone_id=z);try{var t,r;let n=T?await (t=v.competition_id,g("".concat(h,"/").concat(encodeURIComponent(t),"/entries/me"),"PATCH",e)):await (r=v.competition_id,g("".concat(h,"/").concat(encodeURIComponent(r),"/entries"),"POST",e));E(n),"pending"!==n.status&&(F.current=null),("entered"===n.status||"waitlisted"===n.status)&&(V.current=!0,H(null),_())}catch(e){E({status:"rejected",reason:"error"})}finally{W(!1)}}let K=A?y(A,v,T):null,Q=A&&("entered"===A.status||"waitlisted"===A.status),ee=function(e){if(!e)return null;let t=new Date("".concat(e.slice(0,10),"T12:00:00"));if(Number.isNaN(t.getTime()))return null;let r=e=>t.toLocaleDateString("en-GB",e);return"".concat(r({weekday:"long"})," ").concat(r({day:"numeric"})," ").concat(r({month:"long"})," ").concat(r({year:"numeric"}))}(v.competition_date),et=!T&&!Q&&G&&"competition_full"!==G&&b[G]||null;return(0,n.jsx)("div",{role:"dialog","aria-modal":"true","aria-label":"".concat(T?"Edit entry":"Enter"," ").concat(v.name),className:"fixed inset-0 z-50 flex items-end sm:items-center justify-center bg-black/40 p-0 sm:p-4",onClick:e=>{e.target!==e.currentTarget||D||S()},children:(0,n.jsxs)("div",{className:"w-full bg-white rounded-t-xl sm:rounded-xl shadow-xl max-h-[90vh] overflow-y-auto",style:{maxWidth:560},children:[(0,n.jsxs)("div",{"data-testid":"nooq-entry-banner",className:"rounded-t-xl",style:{backgroundColor:j,color:"#ffffff",padding:"16px 20px"},children:[(0,n.jsx)("h3",{className:"text-lg font-semibold",style:{color:"#ffffff",margin:0},children:v.name}),(0,n.jsxs)("p",{className:"text-sm",style:{color:"rgba(255,255,255,0.9)",margin:"2px 0 0"},children:[T?"Edit your entry":"Enter competition",ee&&(0,n.jsxs)(n.Fragment,{children:[" \xb7 ",ee]})]})]}),(0,n.jsxs)("div",{style:{padding:"16px 20px 20px"},children:[!T&&!Q&&I&&(0,n.jsx)(k,{label:Z.label,low:Z.low,expired:Z.expired,minutes:I.hold_minutes,onHoldAgain:()=>Y(e=>e+1)}),!Q&&(0,n.jsxs)(n.Fragment,{children:[$&&(0,n.jsx)("p",{className:"mt-2 text-sm text-amber-800",children:!1===v.places.waitlist_enabled?"This competition is full.":"It's full — you'll go on the waiting list."}),et&&(0,n.jsx)("p",{role:"status",className:"mt-2 text-sm",style:{color:"#991b1b"},children:et}),q.length>0&&(0,n.jsxs)("fieldset",{className:"mt-4 m-0 border-0 p-0",children:[(0,n.jsx)("legend",{className:"text-sm font-medium text-gray-700",children:"Preferred tee time"}),(0,n.jsxs)("div",{className:"mt-2 space-y-2",children:[(0,n.jsx)(N,{label:"Any time",detail:"",checked:null===z,disabled:!1,onSelect:()=>M(null),accent:j}),q.map(e=>{let t=T&&e.zone_id===B;return(0,n.jsx)(N,{label:c(e),detail:t?"Your zone":e.selectable?"".concat(e.remaining," left"):"Full",checked:z===e.zone_id,disabled:!e.selectable&&!t,onSelect:()=>M(e.zone_id),accent:j},e.zone_id)})]}),(0,n.jsx)("p",{className:"mt-2 text-xs text-gray-500",children:T?"You can move to a time with room until entries close.":"If your time fills before you're placed, we'll put you in the next time with room."})]}),R>0&&(0,n.jsx)(C,{max:R,partners:P,onChange:L})]}),K&&(0,n.jsx)("p",{role:"status",className:"mt-4 rounded-md text-sm",style:{padding:"10px 12px",..."ok"===K.tone?{backgroundColor:"#dcfce7",color:"#166534"}:"wait"===K.tone?{backgroundColor:"#fef3c7",color:"#92400e"}:{backgroundColor:"#fee2e2",color:"#991b1b"}},children:K.text}),(0,n.jsxs)("div",{className:"mt-5 flex justify-end gap-2",children:[(0,n.jsx)("button",{type:"button",onClick:S,disabled:D,className:"px-3 py-1.5 text-sm font-medium rounded-md border border-gray-300 text-gray-700 hover:bg-gray-100",style:u,children:Q?"Close":"Cancel"}),!Q&&(0,n.jsx)("button",{type:"button",onClick:X,disabled:D||$&&!1===v.places.waitlist_enabled,className:"px-3 py-1.5 text-sm font-medium rounded-md border disabled:opacity-60",style:{...m,backgroundColor:j,color:"#ffffff",border:"1px solid ".concat(j)},children:D?T?"Saving…":"Entering…":T?"Save changes":$?"Join waiting list":"Confirm entry"})]})]})]})})},k=e=>{let{label:t,low:r,expired:a,minutes:o,onHoldAgain:l}=e;
1return a?(0,n.jsxs)("div",{"data-testid":"nooq-hold-timer",role:"status",className:"flex flex-wrap items-center justify-between gap-2 rounded-md text-sm",style:{padding:"8px 12px",backgroundColor:"#fee2e2",color:"#991b1b"},children:[(0,n.jsx)("span",{children:"Your place is no longer held."}),(0,n.jsx)("button",{type:"button",onClick:l,className:"text-sm font-medium underline",style:{color:"#991b1b"},children:"Hold it again"})]}):t?(0,n.jsxs)("div",{"data-testid":"nooq-hold-timer",className:"flex items-center gap-2 rounded-md text-sm",title:"Your place is kept for ".concat(o," minutes while you finish entering"),style:{padding:"8px 12px",...r?{backgroundColor:"#fef3c7",color:"#92400e",fontWeight:600}:{backgroundColor:"#f0fdfa",color:"#115e59"}},children:[(0,n.jsxs)("svg",{"aria-hidden":"true",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,n.jsx)("circle",{cx:"12",cy:"12",r:"9"}),(0,n.jsx)("path",{d:"M12 7v5l3 2"})]}),(0,n.jsxs)("span",{children:["Place held for you — ",(0,n.jsx)("span",{style:{fontVariantNumeric:"tabular-nums"},children:t})," left"]})]}):null},N=e=>{let{label:t,detail:r,checked:a,disabled:o,onSelect:l,accent:s}=e;return(0,n.jsxs)("label",{className:"flex items-center justify-between gap-3 rounded-md border px-3 py-2 text-sm ".concat(o?"cursor-not-allowed bg-gray-50 text-gray-400":"cursor-pointer text-gray-800"),style:a?{borderColor:s}:{borderColor:"#d1d5db"},children:[(0,n.jsxs)("span",{className:"flex items-center gap-2",children:[(0,n.jsx)("input",{type:"radio",name:"nooq-zone",checked:a,disabled:o,onChange:l}),(0,n.jsx)("span",{className:"font-mono",children:t})]}),r&&(0,n.jsx)("span",{className:"text-xs",children:r})]})},C=e=>{let{max:t,partners:r,onChange:o}=e,[l,i]=(0,a.useState)(!1);return(0,n.jsxs)("div",{className:"mt-4",children:[(0,n.jsxs)("p",{className:"text-sm font-medium text-gray-700",children:["Other players ",(0,n.jsxs)("span",{className:"font-normal text-gray-500",children:["(optional, up to ",t,")"]})]}),r.length>0&&(0,n.jsx)("ul",{className:"mt-2 space-y-1",style:{listStyle:"none",padding:0,margin:"0.5rem 0 0"},children:r.map(e=>(0,n.jsxs)("li",{className:"flex items-center justify-between rounded-md px-3 py-1.5 text-sm",style:{border:"1px solid #e5e7eb"},children:[(0,n.jsx)("span",{children:e.name}),(0,n.jsx)("button",{type:"button","aria-label":"Remove ".concat(e.name),onClick:()=>o(r.filter(t=>t.golfer_uuid!==e.golfer_uuid)),className:"text-xs text-gray-500 hover:text-gray-800",children:"Remove"})]},e.golfer_uuid))}),r.length<t&&(l?(0,n.jsx)(s.y,{excludeUuids:r.map(e=>e.golfer_uuid),onPick:e=>{o([...r,e]),i(!1)},onClose:()=>i(!1)}):(0,n.jsxs)("button",{type:"button",onClick:()=>i(!0),className:"mt-2 inline-flex items-center gap-1.5 px-3 py-1.5 text-sm font-medium rounded-md text-gray-700 hover:bg-gray-100",style:u,children:[(0,n.jsxs)("svg",{"aria-hidden":"true",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,n.jsx)("circle",{cx:"9",cy:"8",r:"4"}),(0,n.jsx)("path",{d:"M3 20c0-3.3 2.7-6 6-6s6 2.7 6 6"}),(0,n.jsx)("path",{d:"M19 8v6M16 11h6"})]}),"Add a player"]}))]})},S={golfgenius:"Golf Genius",clubv1:"ClubV1",howdidido:"HowDidiDo"};function _(e){let t=String(null!=e?e:"").toLowerCase().replace(/[\s_-]/g,"");return"gg"===t||"golfgenius"===t?"golfgenius":"clubv1"===t||"club1"===t||"cv1"===t?"clubv1":"howdidido"===t||"hdid"===t?"howdidido":t||"unknown"}let T=/test|training|archiv/i;function q(e){return String(null!=e?e:"").trim().toLowerCase()}function B(e){if(!e)return null;let t=String(e).trim(),r=new Date(t);if(!Number.isNaN(r.getTime()))return r;let n=t.split(" ");if(n.length>=3){let e=n[n.length-1],t=n.slice(0,-1).join(" "),r=5===e.length&&("+"===e[0]||"-"===e[0])?"".concat(e.slice(0,3),":").concat(e.slice(3)):e,a=new Date("".concat(t.replace(" ","T")).concat(r));if(!Number.isNaN(a.getTime()))return a}return null}function z(e){return e.toLocaleDateString("en-GB",{day:"numeric",month:"short",year:"numeric"})}let M=e=>{let{className:t,style:r}=e;return(0,n.jsxs)("svg",{className:t,style:r,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,n.jsx)("path",{d:"M6 9H4.5a2.5 2.5 0 0 1 0-5H6"}),(0,n.jsx)("path",{d:"M18 9h1.5a2.5 2.5 0 0 0 0-5H18"}),(0,n.jsx)("path",{d:"M4 22h16"}
1),(0,n.jsx)("path",{d:"M10 14.66V17c0 .55-.47.98-.97 1.21C7.85 18.75 7 20.24 7 22"}),(0,n.jsx)("path",{d:"M14 14.66V17c0 .55.47.98.97 1.21C16.15 18.75 17 20.24 17 22"}),(0,n.jsx)("path",{d:"M18 2H6v7a6 6 0 0 0 12 0V2Z"})]})},P=e=>{let{className:t}=e;return(0,n.jsxs)("svg",{className:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,n.jsx)("path",{d:"M21 10c0 7-9 13-9 13S3 17 3 10a9 9 0 0 1 18 0z"}),(0,n.jsx)("circle",{cx:"12",cy:"10",r:"3"})]})},L=e=>{let{className:t}=e;return(0,n.jsxs)("svg",{className:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,n.jsx)("rect",{x:"3",y:"4",width:"18",height:"18",rx:"2",ry:"2"}),(0,n.jsx)("line",{x1:"16",y1:"2",x2:"16",y2:"6"}),(0,n.jsx)("line",{x1:"8",y1:"2",x2:"8",y2:"6"}),(0,n.jsx)("line",{x1:"3",y1:"10",x2:"21",y2:"10"})]})},D=e=>{let{heading:t,eyebrow:r,defaultSupplier:s,maxEvents:i,showSupplierFilter:c,showSeasonFilter:d,showAiReports:m,showFilters:u,sortOrder:p,categories:x,directories:g,seasons:f,orgCode:b,tenantId:y,displayOptions:v,className:j}=e,w=!1!==u&&!1!==c,k=!1!==u&&!1!==d,N=!1!==m,[C,B]=(0,a.useState)([]),[z,M]=(0,a.useState)(!0),[P,L]=(0,a.useState)(null),[D,A]=(0,a.useState)(null),[E,F]=(0,a.useState)(s||"all"),R=function(e){let[t,r]=(0,a.useState)({}),[n,o]=(0,a.useState)(!1),[l,s]=(0,a.useState)(!1),[i,c]=(0,a.useState)(0);return(0,a.useEffect)(()=>{if(!e)return;let t=!1;return(async()=>{try{let e=await fetch("".concat(h,"/upcoming"),{cache:"no-store",credentials:"same-origin"});if(!e.ok){t||(o(!1),s(401===e.status));return}let n=await e.json(),a=Array.isArray(null==n?void 0:n.competitions)?n.competitions:[],l={};for(let e of a)"string"==typeof(null==e?void 0:e.competition_id)&&e.registration&&(l[e.competition_id]=e);t||(r(l),o(!0),s(!1))}catch(e){t||o(!1)}})(),()=>{t=!0}},[e,i]),{byId:t,signedIn:n,signedOut:l,refresh:(0,a.useCallback)(()=>c(e=>e+1),[])}}(b),I=(0,l.DM)(null==v?void 0:v.iconColor,null==v?void 0:v.iconColorCustom),H=(0,l.DM)(null==v?void 0:v.headingColor,null==v?void 0:v.headingColorCustom),G=(0,l.DM)(null==v?void 0:v.textColor,null==v?void 0:v.textColorCustom),U=I||"#111827";(0,a.useEffect)(()=>{let e=!1;return M(!0),L(null),async function(){try{let t=[];if(b){let e=await fetch("/api/unified-competitions/organizations/".concat(encodeURIComponent(b),"/competitions-list?include_metadata=true"),{cache:"no-store"});if(e.ok){let r=await e.json();t=(Array.isArray(null==r?void 0:r.competitions)?r.competitions:[]).map(e=>{var t,r,n,a,o,l,s,i,c,d,m,u,h,p;return{id:String(null!=(r=null!=(t=e.id)?t:e.competition_id)?r:""),ggid:null!=(n=e.ggid)?n:null,website:null!=(a=e.website)?a:null,name:String(null!=(l=null!=(o=e.name)?o:e.competition_name)?l:""),date:String(null!=(i=null!=(s=e.date)?s:e.start_date)?i:""),end_date:null!=(c=e.end_date)?c:null,season:null!=e.season?String(e.season):void 0,source:e.source||"golfgenius",category:(p=e.category)?"string"==typeof p?p.trim()||null:(p.name||"").trim()||null:null,location:null!=(d=e.location)?d:null,registration_status:null!=(m=e.registration_status)?m:null,opening_dates:null!=(u=e.opening_dates)?u:null,has_ai_report:!!e.has_ai_report,total_players:Number(null!=(h=e.total_players)?h:0)||0,directories:Array.isArray(e.directories)?e.directories:[]}})}}if(0===t.length){let e=new URLSearchParams;null!=y&&e.set("tenantId",String(y));let r=await fetch("/api/golf-genius/events?".concat(e),{cache:"no-store"});if(r.ok){let e=await r.json();t=(Array.isArray(null==e?void 0:e.events)?e.events:[]).map(e=>{var t,r,n,a;let o=String(null!=(t=e.date)?t:"");return{id:String(null!=(r=e.id)?r:""),ggid:null!=(n=e.ggid)?n:null,name:String(null!=(a=e.name)?a:""),date:o,end_date:null,season:o?o.slice(0,4):void 0,source:"golfgenius",category:e.categoryName||null,location:null,registration_status:null,opening_dates:null,has_ai_report:!1,total_players:0,directories:Array.isArray(e.directories)?e.directories:[]}})}}e||B(t)}catch(t){e||L(t instanceof Error?t.message:"Failed to load competitions")}finally{e||M(!1)}}(),()=>{e=!0}},[b,y]);let O=(0,a.useMemo)(()=>(function(e,t){var r,n,a,o;
1let l=(null!=(r=t.categories)?r:[]).map(q).filter(Boolean),s=(null!=(n=t.directories)?n:[]).map(q).filter(Boolean),i=(null!=(a=t.seasons)?a:[]).map(e=>String(null!=e?e:"").trim()).filter(Boolean),c=new Map,d=new Map;for(let t of e){let e=_(t.source),r=q(t.category);for(let n of(r&&(c.has(e)||c.set(e,new Set),c.get(e).add(r)),null!=(o=t.directories)?o:[])){let t=q(null==n?void 0:n.name);t&&(d.has(e)||d.set(e,new Set),d.get(e).add(t))}}let m=(e,t)=>e.some(e=>null==t?void 0:t.has(e)),u=e;return l.length&&(u=u.filter(e=>!m(l,c.get(_(e.source)))||l.includes(q(e.category)))),s.length&&(u=u.filter(e=>{var t;return!m(s,d.get(_(e.source)))||(null!=(t=e.directories)?t:[]).some(e=>s.includes(q(null==e?void 0:e.name)))})),i.length&&(u=u.filter(e=>null!=e.season&&i.includes(String(e.season)))),l.length||s.length||(u=u.filter(e=>{var t;return!((t=e.category)&&T.test(t))})),u})(C,{categories:x,directories:g,seasons:f}),[C,x,g,f]),Y=(0,a.useMemo)(()=>{let e=new Set;return O.forEach(t=>e.add(_(t.source))),Array.from(e).sort()},[O]),V=(0,a.useMemo)(()=>"all"===E?O:O.filter(e=>_(e.source)===E),[O,E]),J=(0,a.useMemo)(()=>{let e=new Set;return V.forEach(t=>t.season&&e.add(t.season)),Array.from(e).sort()},[V]),Z=String(new Date().getFullYear());(0,a.useEffect)(()=>{if(0===J.length||null!==D&&("all"===D||J.includes(D)))return;if(J.includes(Z))return void A(Z);let e=J.filter(e=>Number(e)>Number(Z));if(e.length)return void A(e[0]);A(J[J.length-1])},[D,J,Z]);let $="ascending"===p||"descending"===p||"from-today"===p?p:"from-today",X=(0,a.useMemo)(()=>{let e=V;D&&"all"!==D&&(e=e.filter(e=>e.season===D));let t=(()=>{let e=new Date;return e.setHours(0,0,0,0),e.getTime()})();return e=[...e].sort((e,r)=>{let n=new Date(e.date).getTime(),a=new Date(r.date).getTime();if(Number.isNaN(n))return 1;if(Number.isNaN(a))return -1;if("ascending"===$)return n-a;if("descending"===$)return a-n;let o=n>=t;return o!==a>=t?o?-1:1:o?n-a:a-n}),i&&i>0&&(e=e.slice(0,i)),e},[V,D,i,$]),K=(e,t,r)=>(0,n.jsx)("button",{type:"button",onClick:r,className:"px-3 py-1.5 text-sm rounded-md border transition-colors",style:t?{backgroundColor:U,color:"#ffffff",borderColor:U}:{backgroundColor:"#ffffff",color:"#374151",borderColor:"#d1d5db"},children:e});return(0,n.jsx)("section",{className:(0,o.cn)("py-12 sm:py-16 lg:py-20 bg-white",j),children:(0,n.jsxs)("div",{className:"mx-auto max-w-5xl px-4 sm:px-6 lg:px-8",children:[(t||r)&&(0,n.jsxs)("div",{className:"text-center mb-8",children:[r&&(0,n.jsx)("p",{className:"font-medium tracking-widest uppercase text-sm mb-2",style:I?{color:I}:void 0,children:r}),t&&(0,n.jsx)("h2",{className:"text-2xl sm:text-3xl lg:text-4xl font-bold",style:H?{color:H}:void 0,children:t})]}),(w&&Y.length>1||k&&J.length>1)&&(0,n.jsxs)("div",{className:"space-y-3 mb-6",children:[w&&Y.length>1&&(0,n.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,n.jsx)("span",{className:"text-sm font-medium text-gray-600 mr-2",children:"Supplier:"}),K("All Suppliers","all"===E,()=>F("all")),Y.map(e=>K(S[e]||e,E===e,()=>F(e)))]}),k&&J.length>1&&(0,n.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,n.jsx)("span",{className:"text-sm font-medium text-gray-600 mr-2",children:"Season:"}),K("All","all"===D,()=>A("all")),J.map(e=>K(e,D===e,()=>A(e)))]})]}),z&&(0,n.jsx)("div",{className:"text-center py-16 text-gray-500",children:"Loading competitions…"}),P&&(0,n.jsx)("div",{className:"text-center py-12 bg-gray-50",children:(0,n.jsx)("p",{className:"text-red-600 font-medium",children:P})}),!z&&!P&&0===X.length&&(0,n.jsxs)("div",{className:"text-center py-16 text-gray-500",children:["No competitions to show",D&&"all"!==D?" for ".concat(D):"","."]}),!z&&!P&&X.length>0&&(0,n.jsx)("ul",{className:"divide-y divide-gray-200 border-t border-b border-gray-200 bg-white",children:X.map(e=>(0,n.jsx)(W,{comp:e,orgCode:b,showAiReport:N,iconColor:I,textColor:G,nooq:R.byId[e.id],signedOut:R.signedOut,onEntered:R.refresh},e.id))})]})})},W=e=>{var t,r;let{comp:a,orgCode:o,showAiReport:l=!0,iconColor:s,textColor:i,nooq:c,signedOut:d,onEntered:m}=e,u=B(a.date),h=B(a.end_date),x=u?h&&h.getTime()!==u.getTime()?"".concat(z(u)," – ").concat(z(h)):z(u):a.date||"",g=function(e){if(!e)return null;let t=[e.city,e.state,e.country].filter(e=>e&&String(e).trim());return t.length?t.join(", "):null}(a.location),f=a.category,b=a.registration_status,y=B(null==(t=a.opening_dates)?void 0:t.close_for_everyone),j=B(null==(r=a.opening_dates)?void 0:r.open_for_everyone),w=null,k=!1;return"open"===b?(k=!0,w=y?"Open until ".concat(z(y)):"Registration open"):"closed"===b?w=j&&j.getTime()>Date.now()?"Opens ".concat(z(j)):"Registration closed":j&&j.getTime()>Date.now()&&(w="Opens ".concat(z(j))),(0,n.jsxs)("li",{className:"flex flex-col sm:flex-row sm:items-start gap-4 px-4 py-4 hover:bg-gray-50",children:[(0,n.jsx)("span",{className:"flex-shrink-0 mt-0.5",style:{color:s||"#374151"},children:(0,n.jsx)(M,{className:"h-6 w-6"})}),(0,n.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,n.jsx)("div",{className:"font-semibold text-gray-900",style:i?{color:i}:void 0,children:a.name}),(0,n.jsxs)("div",{className:"mt-1 flex flex-wrap items-center gap-x-3 gap-y-1 text-sm text-gray-600",children:[(0,n.jsxs)("span",{className:"inline-flex items-center gap-1",children:[(0,n.jsx)(L,{className:"h-3.5 w-3.5"}),x]}),g&&(0,n.jsxs)("span",{className:"inline-flex items-center gap-1",children:[(0,n.jsx)(P,{className:"h-3.5 w-3.5"}),g]}),f&&(0,n.jsx)("span",{className:"inline-flex items-center px-2 py-0.5 text-xs rounded-full bg-gray-100 text-gray-700",children:f}),a.total_players?(0,n.jsxs)("span",{className:"text-xs text-gray-500",children:[a.total_players," players"]}):null]}),w&&(0,n.jsx)("div",{className:"mt-2",children:(0,n.jsx)("span",{className:"inline-flex items-center px-2 py-0.5 text-xs font-medium rounded-full",style:k?{backgroundColor:"#dcfce7",color:"#166534"}:{backgroundColor:"#f3f4f6",color:"#4b5563"},children:w})})]}),(0,n.jsxs)("div",{className:"flex flex-wrap items-center gap-2 sm:flex-shrink-0",children:[!c&&d&&k&&"golfgenius"===_(a.source)&&(0,n.jsx)(p,{accent:s||"#111827"}
1),c&&(0,n.jsx)(v,{comp:c,accent:s||"#111827",onEntered:m||(()=>{})}),l&&a.has_ai_report&&o&&(0,n.jsx)("a",{href:"/competition-report?orgCode=".concat(encodeURIComponent(o),"&eventId=").concat(encodeURIComponent(a.id)).concat(a.season?"&season=".concat(encodeURIComponent(a.season)):""),className:"px-3 py-1.5 text-sm font-medium rounded-md border",style:{backgroundColor:s||"#111827",color:"#ffffff",borderColor:s||"#111827"},children:"View Report"}),"golfgenius"===_(a.source)&&(0,n.jsx)("a",{href:function(e){if(e.ggid)return"https://www.golfgenius.com/ggid/".concat(e.ggid);if(e.website){let t=String(e.website).replace(/^https?:\/\//i,"").replace(/\/+$/,"");return"https://".concat(t)}return"https://www.golfgenius.com/events/".concat(e.id)}(a),target:"_blank",rel:"noopener noreferrer",className:"px-3 py-1.5 text-sm font-medium rounded-md border border-gray-300 text-gray-700 hover:bg-gray-100",children:"View on Golf Genius"})]})]})}},43133:(e,t,r)=>{"use strict";r.d(t,{IframeLoader:()=>o});var n=r(29064),a=r(34340);function o(e){let{html:t,className:r}=e,[o,l]=(0,a.useState)(!0),s=(0,a.useRef)(null);return(0,a.useEffect)(()=>{if(!s.current)return;let e=s.current.querySelectorAll("iframe");if(0===e.length)return void l(!1);let t=0,r=e.length,n=()=>{++t>=r&&l(!1)};e.forEach(e=>{var t;e.setAttribute("loading","eager"),(null==(t=e.contentDocument)?void 0:t.readyState)==="complete"?n():e.addEventListener("load",n)});let a=setTimeout(()=>{l(!1)},8e3);return()=>{clearTimeout(a),e.forEach(e=>{e.removeEventListener("load",n)})}},[t]),(0,n.jsxs)("div",{className:r,style:{position:"relative",minHeight:o?"400px":"auto"},children:[o&&(0,n.jsxs)("div",{style:{position:"absolute",inset:0,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",backgroundColor:"var(--color-muted, #f5f5f5)",borderRadius:"8px",zIndex:1},children:[(0,n.jsx)("div",{style:{width:"48px",height:"48px",border:"3px solid var(--color-border, #e5e5e5)",borderTopColor:"var(--color-primary, #3b82f6)",borderRadius:"50%",animation:"spin 1s linear infinite"}}),(0,n.jsx)("p",{style:{marginTop:"16px",color:"var(--color-muted-foreground, #666)",fontSize:"14px"},children:"Loading content..."}),(0,n.jsx)("style",{children:"\n            @keyframes spin {\n              to { transform: rotate(360deg); }\n            }\n          "})]}),(0,n.jsx)("div",{ref:s,dangerouslySetInnerHTML:{__html:t},style:{opacity:+!o,transition:"opacity 0.3s ease"}})]})}},43999:(e,t,r)=>{"use strict";r.d(t,{PostListComponent:()=>f});var n=r(29064),a=r(34340),o=r(50933),l=r.n(o),s=r(13702),i=r(51487);let c={amp:"&",lt:"<",gt:">",quot:'"',apos:"'",nbsp:"\xa0",rsquo:"’",lsquo:"‘",rdquo:"”",ldquo:"“",mdash:"—",ndash:"–",hellip:"…",copy:"\xa9",reg:"\xae",trade:"™",deg:"\xb0",middot:"\xb7",bull:"•",laquo:"\xab",raquo:"\xbb"},d=/&(#x[0-9a-fA-F]+|#\d+|[a-zA-Z]+);/g;function m(e){return e&&e.includes("&")?e.replace(d,(e,t)=>{var r;if("#"===t[0]){let r="x"===t[1]||"X"===t[1]?parseInt(t.slice(2),16):parseInt(t.slice(1),10);if(Number.isNaN(r))return e;try{return String.fromCodePoint(r)}catch(t){return e}}return null!=(r=c[t])?r:e}):e}let u={"16:9":"16-9","4:3":"4-3","1:1":"1-1","3:2":"3-2","21:9":"21-9","3:4":"3-4",square:"1-1",landscape:"4-3",portrait:"3-4",wide:"16-9",natural:"auto"},h={auto:void 0,"16-9":"56.25%","4-3":"75%","1-1":"100%","3-2":"66.67%","21-9":"42.86%","3-4":"133.33%"};function p(e){var t;return e?e in h?e:null!=(t=u[e])?t:"auto":"auto"}function x(e){let{currentPage:t,totalPages:r,onPageChange:a,anchorId:o}=e,i=(0,s.usePathname)(),c=(0,s.useSearchParams)(),d=e=>{let t=new URLSearchParams(c.toString());1===e?t.delete("page"):t.set("page",e.toString());let r=t.toString(),n=o?"#".concat(o):"";return r?"".concat(i,"?").concat(r).concat(n):"".concat(i).concat(n)},m=[],u=Math.max(1,t-Math.floor(5)),h=Math.min(r,u+10-1);h-u+1<10&&(u=Math.max(1,h-10+1)),u>1&&(m.push(1),u>2&&m.push("ellipsis-start"));for(let e=u;e<=h;e++)1!==e&&e!==r||1===e&&1===u?m.push(e):e===r&&h===r&&m.push(e);h<r&&(h<r-1&&m.push("ellipsis-end"),m.push(r));let p=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return{display:"inline-flex",alignItems:"center",justifyContent:"center",padding:t?"0.5rem 0.75rem":"0.5rem 0.875rem",borderRadius:"4px",border:"none",backgroundColor:e?"var(--color-primary)":"var(--color-bg-subtle)",color:e?"white":"var(--color-text)",cursor:"pointer",fontWeight:e?600:400,fontSize:"0.875rem",minWidth:t?"auto":"2.5rem",textDecoration:"none",transition:"background-color 0.15s, color 0.15s"}},x={...p(!1,!0),opacity:.5,cursor:"not-allowed",pointerEvents:"none"},g=(e,t)=>{a&&(t.preventDefault(),a(e))};return(0,n.jsxs)("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",gap:"0.25rem",marginTop:"2rem",flexWrap:"wrap"},children:[t<=1?(0,n.jsx)("span",{style:x,title:"Previous 10 pages",children:"\xab"}):(0,n.jsx)(l(),{href:d(Math.max(1,t-10)),onClick:e=>g(Math.max(1,t-10),e),style:p(!1,!0),title:"Previous 10 pages",children:"\xab"}),t<=1?(0,n.jsx)("span",{style:x,title:"Previous page",children:"‹"}):(0,n.jsx)(l(),{href:d(t-1),onClick:e=>g(t-1,e),style:p(!1,!0),title:"Previous page",children:"‹"}),m.map(e=>"ellipsis-start"===e||"ellipsis-end"===e?(0,n.jsx)("span",{style:{padding:"0.5rem 0.5rem",color:"var(--color-text-muted)",fontSize:"0.875rem"},children:"…"},e):(0,n.jsx)(l(),{href:d(e),onClick:t=>g(e,t),style:p(e===t),children:e},"page-".concat(e))),t>=r?(0,n.jsx)("span",{style:x,title:"Next page",children:"›"}):(0,n.jsx)(l(),{href:d(t+1),onClick:e=>g(t+1,e),style:p(!1,!0),title:"Next page",children:"›"}),t>=r?(0,n.jsx)("span",{style:x,title:"Next 10 pages",children:"\xbb"}):(0,n.jsx)(l(),{href:d(Math.min(r,t+10)),onClick:e=>g(Math.min(r,t+10),e),style:p(!1,!0),title:"Next 10 pages",children:"\xbb"})]})}function g(e){return(0,n.jsx)(a.Suspense,{fallback:(0,n.jsx)("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",gap:"0.25rem",marginTop:"2rem"},children:(0,n.jsx)("span",{style:{color:"var(--color-text-muted)",fontSize:"0.875rem"},children:"Loading..."})}),children:(0,n.jsx)(x,{...e})})}function f(e){var t,r,o,s,c,d,u,x;let{posts:f=[],heading:b,description:y,layout:v="cards",columns:j="3",showPagination:w=!0,showSearch:k=!1,cardStyle:N="shadow",imageAspect:C="16-9",showImage:S=!0,showCategory:_=!0,showDate:T=!0,showExcerpt:q=!0,showAuthor:B=!1,showReadMore:z=!0,excerptLength:M="medium",imagePosition:P="left",backgroundColor:L="default",blogSettings:D,useBlogSettings:W=!0,totalPages:A=1,currentPage:E=1,onPageChange:F}=e,R=(0,a.useMemo)(()=>f.map(e=>({...e,title:m(e.title),excerpt:e.excerpt?m(e.excerpt):e.excerpt})),[f]),[I,H]=(0,a.useState)(""),G=W&&(null==D?void 0:D.layout)?"featured"===(x=D.layout)?"magazine":"grid"===x?"cards":x:v,U=W&&(null==D?void 0:D.cardStyle)?D.cardStyle:N,O=W&&(null==D?void 0:D.cardImageAspect)?D.cardImageAspect:C,Y=W&&(null==D?void 0:D.cardImageSize)?D.
1cardImageSize:"medium",V=W&&(null==D?void 0:D.cardImageFocalPoint)?D.cardImageFocalPoint:"top",J=W&&(null==D?void 0:D.cardColumns)?D.cardColumns:j,Z=W&&D?null==(r=D.showCardImage)||r:S,$=W&&D?null==(o=D.showCardCategory)||o:_,X=W&&D?null==(s=D.showCardDate)||s:T,K=W&&D?null==(c=D.showCardExcerpt)||c:q,Q=W&&D?null!=(d=D.showCardAuthor)&&d:B,ee=e=>{var t,r,n;if(!(null==(t=e.featuredImage)?void 0:t.url))return"";let a=e.featuredImage.sizes;return"1-1"===p(O)&&(null==a||null==(r=a.blogCardSquare)?void 0:r.url)?a.blogCardSquare.url:(null==a||null==(n=a.blogCard)?void 0:n.url)?a.blogCard.url:e.featuredImage.url},et={small:.6,medium:1,large:1.4},er={short:50,medium:100,long:200,full:9999}[M]||(null==D?void 0:D.excerptLength)||100,en=(0,a.useMemo)(()=>{if(!I)return R;let e=I.toLowerCase();return R.filter(t=>{var r;return t.title.toLowerCase().includes(e)||(null==(r=t.excerpt)?void 0:r.toLowerCase().includes(e))})},[R,I]),ea={default:"var(--color-bg)",subtle:"var(--color-bg-subtle)",muted:"var(--color-bg-muted)"},eo={shadow:{boxShadow:"0 2px 8px rgba(0,0,0,0.1)",borderRadius:"8px"},border:{border:"1px solid var(--color-border)",borderRadius:"8px"},flat:{backgroundColor:"var(--color-bg-subtle)",borderRadius:"8px"},hoverLift:{boxShadow:"0 2px 8px rgba(0,0,0,0.1)",borderRadius:"8px",transition:"transform 0.2s, box-shadow 0.2s"}},el={2:"repeat(2, 1fr)",3:"repeat(3, 1fr)",4:"repeat(4, 1fr)"},es=e=>{if(e.publishedAtFormatted)return e.publishedAtFormatted;if(!e.publishedAt)return"";try{let t=new Date(e.publishedAt),r=t.getUTCDate(),n=["January","February","March","April","May","June","July","August","September","October","November","December"][t.getUTCMonth()],a=t.getUTCFullYear();return"".concat(r," ").concat(n," ").concat(a)}catch(t){return e.publishedAt}},ei=e=>e?e.length<=er?e:e.substring(0,er).trim()+"...":"",ec=!W||!D||null==(u=D.usePlaceholderImage)||u,ed=null==D||null==(t=D.placeholderLogo)?void 0:t.url,em=(null==D?void 0:D.placeholderGradientStart)||"primary",eu=(null==D?void 0:D.placeholderGradientEnd)||"primaryDark",eh=(null==D?void 0:D.placeholderLogoOpacity)||"30",ep={white:"var(--color-bg)",subtle:"var(--color-bg-subtle)",muted:"var(--color-bg-muted)",dark:"var(--color-bg-dark)",primary:"var(--color-primary)",primaryLight:"var(--color-primary-light)",primaryDark:"var(--color-primary-dark)",secondary:"var(--color-secondary)",secondaryLight:"var(--color-secondary-light)",secondaryDark:"var(--color-secondary-dark)",accent:"var(--color-accent)",accentLight:"var(--color-accent-light, var(--color-accent))",accentDark:"var(--color-accent-dark, var(--color-accent))",transparent:"transparent"},ex=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return e.pinned?(0,n.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:"4px",padding:"2px 8px",borderRadius:"4px",fontSize:"0.7rem",fontWeight:600,backgroundColor:t?"rgba(255,255,255,0.25)":(null==D?void 0:D.badgeBackgroun
1dColor)?"var(--color-".concat(D.badgeBackgroundColor,")"):"var(--color-accent)",color:t?"white":(null==D?void 0:D.badgeTextColor)==="heading"?"var(--color-heading)":"white",marginBottom:"0.5rem",marginRight:"0.5rem",textTransform:"uppercase",letterSpacing:"0.5px"},children:[(0,n.jsx)("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:(0,n.jsx)("path",{d:"M16 4v8l2 2v2h-5v6l-1 1-1-1v-6H6v-2l2-2V4H7V2h10v2h-1z"})}),"Pinned"]}):null},eg=function(e){var t,r,a,o;let s=arguments.length>1&&void 0!==arguments[1]&&arguments[1],c=null==(t=e.featuredImage)?void 0:t.url;return(0,n.jsxs)("article",{className:"hoverLift"===U?"post-card-hover":"",style:{backgroundColor:"white",overflow:"hidden",display:"flex",flexDirection:s?"row":"column",...eo[U]},children:[Z&&(0,n.jsx)(l(),{href:"/blog/".concat(e.slug),style:{display:"block",position:"relative",paddingBottom:((e,t,r)=>{var n;if(r)return"0";let a=parseFloat(null!=(n=h[p(e)])?n:"")||56.25,o=et[t]||1;return"".concat(a*o,"%")})(O,Y,s),width:s?"50%":"100%",height:s?"auto":"0",minHeight:s?"300px":void 0,overflow:"hidden",borderRadius:s?void 0:"8px 8px 0 0"},children:c?(0,n.jsx)("img",{src:(0,i.e)(ee(e)),alt:(null==(r=e.featuredImage)?void 0:r.alt)||e.title,style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",objectFit:"cover",objectPosition:V}}):ec?(()=>{let e=ep[em]||"var(--color-primary)",t=ep[eu]||"var(--color-primary-dark)",r=parseInt(eh)/100;return(0,n.jsx)("div",{style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",background:"linear-gradient(to bottom right, ".concat(e,", ").concat(t,")"),display:"flex",alignItems:"center",justifyContent:"center"},children:ed&&(0,n.jsx)("img",{src:(0,i.e)(ed),alt:"",style:{width:"".concat(60,"%"),height:"".concat(60,"%"),objectFit:"contain",opacity:r}})})})():(0,n.jsx)("div",{style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"var(--color-bg-subtle, #f5f5f5)",color:"var(--color-text-muted, #999)"},children:(0,n.jsxs)("svg",{width:"48",height:"48",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,n.jsx)("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2",ry:"2"}),(0,n.jsx)("circle",{cx:"8.5",cy:"8.5",r:"1.5"}),(0,n.jsx)("polyline",{points:"21 15 16 10 5 21"})]})})}),(0,n.jsxs)("div",{style:{padding:"1.25rem",flex:1},children:[ex(e),$&&(null==(a=e.category)?void 0:a.title)&&(0,n.jsx)("span",{style:{display:"inline-block",padding:"4px 10px",borderRadius:"4px",fontSize:"0.75rem",fontWeight:600,backgroundColor:(null==D?void 0:D.badgeBackgroun
1dColor)?"var(--color-".concat(D.badgeBackgroundColor,")"):"var(--color-accent)",color:(null==D?void 0:D.badgeTextColor)==="heading"?"var(--color-heading)":"white",marginBottom:"0.75rem",textTransform:"uppercase",letterSpacing:"0.5px"},children:e.category.title}),(0,n.jsx)("h3",{style:{fontSize:s?"1.5rem":"1.125rem",fontWeight:600,marginBottom:"0.5rem",lineHeight:1.3},children:(0,n.jsx)(l(),{href:"/blog/".concat(e.slug),style:{color:(null==D?void 0:D.cardTitleColor)?"var(--color-".concat(D.cardTitleColor,")"):"var(--color-heading)",textDecoration:"none"},children:e.title})}),(X||Q)&&(0,n.jsxs)("div",{style:{display:"flex",gap:"1rem",fontSize:"0.8rem",color:"var(--color-text-muted)",marginBottom:"0.75rem"},children:[X&&e.publishedAt&&(0,n.jsx)("span",{children:es(e)}),Q&&(null==(o=e.author)?void 0:o.name)&&(0,n.jsxs)("span",{children:["By ",e.author.name]})]}),K&&e.excerpt&&(0,n.jsx)("p",{style:{fontSize:"0.9rem",color:"var(--color-text-muted)",marginBottom:"1rem",lineHeight:1.6},children:ei(e.excerpt)}),z&&(0,n.jsxs)(l(),{href:"/blog/".concat(e.slug),style:{display:"inline-flex",alignItems:"center",gap:"0.5rem",color:(null==D?void 0:D.linkColor)?"var(--color-".concat(D.linkColor,")"):"var(--color-primary)",textDecoration:"none",fontWeight:500,fontSize:"0.875rem"},children:["Read More",(0,n.jsx)("span",{"aria-hidden":"true",children:"→"})]})]})]},e.id)},ef="magazine"===G?en[0]:null,eb="magazine"===G?en.slice(1):en,ey="posts";return(0,n.jsxs)("section",{id:ey,style:{backgroundColor:ea[L]||ea.default,padding:"var(--section-spacing, 2rem) 0"},children:[(0,n.jsx)("style",{children:"\n        .post-card-hover:hover {\n          transform: translateY(-4px);\n          box-shadow: 0 12px 24px rgba(0,0,0,0.15) !important;\n        }\n        @media (max-width: 768px) {\n          .post-grid { grid-template-columns: 1fr !important; }\n          .post-list-item { flex-direction: column !important; }\n          .post-list-item img { width: 100% !important; height: 200px !important; }\n        }\n      "}),(0,n.jsxs)("div",{className:"container",children:[(b||y)&&(0,n.jsxs)("div",{style:{marginBottom:"2rem",textAlign:"center"},children:[b&&(0,n.jsx)("h2",{style:{fontSize:"2rem",fontWeight:700,marginBottom:"0.5rem",color:"var(--color-heading)"},children:b}),y&&(0,n.jsx)("p",{style:{color:"var(--color-text-muted)",maxWidth:"600px",margin:"0 auto"},children:y})]}),k&&(0,n.jsx)("div",{style:{marginBottom:"1.5rem"},children:(0,n.jsx)("input",{type:"text",placeholder:"Search posts...",value:I,onChange:e=>H(e.target.value),style:{padding:"0.75rem 1rem",borderRadius:"6px",border:"1px solid var(--color-border)",width:"100%",maxWidth:"400px",fontSize:"1rem"}})}),0===en.length&&(0,n.jsx)("div",{style:{textAlign:"center",padding:"3rem",color:"var(--color-text-muted)"},children:(0,n.jsx)("p",{children:"No posts found."})}),"magazine"===G&&ef&&(0,n.jsx)("div",{style:{marginBottom:"2rem"},children:eg(ef,!0)}),"cards"===G&&en.length>0&&(0,n.jsx)("div",{className:"post-grid",style:{display:"grid",gridTemplateColumns:el[J]||el["3"],gap:"1.5rem"},children:en.map(e=>eg(e))}),"grid"===G&&en.length>0&&(0,n.jsx)("div",{className:"post-grid",style:{display:"grid",gridTemplateColumns:el[J]||el["3"],gap:"1.25rem"},children:en.map(e=>(e=>{var t,r,a;let o=null==(t=e.featuredImage)?void 0:t.url,s=ep[em]||"var(--color-primary)",c=ep[eu]||"var(--color-primary-dark)",d=parseInt(eh)/100;return(0,n.jsxs)("article",{className:"hoverLift"===U?"post-card-hover":"",style:{backgroundColor:"white",overflow:"hidden",...eo[U]},children:[Z&&(0,n.jsx)(l(),{href:"/blog/".concat(e.slug),style:{display:"block",position:"relative",paddingBottom:"60%",overflow:"hidden"},children:o?(0,n.jsx)("img",{src:(0,i.e)(ee(e)),alt:(null==(r=e.featuredImage)?void 0:r.alt)||e.title,style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",objectFit:"cover",objectPosition:V}}):ec?(0,n.jsx)("div",{style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",background:"linear-gradient(to bottom right, ".concat(s,", ").concat(c,")"),display:"flex",alignItems:"center",justifyContent:"center"},children:ed&&(0,n.jsx)("img",{src:(0,i.e)(ed),alt:"",style:{width:"80px",height:"80px",objectFit:"contain",opacity:d}})}):(0,n.jsx)("div",{style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"var(--color-bg-subtle, #f5f5f5)",color:"var(--color-text-muted, #999)"},children:(0,n.jsxs)("svg",{width:"36",height:"36",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,n.jsx)("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2",ry:"2"}),(0,n.jsx)("circle",{cx:"8.5",cy:"8.5",r:"1.5"}),(0,n.jsx)("polyline",{points:"21 15 16 10 5 21"})]})})}),(0,n.jsxs)("div",{style:{padding:"1rem"},children:[ex(e),$&&(null==(a=e.category)?void 0:a.title)&&(0,n.jsx)("span",{style:{fontSize:"0.7rem",fontWeight:600,color:"var(--color-accent)",textTransform:"uppercase",letterSpacing:"0.5px"},children:e.category.title}),(0,n.jsx)("h3",{style:{fontSize:"1rem",fontWeight:600,marginTop:"0.25rem",marginBottom:"0.25rem",lineHeight:1.3},children:(0,n.jsx)(l(),{href:"/blog/".concat(e.slug),style:{color:"var(--color-heading)",textDecoration:"none"},children:e.title})}),X&&e.publishedAt&&(0,n.jsx)("span",{style:{fontSize:"0.75rem",color:"var(--color-text-muted)"},children:es(e)})]})]},e.id)})(e))}),"magazine"===G&&eb.length>0&&(0,n.jsx)("div",{className:"post-grid",style:{display:"grid",gridTemplateColumns:el[J]||el["3"],gap:"1.5rem"},children:eb.map(e=>eg(e))}),"masonry"===G&&en.length>0&&(0,n.jsx)("div",{style:{columnCount:parseInt(J)||3,columnGap:"1.5rem"},children:en.map(e=>(0,n.jsx)("div",{style:{breakInside:"avoid",marginBottom:"1.5rem"},children:eg(e)},e.id))}),"list"===G&&en.length>0&&(0,n.jsx)("div",{style:{display:"flex",flexDirection:"column",gap:"1.5rem"},children:en.map(e=>{var t,r,a,o,s,c,d,m;return"background"===P&&Z&&(null==(t=e.featuredImage)?void 0:t.url)?(0,n.jsxs)("article",{style:{position:"relative",overflow:"hidden",minHeight:"200px",display:"flex",alignItems:"flex-end",...eo[U]},children:[(0,n.jsx)("img",{src:(0,i.e)(ee(e)),alt:e.featuredImage.alt||e.title,style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",objectFit:"cover",objectPosition:V}}),(0,n.jsx)("div",{style:{position:"absolute",inset:0,background:"linear-gradient(to top, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0.3) 50%, transparent 100%)"}}),(0,n.jsxs)("div",{style:{position:"relative",padding:"1.5rem",color:"white",width:"100%"},children:[ex(e,!0),$&&(null==(s=e.category)?void 0:s.title)&&(0,n.jsx)("span",{style:{display:"inline-block",padding:"2px 8px",borderRadius:"4px",fontSize:"0.7rem",fontWeight:600,backgroundColor:"var(--color-accent)",marginBottom:"0.5rem"},children:e.category.title}),(0,n.jsx)("h3",{style:{fontSize:"1.25rem",fontWeight:600,marginBottom:"0.25rem"},children:(0,n.jsx)(l(),{href:"/blog/".concat(e.slug),style:{color:"white",textDecoration:"none"},children:e.title})}),X&&e.publishedAt&&(0,n.jsx)("span",{style:{fontSize:"0.8rem",opacity:.8},children:es(e)})]})]},e.id):"top"===P?(0,n.jsxs)("article",{style:{backgroundColor:"white",overflow:"hidden",...eo[U]},children:[Z&&(null==(c=e.featuredImage)?void 0:c.url)&&(0,n.jsx)(l(),{href:"/blog/".concat(e.slug),style:{display:"block",position:"relative",paddingBottom:"40%",overflow:"hidden"},children:(0,n.jsx)("img",{src:(0,i.e)(ee(e)),alt:e.featuredImage.alt||e.title,style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",objectFit:"cover",objectPosition:V}})}),(0,n.jsxs)("div",{style:{padding:"1.25rem"},children:[ex(e),$&&(null==(d=e.category)?void 0:d.title)&&(0,n.jsx)("span",{style:{display:"inline-block",padding:"2px 8px",borderRadius:"4px",fontSize:"0.7rem",fontWeight:600,backgroundColor:"var(--color-accent)",color:"white",marginBottom:"0.5rem",textTransform:"uppercase"},children:e.category.title}),(0,n.jsx)("h3",{style:{fontSize:"1.25rem",fontWeight:600,marginBottom:"0.5rem"},children:(0,n.jsx)(l(),{href:"/blog/".concat(e.slug),style:{color:"var(--color-heading)",textDecoration:"none"},children:e.title})}),(X||Q)&&(0,n.jsxs)("div",{style:{display:"flex",gap:"1rem",fontSize:"0.8rem",color:"var(--color-text-muted)",marginBottom:"0.5rem"},children:[X&&e.publishedAt&&(0,n.jsx)("span",{children:es(e)}),Q&&(null==(m=e.author)?void 0:m.name)&&(0,n.jsxs)("span",{children:["By ",e.author.name]})]}),K&&e.excerpt&&(0,n.jsx)("p",{style:{fontSize:"0.9rem",color:"var(--color-text-muted)",marginBottom:"0.75rem",lineHeight:1.5},children:ei(e.excerpt)}),z&&(0,n.jsx)(l(),{href:"/blog/".concat(e.slug),style:{color:"var(--color-primary)",textDecoration:"none",fontWeight:500,fontSize:"0.875rem"},children:"Read More →"})]})]},e.id):(0,n.jsxs)("article",{style:{backgroundColor:"white",display:"flex",flexDirection:"right"===P?"row-reverse":"row",gap:"1.5rem",padding:"1.25rem",alignItems:"flex-start",...eo[U]},children:[Z&&(null==(r=e.featuredImage)?void 0:r.url)&&(0,n.jsx)(l(),{href:"/blog/".concat(e.slug),style:{flexShrink:0,width:"200px",height:"150px",borderRadius:"6px",overflow:"hidden"},children:(0,n.jsx)("img",{src:(0,i.e)(ee(e)),alt:e.featuredImage.alt||e.title,style:{width:"100%",height:"100%",objectFit:"cover",objectPosition:V}})}),(0,n.jsxs)("div",{style:{flex:1},children:[ex(e),$&&(null==(a=e.category)?void 0:a.title)&&(0,n.jsx)("span",{style:{display:"inline-block",padding:"2px 8px",borderRadius:"4px",fontSize:"0.7rem",fontWeight:600,backgroundColor:"var(--color-accent)",color:"white",marginBottom:"0.5rem",textTransform:"uppercase"},children:e.category.title}),(0,n.jsx)("h3",{style:{fontSize:"1.25rem",fontWeight:600,marginBottom:"0.5rem"},children:(0,n.jsx)(l(),{href:"/blog/".concat(e.slug),style:{color:"var(--color-heading)",textDecoration:"none"},children:e.title})}),(X||Q)&&(0,n.jsxs)("div",{style:{display:"flex",gap:"1rem",fontSize:"0.8rem",color:"var(--color-text-muted)",marginBottom:"0.5rem"},children:[X&&e.publishedAt&&(0,n.jsx)("span",{children:es(e)}),Q&&(null==(o=e.author)?void 0:o.name)&&(0,n.jsxs)("span",{children:["By ",e.author.name]})]}),K&&e.excerpt&&(0,n.jsx)("p",{style:{fontSize:"0.9rem",color:"var(--color-text-muted)",marginBottom:"0.75rem",lineHeight:1.5},children:ei(e.excerpt)}),z&&(0,n.jsx)(l(),{href:"/blog/".concat(e.slug),style:{color:"var(--color-primary)",textDecoration:"none",fontWeight:500,fontSize:"0.875rem"},children:"Read More →"})]})]},e.id)})}),"minimal"===G&&en.length>0&&(0,n.jsx)("div",{style:{maxWidth:"800px",margin:"0 auto"},children:en.map(e=>{var t;return(0,n.jsxs)("article",{style:{padding:"1rem 0",borderBottom:"1px solid var(--color-border)",display:"flex",justifyContent:"space-between",alignItems:"center",gap:"1rem"},children:[(0,n.jsxs)("div",{style:{flex:1},children:[(0,n.jsx)("h3",{style:{fontSize:"1.1rem",fontWeight:600,marginBottom:"0.25rem"},children:(0,n.jsx)(l(),{href:"/blog/".concat(e.slug),style:{color:"var(--color-heading)",textDecoration:"none"},children:e.title})}),K&&e.excerpt&&(0,n.jsx)("p",{style:{fontSize:"0.875rem",color:"var(--color-text-muted)",marginBottom:0,lineHeight:1.4},children:ei(e.excerpt)})]}),(0,n.jsxs)("div",{style:{flexShrink:0,textAlign:"right"}
1,children:[ex(e),$&&(null==(t=e.category)?void 0:t.title)&&(0,n.jsx)("span",{style:{display:"block",fontSize:"0.75rem",fontWeight:600,color:"var(--color-accent)",marginBottom:"0.25rem"},children:e.category.title}),X&&e.publishedAt&&(0,n.jsx)("span",{style:{fontSize:"0.8rem",color:"var(--color-text-muted)"},children:es(e)})]})]},e.id)})}),w&&A>1&&(0,n.jsx)(g,{currentPage:E,totalPages:A,onPageChange:F,anchorId:ey})]})]})}},45409:(e,t,r)=>{"use strict";r.r(t),r.d(t,{ProCtaLink:()=>o,default:()=>l});var n=r(29064);r(34340);var a=r(29599);function o(e){let{href:t,cta:r,style:o,className:l,children:s}=e;return(0,n.jsx)("a",{href:t,style:o,className:l,onClick:()=>(0,a.s)("pro_cta_click",{cta:r,page:window.location.pathname}),children:s})}let l=o},48299:(e,t,r)=>{"use strict";r.d(t,{CourseGuideClient:()=>i});var n=r(29064),a=r(34340);function o(e,t){return"metres"===t?Math.round(.9144*e):Math.round(e)}function l(e){return"metres"===e?"m":"yds"}let s=e=>{let{d:t}=e;return(0,n.jsx)("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:(0,n.jsx)("path",{d:t})})};function i(e){var t;let{course:r,options:i}=e,d=r.holes,h=d.length,[p,x]=(0,a.useState)(0),[g,f]=(0,a.useState)(0),[b,y]=(0,a.useState)(!1),[v,j]=(0,a.useState)(!1),[w,k]=(0,a.useState)(!1),[N,C]=(0,a.useState)(!1),S=!function(){let[e,t]=(0,a.useState)(!1);return(0,a.useEffect)(()=>{let e=window.matchMedia("(prefers-reduced-motion: reduce)"),r=()=>t(e.matches);return r(),e.addEventListener("change",r),()=>e.removeEventListener("change",r)},[]),e}()&&!N,_=(0,a.useRef)(null),T=(0,a.useRef)(null),q=(0,a.useRef)(null),B=(0,a.useRef)(null),z=(0,a.useRef)(null),M=d[p],P=null!=(t=null==M?void 0:M.slides)?t:[],L=P.length,D=L>6,W=L>=2,A=W&&!D&&i.showDots,E=W&&i.showArrows,F=W&&i.showCounter,R=(0,a.useCallback)(e=>{var t;if(0===h)return;let r=(e%h+h)%h;x(r),f(0),y(!1),k(!1),j(!1);let n=null==(t=d[r])?void 0:t.number;n&&window.history.replaceState(null,"","#hole-".concat(n))},[h,d]),I=(0,a.useCallback)(()=>{L<2||(f(e=>(e+1)%L),k(!1))},[L]),H=(0,a.useCallback)(e=>{C(!0),L<2||(f((e%L+L)%L),k(!1))},[L]);(0,a.useEffect)(()=>{if(!S||L<2)return;let e=P[g];if(!e||"video"===e.kind&&e.videoUrl)return;let t=setTimeout(I,5e3);return()=>clearTimeout(t)},[S,L,g,P,I]),(0,a.useEffect)(()=>{let e=T.current,t=q.current;if(!e||!t)return;let r=()=>t.style.setProperty("--nqcg-header-h","".concat(e.offsetHeight,"px"));r();let n="undefined"!=typeof ResizeObserver?new ResizeObserver(r):null;return null==n||n.observe(e),window.addEventListener("resize",r),()=>{null==n||n.disconnect(),window.removeEventListener("resize",r)}},[]),(0,a.useEffect)(()=>{let e=/^#hole-(\d{1,2})$/.exec(window.location.hash);if(!e)return;let t=d.findIndex(t=>t.number===Number(e[1]));t>=0&&x(t)},[]),(0,a.useEffect)(()=>{let e=_.current;if(!e)return;let t=e.querySelector('[data-hole-index="'.concat(p,'"]'));t&&(e.scrollLeft=t.offsetLeft-(e.clientWidth-t.offsetWidth)/2)},[p]),(0,a.useEffect)(()=>{var e;if(!v)return;let t=z.current,r=null!=(e=null==t?void 0:t.querySelector('[aria-current="true"]'))?e:null==t?void 0:t.firstElementChild;null==r||r.focus()},[v]),(0,a.useEffect)(()=>{let e=e=>{if(e.metaKey||e.ctrlKey||e.altKey)return;let t=e.target;if(!t||"INPUT"!==t.tagName&&"TEXTAREA"!==t.tagName&&!t.isContentEditable){if("Escape"===e.key&&v){var r;j(!1),null==(r=B.current)||r.focus(),e.preventDefault();return}"ArrowLeft"===e.key?(R(p-1),e.preventDefault()):"ArrowRight"===e.key?(R(p+1),e.preventDefault()):"["===e.key||","===e.key?(H(g-1),e.preventDefault()):("]"===e.key||"."===e.key)&&(H(g+1),e.preventDefault())}};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[p,g,v,R,H]),(0,a.useEffect)(()=>{if(!v)return;let e=e=>{let t=e.target;t.closest("[data-nqcg-picker]")||t.closest("[data-nqcg-pickbtn]")||j(!1)};return document.addEventListener("click",e),()=>document.removeEventListener("click",e)},[v]);let G=(0,a.useRef)(null),U=L?P[g]:null,O=i.showTip?null==M?void 0:M.tip:void 0,Y=i.showNotes?null==M?void 0:M.notes:void 0,V=i.showProTip?null==M?void 0:M.proTip:void 0,J=!!(O||Y||V),Z=!!(i.showTeeYardages&&(null==M?void 0:M.yardages.length)),$=!!(i.showDiagram&&(null==M?void 0:M.diagram)),X=d[(p-1+h)%h],K=d[(p+1)%h],Q=(0,a.useMemo)(()=>{let e=[];return r.par&&e.push("Par ".concat(r.par)),r.length&&e.push("".concat(o(r.length,i.units).toLocaleStr
1ing()," ").concat(l(i.units))),e.join(" \xb7 ")},[r.par,r.length,i.units]);return M?(0,n.jsxs)("div",{className:"nqcg",ref:q,children:[(0,n.jsx)("style",{dangerouslySetInnerHTML:{__html:'\n.nqcg{\n  --nqcg-primary:var(--color-primary,#16a34a);\n  --nqcg-primary-light:var(--color-primary-light,#22c55e);\n  --nqcg-accent:var(--color-accent,#ca8a04);\n  --nqcg-accent-light:var(--color-accent-light,#eab308);\n  --nqcg-bg:var(--color-bg,#ffffff);\n  --nqcg-bg-subtle:var(--color-bg-subtle,#f9fafb);\n  --nqcg-bg-muted:var(--color-bg-muted,#f3f4f6);\n  --nqcg-bg-dark:var(--color-bg-dark,#111827);\n  --nqcg-heading:var(--color-text-heading,#111827);\n  --nqcg-body:var(--color-text-body,#374151);\n  --nqcg-muted:var(--color-text-muted,#6b7280);\n  --nqcg-inverse:var(--color-text-inverse,#ffffff);\n  --nqcg-border:var(--color-border,#e5e7eb);\n  --nqcg-border-dark:var(--color-border-dark,#d1d5db);\n  --nqcg-font-heading:var(--font-heading,system-ui,sans-serif);\n  --nqcg-font-body:var(--font-body,system-ui,sans-serif);\n\n  --nqcg-deep:color-mix(in srgb, var(--nqcg-primary) 22%, var(--nqcg-bg-dark));\n  --nqcg-deep-2:color-mix(in srgb, var(--nqcg-primary) 34%, var(--nqcg-bg-dark));\n  /* The CARD is the club\'s — deep and brand-tinted, which is the part worth\n     theming. The COURSE on it is not: grass is green at every golf club, and\n     resolving turf through the palette gave Cathkin a navy fairway on a navy\n     card, where the hole was almost invisible. Literal, for the same reason\n     the water and the 200/150/100 posts are literal. */\n  --nqcg-rough:#2e4a2b;\n  --nqcg-fairway:#4e8f43;\n  --nqcg-green:#a9d98c;\n  --nqcg-sand:#f0d9b0;\n  --nqcg-water:#3b8fd4;\n  --nqcg-peach:var(--nqcg-accent-light);\n  --nqcg-cream:color-mix(in srgb, var(--nqcg-accent) 12%, var(--nqcg-bg));\n  --nqcg-cream-line:color-mix(in srgb, var(--nqcg-accent) 45%, transparent);\n  --nqcg-radius:var(--radius,0.5rem);\n  --nqcg-radius-lg:calc(var(--radius,0.5rem) * 2);\n  --nqcg-shadow-sm:0 1px 2px rgba(0,0,0,.05), 0 1px 3px rgba(0,0,0,.06);\n  --nqcg-shadow-lg:0 18px 40px rgba(0,0,0,.20);\n  --nqcg-mono:ui-monospace,SFMono-Regular,\'JetBrains Mono\',Menlo,monospace;\n  --nqcg-fast:.15s ease;\n  --nqcg-normal:.25s ease;\n  --nqcg-header-h:64px;\n\n  position:relative;\n  background:var(--nqcg-bg);\n  color:var(--nqcg-body);\n  font-family:var(--nqcg-font-body);\n}\n.nqcg *{box-sizing:border-box}\n.nqcg :focus-visible{outline:2px solid var(--nqcg-peach);outline-offset:2px}\n.nqcg [hidden]{display:none !important}\n.nqcg button{font:inherit;border:0;background:none;color:inherit}\n\n/* header */\n.nqcg-header{\n  position:sticky;top:0;z-index:40;\n  display:flex;align-items:center;gap:clamp(10px,1.6vw,18px);\n  padding:12px clamp(14px,3vw,40px);\n  background:color-mix(in srgb, var(--nqcg-deep) 94%, transparent);\n  -webkit-backdrop-filter:blur(14px);backdrop-filter:blur(14px);\n  border-bottom:1px solid rgba(255,255,255,.10);\n  color:#fff;\n}\n.nqcg-crest{\n  width:38px;height:38px;flex:0 0 auto;border-radius:50%;\n  display:grid;place-items:center;overflow:hidden;\n  background:rgba(255,255,255,.10);border:1px solid rgba(255,255,255,.22);\n  font-family:var(--nqcg-mono);font-size:13px;font-weight:600;\n}\n.nqcg-crest img{width:100%;height:100%;object-fit:contain}\n.nqcg-clubname{\n  margin:0;font-family:var(--nqcg-font-heading);font-weight:700;\n  font-size:clamp(15px,2vw,21px);letter-spacing:-.01em;line-height:1.15;\n}\n.nqcg-clubmeta{margin:2px 0 0;font-family:var(--nqcg-mono);font-size:11px;color:rgba(255,255,255,.62);letter-spacing:.04em}\n\n/* hero */\n.nqcg-hero{position:relative;height:clamp(400px,64vh,700px);overflow:hidden;background:var(--nqcg-deep);isolation:isolate}\n.nqcg-slide{position:absolute;inset:0;opacity:0;transition:opacity .5s ease;pointer-events:none}\n.nqcg-slide.is-active{opacity:1;pointer-events:auto}\n.nqcg-slide img,.nqcg-slide video{width:100%;height:100%;object-fit:cover;display:block}\n.nqcg-scrim{\n  position:absolute;inset:0;pointer-events:none;\n  background:linear-gradient(to top, rgba(10,10,10,.86) 0%, rgba(10,10,10,.28) 42%, rgba(10,10,10,.35) 100%);\n}\n.nqcg-empty{position:absolute;inset:0;display:grid;place-items:center;background:var(--nqcg-deep)}\n.nqcg-watermark{\n  font-family:var(--nqcg-font-heading);font-weight:700;\n  font-size:clamp(38px,9vw,96px);letter-spacing:-.03em;\n  color:rgba(255,255,255,.055);white-space:nowrap;user-select:none;\n}\n.nqcg-identity{\n  position:absolute;
1left:0;right:0;bottom:0;z-index:3;\n  padding:clamp(18px,3vw,40px) clamp(14px,3vw,40px) clamp(20px,3vw,34px);\n  max-width:1500px;margin:0 auto;\n}\n.nqcg-hero.has-dots .nqcg-identity{padding-bottom:clamp(46px,5vw,58px)}\n.nqcg-eyebrow{\n  margin:0 0 6px;font-weight:700;font-size:12px;letter-spacing:.2em;\n  text-transform:uppercase;color:var(--nqcg-peach);\n}\n.nqcg-holename{\n  margin:0;color:#fff;font-family:var(--nqcg-font-heading);font-weight:700;\n  font-size:clamp(30px,6.4vw,60px);letter-spacing:-.02em;line-height:1.02;text-wrap:balance;\n}\n.nqcg-facts{display:flex;flex-wrap:wrap;gap:8px;margin-top:14px}\n.nqcg-chip{\n  font-family:var(--nqcg-mono);font-size:12px;font-weight:600;\n  padding:6px 11px;border-radius:999px;color:#fff;\n  background:rgba(255,255,255,.12);border:1px solid rgba(255,255,255,.20);\n  font-variant-numeric:tabular-nums;\n}\n.nqcg-chip--par{background:color-mix(in srgb, var(--nqcg-primary) 90%, transparent);border-color:transparent}\n.nqcg-caption{margin:12px 0 0;font-size:12px;color:rgba(255,255,255,.62);max-width:60ch}\n\n/* carousel chrome — the media-type badge is gone; the picture says what it is */\n.nqcg-count{\n  position:absolute;top:clamp(12px,2vw,20px);right:clamp(14px,3vw,40px);z-index:4;\n  padding:6px 12px;border-radius:999px;background:rgba(10,10,10,.45);\n  color:#fff;font-family:var(--nqcg-mono);font-size:12px;font-variant-numeric:tabular-nums;\n}\n.nqcg-arrow{\n  position:absolute;top:50%;transform:translateY(-50%);z-index:4;\n  width:46px;height:46px;border-radius:50%;display:grid;place-items:center;\n  background:rgba(10,10,10,.42);border:1px solid rgba(255,255,255,.28);\n  color:#fff;cursor:pointer;transition:background var(--nqcg-fast),border-color var(--nqcg-fast);\n}\n.nqcg-arrow:hover{background:color-mix(in srgb, var(--nqcg-primary) 78%, transparent);border-color:transparent}\n.nqcg-arrow--prev{left:clamp(10px,2vw,22px)}\n.nqcg-arrow--next{right:clamp(10px,2vw,22px)}\n.nqcg-arrow svg{width:18px;height:18px}\n.nqcg-dotwrap{position:absolute;left:0;right:0;bottom:0;z-index:4;height:44px;display:flex;align-items:center;justify-content:center}\n.nqcg-dots{display:flex;gap:7px}\n.nqcg-dot{\n  width:8px;height:8px;padding:0;border-radius:999px;cursor:pointer;\n  background:rgba(255,255,255,.45);transition:width var(--nqcg-normal),background var(--nqcg-normal);\n}\n.nqcg-dot.is-active{width:26px;background:var(--nqcg-peach)}\n.nqcg-play{position:absolute;inset:0;z-index:3;display:grid;place-items:center;cursor:pointer}\n.nqcg-play span{\n  width:72px;height:72px;border-radius:50%;display:grid;place-items:center;\n  border:1.5px solid rgba(255,255,255,.55);\n  -webkit-backdrop-filter:blur(6px);backdrop-filter:blur(6px);\n  background:rgba(10,10,10,.22);color:#fff;\n  transition:background var(--nqcg-fast),border-color var(--nqcg-fast);\n}\n.nqcg-play:hover span{background:color-mix(in srgb, var(--nqcg-primary) 80%, transparent);border-color:transparent}\n.nqcg-play svg{width:26px;height:26px;margin-left:4px}\n\n/* nav */\n.nqcg-nav{\n  position:sticky;top:var(--nqcg-header-h);z-index:30;\n  background:color-mix(in srgb, var(--nqcg-bg) 92%, transparent);\n  -webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px);\n  border-bottom:1px solid var(--nqcg-border);\n}\n.nqcg-navrow{display:flex;align-items:center;gap:10px;max-width:1500px;margin:0 auto;padding:10px clamp(14px,3vw,40px)}\n.nqcg-step{\n  width:44px;height:44px;flex:0 0 auto;border-radius:50%;display:grid;place-items:center;\n  background:var(--nqcg-bg);border:1px solid color-mix(in srgb, var(--nqcg-heading) 16%, transparent);\n  color:var(--nqcg-heading);cursor:pointer;\n  transition:background var(--nqcg-fast),color var(--nqcg-fast),border-color var(--nqcg-fast);\n}\n.nqcg-step:hover{background:var(--nqcg-primary);border-color:transparent;color:var(--nqcg-inverse)}\n.nqcg-step svg{width:17px;height:17px}\n.nqcg-strip{\n  position:relative;display:flex;gap:8px;overflow-x:auto;scroll-behavior:smooth;\n  scrollbar-width:none;-ms-overflow-style:none;padding:2px 0;flex:1 1 auto;\n}\n.nqcg-strip::-webkit-scrollbar{display:none}\n.nqcg-holebtn{\n  width:44px;height:44px;flex:0 0 auto;border-radius:calc(var(--nqcg-radius) + 2px);\n  background:var(--nqcg-bg);color:var(--nqcg-heading);\n  border:1px solid color-mix(in srgb, var(--nqcg-heading) 16%, transparent);\n  font-family:var(--nqcg-mono);font-size:14px;cursor:pointer;\n  transition:background var(--nqcg-fast),color var(--nqcg-fast),border-color var(--nqcg-fast);\n}\n.nqcg-holebtn:hover{border-color:var(--nqcg-primary)}\n.nqcg-holebtn[aria-current="true"]{background:var(--nqcg-primary);border-color:transparent;color:var(--nqcg-inverse);font-weight:600}\n.nqcg-pickbtn{\n  flex:0 0 auto;min-height:44px;padding:0 15px;border-radius:999px;cursor:pointer;\n  background:var(--nqcg-bg-subtle);color:var(--nqcg-heading);border:1px solid var(--nqcg-border);\n  font-size:13px;font-weight:500;display:inline-flex;align-items:center;gap:8px;\n}\n.nqcg-pickbtn:hover{border-color:var(--nqcg-primary)}\n.nqcg-pickbtn svg{width:13px;height:13px;transition:transform var(--nqcg-normal)}\n.nqcg-pickbtn[aria-expanded="true"] svg{transform:rotate(180deg)}\n.nqcg-picker{border-top:1px solid var(--nqcg-border);background:var(--nqcg-bg)}\n.nqcg-pickgrid{\n  display:grid;grid-template-columns:repeat(auto-fill,minmax(112px,1fr));gap:8px;\n  max-width:1500px;margin:0 auto;padding:14px clamp(14px,3vw,40px) 18px;\n}\n.nqcg-pickcell{\n  text-align:left;padding:10px 12px;min-height:64px;cursor:pointer;\n  background:var(--nqcg-bg-subtle);border:1px solid var(--nqcg-border);\n  border-radius:var(--nqcg-radius);color:var(--nqcg-body);\n  transition:background var(--nqcg-fast),border-color var(--nqcg-fast),color var(--nqcg-fast);\n}\n.nqcg-pickcell:hover{border-color:var(--nqcg-primary)}\n.nqcg-pickcell[aria-current="true"]{background:var(--nqcg-primary);border-color:transparent;color:var(--nqcg-inverse)}\n.nqcg-pickcell b{display:block;font-family:var(--nqcg-mono);font-size:16px;font-weight:600}
1\n.nqcg-pickcell span{display:block;font-size:11px;line-height:1.35;margin-top:3px;opacity:.72}\n\n/* main */\n.nqcg-main{\n  display:grid;grid-template-columns:repeat(auto-fit,minmax(320px,1fr));\n  gap:clamp(16px,2.4vw,28px);align-items:start;\n  max-width:1500px;margin:0 auto;padding:clamp(18px,3vw,40px) clamp(14px,3vw,40px);\n}\n.nqcg-col{display:flex;flex-direction:column;gap:clamp(16px,2.4vw,28px);min-width:0}\n.nqcg-card{\n  background:var(--nqcg-bg);border:1px solid color-mix(in srgb, var(--nqcg-heading) 12%, transparent);\n  border-radius:var(--nqcg-radius-lg);box-shadow:var(--nqcg-shadow-sm);\n  padding:clamp(18px,2.5vw,28px);min-width:0;\n}\n.nqcg-label{margin:0 0 10px;font-weight:700;font-size:11px;letter-spacing:.18em;text-transform:uppercase;color:var(--nqcg-muted)}\n.nqcg-h2{\n  margin:0 0 12px;font-family:var(--nqcg-font-heading);font-weight:700;\n  font-size:clamp(19px,2.1vw,25px);letter-spacing:-.015em;color:var(--nqcg-heading);\n}\n.nqcg-tip{margin:0;font-size:clamp(15px,1.3vw,17px);line-height:1.62;max-width:62ch}\n.nqcg-notes{margin:16px 0 0;font-size:15px;line-height:1.68;max-width:62ch}\n.nqcg-notes p{margin:0 0 12px}\n.nqcg-notes p:last-child{margin-bottom:0}\n.nqcg-toggle{\n  margin-top:16px;min-height:44px;padding:0 16px;border-radius:999px;cursor:pointer;\n  display:inline-flex;align-items:center;gap:9px;\n  background:transparent;border:1px solid var(--nqcg-border-dark);\n  color:var(--nqcg-primary);font-size:14px;font-weight:600;\n  transition:background var(--nqcg-fast),border-color var(--nqcg-fast);\n}\n.nqcg-toggle:hover{background:var(--nqcg-bg-subtle);border-color:var(--nqcg-primary)}\n.nqcg-toggle svg{width:12px;height:12px;transition:transform var(--nqcg-normal)}\n.nqcg-toggle[aria-expanded="true"] svg{transform:rotate(180deg)}\n.nqcg-pro{\n  margin-top:18px;padding:14px 16px;border-radius:var(--nqcg-radius);\n  background:var(--nqcg-cream);border:1px solid var(--nqcg-cream-line);\n  display:flex;gap:12px;align-items:flex-start;\n}\n.nqcg-pro b{\n  flex:0 0 auto;font-family:var(--nqcg-mono);font-size:10px;font-weight:600;letter-spacing:.14em;\n  padding:3px 7px;border-radius:4px;\n  background:color-mix(in srgb, var(--nqcg-accent) 82%, transparent);color:#fff;\n}\n.nqcg-pro p{margin:0;font-style:italic;font-size:14px;line-height:1.6}\n\n/* tee yardages */\n.nqcg-tees{display:grid;grid-template-columns:repeat(auto-fit,minmax(112px,1fr));gap:10px}\n.nqcg-tee{\n  background:var(--nqcg-bg-subtle);border-radius:var(--nqcg-radius);\n  border-left:3px solid var(--nqcg-tee,var(--nqcg-primary));padding:11px 13px;min-width:0;\n}\n.nqcg-tee em{display:block;font-style:normal;font-size:11px;font-weight:600;letter-spacing:.1em;text-transform:uppercase;color:var(--nqcg-muted)}\n.nqcg-tee strong{\n  display:block;margin-top:4px;font-family:var(--nqcg-mono);\n  font-size:clamp(17px,1.8vw,21px);font-weight:600;color:var(--nqcg-heading);font-variant-numeric:tabular-nums;\n}\n.nqcg-tee span{font-family:var(--nqcg-mono);font-size:11px;color:var(--nqcg-muted);margin-left:3px}\n\n/* diagram */\n.nqcg-diagram{border-radius:var(--nqcg-radius-lg);box-shadow:var(--nqcg-shadow-lg);background:var(--nqcg-deep);overflow:hidden}\n.nqcg-diagram-inner{background:linear-gradient(180deg, var(--nqcg-deep-2), var(--nqcg-deep));padding:clamp(16px,2.2vw,24px)}\n.nqcg-diaghead{display:flex;align-items:baseline;justify-content:space-between;gap:12px;margin-bottom:8px}\n.nqcg-diaghead p{margin:0;font-weight:700;font-size:11px;letter-spacing:.18em;text-transform:uppercase;color:var(--nqcg-peach)}\n.nqcg-diaghead span{font-family:var(--nqcg-mono);font-size:11px;color:rgba(255,255,255,.5)}\n.nqcg-svgwrap{height:clamp(300px,46vh,470px);display:grid;place-items:center}\n.nqcg-svgwrap svg{height:100%;width:100%}\n.nqcg-diagimg{height:clamp(300px,46vh,470px);width:100%;object-fit:contain;display:block}\n.nqcg-legend{display:flex;flex-wrap:wrap;gap:8px 20px;margin-top:14px;padding-top:13px;border-top:1px solid rgba(255,255,255,.10)}\n.nqcg-legend div{display:flex;align-items:center;gap:7px;font-size:12px;color:rgba(255,255,255,.66)}\n.nqcg-legend i{width:13px;height:13px;border-radius:3px;display:block}\n\n/* footer */\n.nqcg-foot{\n  /* Always two across. auto-fit with a 240px floor needed 492px for the pair,\n     so a 390px phone got them stacked — two thirds of a screen spent on\n     navigation. Everything inside scales with clamp() rather than a\n     breakpoint, which the rest of this block does not use either. */\n  display:grid;grid-template-columns:1fr 1fr;gap:clamp(8px,1.6vw,12px);\n  max-width:1500px;margin:0 auto;padding:0 clamp(14px,3vw,40px) clamp(28px,4vw,56px);\n}\n.nqcg-footbtn{\n  min-height:60px;padding:12px clamp(11px,2vw,18px);cursor:pointer;text-align:left;\n  border-radius:var(--nqcg-radius-lg);border:1px solid var(--nqcg-border);\n  background:var(--nqcg-bg-subtle);color:var(--nqcg-heading);\n  display:flex;align-items:center;gap:clamp(8px,1.6vw,14px);min-width:0;\n  transition:background var(--nqcg-fast),border-color var(--nqcg-fast);\n}\n.nqcg-footbtn:hover{border-color:var(--nqcg-primary);background:var(--nqcg-bg-muted)}\n.nqcg-footbtn--next{flex-direction:row-reverse;text-align:right}\n.nqcg-footbtn svg{width:16px;height:16px;flex:0 0 auto;color:var(--nqcg-primary)}\n.nqcg-footbtn em{\n  display:block;font-style:normal;font-weight:700;text-transform:uppercase;color:var(--nqcg-muted);\n  font-size:clamp(9px,2.2vw,10px);letter-spacing:clamp(.08em,.35vw,.16em);\n  white-space:nowrap;overflow:hidden;text-overflow:ellipsis;\n}\n.nqcg-footbtn strong{\n  display:block;margin-top:3px;font-family:var(--nqcg-font-heading);font-weight:700;\n  font-size:clamp(13px,3.4vw,16px);letter-spacing:-.01em;\n  /* a long hole name truncates rather than pushing the pair apart */\n  white-space:nowrap;overflow:hidden;text-overflow:ellipsis;\n}\n.nqcg-footbtn i{flex:1 1 auto;min-width:0}\n.nqcg-sr{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0}\n\n@media (prefers-reduced-motion: reduce){\n  .nqcg *,.nqcg *::before,.nqcg *::after{transition-duration:.01ms !important;animation-duration:.01ms !important}\n  .nqcg-strip{scroll-behavior:auto}\n}\n'}}),(0,n.jsxs)("header",{className:"nqcg-header",ref:T,children:[(0,n.jsx)("span",{className:"nqcg-crest","aria-hidden":"true",children:r.logoUrl?(0,n.jsx)("img",{src:r.logoUrl,alt:""}):r.initials}),(0,n.jsxs)("div",{children:[(0,n.jsx)("p",{className:"nqcg-clubname",children:r.name}),Q?(0,n.jsx)("p",{className:"nqcg-clubmeta",children:Q}):null]})]}),(0,n.jsxs)("section",{className:"nqcg-hero".concat(A?" has-dots":""),role:"region","aria-roledescription":"carousel","aria-label":"Photographs of hole ".concat(M.number),onTouchStart:e=>{G.current={x:e.touches[0].clientX,y:e.touches[0].clientY,done:!1}},onTouchMove:e=>{let t=G.current;if(!t||t.done)return;let r=e.touches[0].clientX-t.x;
1if(Math.abs(e.touches[0].clientY-t.y)>Math.abs(r)){G.current=null;return}Math.abs(r)>=40&&(H(g+(r<0?1:-1)),t.done=!0)},onTouchEnd:()=>{G.current=null},children:[0===L?(0,n.jsx)("div",{className:"nqcg-empty",children:(0,n.jsx)("span",{className:"nqcg-watermark",children:r.name})}):P.map((e,t)=>(0,n.jsx)("div",{className:"nqcg-slide".concat(t===g?" is-active":""),children:"video"===e.kind&&e.videoUrl&&(S||w||!e.src)?(0,n.jsx)("video",{src:e.videoUrl,poster:e.src||void 0,muted:!0,playsInline:!0,autoPlay:S?t===g:w&&t===g,loop:S&&1===L,controls:!S,onEnded:S&&t===g?I:void 0}):(0,n.jsx)("img",{src:e.src,alt:e.caption||e.label,loading:0===t?"eager":"lazy",style:e.focalPoint?{objectPosition:e.focalPoint}:void 0})},t)),(0,n.jsx)("div",{className:"nqcg-scrim","aria-hidden":"true"}),F?(0,n.jsxs)("span",{className:"nqcg-count",children:[g+1," / ",L]}):null,E?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("button",{type:"button",className:"nqcg-arrow nqcg-arrow--prev","aria-label":"Previous media",onClick:()=>H(g-1),children:(0,n.jsx)(s,{d:"M15 18l-6-6 6-6"})}),(0,n.jsx)("button",{type:"button",className:"nqcg-arrow nqcg-arrow--next","aria-label":"Next media",onClick:()=>H(g+1),children:(0,n.jsx)(s,{d:"M9 18l6-6-6-6"})})]}):null,A?(0,n.jsx)("div",{className:"nqcg-dotwrap",children:(0,n.jsx)("div",{className:"nqcg-dots",children:P.map((e,t)=>(0,n.jsx)("button",{type:"button",className:"nqcg-dot".concat(t===g?" is-active":""),"aria-label":"Show slide ".concat(t+1," of ").concat(L),onClick:()=>H(t)},t))})}):null,!S&&U&&"video"===U.kind&&U.videoUrl&&U.src&&!w?(0,n.jsx)("button",{type:"button",className:"nqcg-play","aria-label":"Play ".concat(U.label),onClick:()=>k(!0),children:(0,n.jsx)("span",{children:(0,n.jsx)("svg",{viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:(0,n.jsx)("path",{d:"M8 5v14l11-7z"})})})}):null,(0,n.jsxs)("div",{className:"nqcg-identity",children:[(0,n.jsxs)("p",{className:"nqcg-eyebrow",children:["Hole ",M.number]}),(0,n.jsx)("h1",{className:"nqcg-holename",children:M.name}),(0,n.jsxs)("div",{className:"nqcg-facts",children:[M.par?(0,n.jsxs)("span",{className:"nqcg-chip nqcg-chip--par",children:["Par ",M.par]}):null,M.yardages[0]?(0,n.jsxs)("span",{className:"nqcg-chip",children:[o(M.yardages[0].yards,i.units)," ",l(i.units)]}):null,M.strokeIndex?(0,n.jsxs)("span",{className:"nqcg-chip",children:["SI ",M.strokeIndex]}):null]}),(null==U?void 0:U.caption)?(0,n.jsx)("p",{className:"nqcg-caption",children:U.caption}):null]}),(0,n.jsx)("span",{className:"nqcg-sr","aria-live":"polite",children:L?"".concat(null==U?void 0:U.label,", slide ").concat(g+1," of ").concat(L):""})]}),(0,n.jsxs)("nav",{className:"nqcg-nav","aria-label":"Hole navigation",children:[(0,n.jsxs)("div",{className:"nqcg-navrow",children:[(0,n.jsx)("button",{type:"button",className:"nqcg-step","aria-label":"Previous hole",onClick:()=>R(p-1),children:(0,n.jsx)(s,{d:"M15 18l-6-6 6-6"})}),(0,n.jsx)("div",{className:"nqcg-strip",ref:_,role:"group","aria-label":"Holes 1 to ".concat(h),children:d.map((e,t)=>(0,n.jsx)("button",{type:"button",className:"nqcg-holebtn","data-hole-index":t,"aria-label":e.par?"Hole ".concat(e.number,", par ").concat(e.par):"Hole ".concat(e.number),"aria-current":t===p?"true":void 0,onClick:()=>R(t),children:e.number},e.number))}),(0,n.jsx)("button",{type:"button",className:"nqcg-step","aria-label":"Next hole",onClick:()=>R(p+1),children:(0,n.jsx)(s,{d:"M9 18l6-6-6-6"})}),(0,n.jsxs)("button",{type:"button",className:"nqcg-pickbtn",ref:B,"data-nqcg-pickbtn":!0,"aria-expanded":v,onClick:()=>{var e;let t=!v;j(t),t||null==(e=B.current)||e.focus()},children:["Jump to hole",(0,n.jsx)(s,{d:"M6 9l6 6 6-6"})]})]}),v?(0,n.jsx)("div",{className:"nqcg-picker","data-nqcg-picker":!0,children:(0,n.jsx)("div",{className:"nqcg-pickgrid",ref:z,children:d.map((e,t)=>(0,n.jsxs)("button",{type:"button",className:"nqcg-pickcell","aria-label":e.par?"Hole ".concat(e.number,", ").concat(e.name,", par ").concat(e.par):"Hole ".concat(e.number,", ").concat(e.name),"aria-current":t===p?"true":void 0,onClick:()=>R(t),children:[(0,n.jsx)("b",{children:e.number}),(0,n.jsxs)("span",{children:[e.name,e.par?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("br",{}),"Par ",e.par]}):null]})]},e.number))})}):null]}),J||Z||$?(0,n.jsxs)("main",{className:"nqcg-main",children:[(0,n.jsxs)("div",{className:"nqcg-col",children:[J?(0,n.jsxs)("article",{className:"nqcg-card",children:[(0,n.jsx)("p",{className:"nqcg-label",children:"How to play"}),(0,n.jsx)("h2",{className:"nqcg-h2",children:M.name}),O?(0,n.jsx)("p",{className:"nqcg-tip",children:O}):null,Y?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("button",{type:"button",className:"nqcg-toggle","aria-expanded":b,"aria-controls":"nqcg-notes-".concat(M.number),onClick:()=>y(e=>!e),children:[b?"Hide the full notes":"Read the full hole notes",(0,n.jsx)(s,{d:"M6 9l6 6 6-6"})]}),(0,n.jsx)("div",{className:"nqcg-notes",id:"nqcg-notes-".concat(M.number),hidden:!b,children:Y})]}):null,V?(0,n.jsxs)("aside",{className:"nqcg-pro",children:[(0,n.jsx)("b",{children:"PRO"}),(0,n.jsx)("p",{children:V})]}):null]}):null,Z?(0,n.jsxs)("section",{className:"nqcg-card",children:[(0,n.jsx)("p",{className:"nqcg-label",children:"Tee yardages"}),(0,n.jsx)("div",{className:"nqcg-tees",children:M.yardages.map(e=>(0,n.jsxs)("div",{className:"nqcg-tee",style:{"--nqcg-tee":e.colour},children:[(0,n.jsx)("em",{children:e.tee}),(0,n.jsxs)("strong",{children:[o(e.yards,i.units),(0,n.jsx)("span",{children:l(i.units)})]})]},e.tee))})]}):null]}),$&&M.diagram?(0,n.jsx)("div",{className:"nqcg-col",children:(0,n.jsx)("section",{className:"nqcg-diagram",children:(0,n.jsxs)("div",{className:"nqcg-diagram-inner",children:[(0,n.jsxs)("div",{className:"nqcg-diaghead",children:[(0,n.jsx)("p",{children:"Hole diagram"}),(0,n.jsx)("span",{children:"image"===M.diagram.source?"club plan":"surveyed"})]}),"image"===M.diagram.source?(0,n.jsx)("img",{className:"nqcg-diagimg",src:M.diagram.src,alt:"Plan of hole ".concat(M.number),loading:"lazy"}):(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{className:"nqcg-svgwrap",children:(0,n.jsx)(u,{hole:M,units:i.units})}),(0,n.jsx)("div",{className:"nqcg-legend",children:(function(e){if(!e||"geo"!==e.source)return[];let t=new Set(e.layers.map(e=>e.kind));return m.filter(e=>{let[r]=e;return t.has(r)}).map(e=>{let[t,r]=e;return{label:r,colour:c[t]}})})(M.diagram).map(e=>(0,n.jsxs)("div",{children:[(0,n.jsx)("i",{style:{background:e.colour}}),e.label]},e.label))})]})]})})}):null]}):null,(0,n.jsxs)("footer",{className:"nqcg-foot",children:[(0,n.jsxs)("button",{type:"button",className:"nqcg-footbtn",onClick:()=>R(p-1),children:[(0,n.jsx)(s,{d:"M15 18l-6-6 6-6"}),(0,n.jsxs)("i",{children:[(0,n.jsx)("em",{children:"Previous"}),(0,n.jsxs)("strong",{children:[X.number,". ",X.name]})]})]}),(0,n.jsxs)("button",{type:"button",className:"nqcg-footbtn nqcg-footbtn--next",onClick:()=>R(p+1),children:[(0,n.jsx)(s,{d:"M9 18l6-6-6-6"}),(0,n.jsxs)("i",{children:[(0,n.jsx)("em",{children:"Next"}),(0,n.jsxs)("strong",{children:[K.number,". ",K.name]})]})]})]})]}):null}let c={hole:"var(--nqcg-rough)",fairway:"var(--nqcg-fairway)",water:"var(--nqcg-water)",bunker:"var(--nqcg-sand)",green:"var(--nqcg-green)",tee:"rgba(255,255,255,.88)"},d={200:"#f4f4f2",150:"#e3c34a",100:"#c0392b"},m=[["fairway","Fairway"],["bunker","Bunker"],["water","Water"],["green","Green"]];function u(e){var t;let{hole:r,units:a}=e,l=r.diagram;return l&&"geo"===l.source?(0,n.jsxs)("svg",{viewBox:"0 0 200 420",preserveAspectRatio:"xMidYMid meet",role:"img","aria-label":"Plan of hole ".concat(r.number,", tee at the bottom and green at the top"),children:[l.layers.map((e,t)=>{var r;return(0,n.jsx)("path",{d:e.d,fill:null!=(r=c[e.kind])?r:"var(--nqcg-rough)",stroke:"hole"===e.kind?"rgba(255,255,255,.16)":"none",strokeWidth:+("hole"===e.kind)},t)}),(null!=(t=l.markers)?t:[]).map(e=>{var t;return(0,n.jsxs)("g",{children:[(0,n.jsx)("path",{d:e.arc,fill:"none",stroke:"rgba(255,255,255,.30)",strokeWidth:"1",strokeDasharray:"4 5"}),(0,n.jsx)("circle",{cx:e.dot.x,cy:e.dot.y,r:"3.4",fill:null!=(t=d[e.yards])?t:"#ffffff",stroke:"rgba(18,28,26,.55)",strokeWidth:"0.8"}),(0,n.jsx)("text",{x:e.dot.x+6,y:e.dot.y+3,fontFamily:"ui-monospace,Menlo,monospace",fontSize:"8.5",fill:"rgba(255,255,255,.62)",children:o(e.yards,a)})]},e.yards)}),l.flag?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("line",{x1:l.flag.x,y1:l.flag.y,x2:l.flag.x,y2:l.flag.y-34,stroke:"#ffffff",strokeWidth:"1.6",strokeLinecap:"round"}),(0,n.jsx)("path",{d:"M".concat(l.flag.x+.8," ").concat(l.flag.y-34,"\n                L").concat(l.flag.x+17," ").concat(l.flag.y-28.5,"\n                L").concat(l.flag.x+.8," ").concat(l.flag.y-23," Z"),fill:"#d64545",stroke:"rgba(0,0,0,.25)",strokeWidth:"0.5",strokeLinejoin:"round"}),(0,n.jsx)("circle",{cx:l.flag.x,cy:l.flag.y,r:"2.6",fill:"#1d2b1a",stroke:"rgba(255,255,255,.55)",strokeWidth:"0.7"})]}):null,l.tee?(0,n.jsx)("text",{x:l.tee.x,y:Math.min(l.tee.y+14,416),textAnchor:"middle",fontFamily:"ui-monospace,Menlo,monospace",fontSize:"8.5",letterSpacing:"1.4",fill:"rgba(255,255,255,.55)",children:"TEE"}):null]}):null}},49801:(e,t,r)=>{"use strict";r.d(t,{MatchResultsListBlock:()=>s});var n=r(29064);r(34340);var a=r(50933),o=r.n(a),l=r(13702);let s=e=>{let{heading:t,matchResults:r=[],showDate:a=!0,showScore:s=!0,showCompetition:i=!0,showVenue:c=!1,displayStyle:d="table",linkToDetail:m=!0,emptyMessage:u="No match results found."}=e,h=(0,l.useRouter)();if(0===r.length)return(0,n.jsxs)("div",{className:"match-results-list py-4",children:[t&&(0,n.jsx)("h3",{className:"text-xl font-semibold mb-4",children:t}),(0,n.jsx)("p",{className:"text-muted-foreground",children:u})]});let p=e=>new Date(e).toLocaleDateString("en-GB",{day:"numeric",month:"short",year:"numeric"}),x=e=>{switch(e){case"home":return"#22c55e";case"away":return"#ef4444";case"draw":return"#f59e0b";default:return"#6b7280"}};return"table"===d?(0,n.jsxs)("div",{className:"match-results-list py-4",children:[t&&(0,n.jsx)("h3",{className:"text-xl font-semibold mb-4",children:t}),(0,n.jsx)("div",{className:"overflow-x-auto",children:(0,n.jsxs)("table",{className:"w-full border-collapse text-sm",children:[(0,n.jsx)("thead",{children:(0,n.jsxs)("tr",{className:"bg-muted",children:[a&&(0,n.jsx)("th",{className:"p-3 text-left font-semibold",children:"Date"}),(0,n.jsx)("th",{className:"p-3 text-left font-semibold",children:"Match"}),s&&(0,n.jsx)("th",{className:"p-3 text-center font-semibold",children:"Score"}),i&&(0,n.jsx)("th",{className:"p-3 text-left font-semibold",children:"Competition"}),c&&(0,n.jsx)("th",{className:"p-3 text-left font-semibold",children:"Venue"}),(0,n.jsx)("th",{className:"p-3 text-center font-semibold w-12",children:"Result"})]})}),(0,n.jsx)("tbody",{children:r.map(e=>(0,n.jsxs)("tr",{className:"border-b border-border hover:bg-muted/50 transition-colors ".concat(m?"cursor-pointer":""),onClick:m?()=>h.push("/matches/".concat(e.slug)):void 0,children:[a&&(0,n.jsx)("td",{className:"p-3 whitespace-nowrap",children:p(e.matchDate)}),(0,n.jsxs)("td",{className:"p-3",children:[(0,n.jsx)("span",{className:"font-medium",children:e.homeTeam}),(0,n.jsx)("span",{className:"text-muted-foreground mx-2",children:"vs"}),(0,n.jsx)("span",{className:"font-medium",children:e.awayTeam})]}),s&&(0,n.jsxs)("td",{className:"p-3 text-center font-semibold",children:[e.homeScore||"-"," - ",e.awayScore||"-"]}),i&&(0,n.jsx)("td",{className:"p-3 text-muted-foreground",children:e.competition||"-"}),c&&(0,n.jsx)("td",{className:"p-3 text-muted-foreground",children:e.venue||"-"}),(0,n.jsx)("td",{className:"p-3 text-center",children:(0,n.jsx)("span",{className:"inline-flex items-center justify-center w-7 h-7 rounded-full text-white font-bold text-xs",style:{backgroundColor:x(e.result)},children:(e=>{switch(e){case"home":return"W";case"away":return"L";case"draw":return"D";default:return"-"}})(e.result)})})]},e.id))})]})})]}):"cards"===d?(0,n.jsxs)("div",{className:"match-results-list py-4",children:[t&&(0,n.jsx)("h3",{className:"text-xl font-semibold mb-4",children:t}),(0,n.jsx)("div",{className:"grid gap-4 sm:grid-cols-2",children:r.map(e=>{let t=(0,n.jsxs)("div",{className:"p-4 border border-border rounded-lg hover:shadow-md transition-shadow",style:{borderLeftWidth:"4px",borderLeftColor:x(e.result)},children:[(0,n.jsxs)("div",{className:"flex justify-between items-start mb-2",children:[(0,n.jsxs)("div",{children:[(0,n.jsx)("div",{className:"font-semibold",children:e.homeTeam}),(0,n.jsxs)("div",{className:"text-muted-foreground text-sm",children:["vs ",e.awayTeam]})]}),s&&(0,n.jsxs)("div",{className:"text-xl font-bold",children:[e.homeScore||"-"," - ",e.awayScore||"-"]})]}),(0,n.jsxs)("div",{className:"flex gap-3 text-sm text-muted-foreground",children:[a&&(0,n.jsx)("span",{children:p(e.matchDate)}),i&&e.competition&&(0,n.jsx)("span",{children:e.competition})]})]},e.id);return m?(0,n.jsx)(o(),{href:"/matches/".concat(e.slug),className:"block",children:t},e.id):t})})]}):(0,n.jsxs)("div",{className:"match-results-list py-4",children:[t&&(0,n.jsx)("h3",{className:"text-xl font-semibold mb-4",children:t}),(0,n.jsx)("div",{className:"space-y-2",children:r.map(e=>{let t=(0,n.jsxs)("div",{className:"flex items-center justify-between p-2 hover:bg-muted/50 rounded transition-colors",children:[(0,n.jsxs)("div",{className:"flex items-center gap-3",children:[(0,n.jsx)("span",{className:"w-2 h-2 rounded-full",style:{backgroundColor:x(e.result)}}),(0,n.jsxs)("span",{className:"font-medium",children:[e.homeTeam," vs ",e.awayTeam]}),s&&(0,n.jsxs)("span",{className:"text-muted-foreground",children:["(",e.homeScore||"-"," - ",e.awayScore||"-",")"]})]}),a&&(0,n.jsx)("span",{className:"text-sm text-muted-foreground",children:p(e.matchDate)})]},e.id);return m?(0,n.jsx)(o(),{href:"/matches/".concat(e.slug),className:"block",children:t},e.id):t})})]})}},51404:(e,t,r)=>{"use strict";r.r(t),r.d(t,{BadgeIcon:()=>c,DynamicIcon:()=>i,default:()=>d});var n=r(29064);r(34340);var a=r(35501),o=r(92971),l=r(38039),s=r(51703);let i=e=>{let{name:t,size:r=24,strokeWidth:i=2,className:c,style:d,fallback:m="none"}=e,u=(0,s.sW)(t);return u?(0,n.jsx)(u,{size:r,strokeWidth:i,className:c,style:d}):"fileText"===m?(0,n.jsx)(a.A,{size:r,strokeWidth:i,className:c,style:d}):"star"===m?(0,n.jsx)(o.A,{size:r,strokeWidth:i,className:c,style:d}):"briefcase"===m?(0,n.jsx)(l.A,{size:r,strokeWidth:i,className:c,style:d}):null},c=e=>{let{name:t,style:r}=e;if(!t||"none"===t)return null;let a=(0,s.sW)(t);
1return a?(0,n.jsx)(a,{style:{width:"1rem",height:"1rem",...r}}):null},d=i},51487:(e,t,r)=>{"use strict";function n(e){if(!e)return"";if(e.startsWith("/"))return e;try{return new URL(e).pathname}catch(t){return e}}r.d(t,{e:()=>n})},51703:(e,t,r)=>{"use strict";r.d(t,{sW:()=>p,aH:()=>g,d0:()=>x});var n=r(5194),a=r(17312);let o=(0,a.A)("facebook",[["path",{d:"M18 2h-3a5 5 0 0 0-5 5v3H7v4h3v8h4v-8h3l1-4h-4V7a1 1 0 0 1 1-1h3z",key:"1jg4f8"}]]),l=(0,a.A)("instagram",[["rect",{width:"20",height:"20",x:"2",y:"2",rx:"5",ry:"5",key:"2e1cvw"}],["path",{d:"M16 11.37A4 4 0 1 1 12.63 8 4 4 0 0 1 16 11.37z",key:"9exkf1"}],["line",{x1:"17.5",x2:"17.51",y1:"6.5",y2:"6.5",key:"r4j83e"}]]),s=(0,a.A)("twitter",[["path",{d:"M22 4s-.7 2.1-2 3.4c1.6 10-9.4 17.3-18 11.6 2.2.1 4.4-.6 6-2C3 15.5.5 9.6 3 5c2.2 2.6 5.6 4.1 9 4-.9-4.2 4-6.6 7-3.8 1.1 0 3-1.2 3-1.2z",key:"pff0z6"}]]),i=(0,a.A)("youtube",[["path",{d:"M2.5 17a24.12 24.12 0 0 1 0-10 2 2 0 0 1 1.4-1.4 49.56 49.56 0 0 1 16.2 0A2 2 0 0 1 21.5 7a24.12 24.12 0 0 1 0 10 2 2 0 0 1-1.4 1.4 49.55 49.55 0 0 1-16.2 0A2 2 0 0 1 2.5 17",key:"1q2vi4"}],["path",{d:"m10 15 5-3-5-3z",key:"1jp15x"}]]),c=(0,a.A)("linkedin",[["path",{d:"M16 8a6 6 0 0 1 6 6v7h-4v-7a2 2 0 0 0-2-2 2 2 0 0 0-2 2v7h-4v-7a6 6 0 0 1 6-6z",key:"c2jq9f"}],["rect",{width:"4",height:"12",x:"2",y:"9",key:"mk3on5"}],["circle",{cx:"4",cy:"4",r:"2",key:"bt5ra8"}]]),d=(0,a.A)("github",[["path",{d:"M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4",key:"tonef"}],["path",{d:"M9 18c-4.51 2-5-2-7-2",key:"9comsn"}]]),m={Facebook:o,Instagram:l,Twitter:s,X:s,Youtube:i,YouTube:i,Linkedin:c,LinkedIn:c,Github:d,GitHub:d,Twitch:(0,a.A)("twitch",[["path",{d:"M21 2H3v16h5v4l4-4h5l4-4V2zm-10 9V7m5 4V7",key:"c0yzno"}]])},u={link:"Globe",document:"FileText",golf:"Flag",email:"Mail","map-pin":"MapPin",mappin:"MapPin",location:"MapPin",time:"Clock","file-text":"FileText","check-circle":"CircleCheck","alert-circle":"CircleAlert","help-circle":"CircleQuestionMark",warning:"TriangleAlert",error:"CircleAlert",chart:"ChartColumn",arrow:"ArrowRight","book-open":"BookOpen","credit-card":"CreditCard",creditcard:"CreditCard","dollar-sign":"DollarSign","shopping-cart":"ShoppingCart",world:"Globe",temperature:"Thermometer",microphone:"Mic",food:"Utensils",flight:"Plane",boat:"Ship",bicycle:"Bike",walk:"Footprints",camping:"Tent",smile:"FaceSlightlySmiling","smile-plus":"FaceSlightlySmilingPlus",frown:"FaceSlightlyFrowning",meh:"FaceNeutral",angry:"FaceAngry",annoyed:"FaceExpressionless",laugh:"FaceGrinning",album:"DiscAlbum","book-marked":"BookBookmark","trash-2":"Trash","building-2":"Building",history:"RotateCcwClock","rail-symbol":"TrainTrack","flip-horizontal":"MirrorRectangular","flip-horizontal-2":"MirrorRectangular","flip-vertical":"MirrorRectangular","flip-vertical-2":"MirrorRectangular","text-select":"TextCursor",waves:"WavesHorizontal",podcast:"MicVocal"},h=e=>{var t,r;return null!=(r=null!=(t=n[e])?t:m[e])?r:null},p=e=>{if(!e)return null;if(h(e))return h(e);let t=e.toLowerCase().replace(/[_\s]/g,"-"),r=u[t];if(r&&h(r))return h(r);let n=t.split("-").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join("");return h(n)?h(n):null},x=(e,t)=>"custom-lucide"===e?(null==t?void 0:t.trim())||void 0:e||void 0,g=e=>!!(e&&p(e))},52923:(e,t,r)=>{"use strict";r.d(t,{BookCtaLink:()=>o});var n=r(29064);r(34340);var a=r(29599);function o(e){let{href:t,style:r,className:o,children:l}=e;return(0,n.jsx)("a",{href:t,style:r,className:o,onClick:()=>(0,a.s)("book_cta_click",{product:"tee"}),children:l})}},61438:(e,t,r)=>{"use strict";r.d(t,{GiftVoucherBlock:()=>p});var n=r(29064),a=r(34340),o=r(87482),l=r(10021),s=r(23554),i=r(39911);let c=e=>{let{className:t,style:r}=e;return(0,n.jsxs)("svg",{className:t,style:r,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,n.jsx)("polyline",{points:"20 12 20 22 4 22 4 12"}),(0,n.jsx)("rect",{width:"20",height:"5",x:"2",y:"7"}),(0,n.jsx)("line",{x1:"12",x2:"12",y1:"22",y2:"7"}),(0,n.jsx)("path",{d:"M12 7H7.5a2.5 2.5 0 0 1 0-5C11 2 12 7 12 7z"}),(0,n.jsx)("path",{d:"M12 7h4.5a2.5 2.5 0 0 0 0-5C13 2 12 7 12 7z"})]})},d=e=>{let{className:t}=e;return(0,n.jsxs)("svg",{className:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,n.jsx)("rect",{width:"20",height:"14",x:"2",y:"3",rx:"2"}),(0,n.jsx)("line",{x1:"8",x2:"16",y1:"21",y2:"21"}),(0,n.jsx)("line",{x1:"12",x2:"12",y1:"17",y2:"21"})]})},m=e=>{let{className:t,style:r}=e;return(0,n.jsxs)("svg",{className:(0,o.cn)("animate-spin",t),style:r,viewBox:"0 0 24 24",fill:"none",children:[(0,n.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),(0,n.jsx)("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})]})},u=e=>{let{className:t}=e;return(0,n.jsxs)("svg",{className:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,n.jsx)("path",{d:"M22 11.08V12a10 10 0 1 1-5.93-9.14"}),(0,n.jsx)("polyline",{points:"22 4 12 14.01 9 11.01"})]})};function h(e){return new Intl.NumberFormat("en-GB",{style:"currency",currency:"GBP"}).format(e)}let p=e=>{var t;let{heading:r="Give the Gift of Golf",subheading:p,mode:x="both",amountTiers:g,studioTimeTiers:f,allowCustomAmount:b=!0,successPath:y,cancelPath:v,className:j,stripeMode:w}
1=e,k=(0,a.useMemo)(()=>(function(e){let t=(0,l.DM)(e.iconColor,e.iconColorCustom)||"var(--color-primary)",r=(0,l.DM)(e.headingColor,e.headingColorCustom)||"var(--color-primary-dark)";return{icon:t,heading:r,text:(0,l.DM)(e.textColor,e.textColorCustom)||"var(--color-primary-dark)",muted:"#64748b",surface:"#ffffff",surfaceSubtle:"rgba(15,23,42,0.035)",border:"rgba(15,23,42,0.10)",borderStrong:"rgba(15,23,42,0.18)",accent:t,onAccent:"#ffffff"}})(e),[e]),N="gv-"+(0,a.useId)().replace(/[^a-zA-Z0-9_-]/g,""),C=x||"both",S=g&&g.length>0?g:[{label:"\xa325",amount:25},{label:"\xa350",amount:50},{label:"\xa375",amount:75},{label:"\xa3100",amount:100}],_=f&&f.length>0?f:[{label:"30 mins",minutes:30,price:20},{label:"60 mins",minutes:60,price:35},{label:"90 mins",minutes:90,price:50}],[T,q]=(0,a.useState)("studioTime"===C?"studioTime":"gift"),[B,z]=(0,a.useState)(null),[M,P]=(0,a.useState)(""),[L,D]=(0,a.useState)(null),[W,A]=(0,a.useState)(1),[E,F]=(0,a.useState)(""),[R,I]=(0,a.useState)(""),[H,G]=(0,a.useState)(""),[U,O]=(0,a.useState)(""),[Y,V]=(0,a.useState)(!1),[J,Z]=(0,a.useState)(null),$=(0,a.useMemo)(()=>{var e;if("studioTime"===T)return null!=(e=null==L?void 0:L.price)?e:0;if(null!==B)return B;let t=parseFloat(M);return isNaN(t)?0:Math.round(t)},[T,B,M,L]),X=Math.max(1,Math.min(Math.trunc(W)||1,50)),K=$*X,Q=(0,a.useMemo)(()=>!Y&&!!E.trim()&&!!R.trim()&&!!U.trim()&&("studioTime"===T?null!==L:$>=1),[Y,E,R,U,T,L,$]);async function ee(){var e;if(!Q)return;V(!0),Z(null);let t=100*$,r="studioTime"===T?null!=(e=null==L?void 0:L.minutes)?e:0:void 0;try{let e=await fetch("/api/shop/voucher-checkout",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({voucher_type:T,amount_pence:t,quantity:X,...void 0!==r?{minutes:r}:{},recipient_name:E.trim(),recipient_email:R.trim(),message:H.trim()||void 0,buyer_email:U.trim(),success_path:y||"/?gift=success",cancel_path:v||"/"})}),n=await e.json().catch(()=>({}));if(!e.ok)return void Z((null==n?void 0:n.error)||"Failed to start checkout (".concat(e.status,")"));n.checkoutUrl?window.location.href=n.checkoutUrl:Z("No checkout URL returned — please try again.")}catch(e){Z("Could not reach the checkout service. Please try again.")}finally{V(!1)}}let et="\n#".concat(N," .gv-pill{border:1px solid ").concat(k.borderStrong,";color:").concat(k.text,";background:").concat(k.surface,";transition:border-color .15s ease,color .15s ease,background .15s ease;}\n#").concat(N," .gv-pill:not(.gv-pill--sel):not(:disabled):hover{border-color:").concat(k.accent,";color:").concat(k.accent,";}\n#").concat(N," .gv-pill--sel{background:").concat(k.accent,";border-color:").concat(k.accent,";color:").concat(k.onAccent,";box-shadow:0 8px 18px -10px color-mix(in srgb,").concat(k.accent," 70%,transparent);}\n#").concat(N," .gv-type-btn{border:1px solid ").concat(k.borderStrong,";color:").concat(k.text,";background:").concat(k.surfaceSubtle,";border-radius:14px;padding:1rem 1.25rem;text-align:left;transition:border-color .15s ease,box-shadow .15s ease,background .15s ease;}\n#").concat(N," .gv-type-btn:not(.gv-type-btn--sel):hover{border-color:").concat(k.accent,";}\n#").concat(N," .gv-type-btn--sel{border-color:").concat(k.accent,";background:color-mix(in srgb,").concat(k.accent," 10%,").concat(k.surface,");box-shadow:0 0 0 2px color-mix(in srgb,").concat(k.accent," 45%,transparent);}\n#").concat(N," .gv-input{background:#ffffff;border:1px solid ").concat(k.borderStrong,";color:").concat(k.text,";transition:border-color .15s ease,box-shadow .15s ease;}\n#").concat(N," .gv-input::placeholder{color:").concat(k.muted,";}\n#").concat(N," .gv-input:focus{outline:none;border-color:").concat(k.accent,";box-shadow:0 0 0 3px color-mix(in srgb,").concat(k.accent," 24%,transparent);}\n#").concat(N," .gv-cta{background:").concat(k.accent,";color:").concat(k.onAccent,";transition:filter .15s ease,box-shadow .15s ease;}\n#").concat(N," .gv-cta:not(:disabled):hover{filter:brightness(0.94);}\n#").concat(N," .gv-cta:disabled{opacity:0.5;cursor:not-allowed;}\n#").concat(N," .gv-cta:focus-visible{outline:none;box-shadow:0 0 0 3px color-mix(in srgb,").concat(k.accent," 35%,transparent);}\n").trim(),er={background:k.surface,color:k.text,borderRadius:"22px",border:"1px solid ".concat(k.border),boxShadow:"0 24px 60px -30px rgba(15,23,42,0.45), 0 0 0 1px rgba(15,23,42,0.04)",padding:"clamp(1.25rem, 3.2vw, 2.5rem)"},en={background:"#ffffff",border:"1px solid ".concat(k.borderStrong),color:k.text},ea={color:k.text};return(0,n.jsxs)("section",{className:(0,o.cn)("py-12 px-4 sm:px-6 lg:px-8",j),children:[(0,n.jsx)("style",{dangerouslySetInnerHTML:{__html:et}}),(0,n.jsxs)("div",{className:"mx-auto max-w-2xl",children:[(0,n.jsx)(i.PurchaseConfirmation,{}),(r||p)&&(0,n.jsxs)("div",{className:"text-center mb-8 sm:mb-10",children:[r&&(0,n.jsx)("h2",{className:"text-3xl sm:text-4xl font-bold tracking-tight",style:{color:k.heading},children:r}),p&&(0,n.jsx)("p",{className:"mt-3 text-base sm:text-lg max-w-xl mx-auto",style:{color:k.muted},children:p})]}),(0,n.jsxs)("div",{id:N,style:er,children:["both"===C&&(0,n.jsxs)("div",{className:"mb-7",children:[(0,n.jsx)("p",{className:"text-sm font-semibold mb-3",style:{color:k.muted},children:"What would you like to give?"}),(0,n.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,n.jsxs)("button",{type:"button",onClick:()=>{q("gift"),D(null)},className:(0,o.cn)("gv-type-btn flex items-start gap-3","gift"===T&&"gv-type-btn--sel"),children:[(0,n.jsx)(c,{className:"w-6 h-6 shrink-0 mt-0.5",style:{color:k.icon}}),(0,n.jsxs)("div",{children:[(0,n.jsx)("p",{className:"font-semibold text-sm",style:{color:k.text},children:"Gift Voucher"}),(0,n.jsx)("p",{className:"text-xs mt-0.5",style:{color:k.muted},children:"Lesson credit for any value"})]})]}),(0,n.jsxs)("button",{type:"button",onClick:()=>{q("studioTime"),z(null),P("")},className:(0,o.cn)("gv-type-btn flex items-start gap-3","studioTime"===T&&"gv-type-btn--sel"),children:[(0,n.jsx)(d,{className:"w-6 h-6 shrink-0 mt-0.5",style:{color:k.icon}}),(0,n.jsxs)("div",{children:[(0,n.jsx)("p",{className:"font-semibold text-sm",style:{color:k.text},children:"Studio Time"}),(0,n.jsx)("p",{className:"text-xs mt-0.5",style:{color:k.muted},children:"Simulator minutes as a gift"})]})]})]})]}),"gift"===T&&(0,n.jsxs)("div",{className:"mb-6",children:[(0,n.jsx)("p",{className:"text-sm font-semibold mb-3",style:{color:k.muted},children:"Select an amount"}),(0,n.jsx)("div",{className:"grid grid-cols-4 gap-2.5 mb-3",children:S.map(e=>(0,n.jsx)("button",{type:"button",onClick:()=>{z(e.amount),P("")}
1,className:(0,o.cn)("gv-pill rounded-xl py-3 text-sm font-semibold",B===e.amount&&""===M&&"gv-pill--sel"),children:e.label},e.amount))}),b&&(0,n.jsxs)("div",{children:[(0,n.jsx)("label",{className:"block text-xs font-medium mb-1.5",style:{color:k.muted},children:"Or enter a custom amount (\xa3)"}),(0,n.jsx)("input",{type:"number",min:1,step:1,value:M,onChange:e=>{P(e.target.value),z(null)},placeholder:"e.g. 60",className:"gv-input w-full px-4 py-2.5 rounded-lg text-sm",style:en})]})]}),"studioTime"===T&&(0,n.jsxs)("div",{className:"mb-6",children:[(0,n.jsx)("p",{className:"text-sm font-semibold mb-3",style:{color:k.muted},children:"Select a session length"}),(0,n.jsx)("div",{className:"grid grid-cols-3 gap-3",children:_.map(e=>(0,n.jsxs)("button",{type:"button",onClick:()=>D(e),className:(0,o.cn)("gv-type-btn flex flex-col items-center gap-1 text-center",(null==L?void 0:L.minutes)===e.minutes&&"gv-type-btn--sel"),children:[(0,n.jsx)(d,{className:"w-5 h-5",style:{color:k.icon}}),(0,n.jsx)("p",{className:"font-semibold text-sm",style:{color:k.text},children:e.label}),(0,n.jsx)("p",{className:"text-xs font-bold",style:{color:k.accent},children:h(e.price)})]},e.minutes))})]}),(0,n.jsx)("div",{className:"my-6",style:{borderTop:"1px solid ".concat(k.border)}}),(0,n.jsxs)("div",{className:"space-y-4 mb-6",children:[(0,n.jsx)("p",{className:"text-sm font-semibold",style:{color:k.muted},children:"Recipient details"}),(0,n.jsxs)("div",{children:[(0,n.jsxs)("label",{className:"block text-sm font-medium mb-1.5",style:ea,children:["Recipient name ",(0,n.jsx)("span",{style:{color:k.accent},children:"*"})]}),(0,n.jsx)("input",{type:"text",value:E,onChange:e=>F(e.target.value),placeholder:"Their name",className:"gv-input w-full px-4 py-2.5 rounded-lg text-sm",style:en})]}),(0,n.jsxs)("div",{children:[(0,n.jsxs)("label",{className:"block text-sm font-medium mb-1.5",style:ea,children:["Recipient email ",(0,n.jsx)("span",{style:{color:k.accent},children:"*"})]}),(0,n.jsx)("input",{type:"email",value:R,onChange:e=>I(e.target.value),placeholder:"[email protected]",className:"gv-input w-full px-4 py-2.5 rounded-lg text-sm",style:en})]}),(0,n.jsxs)("div",{children:[(0,n.jsxs)("label",{className:"block text-sm font-medium mb-1.5",style:ea,children:["Personal message ",(0,n.jsx)("span",{className:"font-normal text-xs",style:{color:k.muted},children:"(optional)"})]}),(0,n.jsx)("textarea",{value:H,onChange:e=>G(e.target.value),rows:3,placeholder:"Add a personal note to include with the voucher…",className:"gv-input w-full px-4 py-2.5 rounded-lg text-sm resize-none",style:en})]})]}),(0,n.jsxs)("div",{className:"mb-6",children:[(0,n.jsx)("p",{className:"text-sm font-semibold mb-3",style:{color:k.muted},children:"Your details"}),(0,n.jsxs)("div",{children:[(0,n.jsxs)("label",{className:"block text-sm font-medium mb-1.5",style:ea,children:["Your email ",(0,n.jsx)("span",{style:{color:k.accent},children:"*"})]}),(0,n.jsx)("input",{type:"email",value:U,onChange:e=>O(e.target.value),placeholder:"[email protected]",className:"gv-input w-full px-4 py-2.5 rounded-lg text-sm",style:en}),(0,n.jsx)("p",{className:"text-xs mt-1.5",style:{color:k.muted},children:"We will send your receipt here."})]})]}),(0,n.jsxs)("div",{className:"mb-6",children:[(0,n.jsx)("label",{className:"block text-sm font-medium mb-1.5",style:ea,children:"Quantity"}),(0,n.jsxs)("div",{className:"flex items-center gap-3",children:[(0,n.jsx)("button",{type:"button","aria-label":"Decrease quantity",onClick:()=>A(e=>Math.max(1,Math.trunc(e||1)-1)),disabled:X<=1,className:"gv-pill w-10 h-10 rounded-lg text-lg font-semibold flex items-center justify-center disabled:opacity-40",children:"−"}),(0,n.jsx)("input",{type:"number",min:1,max:50,value:W,onChange:e=>{let t=parseInt(e.target.value,10);A(isNaN(t)?1:Math.max(1,Math.min(t,50)))},className:"gv-input w-16 px-3 py-2.5 rounded-lg text-sm text-center",style:en}),(0,n.jsx)("button",{type:"button","aria-label":"Increase quantity",onClick:()=>A(e=>Math.min(50,Math.trunc(e||1)+1)),disabled:X>=50,className:"gv-pill w-10 h-10 rounded-lg text-lg font-semibold flex items-center justify-center disabled:opacity-40",children:"+"}),X>1&&$>0&&(0,n.jsxs)("span",{className:"text-sm",style:{color:k.muted},children:[X," \xd7 ",h($)]})]}),(0,n.jsx)("p",{className:"text-xs mt-1.5",style:{color:k.muted},children:"Each voucher gets its own code; all are sent to the recipient above."})]}),J&&(0,n.jsx)("div",{className:"mb-4 p-3 rounded-lg bg-red-50 border border-red-200",children:(0,n.jsx)("p",{className:"text-sm font-medium text-red-700",children:J})}),$>0&&(0,n.jsxs)("div",{className:"flex items-center justify-between mb-5 px-4 py-3 rounded-xl",style:{background:k.surfaceSubtle,border:"1px solid ".concat(k.border)},children:[(0,n.jsxs)("div",{children:[(0,n.jsxs)("p",{className:"text-xs uppercase tracking-wide font-semibold",style:{color:k.muted},children:["studioTime"===T?"Studio time — ".concat(null!=(t=null==L?void 0:L.label)?t:""):"Gift voucher",X>1?" \xd7 ".concat(X):""]}),(0,n.jsx)("p",{className:"text-lg font-bold mt-0.5",style:{color:k.text},children:h(K)})]}),(0,n.jsx)(c,{className:"w-8 h-8 opacity-30",style:{color:k.icon}})]}),"test"===w&&(0,n.jsx)(s.C,{className:"mb-4"}),(0,n.jsx)("button",{type:"button",onClick:ee,disabled:!Q,className:"gv-cta w-full py-3.5 rounded-xl text-base font-semibold flex items-center justify-center gap-2",children:Y?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(m,{className:"h-5 w-5"}),(0,n.jsx)("span",{children:"Redirecting to checkout…"})]}):(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(u,{className:"h-5 w-5"}),(0,n.jsx)("span",{children:$>0?"Buy — ".concat(h(K)):"Select an amount to continue"})]})})]})]})]})}},65767:(e,t,r)=>{"use strict";r.d(t,{CompactHourlyPager:()=>C,FullGridShell:()=>w,FullHourlyToggle:()=>k,HeaderWidthShell:()=>j,MIN_HEADER_WIDTH:()=>v});
1var n=r(29064),a=r(34340),o=r(1834),l=r(17727);function s(e){let{size:t=24,className:r,children:a}=e;return(0,n.jsx)("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round",className:r,"aria-hidden":"true",children:a})}r(11782),r(7854),r(85450);let i="M17.5 18H7a4 4 0 1 1 .6-7.96A5.5 5.5 0 0 1 18 8.5a4.75 4.75 0 0 1-.5 9.5z",c=e=>(0,n.jsxs)(s,{...e,children:[(0,n.jsx)("circle",{cx:"12",cy:"12",r:"4"}),(0,n.jsx)("path",{d:"M12 2v2M12 20v2M4.9 4.9l1.4 1.4M17.7 17.7l1.4 1.4M2 12h2M20 12h2M4.9 19.1l1.4-1.4M17.7 6.3l1.4-1.4"})]}),d=e=>(0,n.jsxs)(s,{...e,children:[(0,n.jsx)("circle",{cx:"8",cy:"8",r:"3"}),(0,n.jsx)("path",{d:"M8 1.5V3M1.5 8H3M3.4 3.4l1 1M12.6 3.4l-1 1"}),(0,n.jsx)("path",{d:"M18.5 19H9.5a3.5 3.5 0 1 1 .53-6.96A4.75 4.75 0 0 1 19.4 10a4 4 0 0 1-.9 9z"})]}),m=e=>(0,n.jsx)(s,{...e,children:(0,n.jsx)("path",{d:i})}),u=e=>(0,n.jsxs)(s,{...e,children:[(0,n.jsx)("path",{d:i,transform:"translate(0 -2.5) scale(0.92)"}),(0,n.jsx)("path",{d:"M8 18v1M12 18v1M16 18v1M10 21v1M14 21v1"})]}),h=e=>(0,n.jsxs)(s,{...e,children:[(0,n.jsx)("path",{d:i,transform:"translate(0 -2.5) scale(0.92)"}),(0,n.jsx)("path",{d:"M8 17.5l-1 3M12.5 17.5l-1 3M17 17.5l-1 3"})]}),p=e=>(0,n.jsxs)(s,{...e,children:[(0,n.jsx)("path",{d:i,transform:"translate(0 -2.5) scale(0.92)"}),(0,n.jsx)("path",{d:"M8 18.5h.01M12 20h.01M16 18.5h.01M10 21.5h.01M14 21.5h.01",strokeWidth:"2.2"})]}),x=e=>(0,n.jsxs)(s,{...e,children:[(0,n.jsx)("path",{d:i,transform:"translate(0 -3) scale(0.88)"}),(0,n.jsx)("path",{d:"M5 18h14M7 21h10"})]}),g=e=>(0,n.jsxs)(s,{...e,children:[(0,n.jsx)("path",{d:i,transform:"translate(0 -2.5) scale(0.92)"}),(0,n.jsx)("path",{d:"M12.5 16l-2 3.5h3L11.5 23"})]}),f={color:"var(--color-text-muted)",fontSize:"var(--text-small)"};function b(e){let{degrees:t,size:r=12}=e,a="number"==typeof t&&Number.isFinite(t)?(t+180)%360:null;return null===a?null:(0,n.jsxs)("svg",{width:r,height:r,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.2",strokeLinecap:"round",strokeLinejoin:"round",style:{transform:"rotate(".concat(a,"deg)"),flexShrink:0},"aria-hidden":"true",children:[(0,n.jsx)("path",{d:"M12 3v18"}),(0,n.jsx)("path",{d:"M6 15l6 6 6-6"})]})}function y(e){let{hour:t,compact:r,shaded:a,fillHeight:o}=e,l=function(e){let t=(e||"").toLowerCase();return t.includes("thunder")?g:t.includes("snow")||t.includes("sleet")?p:t.includes("fog")||t.includes("mist")?x:t.includes("drizzle")?u:t.includes("rain")||t.includes("shower")?h:t.includes("overcast")||t.includes("cloudy")?m:t.includes("partly")||t.includes("mainly")?d:t.includes("clear")||t.includes("sun")?c:d}(t.icon);return(0,n.jsxs)("div",{title:[t.conditions,t.windspeed&&"wind ".concat(t.windspeed),t.precipitation].filter(Boolean).join(" \xb7 "),style:{display:"flex",flexDirection:"column",alignItems:"center",gap:r?"0.1rem":"0.2rem",minWidth:r?"2.75rem":"4rem",padding:r?"0.35rem 0.15rem":"0.5rem 0.25rem",borderRadius:0,backgroundColor:a?"color-mix(in srgb, var(--color-text-muted) 10%, transparent)":"transparent",...o?{height:"100%",boxSizing:"border-box"}:{}},children:[(0,n.jsx)("span",{style:{...f,fontSize:r?"0.65rem":f.fontSize},children:t.timeOfDay}),(0,n.jsx)("span",{style:{color:"var(--color-primary)",display:"flex"},children:(0,n.jsx)(l,{size:r?15:20})}),(0,n.jsx)("span",{style:{fontSize:r?"0.7rem":"var(--text-small)",fontWeight:600},children:(t.temperature||"").replace("\xb0C","\xb0")}),(0,n.jsxs)("span",{style:{...f,fontSize:r?"0.65rem":f.fontSize,display:"inline-flex",alignItems:"center",gap:"0.1rem"},children:[(0,n.jsx)(b,{degrees:t.winddirectionDegrees,size:r?8:10}),(t.windspeed||"").replace(" mph",""),!r&&t.winddirection?" ".concat(t.winddirection):""]})]})}let v=340;function j(e){let{header:t,children:r}=e,o=(0,a.useRef)(null),[l,s]=(0,a.useState)(void 0);return(0,a.useLayoutEffect)(()=>{let e=o.current;if(!e)return;let t=()=>s(e.getBoundingClientRect().width);t();let r=new ResizeObserver(t);return r.observe(e),()=>r.disconnect()},[]),(0,n.jsxs)("div",{style:{display:"inline-block",maxWidth:"100%",verticalAlign:"top"},children:[(0,n.jsx)("div",{ref:o,style:{display:"inline-block",maxWidth:"100%",minWidth:v},children:t}),(0,n.jsx)("div",{style:{width:l,marginTop:"0.75rem",display:"flex",flexDirection:"column",gap:"0.75rem"},children:r})]})}function w(e){let{header:t,dayStrip:r,courseStatus:o,hourly:l}=e,s=(0,a.useRef)(null),i=(0,a.useRef)(null),[c,d]=(0,a.useState)(void 0),[m,u]=(0,a.useState)(void 0);return(0,a.useLayoutEffect)(()=>{let e=s.current;if(!e)return;let t=()=>d(e.getBoundingClientRect().width);t();let r=new ResizeObserver(t);return r.observe(e),()=>r.disconnect()},[]),(0,a.useLayoutEffect)(()=>{let e=i.current;if(!e)return;let t=()=>u(e.getBoundingClientRect().height);t();let r=new ResizeObserver(t);return r.observe(e),()=>r.disconnect()},[]),(0,n.jsxs)("div",{style:{display:"grid",gridTemplateColumns:c?"".concat(c,"px minmax(0, 1fr)"):"auto minmax(0, 1fr)",gap:"0.75rem 2rem",alignItems:"stretch"},children:[(0,n.jsx)("div",{style:{gridColumn:1,gridRow:1},children:(0,n.jsx)("div",{ref:s,style:{display:"inline-block",maxWidth:"100%",minWidth:v},children:t})}),(0,n.jsx)("div",{style:{gridColumn:2,gridRow:1,minWidth:"16rem"},children:r}),(0,n.jsx)("div",{style:{gridColumn:1,gridRow:2,overflowY:"auto",height:m},children:o}),(0,n.jsx)("div",{ref:i,style:{gridColumn:2,gridRow:2,minWidth:0,alignSelf:"start"},children:l})]})}function k(e){let{hours:t,toggleable:r=!0}=e,[o,l]=(0,a.useState)(!0);if(!t.length)return null;let s=!r||o;return(0,n.jsxs)("div",{children:[r?(0,n.jsx)("button",{type:"button",onClick:()=>l(e=>!e),style:{background:"none",border:"none",padding:0,marginBottom:o?"0.5rem":0,color:"var(--color-primary)",fontSize:"var(--text-small)",fontWeight:600,cursor:"pointer"},"aria-expanded":o,children:o?"Hide hourly forecast":"Show hourly forecast"}):null,s?(0,n.jsx)("div",{style:{display:"flex",gap:"0.25rem",overflowX:"auto",paddingBottom:"0.25rem"},children:t.map((e,t)=>(0,n.jsx)("div",{style:{flex:"1 1 0"},children:(0,n.jsx)(y,{hour:e,shaded:t%2==0,fillHeight:!0})},e.timeOfDay))}):null]})}function N(e){let{direction:t,buttonRef:r}=e;return(0,n.jsx)("button",{ref:r,type:"button","aria-label":"prev"===t?"Previous hours":"Next hours",style:{flexShrink:0,display:"flex",alignItems:"center",justifyContent:"center",width:"1.5rem",height:"1.5rem",padding:0,border:"none",background:"none",color:"var(--color-primary)",cursor:"pointer"},children:(0,n.jsx)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.4",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:"prev"===t?(0,n.jsx)("path",{d:"M15 18l-6-6 6-6"}):(0,n.jsx)("path",{d:"M9 18l6-6-6-6"})})})}function C(e){let{hours:t}=e,[r,s]=(0,a.useState)(null),[i,c]=(0,a.useState)(null);if(!t.length)return null;let d=t.length>3;return(0,n.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"0.25rem"},children:[d?(0,n.jsx)(N,{direction:"prev",buttonRef:s}):null,(0,n.jsx)("div",{style:{flex:"1 1 auto",minWidth:0},children:(0,n.jsx)(o.RC,{modules:[l.Vx],navigation:!!d&&{prevEl:r,nextEl:i},slidesPerView:"auto",spaceBetween:4,grabCursor:!0,children:t.map((e,t)=>(0,n.jsx)(o.qr,{style:{width:"auto"},children:(0,n.jsx)(y,{hour:e,compact:!0,shaded:t%2==0})},e.timeOfDay))})}),d?(0,n.jsx)(N,{direction:"next",buttonRef:c}):null]})}},67145:(e,t,r)=>{"use strict";r.d(t,{SocialFeedCarousel:()=>u});
1var n=r(29064),a=r(34340);let o=()=>(0,n.jsx)("svg",{viewBox:"0 0 24 24",width:"32",height:"32",fill:"white",children:(0,n.jsx)("path",{d:"M8 5v14l11-7z"})}),l={instagram:"#E4405F",facebook:"#1877F2",tiktok:"#000000"},s={instagram:()=>(0,n.jsx)("svg",{viewBox:"0 0 24 24",width:"16",height:"16",fill:"currentColor",children:(0,n.jsx)("path",{d:"M12 2.163c3.204 0 3.584.012 4.85.07 3.252.148 4.771 1.691 4.919 4.919.058 1.265.069 1.645.069 4.849 0 3.205-.012 3.584-.069 4.849-.149 3.225-1.664 4.771-4.919 4.919-1.266.058-1.644.07-4.85.07-3.204 0-3.584-.012-4.849-.07-3.26-.149-4.771-1.699-4.919-4.92-.058-1.265-.07-1.644-.07-4.849 0-3.204.013-3.583.07-4.849.149-3.227 1.664-4.771 4.919-4.919 1.266-.057 1.645-.069 4.849-.069zM12 0C8.741 0 8.333.014 7.053.072 2.695.272.273 2.69.073 7.052.014 8.333 0 8.741 0 12c0 3.259.014 3.668.072 4.948.2 4.358 2.618 6.78 6.98 6.98C8.333 23.986 8.741 24 12 24c3.259 0 3.668-.014 4.948-.072 4.354-.2 6.782-2.618 6.979-6.98.059-1.28.073-1.689.073-4.948 0-3.259-.014-3.667-.072-4.947-.196-4.354-2.617-6.78-6.979-6.98C15.668.014 15.259 0 12 0zm0 5.838a6.162 6.162 0 100 12.324 6.162 6.162 0 000-12.324zM12 16a4 4 0 110-8 4 4 0 010 8zm6.406-11.845a1.44 1.44 0 100 2.881 1.44 1.44 0 000-2.881z"})}),facebook:()=>(0,n.jsx)("svg",{viewBox:"0 0 24 24",width:"16",height:"16",fill:"currentColor",children:(0,n.jsx)("path",{d:"M24 12.073c0-6.627-5.373-12-12-12s-12 5.373-12 12c0 5.99 4.388 10.954 10.125 11.854v-8.385H7.078v-3.47h3.047V9.43c0-3.007 1.792-4.669 4.533-4.669 1.312 0 2.686.235 2.686.235v2.953H15.83c-1.491 0-1.956.925-1.956 1.874v2.25h3.328l-.532 3.47h-2.796v8.385C19.612 23.027 24 18.062 24 12.073z"})}),tiktok:()=>(0,n.jsx)("svg",{viewBox:"0 0 24 24",width:"16",height:"16",fill:"currentColor",children:(0,n.jsx)("path",{d:"M12.525.02c1.31-.02 2.61-.01 3.91-.02.08 1.53.63 3.09 1.75 4.17 1.12 1.11 2.7 1.62 4.24 1.79v4.03c-1.44-.05-2.89-.35-4.2-.97-.57-.26-1.1-.59-1.62-.93-.01 2.92.01 5.84-.02 8.75-.08 1.4-.54 2.79-1.35 3.94-1.31 1.92-3.58 3.17-5.91 3.21-1.43.08-2.86-.31-4.08-1.03-2.02-1.19-3.44-3.37-3.65-5.71-.02-.5-.03-1-.01-1.49.18-1.9 1.12-3.72 2.58-4.96 1.66-1.44 3.98-2.13 6.15-1.72.02 1.48-.04 2.96-.04 4.44-.99-.32-2.15-.23-3.02.37-.63.41-1.11 1.04-1.36 1.75-.21.51-.15 1.07-.14 1.61.24 1.64 1.82 3.02 3.5 2.87 1.12-.01 2.19-.66 2.77-1.61.19-.33.4-.67.41-1.06.1-1.79.06-3.57.07-5.36.01-4.03-.01-8.05.02-12.07z"})})},i=e=>{let{item:t,showCaptions:r=!0,showLikes:a=!1,showDates:i=!1,showPlatformBadge:c=!0,rounded:d=!1,shadow:m=!1,hoverEffect:u="zoom"}=e,h="video"===t.contentType||"reel"===t.contentType,p=s[t.platform],x={position:"absolute",top:0,left:0,width:"100%",height:"100%",objectFit:"cover"};return(0,n.jsxs)("a",{href:t.permalink,target:"_blank",rel:"noopener noreferrer",className:"social-feed-card social-feed-card--".concat(u),style:{display:"block",overflow:"hidden",backgroundColor:"var(--color-bg-surface, #fff)",borderRadius:d?"var(--radius-lg, 12px)":"var(--radius-default, 6px)",boxShadow:m?"0 2px 8px rgba(0,0,0,0.1)":void 0,textDecoration:"none",color:"inherit",transition:"transform 0.2s ease, box-shadow 0.2s ease"},children:[(0,n.jsxs)("div",{style:{position:"relative",width:"100%",paddingBottom:"100%",overflow:"hidden",backgroundColor:"var(--color-bg-muted, #f0f0f0)"},children:[t.mediaUrl?(0,n.jsx)("img",{src:t.mediaUrl,alt:t.caption?t.caption.slice(0,100):"".concat(t.platform," post"),style:x,loading:"lazy"}):(0,n.jsx)("div",{style:{...x,display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"var(--color-bg-muted)"},children:p&&(0,n.jsx)(p,{})}),h&&(0,n.jsx)("div",{style:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",width:56,height:56,borderRadius:"50%",backgroundColor:"rgba(0,0,0,0.5)",display:"flex",alignItems:"center",justifyContent:"center"},children:(0,n.jsx)(o,{})}),c&&p&&(0,n.jsx)("div",{style:{position:"absolute",top:8,right:8,width:28,height:28,borderRadius:"50%",backgroundColor:l[t.platform]||"#333",color:(t.platform,"#fff"),display:"flex",alignItems:"center",justifyContent:"center"},children:(0,n.jsx)(p,{})})]}),(r||a||i)&&(0,n.jsxs)("div",{style:{padding:"10px 12px"},children:[r&&t.caption&&(0,n.jsx)("p",{style:{margin:0,fontSize:"var(--text-small, 0.875rem)",lineHeight:1.4,color:"var(--color-text, #333)",display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical",overflow:"hidden"},children:t.caption}),(0,n.jsxs)("div",{style:{display:"flex",gap:12,marginTop:r&&t.caption?6:0,fontSize:"var(--text-xs, 0.75rem)",color:"var(--color-text-muted, #888)"},children:[a&&null!=t.likeCount&&(0,n.jsxs)("span",{children:[t.likeCount.toLocaleStr
1ing()," likes"]}),i&&t.publishedAt&&(0,n.jsx)("span",{children:new Date(t.publishedAt).toLocaleDateString(void 0,{month:"short",day:"numeric"})})]})]})]})},c={small:"8px",medium:"16px",large:"24px"},d=()=>(0,n.jsx)("svg",{viewBox:"0 0 24 24",width:"24",height:"24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:(0,n.jsx)("polyline",{points:"15 18 9 12 15 6"})}),m=()=>(0,n.jsx)("svg",{viewBox:"0 0 24 24",width:"24",height:"24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:(0,n.jsx)("polyline",{points:"9 6 15 12 9 18"})}),u=e=>{let{items:t,gap:r="medium",showCaptions:o,showLikes:l,showDates:s,showPlatformBadge:u,rounded:h,shadow:p,hoverEffect:x}=e,g=(0,a.useRef)(null),[f,b]=(0,a.useState)(!1),[y,v]=(0,a.useState)(!0),j=c[r]||c.medium,w=(0,a.useCallback)(()=>{let e=g.current;e&&(b(e.scrollLeft>5),v(e.scrollLeft<e.scrollWidth-e.clientWidth-5))},[]);(0,a.useEffect)(()=>{w();let e=g.current;if(e)return e.addEventListener("scroll",w,{passive:!0}),()=>e.removeEventListener("scroll",w)},[w]);let k=e=>{let t=g.current;if(!t)return;let r=.8*t.clientWidth;t.scrollBy({left:"left"===e?-r:r,behavior:"smooth"})};return(0,n.jsxs)("div",{style:{position:"relative"},children:[(0,n.jsx)("style",{children:"\n        .social-feed-carousel {\n          display: flex;\n          gap: ".concat(j,";\n          overflow-x: auto;\n          scroll-snap-type: x mandatory;\n          -webkit-overflow-scrolling: touch;\n          scrollbar-width: none;\n          padding-bottom: 4px;\n        }\n        .social-feed-carousel::-webkit-scrollbar { display: none; }\n        .social-feed-carousel > * {\n          flex: 0 0 280px;\n          scroll-snap-align: start;\n        }\n        @media (min-width: 640px) {\n          .social-feed-carousel > * { flex: 0 0 300px; }\n        }\n        .social-feed-card--zoom:hover img { transform: scale(1.05); }\n        .social-feed-card--zoom img { transition: transform 0.3s ease; }\n        .social-feed-card:hover {\n          transform: translateY(-2px);\n          box-shadow: 0 4px 12px rgba(0,0,0,0.12);\n        }\n        .social-carousel-arrow {\n          position: absolute;\n          top: 50%;\n          transform: translateY(-50%);\n          width: 40px;\n          height: 40px;\n          border-radius: 50%;\n          background: rgba(255,255,255,0.9);\n          border: 1px solid rgba(0,0,0,0.1);\n          display: flex;\n          align-items: center;\n          justify-content: center;\n          cursor: pointer;\n          z-index: 2;\n          transition: opacity 0.2s;\n          box-shadow: 0 2px 6px rgba(0,0,0,0.1);\n        }\n        .social-carousel-arrow:hover { background: #fff; }\n        .social-carousel-arrow--left { left: -16px; }\n        .social-carousel-arrow--right { right: -16px; }\n      ")}),f&&(0,n.jsx)("button",{className:"social-carousel-arrow social-carousel-arrow--left",onClick:()=>k("left"),"aria-label":"Scroll left",children:(0,n.jsx)(d,{})}),(0,n.jsx)("div",{ref:g,className:"social-feed-carousel",children:t.map(e=>(0,n.jsx)(i,{item:e,showCaptions:o,showLikes:l,showDates:s,showPlatformBadge:u,rounded:h,shadow:p,hoverEffect:x},e.id))}),y&&(0,n.jsx)("button",{className:"social-carousel-arrow social-carousel-arrow--right",onClick:()=>k("right"),"aria-label":"Scroll right",children:(0,n.jsx)(m,{})})]})}},70958:(e,t,r)=>{"use strict";r.d(t,{SignatureField:()=>o});var n=r(29064),a=r(34340);function o(e){let{name:t,label:r="Signature",required:o=!1,instructions:l,canvasHeight:s="medium",penColor:i="black",showClearButton:c=!0,width:d="100%"}=e,m=(0,a.useRef)(null),[u,h]=(0,a.useState)(""),p=(0,a.useRef)(!1),x=(0,a.useRef)({x:0,y:0}),g={small:"100px",medium:"150px",large:"200px"},f={black:"#000000",blue:"#2563eb",navy:"#1e3a5f"},b=g[s]||g.medium,y=f[i]||f.black;return(0,a.useEffect)(()=>{let e=m.current;if(!e)return;let t=e.getContext("2d");if(!t)return;let r=e.getBoundingClientRect();e.width=2*r.width,e.height=2*r.height,t.scale(2,2),t.strokeStyle=y,t.lineWidth=2,t.lineCap="round",t.lineJoin="round";let n=t=>{let r=e.getBoundingClientRect();return"touches"in t&&t.touches.length>0?{x:t.touches[0].clientX-r.left,y:t.touches[0].clientY-r.top}:"clientX"in t?{x:t.clientX-r.left,y:t.clientY-r.top}:{x:0,y:0}},a=e=>{p.current=!0,x.current=n(e)},o=e=>{if(!p.current)return;e.preventDefault();let r=n(e);t.beginPath(),t.moveTo(x.current.x,x.current.y),t.lineTo(r.x,r.y),t.stroke(),x.current=r},l=()=>{p.current&&(p.current=!1,h(e.toDataURL("image/png")))};return e.addEventListener("mousedown",a),e.addEventListener("mousemove",o),e.addEventListener("mouseup",l),e.addEventListener("mouseout",l),e.addEventListener("touchstart",a,{passive:!1}),e.addEventListener("touchmove",o,{passive:!1}),e.addEventListener("touchend",l),()=>{e.removeEventListener("mousedown",a),e.removeEventListener("mousemove",o),e.removeEventListener("mouseup",l),e.removeEventListener("mouseout",l),e.removeEventListener("touchstart",a),e.removeEventListener("touchmove",o),e.removeEventListener("touchend",l)}},[y]),(0,n.jsxs)("div",{style:{width:d,marginBottom:"1rem"},children:[(0,n.jsxs)("label",{style:{display:"block",marginBottom:"0.5rem",fontWeight:500},children:[r," ",o&&"*"]}),l&&(0,n.jsx)("p",{style:{fontSize:"0.875rem",color:"var(--color-text-muted)",marginTop:0,marginBottom:"0.5rem"},children:l}),(0,n.jsxs)("div",{style:{position:"relative"},children:[(0,n.jsx)("canvas",{ref:m,style:{width:"100%",height:b,border:"1px solid var(--color-border)",borderRadius:"var(--radius-default)",backgroundColor:"white",cursor:"crosshair",touchAction:"none"}}),(0,n.jsx)("input",{type:"hidden",name:t,value:u,required:o}),c&&(0,n.jsx)("button",{type:"button",onClick:()=>{let e=m.current,t=null==e?void 0:e.getContext("2d");t&&e&&(t.clearRect(0,0,e.width,e.height),h(""))},style:{position:"absolute",top:"0.5rem",right:"0.5rem",padding:"0.25rem 0.75rem",fontSize:"0.75rem",backgroundColor:"var(--color-bg-muted)",border:"1px solid var(--color-border)",borderRadius:"var(--radius-default)",cursor:"pointer"},children:"Clear"})]})]})}},71367:(e,t,r)=>{"use strict";r.d(t,{GolfGeniusLeaderboardBlock:()=>C});
1var n=r(29064),a=r(34340),o=r(87482),l=r(10021);function s(e){return"upcoming"===e.state||0===e.net?null:e.net>0?"home":"away"}function i(e){return e.matches.reduce((e,t)=>({home:e.home+t.points.home,away:e.away+t.points.away}),{home:0,away:0})}let c=e=>Number.isInteger(e)?"".concat(e):e.toFixed(1).replace(".5","\xbd"),d=e=>{let{name:t,color:r,logo:a,align:l="left"}=e;return(0,n.jsxs)("div",{className:(0,o.cn)("flex items-center gap-2 min-w-0","right"===l&&"flex-row-reverse text-right"),children:[a?(0,n.jsx)("img",{src:a,alt:"",className:"h-8 w-8 rounded-full object-cover bg-white shrink-0"}):(0,n.jsx)("span",{className:"h-8 w-8 rounded-full shrink-0 inline-flex items-center justify-center text-white text-xs font-bold",style:{backgroundColor:r},children:t.slice(0,2).toUpperCase()}),(0,n.jsx)("span",{className:"font-semibold text-gray-900 truncate",children:t})]})},m=e=>{let{m:t,homeColor:r,awayColor:a}=e,{main:l,sub:i}=function(e){if("upcoming"===e.state)return{main:"—",sub:e.teeTime?"Tee ".concat(e.teeTime):null};let t=Math.abs(e.net);if("finished"===e.state){var r;if(0===e.net)return{main:"A/S",sub:null};let n=18-(null!=(r=e.closedHole)?r:18);return n>0?{main:"".concat(t,"&").concat(n),sub:null}:{main:"".concat(t," UP"),sub:null}}return{main:0===e.net?"A/S":"".concat(t," UP"),sub:e.thru>0?"thru ".concat(e.thru):null}}(t),c=s(t),d="home"===c?r:"away"===c?a:void 0;return(0,n.jsxs)("div",{className:"text-center shrink-0 w-20",children:[(0,n.jsx)("span",{className:(0,o.cn)("inline-block px-2.5 py-1 rounded-full text-sm font-bold",c?"text-white":"bg-gray-100 text-gray-600"),style:d?{backgroundColor:d}:void 0,children:l}),i&&(0,n.jsx)("div",{className:"text-[11px] text-gray-500 mt-1",children:i}),"live"===t.state&&!i&&(0,n.jsx)("div",{className:"text-[11px] text-gray-500 mt-1",children:"live"})]})},u=e=>{let{side:t,align:r,emphasised:a}=e;return(0,n.jsxs)("div",{className:(0,o.cn)("flex-1 min-w-0","right"===r&&"text-right"),children:[t.players.map(e=>(0,n.jsx)("div",{className:(0,o.cn)("text-sm truncate",a?"font-semibold text-gray-900":"text-gray-700"),children:e},e)),t.club&&(0,n.jsx)("div",{className:"text-[11px] text-gray-400 truncate",children:t.club})]})},h=e=>{let{data:t}=e,r=t.sessions.reduce((e,t)=>{let r=i(t);return{home:e.home+r.home,away:e.away+r.away}},{home:0,away:0}),{pointsToWin:a,totalPoints:o,home:l,away:s}=t.event,m=o>0?r.home/o*100:0,u=o>0?r.away/o*100:0,h=o>0?a/o*100:50;return(0,n.jsxs)("div",{children:[(0,n.jsxs)("div",{className:"flex items-end justify-between mb-2",children:[(0,n.jsxs)("div",{className:"flex items-center gap-3",children:[(0,n.jsx)(d,{name:l.name,color:l.color,logo:l.logo}),(0,n.jsx)("span",{className:"text-3xl font-bold tabular-nums",style:{color:l.color},children:c(r.home)})]}),(0,n.jsxs)("div",{className:"text-xs text-gray-400 uppercase tracking-wider pb-2",children:["first to ",c(a)]}),(0,n.jsxs)("div",{className:"flex items-center gap-3",children:[(0,n.jsx)("span",{className:"text-3xl font-bold tabular-nums",style:{color:s.color},children:c(r.away)}),(0,n.jsx)(d,{name:s.name,color:s.color,logo:s.logo,align:"right"})]})]}),(0,n.jsxs)("div",{className:"relative h-3 rounded-full bg-gray-100 overflow-hidden",children:[(0,n.jsx)("div",{className:"absolute inset-y-0 left-0 rounded-l-full",style:{width:"".concat(m,"%"),backgroundColor:l.color}}),(0,n.jsx)("div",{className:"absolute inset-y-0 right-0 rounded-r-full",style:{width:"".concat(u,"%"),backgroundColor:s.color}}),(0,n.jsx)("div",{className:"absolute inset-y-0 w-0.5 bg-gray-500/60",style:{left:"".concat(h,"%")},title:"First to ".concat(c(a))})]})]})},p=e=>{let{m:t,data:r,onOpen:a}=e,o=s(t);return(0,n.jsxs)("button",{type:"button",onClick:a,className:"w-full text-left bg-white rounded-lg border border-gray-200 hover:border-gray-300 hover:shadow-sm transition p-3 flex items-center gap-3",children:[(0,n.jsx)("span",{className:"text-xs text-gray-400 w-5 shrink-0 tabular-nums",children:t.no}),(0,n.jsx)(u,{side:t.home,align:"left",emphasised:"home"===o}),(0,n.jsx)(m,{m:t,homeColor:r.event.home.color,awayColor:r.event.away.color}),(0,n.jsx)(u,{side:t.away,align:"right",emphasised:"away"===o})]})},x=e=>{let{m:t,data:r}=e,{home:a,away:l}=r.event,i=function(e){let t=0;return e.map(e=>("home"===e.winner?t+=1:"away"===e.winner&&(t-=1),0===t?"AS":"".concat(Math.abs(t))))}(t.holes);return(0,n.jsxs)("div",{className:"bg-white rounded-lg border border-gray-200 p-4",children:[(0,n.jsxs)("div",{className:"flex items-center gap-3 mb-4",children:[(0,n.jsx)(u,{side:t.home,align:"left",emphasised:"home"===s(t)}),(0,n.jsx)(m,{m:t,homeColor:a.color,awayColor:l.color}),(0,n.jsx)(u,{side:t.away,align:"right",emphasised:"away"===s(t)})]}),t.holes.length>0?(0,n.jsxs)("div",{className:"overflow-x-auto",children:[(0,n.jsx)("div",{className:"flex gap-1.5 min-w-max pb-1",children:t.holes.map((e,t)=>(0,n.jsxs)("div",{className:"flex flex-col items-center gap-1",children:[(0,n.jsx)("span",{className:"text-[10px] text-gray-400 tabular-nums",children:e.no}),(0,n.jsx)("span",{className:(0,o.cn)("h-6 w-6 rounded-full inline-flex items-center justify-center text-[10px] font-bold","halve"===e.winner&&"bg-gray-200 text-gray-500","halve"!==e.winner&&"text-white"),style:"home"===e.winner?{backgroundColor:a.color}:"away"===e.winner?{backgroundColor:l.color}:void 0,children:"halve"===e.winner?"\xbd":""}),(0,n.jsx)("span",{className:"text-[10px] text-gray-500 tabular-nums",children:i[t]})]},e.no))}),(0,n.jsxs)("div",{className:"flex gap-4 mt-3 text-[11px] text-gray-500",children:[(0,n.jsxs)("span",{className:"inline-flex items-center gap-1",children:[(0,n.jsx)("span",{className:"h-2.5 w-2.5 rounded-full inline-block",style:{backgroundColor:a.color}}),a.name," wins hole"]}),(0,n.jsxs)("span",{className:"inline-flex items-center gap-1",children:[(0,n.jsx)("span",{className:"h-2.5 w-2.5 rounded-full inline-block bg-gray-200"}),"halved"]}),(0,n.jsxs)("span",{className:"inline-flex items-center gap-1",children:[(0,n.jsx)("span",{className:"h-2.5 w-2.5 rounded-full inline-block",style:{backgroundColor:l.color}}),l.name," wins hole"]})]})]}):(0,n.jsx)("p",{className:"text-sm text-gray-400 text-center py-4",children:"upcoming"===t.state?t.teeTime?"Tees off at ".concat(t.teeTime):"Not started yet":"Hole-by-hole detail not available for this match"})]})},g=e=>{let{data:t}=e,[r,l]=(0,a.useState)({view:"overview"}),s=(0,a.useMemo)(()=>t.sessions.flatMap(e=>e.matches.filter(e=>"live"===e.state).map(t=>({session:e,match:t}))),[t]),d="overview"===r.view?null:t.sessions.find(e=>e.id===r.sessionId)||null,m="match"===r.view&&d&&d.matches.find(e=>e.no===r.matchNo)||null;return(0,n.jsxs)("div",{className:"max-w-3xl mx-auto",children:[(0,n.jsxs)("button",{type:"button",onClick:()=>l({view:"overview"}),className:"w-full text-left bg-white rounded-lg border border-gray-200 p-4 mb-4 block",children:[(0,n.jsx)("div",{className:"text-center text-xs text-gray-400 uppercase tracking-widest mb-3",children:t.event.title}),(0,n.jsx)(h,{data:t})]}),(0,n.jsx)("div",{className:"flex gap-2 mb-4",children:t.sessions.map(e=>{let t=i(e),a="overview"!==r.view&&r.sessionId===e.id;return(0,n.jsxs)("button",{type:"button",onClick:()=>l({view:"session",sessionId:e.id}),className:(0,o.cn)("flex-1 rounded-lg border px-3 py-2 text-sm transition",a?"border-gray-900":"border-gray-200 bg-white text-gray-700 hover:border-gray-300"),style:a?{backgroundColor:"#111827",color:"#ffffff"}:void 0,children:[(0,n.jsx)("span",{className:"font-semibold",children:e.name}),(0,n.jsxs)("span",{className:(0,o.cn)("ml-2 tabular-nums",a?"text-gray-300":"text-gray-400"),children:[c(t.home),"–",c(t.away)]}),e.timeLabel&&"overview"===r.view&&(0,n.jsx)("span",{className:"hidden sm:inline ml-2 text-[11px] opacity-60",children:e.timeLabel})]},e.id)})}),"overview"===r.view&&(0,n.jsxs)("div",{className:"space-y-2",children:[s.length>0&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("div",{className:"flex items-center gap-2 text-xs font-semibold text-gray-500 uppercase tracking-wider",children:[(0,n.jsxs)("span",{className:"relative flex h-2 w-2",children:[(0,n.jsx)("span",{className:"animate-ping absolute inline-flex h-full w-full rounded-full bg-red-400 opacity-75"}),(0,n.jsx)("span",{className:"relative inline-flex rounded-full h-2 w-2 bg-red-500"})]}),"On the course"]}),s.map(e=>{let{session:r,match:a}=e;return(0,n.jsx)(p,{m:a,data:t,onOpen:()=>l({view:"match",sessionId:r.id,matchNo:a.no})},"".concat(r.id,"-").concat(a.no))})]}),0===s.length&&(0,n.jsx)("p",{className:"text-sm text-gray-400 text-center py-4",children:"No matches on the course — pick a session above for all results."})]}),"session"===r.view&&d&&(0,n.jsxs)("div",{className:"space-y-2",children:[d.timeLabel&&(0,n.jsx)("div",{className:"text-xs text-gray-400",children:d.timeLabel}),d.matches.map(e=>(0,n.jsx)(p,{m:e,data:t,onOpen:()=>l({view:"match",sessionId:d.id,matchNo:e.no})},e.no))]}),"match"===r.view&&d&&m&&(0,n.jsxs)("div",{children:[(0,n.jsxs)("button",{type:"button",onClick:()=>l({view:"session",sessionId:d.id}
1),className:"text-sm text-gray-500 hover:text-gray-800 mb-2 inline-flex items-center gap-1",children:["← ",d.name]}),(0,n.jsx)(x,{m:m,data:t})]})]})},f=e=>{let{className:t}=e;return(0,n.jsxs)("svg",{className:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,n.jsx)("path",{d:"M6 9H4.5a2.5 2.5 0 0 1 0-5H6"}),(0,n.jsx)("path",{d:"M18 9h1.5a2.5 2.5 0 0 0 0-5H18"}),(0,n.jsx)("path",{d:"M4 22h16"}),(0,n.jsx)("path",{d:"M10 14.66V17c0 .55-.47.98-.97 1.21C7.85 18.75 7 20.24 7 22"}),(0,n.jsx)("path",{d:"M14 14.66V17c0 .55.47.98.97 1.21C16.15 18.75 17 20.24 17 22"}),(0,n.jsx)("path",{d:"M18 2H6v7a6 6 0 0 0 12 0V2Z"})]})},b=e=>{let{className:t}=e;return(0,n.jsxs)("svg",{className:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,n.jsx)("path",{d:"M7.21 15 2.66 7.14a2 2 0 0 1 .13-2.2L4.4 2.8A2 2 0 0 1 6 2h12a2 2 0 0 1 1.6.8l1.6 2.14a2 2 0 0 1 .14 2.2L16.79 15"}),(0,n.jsx)("path",{d:"M11 12 5.12 2.2"}),(0,n.jsx)("path",{d:"m13 12 5.88-9.8"}),(0,n.jsx)("path",{d:"M8 7h8"}),(0,n.jsx)("circle",{cx:"12",cy:"17",r:"5"}),(0,n.jsx)("path",{d:"M12 18v-2h-.5"})]})},y=e=>{let{className:t}=e;return(0,n.jsxs)("svg",{className:(0,o.cn)("animate-spin",t),viewBox:"0 0 24 24",fill:"none",children:[(0,n.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),(0,n.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"})]})};function v(e){return new Date(e).toLocaleDateString("en-GB",{day:"numeric",month:"long",year:"numeric"})}let j=e=>{let{competitions:t,selectedEvent:r,onEventChange:o,loading:l}=e,[s,i]=(0,a.useState)("all"),[c,d]=(0,a.useState)("all"),m=(0,a.useMemo)(()=>[...new Set(t.map(e=>e.season))].sort().reverse(),[t]),u=(0,a.useMemo)(()=>{let e=new Set;return t.forEach(t=>{t.competition_type&&e.add(t.competition_type)}),Array.from(e).sort()},[t]),h=(0,a.useMemo)(()=>{let e=[...t];return"all"!==s&&(e=e.filter(e=>e.season===s)),"all"!==c&&(e=e.filter(e=>e.competition_type===c)),e},[t,s,c]);return(0,n.jsxs)("div",{className:"flex flex-wrap items-center gap-4 mb-6 p-4 bg-gray-50 rounded-lg",children:[(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)("label",{className:"text-sm font-medium text-gray-600",children:"Season:"}),(0,n.jsxs)("select",{value:s,onChange:e=>i(e.target.value),className:"px-3 py-1.5 text-sm rounded-md border border-gray-300 bg-white",children:[(0,n.jsx)("option",{value:"all",children:"All Seasons"}),m.map(e=>(0,n.jsx)("option",{value:e,children:e},e))]})]}),u.length>0&&(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)("label",{className:"text-sm font-medium text-gray-600",children:"Category:"}),(0,n.jsxs)("select",{value:c,onChange:e=>d(e.target.value),className:"px-3 py-1.5 text-sm rounded-md border border-gray-300 bg-white",children:[(0,n.jsx)("option",{value:"all",children:"All Categories"}),u.map(e=>(0,n.jsx)("option",{value:e,children:e},e))]})]}),(0,n.jsxs)("div",{className:"flex items-center gap-2 flex-1 min-w-[250px]",children:[(0,n.jsx)("label",{className:"text-sm font-medium text-gray-600",children:"Event:"}),(0,n.jsxs)("select",{value:r||"",onChange:e=>o(e.target.value),disabled:l,className:"flex-1 px-3 py-1.5 text-sm rounded-md border border-gray-300 bg-white disabled:opacity-50",children:[(0,n.jsx)("option",{value:"",children:"Select an event..."}),h.map(e=>(0,n.jsxs)("option",{value:e.id,children:[e.name," (",v(e.date),")",e.total_players?" - ".concat(e.total_players," players"):""]},e.id))]})]})]})},w=/^-?\d+(\.\d+)?$|^[+-]?\d+$|^E$/i,k=e=>{let{data:t,title:r,subtitle:l,maxRows:s,highlightWinners:i}=e,[c,d]=(0,a.useState)(!1),{headers:m,rows:u}=t,h=c?u:u.slice(0,s),p=m.map((e,t)=>{if(0===t)return!0;if(1===t)return!1;let r=u.slice(0,5).map(e=>{var r;return(null==(r=e[t])?void 0:r.text)||""}).filter(Boolean);return!!r.length&&r.every(e=>w.test(e.trim()))});return(0,n.jsxs)("div",{className:"bg-white rounded-lg shadow-lg overflow-hidden",children:[(r||l)&&(0,n.jsxs)("div",{className:"p-4 flex items-center gap-2",style:{backgroundColor:"var(--color-primary)",color:"var(--color-primary-foreground)"},children:[(0,n.jsx)(f,{className:"h-5 w-5 text-yellow-400"}),(0,n.jsxs)("div",{children:[r&&(0,n.jsx)("h3",{className:"text-lg font-semibold leading-tight",style:{color:"var(--color-primary-foreground)"},children:r}),l&&(0,n.jsx)("p",{className:"text-sm",style:{color:"var(--color-primary-foreground)",opacity:.8},children:l})]})]}),(0,n.jsx)("div",{className:"overflow-x-auto",children:(0,n.jsxs)("table",{className:"w-full text-sm",children:[(0,n.jsx)("thead",{className:"bg-gray-50 border-b border-gray-200",children:(0,n.jsx)("tr",{children:m.map((e,t)=>(0,n.jsx)("th",{className:(0,o.cn)("px-4 py-3 text-xs font-semibold text-gray-600 uppercase tracking-wider whitespace-nowrap",p[t]?"text-right":"text-left"),dangerouslySetInnerHTML:{__html:e.replace(/\n/g,"<br/>")}},t))})}),(0,n.jsx)("tbody",{className:"divide-y divide-gray-100",children:h.map((e,t)=>{var r,a;let l=parseInt((null==(a=e[0])||null==(r=a.text)?void 0:r.trim())||"",10),s=i&&l>=1&&l<=3,c=function(e){switch(e){case 1:return{bg:"bg-yellow-100",text:"text-yellow-700"};case 2:return{bg:"bg-gray-100",text:"text-gray-700"};case 3:return{bg:"bg-orange-100",text:"text-orange-700"};default:return{bg:"bg-white",text:"text-gray-600"}}}(l);return(0,n.jsx)("tr",{className:(0,o.cn)("hover:bg-gray-50 transition-colors",s&&c.bg),children:e.map((e,t)=>{let r=p[t];if(0===t&&s)return(0,n.jsx)("td",{className:"px-4 py-3",children:(0,n.jsxs)("div",{className:(0,o.cn)("w-8 h-8 rounded-full flex items-center justify-center text-sm font-bold",c.bg,c.text),children:[1===l&&(0,n.jsx)(f,{className:"h-5 w-5 text-yellow-500"}),2===l&&(0,n.jsx)(b,{className:"h-5 w-5 text-gray-400"}),3===l&&(0,n.jsx)(b,{className:"h-5 w-5 text-orange-500"})]})},t);
1if(e.club)return(0,n.jsxs)("td",{className:"px-4 py-3",children:[(0,n.jsx)("div",{className:"font-medium text-gray-900",children:e.text}),(0,n.jsx)("div",{className:"text-xs text-gray-500",children:e.club})]},t);let a=e.text.trim(),i=r&&/^-\d/.test(a)?"text-green-600 font-semibold":r&&/^\+\d/.test(a)?"text-red-600 font-semibold":r?"text-gray-800":"text-gray-700";return(0,n.jsx)("td",{className:(0,o.cn)("px-4 py-3 whitespace-nowrap",r?"text-right":"text-left",i),children:a||"-"},t)})},t)})})]})}),u.length>s&&!c&&(0,n.jsx)("div",{className:"p-4 text-center border-t border-gray-100",children:(0,n.jsxs)("button",{onClick:()=>d(!0),className:"px-4 py-2 text-sm font-medium text-gray-700 hover:text-gray-900",children:["Show all ",u.length," players"]})})]})},N=e=>{let{eventId:t,height:r}=e;return(0,n.jsx)("div",{className:"bg-white rounded-lg shadow-lg overflow-hidden",children:(0,n.jsx)("iframe",{src:"https://www.golfgenius.com/leagues/".concat(t,"/widgets/tournament_results?shared=false"),width:"100%",height:r,style:{border:0,display:"block"},scrolling:"no",title:"Tournament bracket"})})},C=e=>{let{heading:t,eyebrow:r,displayMode:s="selector",eventId:i,eventName:c,eventDate:d,roundId:m,roundName:u,tournamentId:h,tournamentName:p,resultsRenderMode:x,iframeHeight:b,displayOptions:w,className:C,orgCode:S,apiBaseUrl:_,tenantId:T}=e,q="specific"===s||!!i,B="iframe"===x,[z,M]=(0,a.useState)([]),[P,L]=(0,a.useState)(null),[D,W]=(0,a.useState)(q&&i||null),[A,E]=(0,a.useState)(!0),[F,R]=(0,a.useState)(!1),[I,H]=(0,a.useState)(null),[G,U]=(0,a.useState)(S||null),O=(0,l.DM)(null==w?void 0:w.iconColor,null==w?void 0:w.iconColorCustom),Y=(0,l.DM)(null==w?void 0:w.headingColor,null==w?void 0:w.headingColorCustom),V=(0,l.DM)(null==w?void 0:w.textColor,null==w?void 0:w.textColorCustom);return((0,a.useEffect)(()=>{if(S)return void U(S);async function e(){try{let e=await fetch("/api/golf-genius/settings?tenantId=".concat(T));if(e.ok){let t=await e.json();t.orgCode&&U(t.orgCode)}}catch(e){console.error("Error fetching Golf Genius settings:",e)}}T&&e()},[S,T]),(0,a.useEffect)(()=>{if(q){i&&W(i),E(!1);return}if(!G){S||T||H("Organization code not configured"),E(!1);return}!async function(){try{let t=[];if(G)try{let e=await fetch("/api/unified-competitions/organizations/".concat(G,"/competitions-list?include_metadata=true"));e.ok&&(t=(await e.json()).competitions||[])}catch(e){}if(0===t.length)try{let r=T?"/api/golf-genius/events?tenantId=".concat(encodeURIComponent(String(T))):"/api/golf-genius/events",n=await fetch(r);if(n.ok){var e;let r=await n.json();(null==(e=r.events)?void 0:e.length)&&(t=r.events.map(e=>({id:e.id,ggid:e.ggid||"",name:e.name,date:e.date||"",season:e.date?e.date.substring(0,4):"",source:"golfgenius",competition_type:e.categoryName||""})))}}catch(e){}if(M(t),"latest"===s&&t.length>0){let e=t.filter(e=>new Date(e.date)<new Date).sort((e,t)=>new Date(t.date).getTime()-new Date(e.date).getTime());e.length>0&&W(e[0].id)}}catch(e){console.error("Error fetching competitions:",e),H(e instanceof Error?e.message:"Failed to load competitions")}finally{E(!1)}}()},[G,s,q,S,T]),(0,a.useEffect)(()=>{if(!D||B)return;let e=!1;return async function(){R(!0),H(null);try{let t=new URLSearchParams({eventId:D});q&&m&&t.set("roundId",m),q&&h&&t.set("tournamentId",h);let r=await fetch("/api/golf-genius/tournament-data?".concat(t)),n=await r.json();if(e)return;if(!r.ok)throw Error((null==n?void 0:n.error)||"Failed to load tournament (".concat(r.status,")"));L(n)}catch(t){if(e)return;console.error("[GG Leaderboard] tournament-data fetch failed:",t),L(null),H(t instanceof Error?t.message:"Failed to load tournament")}finally{e||R(!1)}}(),()=>{e=!0}},[D,q,m,h,B]),(0,a.useEffect)(()=>{if(!D||B||!P||"matchplay"!==P.format)return;let e=P.sessions.flatMap(e=>e.matches);if(e.length>0&&e.every(e=>"finished"===e.state))return;let t=setInterval(async()=>{if("undefined"==typeof document||!document.hidden)try{let e=new URLSearchParams({eventId:D,fresh:"1"});q&&m&&e.set("roundId",m),q&&h&&e.set("tournamentId",h);let t=await fetch("/api/golf-genius/tournament-data?".concat(e));t.ok&&L(await t.json())}catch(e){}},e.some(e=>"live"===e.state)?2e4:6e4);return()=>clearInterval(t)},[P,D,B,q,m,h]),I)?(0,n.jsx)("section",{className:(0,o.cn)("py-8 sm:py-16 lg:py-24 bg-white",C),children:(0,n.jsx)("div",{className:"mx-auto max-w-7xl px-4 sm:px-6 lg:px-8",children:(0,n.jsx)("div",{className:"text-center py-12 bg-gray-50 rounded-lg",children:(0,n.jsx)("p",{className:"text-red-600 font-medium",children:I})})})}):(0,n.jsx)("section",{className:(0,o.cn)("py-8 sm:py-16 lg:py-24 bg-white",C),children:(0,n.jsxs)("div",{className:"mx-auto max-w-7xl px-4 sm:px-6 lg:px-8",children:[(t||r)&&(0,n.jsxs)("div",{className:"text-center mb-6 sm:mb-10",children:[r&&(0,n.jsx)("p",{className:"font-medium tracking-widest uppercase text-sm mb-2",style:O?{color:O}:void 0,children:r}),t&&(0,n.jsx)("h2",{className:"text-2xl sm:text-3xl lg:text-4xl font-bold mb-2",style:Y?{color:Y}:void 0,children:t}),q&&c&&(0,n.jsx)("h3",{className:"text-xl mb-2",style:V?{color:V}:void 0,children:c}),q&&d&&(0,n.jsx)("p",{style:V?{color:V}:void 0,children:v(d)})]}),"selector"===s&&!q&&!A&&(0,n.jsx)(j,{competitions:z,selectedEvent:D,onEventChange:W,loading:F}),(A||F)&&(0,n.jsxs)("div",{className:"flex items-center justify-center py-16",children:[(0,n.jsx)(y,{className:"h-8 w-8 text-gray-400"}),(0,n.jsx)("span",{className:"ml-3 text-gray-500",children:A?"Loading competitions...":"Loading tournament..."})]}),B&&D&&(0,n.jsx)(N,{eventId:D,height:b||900}),!B&&!F&&P&&"leaderboard"===P.format&&(0,n.jsx)(k,{data:P,title:q&&(p||c)||void 0,subtitle:q&&u?u:void 0,maxRows:20,highlightWinners:!0}),!B&&!F&&P&&"bracket"===P.format&&(0,n.jsx)(N,{eventId:P.eventId,height:P.height}),!B&&!F&&P&&"matchplay"===P.format&&(0,n.jsx)(g,{data:P}),!B&&!A&&!F&&!P&&D&&!I&&(0,n.jsxs)("div",{className:"text-center py-16",children:[(0,n.jsx)(f,{className:"h-16 w-16 text-gray-300 mx-auto mb-4"}),(0,n.jsx)("p",{className:"text-gray-500 text-lg",children:"Tourn
1ament not available yet"}),(0,n.jsx)("p",{className:"text-gray-400 text-sm mt-2",children:"Check back during or after the event"})]}),!A&&!D&&"selector"===s&&!q&&(0,n.jsxs)("div",{className:"text-center py-16",children:[(0,n.jsx)(f,{className:"h-16 w-16 text-gray-300 mx-auto mb-4"}),(0,n.jsx)("p",{className:"text-gray-500 text-lg",children:"Select an event to view the leaderboard"})]}),!A&&!D&&q&&(0,n.jsxs)("div",{className:"text-center py-16",children:[(0,n.jsx)(f,{className:"h-16 w-16 text-gray-300 mx-auto mb-4"}),(0,n.jsx)("p",{className:"text-gray-500 text-lg",children:"No event configured for this leaderboard"}),(0,n.jsx)("p",{className:"text-gray-400 text-sm mt-2",children:"Open this block in the CMS and pick an event from Golf Genius."})]})]})})}},72718:(e,t,r)=>{"use strict";r.d(t,{ContactForm:()=>c});var n=r(29064),a=r(34340),o=r(41361),l=r(73037),s=r(29599),i=r(36015);function c(e){let{tenantId:t,showPhone:r=!0,phoneRequired:c=!1,showSubject:d=!0,subjectRequired:m=!1,subjectOptions:u=[],buttonText:h="Send Message",buttonColor:p="var(--color-primary)",successMessage:x="Thank you for your message. We will get back to you soon!",page:g,turnstileSiteKey:f}=e,[b,y]=(0,a.useState)(!1),[v,j]=(0,a.useState)("idle"),[w,k]=(0,a.useState)(""),N=(0,o.A$)(f),C=async e=>{e.preventDefault();let r=e.currentTarget;y(!0),j("idle"),k("");let n=new FormData(r),a={name:n.get("name"),email:n.get("email"),phone:n.get("phone")||void 0,subject:n.get("subject")||void 0,message:n.get("message"),honeypot:n.get("honeypot")||void 0,tenantId:t,page:g,utm:(0,i.hB)()},c={"Content-Type":"application/json"};if(N.enabled){let e=await (0,l.G)(N.getToken);if(!e){j("error"),k('Please complete the "Verify you are human" check below the form, then send again.'),y(!1);return}c[o.RZ]=e}try{let e=await fetch("/api/contact",{method:"POST",headers:c,body:JSON.stringify(a)}),t=await e.json();if(!e.ok)throw Error(t.error||"Failed to send message");j("success"),(0,s.s)("enquiry_submitted",{form:"contact"}),r.reset()}catch(e){j("error"),k(e instanceof Error?e.message:"Failed to send message. Please try again.")}finally{N.reset(),y(!1)}};return"success"===v?(0,n.jsxs)("div",{style:{padding:"2rem",backgroundColor:"var(--color-success-bg, #d4edda)",borderRadius:"var(--radius-lg)",textAlign:"center"},children:[(0,n.jsx)("div",{style:{fontSize:"2rem",marginBottom:"1rem"},children:"✓"}),(0,n.jsx)("p",{style:{margin:0,color:"var(--color-success, #155724)",fontWeight:500},children:x}),(0,n.jsx)("button",{type:"button",onClick:()=>j("idle"),style:{marginTop:"1rem",padding:"0.5rem 1rem",backgroundColor:"transparent",border:"1px solid var(--color-success, #155724)",borderRadius:"var(--radius-default)",color:"var(--color-success, #155724)",cursor:"pointer",fontSize:"0.875rem"},children:"Send another message"})]}):(0,n.jsxs)("form",{onSubmit:C,style:{display:"flex",flexDirection:"column",gap:"1rem"},children:["error"===v&&(0,n.jsx)("div",{style:{padding:"1rem",backgroundColor:"var(--color-error-bg, #f8d7da)",borderRadius:"var(--radius-default)",color:"var(--color-error, #721c24)"},children:w}),(0,n.jsxs)("div",{children:[(0,n.jsx)("label",{style:{display:"block",marginBottom:"0.5rem",fontWeight:500},children:"Name *"}),(0,n.jsx)("input",{type:"text",name:"name",required:!0,disabled:b,style:{width:"100%",padding:"0.75rem 1rem",borderRadius:"var(--radius-default)",border:"1px solid var(--color-border)",fontSize:"1rem",opacity:b?.7:1},placeholder:"Your name"})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)("label",{style:{display:"block",marginBottom:"0.5rem",fontWeight:500},children:"Email *"}),(0,n.jsx)("input",{type:"email",name:"email",required:!0,disabled:b,style:{width:"100%",padding:"0.75rem 1rem",borderRadius:"var(--radius-default)",border:"1px solid var(--color-border)",fontSize:"1rem",opacity:b?.7:1},placeholder:"[email protected]"})]}),r&&(0,n.jsxs)("div",{children:[(0,n.jsxs)("label",{style:{display:"block",marginBottom:"0.5rem",fontWeight:500},children:["Phone ",c?"*":""]}),(0,n.jsx)("input",{type:"tel",name:"phone",required:c,disabled:b,style:{width:"100%",padding:"0.75rem 1rem",borderRadius:"var(--radius-default)",border:"1px solid var(--color-border)",fontSize:"1rem",opacity:b?.7:1},placeholder:"Your phone number"})]}),d&&(0,n.jsxs)("div",{children:[(0,n.jsxs)("label",{style:{display:"block",marginBottom:"0.5rem",fontWeight:500},children:["Subject ",m?"*":""]}),u&&u.length>0?(0,n.jsxs)("select",{name:"subject",required:m,disabled:b,style:{width:"100%",padding:"0.75rem 1rem",borderRadius:"var(--radius-default)",border:"1px solid var(--color-border)",fontSize:"1rem",backgroundColor:"white",opacity:b?.7:1},children:[(0,n.jsx)("option",{value:"",children:"Select a subject"}),u.map((e,t)=>(0,n.jsx)("option",{value:e.option,children:e.option},t))]}):(0,n.jsx)("input",{type:"text",name:"subject",required:m,disabled:b,style:{width:"100%",padding:"0.75rem 1rem",borderRadius:"var(--radius-default)",border:"1px solid var(--color-border)",fontSize:"1rem",opacity:b?.7:1},placeholder:"Subject of your enquiry"})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)("label",{style:{display:"block",marginBottom:"0.5rem",fontWeight:500},children:"Message *"}),(0,n.jsx)("textarea",{name:"message",required:!0,disabled:b,rows:5,style:{width:"100%",padding:"0.75rem 1rem",borderRadius:"var(--radius-default)",border:"1px solid var(--color-border)",fontSize:"1rem",resize:"vertical",opacity:b?.7:1},placeholder:"How can we help you?"})]}),(0,n.jsx)("input",{type:"text",name:"honeypot",style:{display:"none"},tabIndex:-1,autoComplete:"off"}),N.enabled&&(0,n.jsx)("div",{ref:N.containerRef,style:{minHeight:65},"aria-label":"Verify you are human"}),(0,n.jsx)("button",{type:"submit",disabled:b,style:{padding:"0.875rem 2rem",backgroundColor:p,color:"white",border:"none",borderRadius:"var(--radius-default)",fontSize:"1rem",fontWeight:600,cursor:b?"wait":"pointer",transition:"opacity 0.2s",o
1pacity:b?.7:1},children:b?"Sending...":h})]})}},73114:(e,t,r)=>{"use strict";r.d(t,{AccordionContainerClient:()=>l});var n=r(29064),a=r(34340),o=r(1181);let l=e=>{let{heading:t,headingLevel:r="h2",sections:l,allowMultiple:s,showBorder:i,gap:c,iconPosition:d,headerBgColor:m,headerTextColor:u,contentBgColor:h,contentPadding:p}=e,[x,g]=(0,a.useState)(()=>{let e=[];return l.forEach((t,r)=>{t.defaultOpen&&e.push(r)}),e}),f={subtle:"var(--color-bg-subtle)",primary:"var(--color-primary)",primaryDark:"var(--color-primary-dark)",secondary:"var(--color-secondary)",transparent:"transparent"},b={heading:"var(--color-heading)",inverse:"white",primary:"var(--color-primary)"},y={white:"var(--color-bg)",subtle:"var(--color-bg-subtle)",transparent:"transparent"},v={none:"0",small:"0.75rem",medium:"1.5rem",large:"2rem"};if(0===l.length)return null;let j="inverse"===u;return(0,n.jsx)("section",{className:"accordion-block",children:(0,n.jsxs)("div",{className:"accordion-inner",children:[t&&(0,n.jsx)(r,{style:{marginBottom:"1.5rem",fontSize:"h2"===r?"1.75rem":"h3"===r?"1.5rem":"1.25rem",fontWeight:600,color:"var(--color-heading)"},children:t}),(0,n.jsx)("div",{style:{display:"flex",flexDirection:"column",gap:{none:"0",small:"0.5rem",medium:"1rem"}[c]||"0.5rem"},children:l.map((e,t)=>{let r=x.includes(t);return(0,n.jsxs)("div",{style:{border:i?"1px solid var(--color-border)":"none",borderRadius:i?"var(--radius-lg)":"0",overflow:"hidden"},children:[(0,n.jsxs)("button",{type:"button",onClick:()=>(e=>{g(t=>t.includes(e)?t.filter(t=>t!==e):s?[...t,e]:[e])})(t),style:{width:"100%",display:"flex",alignItems:"center",flexDirection:"left"===d?"row-reverse":"row",justifyContent:"space-between",padding:"1rem 1.25rem",border:"none",cursor:"pointer",textAlign:"left"===d?"right":"left",backgroundColor:f[m]||f.subtle,color:b[u]||b.heading},children:[(0,n.jsx)("span",{style:{fontWeight:600,fontSize:"1.1rem"},children:e.title}),(0,n.jsx)(o.A,{size:20,style:{color:j?"rgba(255,255,255,0.8)":"var(--color-text-muted)",transition:"transform 0.2s",transform:r?"rotate(180deg)":"rotate(0)"}})]}),(0,n.jsx)("div",{style:{maxHeight:r?"10000px":"0",overflow:"hidden",transition:"max-height 0.3s ease-in-out",backgroundColor:y[h]||y.white},children:(0,n.jsx)("div",{className:"accordion-content",style:{padding:v[p]||v.medium},children:e.renderedContent})})]},t)})})]})})}},74327:(e,t,r)=>{"use strict";r.d(t,{TabsBlock:()=>l});var n=r(29064),a=r(34340),o=r(51404);let l=e=>{let{tabs:t,styling:r,heading:l,description:s}=e,[i,c]=(0,a.useState)((null==r?void 0:r.defaultTab)||0),d=(null==r?void 0:r.tabStyle)||"underline",m=(null==r?void 0:r.tabAlignment)||"left";return t&&0!==t.length?(0,n.jsxs)("section",{style:{paddingTop:"var(--section-spacing)",paddingBottom:"0",backgroundColor:{white:"var(--color-bg)",muted:"var(--color-bg-muted)",primary:"var(--color-primary-subtle)"}[(null==r?void 0:r.backgroundStyle)||"white"]||"var(--color-bg)"},children:[(0,n.jsx)("style",{children:"\n        .tabs-block-mobile-select {\n          display: block;\n          margin-bottom: 1.5rem;\n        }\n        .tabs-block-desktop-tabs {\n          display: none;\n        }\n        @media (min-width: 768px) {\n          .tabs-block-mobile-select {\n            display: none;\n          }\n          .tabs-block-desktop-tabs {\n            display: flex;\n          }\n        }\n      "}),(0,n.jsxs)("div",{className:"container",children:[l&&(0,n.jsx)("h2",{children:l}),s&&(0,n.jsx)("p",{style:{color:"var(--color-text-muted)",marginBottom:"1.5rem"},children:s}),(0,n.jsx)("div",{className:"tabs-block-mobile-select",children:(0,n.jsx)("select",{value:i,onChange:e=>c(Number(e.target.value)),style:{width:"100%",padding:"0.75rem 1rem",fontSize:"1rem",fontWeight:500,border:"1px solid var(--color-border)",borderRadius:"var(--radius-default)",backgroundColor:"var(--color-bg)",color:"inherit",cursor:"pointer",appearance:"none",backgroundImage:"url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E\")",backgroundRepeat:"no-repeat",backgroundPosition:"right 1rem center",paddingRight:"2.5rem"},children:t.map((e,t)=>(0,n.jsx)("option",{value:t,children:e.label},t))})}),(0,n.jsx)("div",{className:"tabs-block-desktop-tabs",style:{gap:"0.5rem",marginBottom:"0",flexWrap:"wrap",...(()=>{switch(m){case"center":return{justifyContent:"center"};case"full":return{justifyContent:"stretch"};default:return{justifyContent:"flex-start"}}})()},children:t.map((e,t)=>(0,n.jsxs)("button",{type:"button",onClick:()=>c(t),style:{...(e=>{let t=e===i,r={padding:"0.75rem 1.5rem",cursor:"pointer",fontWeight:t?600:400,flex:"full"===m?1:"initial",transition:"all 0.2s ease"};switch(d){case"pills":return{...r,border:"none",backgroundColor:t?"var(--color-primary)":"var(--color-bg-muted)",color:t?"white":"inherit",borderRadius:"var(--radius-default)"};case"boxed":return{...r,border:"1px solid var(--color-border)",borderBottom:t?"1px solid var(--color-bg)":"1px solid var(--color-border)",backgroundColor:t?"var(--color-bg)":"transparent",borderRadius:"var(--radius-sm) var(--radius-sm) 0 0",marginBottom:"-1px"};default:return{...r,border:"none",borderBottom:t?"2px solid var(--color-primary)":"2px solid transparent",backgroundColor:"transparent",color:"inherit",borderRadius:0}}})(t),display:"inline-flex",alignItems:"center",gap:"0.5rem"},children:[e.icon&&"none"!==e.icon?(0,n.jsx)(o.DynamicIcon,{name:e.icon,size:16,strokeWidth:1.75,fallback:"none"}):null,e.label]},t))})]}),t.map((e,t)=>(0,n.jsx)("div",{style:{display:t===i?"block":"none"},children:e.content},t))]}):null}},74533:(e,t,r)=>{"use strict";r.d(t,{default:()=>i});
1var n=r(29064),a=r(34340);let o={primary:"var(--color-primary)",primaryDark:"var(--color-primary-dark, var(--color-primary))",secondary:"var(--color-secondary)",dark:"var(--color-bg-dark)",muted:"var(--color-bg-muted)",subtle:"var(--color-bg-subtle)",transparent:"transparent"},l=new Set(["muted","subtle"]),s={primary:{bg:"var(--color-primary)",fg:"var(--color-text-inverse, #fff)"},accent:{bg:"var(--color-accent)",fg:"var(--accent-foreground, var(--color-text-heading))"},secondary:{bg:"var(--color-secondary)",fg:"var(--color-text-inverse, #fff)"},inverse:{bg:"var(--color-bg)",fg:"var(--color-primary)"}},i=e=>{let t,{heading:r,description:i,eyebrow:c,placeholderText:d="Enter your email address",buttonText:m="Subscribe",successMessage:u="Thanks for subscribing!",showNameField:h=!1,showPrivacyCheckbox:p=!0,privacyText:x="I agree to receive marketing emails",listId:g,backgroundType:f="color",backgroundColor:b="primary",gradientEndColor:y="primaryDark",backgroundImageUrl:v,overlayOpacity:j="75",textColor:w="inverse",buttonColor:k="accent",layout:N="centered"}=e,[C,S]=(0,a.useState)(""),[_,T]=(0,a.useState)(""),[q,B]=(0,a.useState)(!1),[z,M]=(0,a.useState)(!1),[P,L]=(0,a.useState)(null),D=async e=>{if(e.preventDefault(),C.trim()){if(p&&!q)return void L({success:!1,message:"Please accept the privacy consent to continue."});M(!0),L(null);try{let e={email:C.trim()};h&&_.trim()&&(e.name=_.trim()),g&&(e.list_id=g);let t=await fetch("/api/newsletter/public/subscribe",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(t.ok)L({success:!0,message:u}),S(""),T(""),B(!1);else{let e=await t.json().catch(()=>({detail:"Subscription failed"}));L({success:!1,message:e.detail||e.error||"Something went wrong. Please try again."})}}catch(e){L({success:!1,message:"Network error. Please try again."})}finally{M(!1)}}};t="image"===f&&v?{backgroundImage:"linear-gradient(rgba(0,0,0,0.".concat(j,"), rgba(0,0,0,0.").concat(j,")), url(").concat(v,")"),backgroundSize:"cover",backgroundPosition:"center"}:"gradient"===f?{background:"linear-gradient(to right, ".concat(o[b]||o.primary,", ").concat(o[y]||o.primaryDark,")")}:{backgroundColor:o[b]||o.primary};let W=!("image"!==f&&l.has(b))&&"inverse"===w,A=W?"color-mix(in srgb, var(--color-text-inverse, #fff) 82%, transparent)":"var(--color-text-muted)",E=s[k]||s.accent,F="split"===N,R={height:"48px",padding:"0 1rem",borderRadius:"var(--radius-default)",border:"1px solid var(--color-border-dark, var(--color-border))",backgroundColor:"var(--color-bg)",color:"var(--color-text-body)",fontSize:"1rem",boxShadow:"0 1px 2px rgba(0,0,0,0.06)",minWidth:0},I=(0,n.jsxs)("div",{style:{flex:F?"1 1 320px":void 0,textAlign:F?"left":"center"},children:[c?(0,n.jsx)("p",{style:{fontSize:"0.875rem",fontWeight:600,textTransform:"uppercase",letterSpacing:"0.05em",color:W?A:"var(--color-primary)",marginBottom:"0.5rem"},children:c}):null,r?(0,n.jsx)("h2",{style:{color:W?"var(--color-text-inverse, #fff)":"var(--color-text-heading)",marginBottom:i?"0.75rem":0},children:r}):null,i?(0,n.jsx)("p",{style:{color:A,margin:0},children:i}):null]}),H=(null==P?void 0:P.success)?(0,n.jsx)("div",{role:"status",style:{flex:F?"1 1 360px":void 0,padding:"1rem",marginTop:F?0:"1.75rem",borderRadius:"var(--radius-default)",backgroundColor:"var(--color-bg)",color:"var(--color-success)",border:"1px solid var(--color-border)",fontWeight:500},children:P.message}):(0,n.jsxs)("form",{onSubmit:D,style:{flex:F?"1 1 360px":void 0,marginTop:F?0:"1.75rem"},children:[(0,n.jsxs)("div",{style:{display:"flex",gap:"0.5rem",flexWrap:"wrap",justifyContent:F?"flex-start":"center"},children:[h&&(0,n.jsx)("input",{type:"text","aria-label":"Your name",autoComplete:"name",value:_,onChange:e=>T(e.target.value),placeholder:"Your name",style:{...R,flex:"1 1 150px"}}),(0,n.jsx)("input",{type:"email","aria-label":"Email address",autoComplete:"email",required:!0,value:C,onChange:e=>S(e.target.value),placeholder:d,style:{...R,flex:"2 1 220px"}}),(0,n.jsx)("button",{type:"submit",disabled:z,className:"btn",style:{height:"48px",padding:"0 1.5rem",backgroundColor:E.bg,color:E.fg,border:"none",fontWeight:600,flex:"0 0 auto",opacity:z?.7:1,cursor:z?"not-allowed":"pointer"}
1,children:z?"Subscribing...":m})]}),p&&(0,n.jsxs)("label",{style:{display:"flex",alignItems:"center",justifyContent:F?"flex-start":"center",gap:"0.5rem",marginTop:"0.875rem",fontSize:"0.875rem",color:A,cursor:"pointer"},children:[(0,n.jsx)("input",{type:"checkbox",checked:q,onChange:e=>B(e.target.checked),style:{width:"16px",height:"16px",accentColor:W?"var(--color-bg)":"var(--color-primary)"}}),x]}),P&&!P.success&&(0,n.jsx)("div",{role:"alert",style:{marginTop:"0.75rem",padding:"0.5rem 1rem",borderRadius:"var(--radius-default)",backgroundColor:"var(--color-bg)",color:"var(--color-error)",fontSize:"0.875rem",border:"1px solid var(--color-border)"},children:P.message})]});return(0,n.jsx)("section",{style:{padding:"var(--section-spacing) var(--container-padding)",...t},children:(0,n.jsxs)("div",{className:"container",style:F?{maxWidth:"1100px",display:"flex",flexWrap:"wrap",alignItems:"center",gap:"2rem 3rem"}:{maxWidth:"640px",textAlign:"center"},children:[I,H]})})}},75936:(e,t,r)=>{"use strict";function n(e){return(null!=e?e:[]).slice(0,4)}r.d(t,{G:()=>n})},76359:(e,t,r)=>{"use strict";r.d(t,{LocationMapBlock:()=>x});var n=r(29064),a=r(34340),o=r(16381);r(2988);var l=r(83863);let s="pk.eyJ1IjoiZ3JhZW1lYXRub29xZ29sZiIsImEiOiJjbWtpMzVva2cwb3V4M2VxeGJ4MHh3bmZiIn0.DbOhpxUZkMn_pY0lRrubpg",i={streets:"mapbox://styles/mapbox/streets-v12",outdoors:"mapbox://styles/mapbox/outdoors-v12",light:"mapbox://styles/mapbox/light-v11",satellite:"mapbox://styles/mapbox/satellite-streets-v12"},c={small:300,medium:450,large:600,xlarge:750},d={small:32,medium:48,large:64};function m(e){let{size:t}=e;return(0,n.jsxs)("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{cursor:"pointer"},children:[(0,n.jsx)("path",{d:"M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7z",fill:"var(--color-primary, #1e40af)"}),(0,n.jsx)("circle",{cx:"12",cy:"9",r:"3",fill:"white"})]})}function u(e){let{logoUrl:t,size:r}=e;return(0,n.jsx)("div",{style:{width:r,height:r,borderRadius:"50%",backgroundColor:"white",border:"3px solid var(--color-primary, #1e40af)",overflow:"hidden",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",filter:"drop-shadow(0 2px 6px rgba(0,0,0,0.3))"},children:(0,n.jsx)("img",{src:t,alt:"Location",style:{width:r-10,height:r-10,objectFit:"contain"}})})}function h(e){let{latitude:t,longitude:r,address:l,logoUrl:h,markerIconSource:p="siteLogo",markerIconUrl:x,defaultZoom:g,mapHeight:f,mapStyle:b,markerSize:y,showPopup:v,backgroundColor:j}=e,[w,k]=(0,a.useState)(!1),[N,C]=(0,a.useState)(null),[S,_]=(0,a.useState)(!1),[T,q]=(0,a.useState)(!1),B=null!=t&&null!=r;(0,a.useEffect)(()=>{if(B||!l||!s)return;let e=!1;return _(!0),q(!1),fetch("https://api.mapbox.com/geocoding/v5/mapbox.places/".concat(encodeURIComponent(l),".json?access_token=").concat(s,"&limit=1")).then(e=>e.json()).then(t=>{var r;if(e)return;let n=null==t||null==(r=t.features)?void 0:r[0];(null==n?void 0:n.center)?C({lng:n.center[0],lat:n.center[1]}):q(!0)}).catch(()=>{e||q(!0)}).finally(()=>{e||_(!1)}),()=>{e=!0}},[l,B]);let z=B?t:null==N?void 0:N.lat,M=B?r:null==N?void 0:N.lng,P=c[f]||450,L=d[y]||48,D={default:"var(--color-bg)",subtle:"var(--color-bg-subtle)",muted:"var(--color-bg-muted)"},W=(0,a.useCallback)(()=>{v&&l&&k(e=>!e)},[v,l]);return!B&&S?(0,n.jsx)("section",{style:{padding:"var(--section-spacing) var(--container-padding)",backgroundColor:D[j]||"var(--color-bg)"},children:(0,n.jsx)("div",{className:"container",style:{maxWidth:"var(--container-max-width, 1200px)",margin:"0 auto"},children:(0,n.jsx)("div",{style:{height:P,borderRadius:"var(--radius-default, 8px)",backgroundColor:"var(--color-bg-muted)",display:"flex",alignItems:"center",justifyContent:"center",color:"var(--color-text-muted)"},children:"Loading map..."})})}):z&&M?(0,n.jsx)("section",{style:{padding:"var(--section-spacing) var(--container-padding)",backgroundColor:D[j]||"var(--color-bg)"},children:(0,n.jsx)("div",{className:"container",style:{maxWidth:"var(--container-max-width, 1200px)",margin:"0 auto"},children:(0,n.jsx)("div",{style:{borderRadius:"var(--radius-default, 8px)",overflow:"hidden"},children:(0,n.jsxs)(o.T5,{mapboxAccessToken:s,initialViewState:{latitude:z,longitude:M,zoom:g},style:{width:"100%",height:P},mapStyle:i[b]||i.streets,children:[(0,n.jsx)(o.ov,{position:"top-right"}),(0,n.jsx)(o.pH,{latitude:z,longitude:M,anchor:"bottom",onClick:W,children:"pin"===p?(0,n.jsx)(m,{size:L}):"custom"===p&&x?(0,n.jsx)(u,{logoUrl:x,size:L}):h?(0,n.jsx)(u,{logoUrl:h,size:L}):(0,n.jsx)(m,{size:L})}),w&&v&&l&&(0,n.jsx)(o.zD,{latitude:z,longitude:M,anchor:"top",onClose:()=>k(!1),closeOnClick:!1,offset:[0,10],children:(0,n.jsx)("div",{style:{padding:"0.25rem",fontSize:"0.875rem",lineHeight:1.5,whiteSpace:"pre-line"},children:l})})]})})})}):T?(0,n.jsx)("section",{style:{padding:"var(--section-spacing) var(--container-padding)",backgroundColor:D[j]||"var(--color-bg)"},children:(0,n.jsx)("div",{className:"container",style:{maxWidth:"var(--container-max-width, 1200px)",margin:"0 auto"},children:(0,n.jsx)("div",{style:{height:P/2,borderRadius:"var(--radius-default, 8px)",backgroundColor:"var(--color-bg-muted)",display:"flex",alignItems:"center",justifyContent:"center",color:"var(--color-text-muted)"},children:"Could not find location for the given address."})})}):null}let p=(0,l.default)(()=>Promise.resolve(h),{ssr:!1,loading:()=>(0,n.jsx)("section",{style:{padding:"var(--section-spacing) var(--container-padding)"},children:(0,n.jsx)("div",{className:"container",style:{maxWidth:"var(--container-max-width, 1200px)",margin:"0 auto"},children:(0,n.jsx)("div",{style:{height:450,borderRadius:"var(--radius-default, 8px)",backgroundColor:"var(--color-bg-muted)",display:"flex",alignItems:"center",justifyContent:"center",color:"var(--color-text-muted)"},children:"Loading map..."})})})});function x(e){return(0,n.jsx)(p,{...e})}},77400:(e,t,r)=>{"use strict";r.d(t,{default:()=>o});
1var n=r(29064),a=r(34340);function o(e){let{src:t,title:r,minHeight:o=900}=e,[l,s]=(0,a.useState)(o);return(0,a.useEffect)(()=>{let e;try{e=new URL(t).origin}catch(e){return}function r(t){if(t.origin!==e)return;let r=t.data;r&&"nooq:resize"===r.type&&"number"==typeof r.height&&(r.source&&"match-report"!==r.source||s(Math.max(o,Math.ceil(r.height))))}return window.addEventListener("message",r),()=>window.removeEventListener("message",r)},[t,o]),(0,n.jsx)("iframe",{src:t,title:r,className:"w-full rounded-lg border border-border",style:{height:"".concat(l,"px"),minHeight:"".concat(o,"px")},loading:"lazy"})}},80384:(e,t,r)=>{"use strict";r.d(t,{ParallaxLayer:()=>l});var n=r(29064),a=r(34340);let o={subtle:60,medium:130,strong:220};function l(e){let{imageUrl:t,intensity:r}=e,l=(0,a.useRef)(null),s=(0,a.useRef)(null);return(0,a.useEffect)(()=>{var e;let t=l.current,n=s.current;if(!t||!n||window.matchMedia("(prefers-reduced-motion: reduce)").matches)return;let a=null!=(e=o[r])?e:o.medium,i=0,c=1,d=()=>{c=1+2*a/(t.getBoundingClientRect().height||1)+.05},m=()=>{i=0;let e=t.getBoundingClientRect(),r=window.innerHeight||document.documentElement.clientHeight,o=(Math.max(-1,Math.min(1,(e.top+e.height/2-r/2)/(r/2+e.height/2)))*a).toFixed(1);n.style.transform="translate3d(0, ".concat(o,"px, 0) scale(").concat(c.toFixed(4),")")},u=()=>{i||(i=requestAnimationFrame(()=>{d(),m()}))};return d(),m(),window.addEventListener("scroll",u,{passive:!0}),window.addEventListener("resize",u),()=>{window.removeEventListener("scroll",u),window.removeEventListener("resize",u),i&&cancelAnimationFrame(i)}},[r]),(0,n.jsx)("div",{ref:l,style:{position:"absolute",inset:0,overflow:"hidden"},children:(0,n.jsx)("div",{ref:s,style:{position:"absolute",inset:0,willChange:"transform"},children:(0,n.jsx)("img",{src:t,alt:"",style:{width:"100%",height:"100%",objectFit:"cover"}})})})}},84427:(e,t,r)=>{"use strict";r.d(t,{EventsDisplay:()=>b});var n=r(29064),a=r(34340),o=r(20207),l=r(1181),s=r(4179),i=r(51444),c=r(58067),d=r(58249),m=r(33771),u=r(375),h=r(5433),p=r(13342),x=r(57315),g=r(16010);function f(e){let t=e.getFullYear(),r=String(e.getMonth()+1).padStart(2,"0"),n=String(e.getDate()).padStart(2,"0");return"".concat(t,"-").concat(r,"-").concat(n)}function b(e){var t;let{events:r,categories:b=[],showCategoryFilters:y=!1,defaultView:v,showViewToggle:j=!0,showVenue:w=!0,showDescription:k=!0,showEntryInfo:N=!1,isDark:C=!1}=e,[S,_]=(0,a.useState)("calendar"===v?"calendar":"list"),[T,q]=(0,a.useState)(()=>new Date),[B,z]=(0,a.useState)([]),[M,P]=(0,a.useState)(!1),L=(0,a.useRef)(null);(0,a.useEffect)(()=>{function e(e){L.current&&!L.current.contains(e.target)&&P(!1)}return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]);let D=e=>{z(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},W=(0,a.useMemo)(()=>0===B.length?r:r.filter(e=>{var t;return null==(t=e.categories)?void 0:t.some(e=>B.includes(e.id))}),[r,B]),A=(0,a.useMemo)(()=>{let e=new Map;return W.forEach(t=>{let r=f(new Date(t.startDate));e.has(r)||e.set(r,[]),e.get(r).push(t)}),e},[W]),E=(0,a.useMemo)(()=>{let e=T.getFullYear(),t=T.getMonth(),r=new Date(e,t,1),n=new Date(e,t+1,0),a=[],o=r.getDay()||7;for(let r=o-1;r>0;r--){let n=new Date(e,t,1-r),o=f(n);a.push({date:n,events:A.get(o)||[],isCurrentMonth:!1})}for(let r=1;r<=n.getDate();r++){let n=new Date(e,t,r),o=f(n);a.push({date:n,events:A.get(o)||[],isCurrentMonth:!0})}let l=42-a.length;for(let r=1;r<=l;r++){let n=new Date(e,t+1,r),o=f(n);a.push({date:n,events:A.get(o)||[],isCurrentMonth:!1})}return a},[T,A]),F=e=>{let t=new Date;return e.toDateString()===t.toDateString()},R=0===B.length?"All Events":1===B.length?(null==(t=b.find(e=>e.id===B[0]))?void 0:t.name)||"Category":"".concat(B.length," categories");return(0,n.jsxs)("div",{children:[(0,n.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-3 mb-6 p-3 rounded-lg ".concat(C?"bg-gray-800":"bg-gray-50"),children:[y&&b.length>0&&(0,n.jsxs)("div",{className:"relative",ref:L,children:[(0,n.jsxs)("button",{onClick:()=>P(!M),className:"flex items-center gap-2 px-4 py-2 rounded-lg text-sm font-medium transition-colors min-w-[180px] justify-between ".concat(C?"bg-gray-700 text-gray-200 hover:bg-gray-600":"bg-white text-gray-700 hover:bg-gray-100 border border-gray-200"),children:[(0,n.jsxs)("span",{className:"flex items-center gap-2",children:[(0,n.jsx)(o.A,{className:"h-4 w-4 flex-shrink-0"}),(0,n.jsx)("span",{className:"hidden sm:inline",children:R}),(0,n.jsx)("span",{className:"sm:hidden",children:"Filter"})]}),B.length>0&&(0,n.jsx)("span",{className:"ml-1 px-1.5 py-0.5 text-xs rounded-full text-white bg-primary",style:{backgroundColor:"var(--color-primary)"},children:B.length}),(0,n.jsx)(l.A,{className:"h-4 w-4 transition-transform ".concat(M?"rotate-180":"")})]}),M&&(0,n.jsxs)("div",{className:"absolute left-0 top-full mt-1 z-50 min-w-[280px] max-h-[300px] overflow-auto rounded-lg shadow-lg border ".concat(C?"bg-gray-800 border-gray-700":"bg-white border-gray-200"),children:[(0,n.jsxs)("div",{className:"flex items-center justify-between px-4 py-2 border-b ".concat(C?"border-gray-700":"border-gray-100"),children:[(0,n.jsx)("span",{className:"text-xs font-medium ".concat(C?"text-gray-400":"text-gray-500"),children:0===B.length?"Select categories":"".concat(B.length," selected")}),B.length>0&&(0,n.jsx)("button",{onClick:()=>z([]),className:"text-xs text-primary hover:underline",children:"Clear all"})]}),b.map(e=>{let t=B.includes(e.id);return(0,n.jsxs)("button",{onClick:()=>D(e.id),className:"w-full flex items-center gap-3 px-4 py-2.5 text-sm text-left transition-colors ".concat(t?C?"bg-gray-700/50 text-white":"bg-primary/5":C?"text-gray-300 hover:bg-gray-700":"text-gray-700 hover:bg-gray-50"),children:[(0,n.jsx)("span",{className:"w-4 h-4 rounded border flex items-center justify-center flex-shrink-0 ".concat(t?"border-transparent text-white":C?"border-gray-600":"border-gray-300"),style:t?{backgroundColor:e.colour||"var(--color-primary)"}:void 0,children:t&&(0,n.jsx)("svg",{className:"w-3 h-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:3,children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"})})}),(0,n.jsxs)("span",{className:"flex items-center gap-2 flex-1",children:[(0,n.jsx)("span",{className:"w-2.5 h-2.5 rounded-full flex-shrink-0",style:{backgroundColor:e.colour||"var(--color-primary)"}}),(0,n.jsx)("span",{className:"whitespace-nowrap ".concat(t?"font-medium":""),children:e.name})]})]},e.id)})]})]}),(0,n.jsxs)("div",{className:"flex items-center gap-2 ml-auto",children:[j&&(0,n.jsxs)("div",{className:"inline-flex rounded-lg p-0.5 ".concat(C?"bg-gray-700":"bg-gray-200/60"),children:[(0,n.jsxs)("button",{onClick:()=>_("list"),className:"flex items-center gap-1.5 px-3 py-1.5 rounded-md text-sm font-medium transition-colors ".concat("list"===S?"bg-white text-gray-900 shadow-sm":C?"text-gray-400 hover:text-white":"text-gray-600 hover:text-gray-900"),children:[(0,n.jsx)(s.A,{className:"h-4 w-4"}),(0,n.jsx)("span",{className:"hidden sm:inline",children:"List"})]}),(0,n.jsxs)("button",{onClick:()=>_("calendar"),className:"flex items-center gap-1.5 px-3 py-1.5 rounded-md text-sm font-medium transition-colors ".concat("calendar"===S?"bg-white text-gray-900 shadow-sm":C?"text-gray-400 hover:text-white":"text-gray-600 hover:text-gray-900"),children:[(0,n.jsx)(i.A,{className:"h-4 w-4"}),(0,n.jsx)("span",{className:"hidden sm:inline",children:"Calendar"})]})]}
1),(0,n.jsx)(g.CalendarSubscribeButton,{isDark:C,compact:!0})]})]}),B.length>0&&(0,n.jsxs)("div",{className:"flex flex-wrap items-center gap-2 mb-4",children:[(0,n.jsx)("span",{className:"text-sm ".concat(C?"text-gray-400":"text-gray-500"),children:"Filtered by:"}),B.map(e=>{let t=b.find(t=>t.id===e);return t?(0,n.jsxs)("button",{onClick:()=>D(e),className:"inline-flex items-center gap-1.5 px-3 py-1 rounded-full text-sm font-medium text-white",style:{backgroundColor:t.colour||"var(--color-primary)"},children:[t.name,(0,n.jsx)(c.A,{className:"h-3.5 w-3.5"})]},e):null}),B.length>1&&(0,n.jsx)("button",{onClick:()=>z([]),className:"text-xs underline hover:no-underline ".concat(C?"text-gray-400":"text-gray-500"),children:"Clear all"})]}),"list"===S&&(0,n.jsx)("div",{className:"space-y-4",children:0===W.length?(0,n.jsxs)("div",{className:"rounded-lg p-8 text-center border ".concat(C?"bg-gray-800 border-gray-700":"bg-white border-gray-200"),children:[(0,n.jsx)(d.A,{className:"h-12 w-12 mx-auto mb-4 ".concat("text-gray-400")}),(0,n.jsx)("p",{className:C?"text-gray-400":"text-gray-500",children:"No upcoming events"})]}):W.map(e=>{var t,r;let a=e.categories||[],o=function(e){switch(e){case"cancelled":return{text:"Cancelled",bgColor:"#FEE2E2",textColor:"#991B1B"};case"postponed":return{text:"Postponed",bgColor:"#FEF3C7",textColor:"#92400E"};case"draft":return{text:"Draft",bgColor:"#F3F4F6",textColor:"#374151"};default:return null}}(e.status||"published");return(0,n.jsx)("div",{className:"rounded-lg p-6 shadow-sm hover:shadow-md transition-shadow border ".concat(C?"bg-gray-800 border-gray-700":"bg-white border-gray-100"),children:(0,n.jsxs)("div",{className:"flex flex-col lg:flex-row lg:items-center lg:justify-between gap-4",children:[(0,n.jsxs)("div",{className:"flex-1",children:[(0,n.jsxs)("div",{className:"flex flex-wrap items-center gap-2 mb-2",children:[a.map(e=>(0,n.jsx)("span",{className:"px-2 py-0.5 text-xs font-medium rounded-full",style:{backgroundColor:e.colour||"var(--color-primary)",color:e.textColour||"#FFFFFF"},children:e.name},e.id)),o&&(0,n.jsx)("span",{className:"px-2 py-0.5 text-xs font-medium rounded-full",style:{backgroundColor:o.bgColor,color:o.textColor},children:o.text})]}),(0,n.jsx)("h3",{className:"text-xl font-semibold mb-2 ".concat(C?"text-white":"text-gray-900"),children:(0,n.jsx)("a",{href:"/events/".concat(e.slug||e.id),className:"hover:opacity-80 transition-opacity",children:e.title})}),(0,n.jsxs)("div",{className:"flex flex-wrap items-center gap-4 text-sm ".concat(C?"text-gray-300":"text-gray-500"),children:[(0,n.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,n.jsx)(d.A,{className:"h-4 w-4"}),(0,n.jsx)("span",{children:function(e,t,r){let n=new Date(e),a=t?new Date(t):null,o={weekday:"short",day:"numeric",month:"short",year:"numeric"},l={hour:"2-digit",minute:"2-digit",hour12:!1},s=n.getHours(),i=n.getMinutes(),c=n.toLocaleDateString("en-GB",o);if(r||0===s&&0===i||1===s&&0===i||(12===s||13===s)&&0===i)a&&a.getTime()!==n.getTime()&&n.toDateString()!==a.toDateString()&&(c+=" - ".concat(a.toLocaleDateString("en-GB",o)));else{let e=n.toLocaleTimeString("en-GB",l);if(a&&a.getTime()!==n.getTime())if(n.toDateString()===a.toDateString()){let t=a.toLocaleTimeString("en-GB",l);c+=" ".concat(e,"-").concat(t)}else c+=" ".concat(e," - ").concat(a.toLocaleDateString("en-GB",o)," ").concat(a.toLocaleTimeString("en-GB",l));else c+=" ".concat(e)}return c}(e.startDate,e.endDate,e.allDay)})]}),w&&e.venue&&(0,n.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,n.jsx)(m.A,{className:"h-4 w-4"}),(0,n.jsx)("span",{children:e.venue})]})]}),k&&e.shortDescription&&(0,n.jsx)("p",{className:"mt-3 text-sm line-clamp-2 ".concat(C?"text-gray-400":"text-gray-600"),children:e.shortDescription})]}),(0,n.jsxs)("div",{className:"flex flex-col items-start lg:items-end gap-2",children:[N&&(null==(t=e.entryInfo)?void 0:t.entryFee)&&(0,n.jsxs)("div",{className:"flex items-center gap-1.5 text-sm ".concat(C?"text-gray-300":"text-gray-600"),children:[(0,n.jsx)(u.A,{className:"h-4 w-4"}),(0,n.jsxs)("span",{children:["Entry: \xa3",e.entryInfo.entryFee]})]}),(0,n.jsxs)("div",{className:"flex gap-2",children:[(null==(r=e.entryInfo)?void 0:r.entryUrl)&&(0,n.jsxs)("a",{href:e.entryInfo.entryUrl,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1.5 px-4 py-2 rounded-md text-sm font-medium text-white hover:opacity-90 transition-opacity",style:{backgroundColor:"var(--color-primary)"},children:["Enter Now",(0,n.jsx)(h.A,{className:"h-3.5 w-3.5"})]}),e.externalUrl&&(0,n.jsxs)("a",{href:e.externalUrl,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1.5 px-4 py-2 rounded-md text-sm font-medium transition-colors ".concat(C?"bg-gray-700 text-white hover:bg-gray-600":"bg-gray-100 text-gray-700 hover:bg-gray-200"),children:[e.externalUrl.
1includes("golfgenius.com")?"GolfGenius":"Details",(0,n.jsx)(h.A,{className:"h-3.5 w-3.5"})]})]})]})]})},e.id)})}),"calendar"===S&&(0,n.jsxs)("div",{className:"rounded-lg border overflow-hidden ".concat(C?"bg-gray-800 border-gray-700":"bg-white border-gray-200"),children:[(0,n.jsxs)("div",{className:"flex items-center justify-between p-4 border-b ".concat(C?"border-gray-700":"border-gray-200"),children:[(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)("button",{onClick:()=>{q(e=>new Date(e.getFullYear(),e.getMonth()-1,1))},className:"p-2 rounded-md transition-colors ".concat(C?"hover:bg-gray-700":"hover:bg-gray-100"),children:(0,n.jsx)(p.A,{className:"h-5 w-5"})}),(0,n.jsx)("button",{onClick:()=>{q(e=>new Date(e.getFullYear(),e.getMonth()+1,1))},className:"p-2 rounded-md transition-colors ".concat(C?"hover:bg-gray-700":"hover:bg-gray-100"),children:(0,n.jsx)(x.A,{className:"h-5 w-5"})})]}),(0,n.jsx)("h3",{className:"text-lg font-semibold ".concat(C?"text-white":"text-gray-900"),children:T.toLocaleDateString("en-GB",{month:"long",year:"numeric"})}),(0,n.jsx)("button",{onClick:()=>{q(new Date)},className:"px-3 py-1.5 text-sm font-medium rounded-md transition-colors ".concat(C?"bg-gray-700 text-white hover:bg-gray-600":"bg-gray-100 text-gray-700 hover:bg-gray-200"),children:"Today"})]}),(0,n.jsx)("div",{className:"border-b ".concat(C?"border-gray-700":"border-gray-200"),style:{display:"grid",gridTemplateColumns:"repeat(7, 1fr)"},children:["Mon","Tue","Wed","Thu","Fri","Sat","Sun"].map(e=>(0,n.jsx)("div",{className:"py-3 text-center text-sm font-medium ".concat(C?"text-gray-400":"text-gray-500"),children:e},e))}),(0,n.jsx)("div",{style:{display:"grid",gridTemplateColumns:"repeat(7, 1fr)"},children:E.map((e,t)=>(0,n.jsxs)("div",{className:"min-h-24 min-w-0 overflow-hidden p-2 border-b ".concat(t%7!=6?"border-r":""," ").concat(C?"border-gray-700":"border-gray-100"," ").concat(e.isCurrentMonth?"":C?"bg-gray-900/50":"bg-gray-50"),children:[(0,n.jsx)("div",{className:"flex items-center justify-center w-7 h-7 rounded-full text-sm font-medium mb-1 ".concat(F(e.date)?"text-white":e.isCurrentMonth?C?"text-white":"text-gray-900":C?"text-gray-600":"text-gray-400"),style:F(e.date)?{backgroundColor:"var(--color-primary)"}:void 0,children:e.date.getDate()}),(0,n.jsxs)("div",{className:"space-y-1",children:[e.events.slice(0,3).map(e=>{var t,r;let a=e.categories||[],o=(null==(t=a[0])?void 0:t.colour)||"var(--color-primary)",l=(null==(r=a[0])?void 0:r.textColour)||"#FFFFFF";return(0,n.jsx)("a",{href:"/events/".concat(e.slug||e.id),className:"block px-1.5 py-0.5 text-xs rounded truncate hover:opacity-80 transition-opacity",style:{backgroundColor:o,color:l},title:e.title,children:e.title},e.id)}),e.events.length>3&&(0,n.jsxs)("div",{className:"text-xs px-1.5 ".concat(C?"text-gray-400":"text-gray-500"),children:["+",e.events.length-3," more"]})]})]},t))})]})]})}},90420:(e,t,r)=>{"use strict";function n(e){let t,r;if(e.logo&&"object"==typeof e.logo){var n,a,o,l;t=(null==(a=e.logo.sizes)||null==(n=a.logo)?void 0:n.url)||(null==(l=e.logo.sizes)||null==(o=l.thumbnail)?void 0:o.url)||e.logo.url,r=e.logo.alt||e.name}return{id:e.id,name:e.name,slug:e.slug,county:e.county,additionalCounties:e.additionalCounties,countyCard:e.countyCard,website:e.website,phone:e.phone,email:e.email,address:e.address,latitude:e.latitude,longitude:e.longitude,established:e.established,holes:e.holes,courseType:e.courseType,logo:t?{url:t,alt:r}:void 0}}async function a(e,t){if(0===e.length)return[];let r=function(e,t){let r=new URLSearchParams;e.forEach((e,t)=>{r.append("where[or][0][county][in][".concat(t,"]"),e),r.append("where[or][1][additionalCounties][in][".concat(t,"]"),e)});let n=(null==t?void 0:t.sortBy)||"name",a="name";switch(n){case"established-asc":a="established";break;case"established-desc":a="-established";break;case"displayOrder":a="displayOrder";break;default:a="name"}r.set("sort",a);let o=(null==t?void 0:t.limit)&&t.limit>0?t.limit:500;return r.set("limit",String(o)),r.set("depth","1"),r.toString()}(e,t),a=await fetch("/api/clubs?".concat(r));if(!a.ok)throw Error("Failed to load clubs (".concat(a.status,")"));return((await a.json()).docs||[]).map(n)}r.d(t,{i:()=>a})},92493:(e,t,r)=>{"use strict";let n;r.d(t,{SiteButtonStyle:()=>l});var a=r(29064),o=r(34340);function l(e){let{children:t}=e,r=(0,o.useRef)(null);return(0,o.useEffect)(()=>{let e=!1,t=0,a=()=>{var o,l;if(e)return;let s=null==(l=r.current)||null==(o=l.querySelector("membership-application"))?void 0:o.shadowRoot;if(s){let e=(n||(n=new CSSStyleSheet).replaceSync('\nbutton[type="submit"] {\n  border-radius: var(--radius-default, 0.5rem);\n  background: var(--color-primary);\n  box-shadow: none;\n  translate: none;\n  padding: 0.75rem 1.5rem;\n  font-family: var(--font-body, inherit);\n  font-weight: 500;\n}\nbutton[type="submit"]:hover:not(:disabled) {\n  background: var(--color-primary-dark, var(--color-primary));\n  box-shadow: none;\n  translate: none;\n}\n'),n);s.adoptedStyleSheets.includes(e)||(s.adoptedStyleSheets=[...s.adoptedStyleSheets,e]);return}t++<600&&requestAnimationFrame(a)};return"undefined"!=typeof CSSStyleSheet&&"replaceSync"in CSSStyleSheet.prototype&&customElements.whenDefined("membership-application").then(a),()=>{e=!0}},[]),(0,a.jsx)("div",{ref:r,children:t})}},94927:(e,t,r)=>{"use strict";r.d(t,{TeamsShowcase:()=>b});
1var n=r(29064),a=r(48164),o=r.n(a);r(34340);var l=r(50933),s=r.n(l),i=r(23723),c=r(73277),d=r(47373),m=r(92971),u=r(47992),h=r(19680),p=r(58921),x=r(51404),g=r(51703);let f={users:i.A,trophy:c.A,flag:d.A,star:m.A,shield:u.A,award:h.A},b=e=>{let{eyebrow:t,heading:r,description:a,teams:l,gradientStyle:c="primary",accentColor:d="secondary",headingColor:m="white",descriptionColor:u="whiteAlpha80",columns:h="3",spacing:b="normal",className:y}=e,v={primary:"teams-gradient-primary",secondary:"teams-gradient-secondary",accent:"teams-gradient-accent",dark:"teams-gradient-dark"},j={primary:"var(--color-primary)",primaryLight:"var(--color-primary-light)",primaryDark:"var(--color-primary-dark)",secondary:"var(--color-secondary)",secondaryLight:"var(--color-secondary-light)",secondaryDark:"var(--color-secondary-dark)",accent:"var(--color-accent)",accentLight:"var(--color-accent-light)",accentDark:"var(--color-accent-dark)",textHeading:"var(--color-text-heading)",textBody:"var(--color-text-body)",textMuted:"var(--color-text-muted)",textInverse:"var(--color-text-inverse)",white:"#ffffff",whiteAlpha80:"rgba(255, 255, 255, 0.8)",whiteAlpha70:"rgba(255, 255, 255, 0.7)"},w=j[d]||"var(--color-secondary)",k=j[m]||"#ffffff",N=j[u]||"rgba(255, 255, 255, 0.8)",C={2:"md:grid-cols-2",3:"md:grid-cols-3",4:"md:grid-cols-2 lg:grid-cols-4"},S={compact:{section:"py-12 sm:py-16",gap:"gap-6"},normal:{section:"py-20 sm:py-28",gap:"gap-8"},spacious:{section:"py-24 sm:py-32",gap:"gap-10"}},_=S[b]||S.normal;return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(o(),{id:"f5eb616ee9abb8d9",children:".teams-gradient-primary{background:linear-gradient(to bottom right,var(--color-primary-dark),var(--color-primary),var(--color-primary-dark))}.teams-gradient-secondary{background:linear-gradient(to bottom right,var(--color-secondary-dark),var(--color-secondary),var(--color-secondary-dark))}.teams-gradient-accent{background:linear-gradient(to bottom right,var(--color-accent-dark),var(--color-accent),var(--color-accent-dark))}.teams-gradient-dark{background:var(--color-bg-dark)}"}),(0,n.jsxs)("section",{className:"jsx-f5eb616ee9abb8d9 "+"relative overflow-hidden ".concat(_.section," ").concat(y||""),children:[(0,n.jsx)("div",{className:"jsx-f5eb616ee9abb8d9 "+"absolute inset-0 ".concat(v[c]||v.primary)}),(0,n.jsxs)("div",{className:"jsx-f5eb616ee9abb8d9 relative mx-auto max-w-7xl px-6 lg:px-8",children:[(0,n.jsxs)("div",{className:"jsx-f5eb616ee9abb8d9 text-center mb-16",children:[t&&(0,n.jsx)("div",{style:{color:w},className:"jsx-f5eb616ee9abb8d9 text-sm font-semibold tracking-wider uppercase mb-3",children:t}),r&&(0,n.jsx)("h2",{style:{fontFamily:"var(--font-heading)",color:k},className:"jsx-f5eb616ee9abb8d9 font-serif text-4xl font-bold sm:text-5xl mb-4",children:r}),a&&(0,n.jsx)("p",{style:{color:N},className:"jsx-f5eb616ee9abb8d9 mx-auto max-w-2xl text-lg",children:a})]}),(0,n.jsx)("div",{className:"jsx-f5eb616ee9abb8d9 "+"grid grid-cols-1 ".concat(_.gap," ").concat(C[h]||C["3"]),children:null==l?void 0:l.map((e,t)=>{let r=f[e.icon],a=(0,g.d0)(e.icon,e.lucideIcon),o=r||((0,g.aH)(a)?null:i.A),l="#";if(e.link){var d;if("custom"===e.link.type&&e.link.url)l=e.link.url;else if("reference"===e.link.type&&(null==(d=e.link.reference)?void 0:d.value)){let t=e.link.reference.value;"object"==typeof t&&"slug"in t&&(l="/".concat(t.slug))}}return(0,n.jsxs)("div",{style:{backgroundColor:"rgba(255,255,255,0.05)",border:"1px solid rgba(255,255,255,0.1)"},className:"jsx-f5eb616ee9abb8d9 group text-center p-6 rounded-lg transition-colors",children:[(0,n.jsx)("div",{style:{backgroundColor:"color-mix(in srgb, ".concat(w," 20%, transparent)")},className:"jsx-f5eb616ee9abb8d9 mx-auto w-16 h-16 rounded-full flex items-center justify-center mb-4",children:o?(0,n.jsx)(o,{style:{color:w},className:"jsx-f5eb616ee9abb8d9 h-8 w-8"}):(0,n.jsx)(x.DynamicIcon,{name:a,size:32,className:"h-8 w-8",style:{color:w},fallback:"none"})}),(0,n.jsx)("h3",{style:{fontFamily:"var(--font-heading, serif)",color:k},className:"jsx-f5eb616ee9abb8d9 text-xl font-semibold mb-2",children:e.title}),e.description&&(0,n.jsx)("p",{style:{color:N},className:"jsx-f5eb616ee9abb8d9 text-sm mb-4 leading-relaxed",children:e.description}),e.playerCount&&(0,n.jsxs)("div",{style:{color:w},className:"jsx-f5eb616ee9abb8d9 text-sm font-medium mb-4 flex items-center justify-center gap-2",children:[(0,n.jsx)(i.A,{className:"h-4 w-4"}),e.playerCount," players"]}),"#"!==l&&(0,n.jsxs)(s(),{href:l,className:"inline-flex items-center gap-1 px-4 py-2 border font-medium rounded-md text-sm transition-all w-full justify-center",style:{borderColor:"color-mix(in srgb, ".concat(w," 50%, transparent)"),color:w,backgroundColor:"transparent"},onMouseEnter:e=>{e.currentTarget.style.backgroundColor=w,e.currentTarget.style.color="primary"===c?"var(--color-primary-dark)":"secondary"===c?"var(--color-secondary-dark)":"accent"===c?"var(--color-accent-dark)":"var(--color-bg-dark)"},onMouseLeave:e=>{e.currentTarget.style.backgroundColor="transparent",e.currentTarget.style.color=w},children:[e.buttonText||"View Squad",(0,n.jsx)(p.A,{className:"ml-1 h-3 w-3"})]})]},t)})})]})]})]})}},95134:(e,t,r)=>{"use strict";r.d(t,{ScorecardBlock:()=>c});
1var n=r(29064),a=r(34340);let o=["A","B","C","D"],l={0:"Date",2:"Time"},s=["A","B","C","D/Marker"];function i(e,t,r,n,a){let o=0;for(let i of e){var l,s;if(i.holeNumber<n||i.holeNumber>a)continue;let e=null==(s=i.teeValues)||null==(l=s[t])?void 0:l[r];"number"==typeof e&&(o+=e)}return o}let c=e=>{let{title:t,holeCount:r="18",tees:c=[],holesData:x=[]}=e,g="9"===r?9:18,f=Array.from({length:g},(e,t)=>t+1),b=c.filter(e=>e.id&&e.name),y=(0,a.useRef)(null);return 0===b.length?null:(0,n.jsxs)("section",{ref:y,className:"nooq-scorecard py-12",children:[(0,n.jsxs)("div",{className:"mx-auto px-6",style:{maxWidth:"1200px"},children:[(0,n.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"baseline",marginBottom:"16px"},children:[t?(0,n.jsx)("h2",{className:"scorecard__title text-2xl font-bold md:text-3xl",style:{color:"var(--foreground)",margin:0},children:t}):(0,n.jsx)("span",{}),(0,n.jsx)("button",{type:"button",onClick:()=>y.current&&function(e){let t=[],r=e;for(;;){let e=r.parentElement;if(!e)break;for(let n of Array.from(e.children))n!==r&&n instanceof HTMLElement&&"none"!==n.style.display&&(t.push({el:n,display:n.style.display}),n.style.display="none");r=e}let n=()=>{for(let{el:e,display:r}of t)e.style.display=r;window.removeEventListener("afterprint",n),window.removeEventListener("focus",n)};window.addEventListener("afterprint",n),window.addEventListener("focus",n,{once:!0}),window.print()}(y.current),className:"scorecard__no-print",style:{padding:"8px 16px",borderRadius:"6px",border:"1px solid var(--border, #d1d5db)",backgroundColor:"transparent",color:"var(--foreground)",fontSize:"13px",fontWeight:500,cursor:"pointer"},children:"Print"})]}),(0,n.jsx)("div",{className:"scorecard__print-block",style:{marginBottom:"20px"},children:(0,n.jsxs)("table",{style:{width:"100%",borderCollapse:"collapse",fontSize:"12px",tableLayout:"fixed"},children:[(0,n.jsxs)("colgroup",{children:[(0,n.jsx)("col",{style:{width:"20%"}}),(0,n.jsx)("col",{style:{width:"41%"}}),(0,n.jsx)("col",{style:{width:"8%"}}),(0,n.jsx)("col",{style:{width:"8%"}}),(0,n.jsx)("col",{style:{width:"8%"}}),(0,n.jsx)("col",{style:{width:"4%"}}),(0,n.jsx)("col",{style:{width:"6%"}}),(0,n.jsx)("col",{style:{width:"6%"}}),(0,n.jsx)("col",{style:{width:"3%"}})]}),(0,n.jsx)("thead",{children:(0,n.jsxs)("tr",{children:[(0,n.jsx)("th",{style:{...u(),textAlign:"left"},colSpan:2,children:"Competition"}),(0,n.jsx)("th",{style:{...u(),fontSize:"9px"},children:"H'cap Index"}),(0,n.jsx)("th",{style:{...u(),fontSize:"9px"},children:"Course H'cap"}),(0,n.jsx)("th",{style:{...u(),fontSize:"9px"},children:"Playing H'cap"}),(0,n.jsx)("th",{style:{...u(),fontSize:"9px"},children:"Par"}),(0,n.jsx)("th",{style:{...u(),fontSize:"9px"},children:"Course Rating"}),(0,n.jsx)("th",{style:{...u(),fontSize:"9px"},children:"Slope Rating"}),(0,n.jsx)("th",{style:{...u(),fontSize:"9px"},children:"✓"})]})}),(0,n.jsx)("tbody",{children:Array.from({length:Math.max(s.length,b.length)},(e,t)=>{var r,a;let o=l[t],c=s[t],d=b[t];return(0,n.jsxs)("tr",{children:[o?(0,n.jsxs)("td",{style:{...p(),fontWeight:600,textAlign:"left"},rowSpan:2,children:[o,":"]}):1===t||3===t?null:(0,n.jsx)("td",{style:p()}),(0,n.jsx)("td",{style:{...p(),fontWeight:600,textAlign:"left"},children:c?"".concat(c,":"):""}),(0,n.jsx)("td",{style:p()}),(0,n.jsx)("td",{style:p()}),(0,n.jsx)("td",{style:p()}),(0,n.jsx)("td",{style:p(!1,d),children:d?i(x,d.id,"par",1,g)||"—":""}),(0,n.jsx)("td",{style:p(!1,d),children:null!=(r=null==d?void 0:d.courseRating)?r:""}),(0,n.jsx)("td",{style:p(!1,d),children:null!=(a=null==d?void 0:d.slopeRating)?a:""}),(0,n.jsx)("td",{style:p(!1,d)})]},t)})})]})}),(0,n.jsx)("div",{className:"scorecard__no-print",style:{display:"flex",flexWrap:"wrap",gap:"16px",marginBottom:"20px"},children:b.map(e=>(0,n.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"8px",padding:"8px 12px",borderRadius:"8px",border:"1px solid var(--border, #e5e7eb)",fontSize:"13px"},children:[(0,n.jsx)("span",{style:{width:"14px",height:"14px",borderRadius:"50%",backgroundColor:e.color||"#cccccc",border:"1px solid rgba(0,0,0,0.15)",flexShrink:0}}),(0,n.jsx)("strong",{children:e.name}),(0,n.jsxs)("span",{style:{color:"var(--muted-foreground)"},children:["Par ",i(x,e.id,"par",1,g)||"—","number"==typeof e.courseRating?" \xb7 CR ".concat(e.courseRating):"","number"==typeof e.slopeRating?" \xb7 Slope ".concat(e.slopeRating):""]})]},e.id))}),(0,n.jsx)("div",{className:"scorecard__scroll",style:{overflowX:"auto"},children:(0,n.jsxs)("table",{style:{width:"100%",borderCollapse:"collapse",fontSize:"13px"},children:[(0,n.jsxs)("thead",{children:[(0,n.jsxs)("tr",{children:[(0,n.jsx)("th",{style:u(),children:"Hole"}),b.map(e=>(0,n.jsx)("th",{colSpan:3,style:{...u(),backgroundColor:e.color,color:e.textColor||"#111"},children:e.name},e.id)),(0,n.jsx)("th",{className:"scorecard__print-only",colSpan:o.length+1,style:u(),children:"Score"})]}),(0,n.jsxs)("tr",{children:[(0,n.jsx)("th",{style:h()}),b.map(e=>(0,n.jsxs)(a.Fragment,{children:[(0,n.jsx)("th",{style:h(e),children:"Yds"}),(0,n.jsx)("th",{style:h(e),children:"Par"}),(0,n.jsx)("th",{style:h(e),children:"S.I."})]},e.id)),o.map(e=>(0,n.jsx)("th",{className:"scorecard__print-only",style:h(),children:e},e)),(0,n.jsx)("th",{className:"scorecard__print-only",style:h(),children:"Pts"})]})]}),(0,n.jsxs)("tbody",{children:[18===g?(0,n.jsxs)(n.Fragment,{children:[f.slice(0,9).map(e=>d(e,b,x)),m("Out",b,x,1,9,!1,"mid"),f.slice(9).map(e=>d(e,b,x)),m("In",b,x,10,18),m("Out",b,x,1,9,!1,"end"),m("Total",b,x,1,18,!0)]}):(0,n.jsxs)(n.Fragment,{children:[f.map(e=>d(e,b,x)),m("Total",b,x,1,9,!0)]}),(0,n.jsxs)("tr",{className:"scorecard__print-only",children:[(0,n.jsx)("td",{style:{...p(),fontWeight:600},colSpan:1+3*b.length,children:"Handicap"}),o.map(e=>(0,n.jsx)("td",{style:p()},e)),(0,n.jsx)("td",{style:p()})]}),(0,n.jsxs)("tr",{className:"scorecard__print-only",children:[(0,n.jsx)("td",{style:{...p(),fontWeight:600},colSpan:1+3*b.length,children:"Nett Score"}),o.map(e=>(0,n.jsx)("td",{style:p()},e)),(0,n.jsx)("td",{style:p()})]})]})]})})]}),(0,n.jsx)("style",{children:'\n        .scorecard__print-only { display: none; }\n        .scorecard__print-block { display: none; }\n        @media print {\n          .nooq-scorecard .scorecard__no-print { display: none !important; }\n          .nooq-scorecard .scorecard__print-only { display: table-cell; }\n          .nooq-scorecard tr.scorecard__print-only { display: table-row; }\n          .nooq-scorecard .scorecard__print-block { display: block; }\n          .nooq-scorecard { -webkit-print-color-adjust: exact; print-color-adjust: exact; }\n          .nooq-scorecard .scorecard__scroll { overflow: visible !important; width: auto !important; }\n          .nooq-scorecard tr { break-inside: avoid; }\n          /* Trim vertical space so an 18-hole card fits a single A4 page.\n             Longhand top/bottom padding so it overrides the inline\n             "padding: 6px 8px"-style shorthand without touching left/right\n             spacing. */\n          .nooq-scorecard .scorecard__title { font-size: 16px !important; }\n          .nooq-scorecard table { font-size: 12px !important; }\n          .nooq-scorecard td, .nooq-scorecard th { padding-top: 4px !important; padding-bottom: 4px !important; }\n        }\n      '})]})};function d(e,t,r){let l=r.find(t=>t.holeNumber===e);return(0,n.jsxs)("tr",{className:"scorecard__row",children:[(0,n.jsx)("td",{style:{...p(),fontWeight:600,textAlign:"center"},children:e}),t.map(e=>{var t,r,o,s;let i=(null==l||null==(t=l.teeValues)?void 0:t[e.id])||{};return(0,n.jsxs)(a.Fragment,{children:[(0,n.jsx)("td",{style:p(!1,e),children:null!=(r=i.yards)?r:"—"}),(0,n.jsx)("td",{style:p(!1,e),children:null!=(o=i.par)?o:"—"}),(0,n.jsx)("td",{style:p(!1,e),children:null!=(s=i.strokeIndex)?s:"—"})]},e.id)}),o.map(e=>(0,n.jsx)("td",{className:"scorecard__print-only",style:p()},e)),(0,n.jsx)("td",{className:"scorecard__print-only",style:p()})]},e)}function m(e,t,r,l,s){let c=arguments.length>5&&void 0!==arguments[5]&&arguments[5],d=arguments.length>6&&void 0!==arguments[6]?arguments[6]:"";return(0,n.jsxs)("tr",{children:[(0,n.jsx)("td",{style:{...p(!0),fontWeight:600,backgroundColor:"var(--muted, #f8fafc)"},children:e}),t.map(e=>(0,n.jsxs)(a.Fragment,{children:[(0,n.jsx)("td",{style:{...p(!0,e),fontWeight:c?700:500},children:i(r,e.id,"yards",l,s)||"—"}),(0,n.jsx)("td",{style:{...p(!0,e),fontWeight:c?700:500},children:i(r,e.id,"par",l,s)||"—"}),(0,n.jsx)("td",{style:p(!0,e)})]},e.id)),(0,n.jsx)("td",{className:"scorecard__print-only",style:{...p(!0),backgroundColor:"var(--muted, #f8fafc)"},colSpan:o.length+1})]},"".concat(e).concat(d))}
1function u(){return{padding:"8px",borderBottom:"2px solid var(--border, #e5e7eb)",backgroundColor:"var(--muted, #f8fafc)",color:"var(--foreground)",fontWeight:700,textAlign:"center"}}function h(e){return{padding:"6px 8px",borderBottom:"2px solid var(--border, #e5e7eb)",backgroundColor:(null==e?void 0:e.color)||"var(--muted, #f8fafc)",color:(null==e?void 0:e.textColor)||"var(--muted-foreground)",opacity:e?.85:1,fontSize:"11px",fontWeight:600,textAlign:"center"}}function p(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1?arguments[1]:void 0;return{padding:"6px 8px",borderBottom:e?"2px solid var(--border, #e5e7eb)":"1px solid var(--border, #f1f5f9)",textAlign:"center",backgroundColor:null==t?void 0:t.color,color:(null==t?void 0:t.textColor)||"var(--foreground)"}}},96031:(e,t,r)=>{Promise.resolve().then(r.bind(r,77976)),Promise.resolve().then(r.t.bind(r,50933,23)),Promise.resolve().then(r.bind(r,16426)),Promise.resolve().then(r.bind(r,26739)),Promise.resolve().then(r.bind(r,3975)),Promise.resolve().then(r.bind(r,36645)),Promise.resolve().then(r.bind(r,23500)),Promise.resolve().then(r.bind(r,48299)),Promise.resolve().then(r.bind(r,8608)),Promise.resolve().then(r.bind(r,61438)),Promise.resolve().then(r.bind(r,43047)),Promise.resolve().then(r.bind(r,20876)),Promise.resolve().then(r.bind(r,71367)),Promise.resolve().then(r.bind(r,25221)),Promise.resolve().then(r.bind(r,7356)),Promise.resolve().then(r.bind(r,11718)),Promise.resolve().then(r.bind(r,42856)),Promise.resolve().then(r.bind(r,76359)),Promise.resolve().then(r.bind(r,49801)),Promise.resolve().then(r.bind(r,92493)),Promise.resolve().then(r.bind(r,282)),Promise.resolve().then(r.bind(r,26216)),Promise.resolve().then(r.bind(r,6674)),Promise.resolve().then(r.bind(r,77400)),Promise.resolve().then(r.bind(r,43613)),Promise.resolve().then(r.bind(r,80384)),Promise.resolve().then(r.bind(r,43999)),Promise.resolve().then(r.bind(r,4980)),Promise.resolve().then(r.bind(r,95134)),Promise.resolve().then(r.bind(r,681)),Promise.resolve().then(r.bind(r,39911)),Promise.resolve().then(r.bind(r,67145)),Promise.resolve().then(r.bind(r,7329)),Promise.resolve().then(r.bind(r,94927)),Promise.resolve().then(r.bind(r,18174)),Promise.resolve().then(r.bind(r,8492)),Promise.resolve().then(r.bind(r,65767)),Promise.resolve().then(r.bind(r,73114)),Promise.resolve().then(r.bind(r,804)),Promise.resolve().then(r.bind(r,52923)),Promise.resolve().then(r.bind(r,16010)),Promise.resolve().then(r.bind(r,14135)),Promise.resolve().then(r.bind(r,72718)),Promise.resolve().then(r.bind(r,74533)),Promise.resolve().then(r.bind(r,24557)),Promise.resolve().then(r.bind(r,40156)),Promise.resolve().then(r.bind(r,51404)),Promise.resolve().then(r.bind(r,84427)),Promise.resolve().then(r.bind(r,22868)),Promise.resolve().then(r.bind(r,8325)),Promise.resolve().then(r.bind(r,43133)),Promise.resolve().then(r.bind(r,29033)),Promise.resolve().then(r.bind(r,45409)),Promise.resolve().then(r.bind(r,27880)),Promise.resolve().then(r.bind(r,70958)),Promise.resolve().then(r.bind(r,74327))}}]);

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.