PageSourceSearch

https://www.chronogolf.ca/_next/static/chunks/922.827d5a8f95a12261.js

js chronogolf.ca collected 2026-09-28 09:24:42 UTC 4,205 bytes, 2 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[922],{4922:function(e,t,a){a.r(t),a.d(t,{WidgetTeetime:function(){return F}});var s=a(5893),o=a(7294),r=a(3190),l=a(777),n=a(4139),d=a(7066),i=a(120),m=a(1163),u=a(7401),c=a(1182),h=a(1478),g=a(7557),p=a(1509),x=a(9931),w=a(3967),y=a(1289),j=a(5228),v=a(9279),b=a(2956),f=a(9830),N=a(4022),k=a(1616);let F=e=>{var t;let a,{coursesIds:h,holes:F}=e,_=(0,g.C)(),{session:D}=(0,p.Tt)(),O=(0,v.sq)(_,D),R=(0,m.useRouter)(),C=decodeURI((0,y.t)(R.query.date)),S=e=>i.ou.fromFormat(e,w.t6).isValid&&i.ou.fromFormat(e,w.t6)>i.ou.now();a=C&&S(C)?i.ou.fromFormat(C,w.t6):i.ou.now();let T=R.query.step,[E,z]=(0,o.useState)(a),{data:I,isError:P,isFetching:U,isPending:W}=(0,l.a)({queryKey:["teeTimes",E],refetchOnWindowFocus:!1,placeholderData:n.Wk,staleTime:1e4,retry:1,enabled:null!=_&&!(0,v.J1)(_,C,D)&&!T,queryFn:e=>{let{signal:t}=e;return(0,u.Uf)({coursesIds:h,holes:F,signal:t,startDate:(0,w.ii)(E),startTime:E.hasSame(i.ou.local(),"day")?E.toFormat("HH:mm"):void 0})}});(0,o.useEffect)(()=>{let e={pathname:R.pathname,query:{...R.query,date:encodeURI((0,w.ii)(E))}};R.push(e,void 0,{shallow:!0})},[E]),(0,o.useEffect)(()=>{C&&z(S(C)?i.ou.fromFormat(C,w.t6):i.ou.now())},[C]);let B=()=>{let e={pathname:R.pathname,query:{...R.query,step:"teetimes"}};(0,x.O)("widget_view_more_teetime"),R.push(e,void 0,{shallow:!0})},H=e=>{let t={slug:R.query.slug,date:R.query.date,step:"options",teetime:e},a={pathname:R.pathname,query:(0,j.AO)(t)};(0,x.O)("widget_select_teetime"),R.push(a,void 0,{shallow:!0})};return _?(0,v.J1)(_,C,D)?(0,s.jsxs)("div",{className:"relative space-y-6 @container/widget lg:rounded-md lg:bg-white lg:p-6 lg:shadow",children:[(0,s.jsx)("h3",{className:"heading-md",children:(0,d.t)("Book your round")}),(0,s.jsxs)("div",{className:"mx-auto max-w-[480px]",children:[(0,s.jsx)(q,{startDate:E,onChange:z,bookingRange:O}),(0,s.jsx)(f.G,{bookingRange:O})]})]}):(0,s.jsxs)("div",{className:"relative space-y-6 @container/widget lg:rounded-md lg:bg-white lg:p-6 lg:shadow",children:[(0,s.jsx)("h3",{className:"heading-md",children:(0,d.t)("Book your round")}),(0,s.jsx)("div",{className:"mx-auto max-w-[480px]",children:(0,s.jsx)(q,{startDate:E,onChange:z,bookingRange:O})}),P&&(0,s.jsxs)("div",{className:"text-center",children:[(0,s.jsx)("h2",{className:"mb-2 heading-md",children:(0,d.t)("Sorry")}),(0,s.jsx)("p",{className:"text-center",children:(0,d.t)("There was an error while fetching tee times")})]}),(0,s.jsxs)("div",{className:"relative space-y-6 ".concat(W?"min-h-[100px]":""),children:[U&&(0,s.jsx)("div",{className:"absolute left-0 top-0 z-50 flex h-full w-full items-center justify-center bg-white bg-opacity-50",children:(0,s.jsx)(r.$j,{size:"large"})}),!W&&!P&&(0,s.jsxs)(s.Fragment,{children:[(null==I?void 0:I.teetimes)&&I.teetimes.length>0&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:"grid grid-cols-1 gap-3 @[700px]:grid-cols-2",children:I.teetimes.map((e,t)=>(0,s.jsx)("div",{className:"block ".concat(t>3?"lg:hidden":""," ").concat(t>7?"hidden":""),children:(0,s.jsx)(c.Z,{...e,onPress:e=>H(e)})},e.uuid))}),(0,s.jsx)("div",{className:"mx-auto max-w-[480px]",children:(0,s.jsx)(r.zx,{block:!0,type:"button",onPress:()=>B(),intent:"primary",children:(0,d.t)("View more tee times")})})]}),(null==I?void 0:I.status)==="closed"&&(0,s.jsx)(k.L,{className:"rounded-md border border-grey-300 p-10 lg:border-0 lg:p-0"}),(null==I?void 0:I.status)==="sold_out"&&(0,s.jsx)(N.S,{className:"rounded-md border border-grey-300 p-10 lg:border-0 lg:p-0"}),(null==I?void 0:I.status)==="open"&&(null==I?void 0:null===(t=I.teetimes)||void 0===t?void 0:t.length)===0&&(0,s.jsx)(b.c,{className:"rounded-md border border-grey-300 p-10 lg:border-0 lg:p-0"})]})]})]}):null},q=e=>{let{onChange:t,startDate:a,bookingRange:r}=e,l=i.ou.now(),n=r>0?i.ou.fromFormat(i.ou.now().plus({day:r}).toFormat(w.t6),w.t6):i.ou.fromFormat(i.ou.now().plus({day:365}).toFormat(w.t6),w.t6),[d,m]=(0,o.useState)(!1);return(0,s.jsx)(h.S,{selectedDate:a,minDate:l,maxDate:n,bookingRange:r,onDateChange:e=>{t(e),m(!1),(0,x.O)("widget_date_change")},isOpen:d,setIsOpen:m,forcePortal:!0})}}}]);
2//# sourceMappingURL=922.827d5a8f95a12261.js.map

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.