1"use strict";(self.webpackChunkfitu_app=self.webpackChunkfitu_app||[]).push([[7139],{4834:function(e,t,i){i.d(t,{AW:function(){return r},Gb:function(){return d},M:function(){return c},NP:function(){return n},OZ:function(){return h},T0:function(){return u},Uj:function(){return o},_G:function(){return a},xP:function(){return l}});var s=i(39708);const n=s.Ay` 2 query nextAvailableSchedule($filter: BranchSchedulesFilterType, $limit: Int) { 3 branchSchedules: branchSchedules(filter: $filter, limit: $limit) { 4 collection { 5 id 6 startAt 7 } 8 } 9 } 10`,r=s.Ay` 11 query branchSchedules( 12 $filter: BranchSchedulesFilterType 13 $userId: Int 14 $limit: Int 15 $isAuthenticated: Boolean = false 16 $waitlistEnabled: Boolean = false 17 $waitlistAuthenticated: Boolean = false 18 ) { 19 branchSchedules: branchSchedules(filter: $filter, limit: $limit) { 20 collection { 21 id 22 autoAssignSpot 23 branchId 24 daylong 25 scheduleKind 26 startAt 27 stopAt 28 spaces 29 onSaleUntil 30 onSaleUntilPeriod 31 canceledAt 32 disabledAt 33 soldOutAt 34 pricingKind 35 pricingLabel 36 workoutLink 37 duration 38 price 39 openWindowTime 40 openWindowPeriod 41 staffId 42 branchId 43 klassId 44 bookedByUser: bookingsExist(filter: { userIdEq: $userId, statusEq: booked }) 45 @include(if: $isAuthenticated) 46 bookingsWaitlistsCount @include(if: $waitlistEnabled) 47 userInWaitlist: bookingsWaitlistsExist(filter: { userIdEq: $userId }) 48 @include(if: $waitlistAuthenticated) 49 visualData 50 } 51 } 52 } 53`,a=s.Ay` 54 query branches { 55 branches { 56 collection { 57 id 58 name 59 formattedAddress 60 howFindUs 61 lat 62 lng 63 online 64 googleReserveBranchAttributes 65 } 66 } 67 } 68`,o=s.Ay` 69 query klasses($filter: KlassesFilter) { 70 klasses(filter: $filter) { 71 collection { 72 id 73 activityKind 74 description 75 freeWorkout 76 personalTraining 77 title 78 workoutType { 79 id 80 name 81 } 82 } 83 } 84 } 85`,l=s.Ay` 86 query staffs { 87 staffs { 88 collection { 89 id 90 displayName 91 } 92 } 93 } 94`,d=s.Ay` 95 query providerPlans($includePlanChainIds: Boolean! = true) { 96 providerPlans { 97 collection { 98 id 99 name 100 description 101 unlimitedTickets 102 allowOverBooking 103 allowCancellation 104 allowMultipleBookings 105 planChainIds @include(if: $includePlanChainIds) 106 bookingLimits { 107 id 108 limitType 109 maxBookings 110 } 111 } 112 } 113 } 114`,c=s.Ay` 115 query userSubscriptions { 116 userSubscriptions: userSubscriptions(filter: { scopeEq: actives }) { 117 collection { 118 id 119 status 120 oneTime 121 startDate 122 currentPeriodStartAt 123 currentPeriodEndAt 124 trialStartAt 125 trialEndAt 126 cancelAt 127 canceledAt 128 availableTickets 129 providerPlanId 130 providerPlan { 131 klassIds 132 klassesScope 133 branchIds 134 branchesScope 135 } 136 } 137 } 138 } 139`,h=s.Ay` 140 query KlassPictures($filter: KlassPicturesFilterType, $limit: Int) { 141 klassPictures(filter: $filter, page: 1, limit: $limit) { 142 collection { 143 klassId 144 fileUrl(variant: medium) 145 priority 146 } 147 } 148 } 149`,u=s.Ay` 150 query UnsplashImages($filter: UnsplashImagesFilterType, $limit: Int) { 151 unsplashImages(filter: $filter, page: 1, limit: $limit) { 152 collection { 153 imageableId 154 priority 155 unsplashImageLinks(filter: { urlTypeIn: [thumb] }) { 156 url 157 } 158 } 159 } 160 } 161`},6853:function(e,t){t.A={methods:{redirectToFitune(e="poweredbyfitunebranding",t="provider_referrals"){const i=this.$store.state.origin,s=window.location.hostname;let n,r;s.includes("fitune.io")?(n="fitune-subdomain",r=i):(n="custom-domain",r=s);const a=`https://www.fitune.io/?${new URLSearchParams({utm_source:n,utm_medium:e,utm_campaign:t,utm_content:r}).toString()}`;window.open(a,"_blank")}}}},10996:function(e,t,i){var s=i(4834),n=i(16196);t.A={data(){return{redeemableStatus:["active","trialing","unpaid"]}},methods:{getWindowDate(e,t,i,s){let n,r=e.clone();switch(t[i]){case"minutes":n=r.subtract(t[s],"minutes");break;case"hours":n=r.subtract(t[s],"hours");break;case"days":n=r.subtract(t[s],"days")}return n},getTimeToWindow(e){const t=this.$moment().tz(this.savedTimezone),i=this.$moment.utc(e.startAt,"YYYY-MM-DD HH:mm:ss").tz(this.savedTimezone),s=this.getWindowDate(i.clone(),e,"openWindowPeriod","openWindowTime"),n=this.getWindowDate(i.clone(),e,"onSaleUntilPeriod","onSaleUntil");return s&&s.isAfter(t)?{label:"window-open",text:s.format("dddd DD MMMM YYYY ⢠hh:mm A"),status:!0}:n&&n.isBefore(t)?{label:"window-close",text:n.format("dddd DD MMMM YYYY ⢠hh:mm A"),status:!0}:{label:"",text:"",status:!1}},showStartDate(e){const t=this.$moment().utc();return!!e.startDate&&t.isBefore(this.$moment.utc(e.startDate))},getSortedSubs(e){return e.length>1?e.filter(e=>this.redeemableStatus.includes(e.status)).sort((e,t)=>
161new Date(t.currentPeriodStartAt)-new Date(e.currentPeriodStartAt)):e},getFirstRedeemable(e){const t=this.getSortedSubs(e.userSubscriptions),i=t.filter(e=>this.redeemableStatus.includes(e.status)).findIndex(e=>{const t=!this.showStartDate(e),i=e.providerPlan.unlimitedTickets,s=e.availableTickets>0,n=i||s,r=e.providerPlan.allowMultipleBookings;return t&&n&&r});return-1!==i?t[i]:t[0]},async fetchCalendarFiltersGraphql(e){var t,i,r;const a=await Promise.all([this.$apollo.query({query:s.Uj,variables:{filter:{unlistedEq:!1,activityKindEq:e}}}),this.$apollo.query({query:s._G}),this.$apollo.query({query:s.xP})]),[o,l,d]=a;if(null!==(t=o.errors)&&void 0!==t&&t.length||null!==(i=l.errors)&&void 0!==i&&i.length||null!==(r=d.errors)&&void 0!==r&&r.length){return[o,l,d].some(e=>e.errors&&(0,n.hd)({errors:e.errors}))||this.$notify({group:"webapp",type:"error",title:this.$t("error-title"),text:`LaunchDarkly: ${this.$t("error-description")}`,duration:1e4,speed:300,position:"top right"}),null}return{klasses:o.data.klasses.collection,branches:l.data.branches.collection,staffs:d.data.staffs.collection}}}}},64667:function(e,t,i){e.exports=i.p+"6a0410757a6200c4f015.png"},67139:function(e,t,i){i.r(t),i.d(t,{default:function(){return w}});var s=i(95353),n=i(90151),r=i(2543),a=i(10996),o=i(6853),l=i(16196);var d=i(93962),c=i(4834);const h=(e,t,i,s)=>{const n={startAtGteq:i,startAtLteq:s,scheduleKindEq:"klass",klassPersonalTrainingEq:t,klassReviewedEq:!0,klassUnlistedEq:!1,disabledAtNull:!0};return e.selectedWorkoutStyle&&(n.locationEnvironmentEq=e.selectedWorkoutStyle),e.selectedTrainer&&(n.staffIdEq=Number(e.selectedTrainer)),e.selectedWt&&(n.klassIdEq=Number(e.selectedWt)),e.selectedLocation&&(n.branchIdEq=Number(e.selectedLocation)),e.selectedPricingType&&(n.pricingKindNotEq=e.selectedPricingType),n},u=(e,t,i,s,n)=>({date_to:s,date_from:i,q_klass_id_eq:e.selectedWt,q_branch_id_eq:e.selectedLocation,q_trainer_id_eq:e.selectedTrainer,q_personal_training_eq:t,location_environment_eq:e.selectedWorkoutStyle,events:!1,limit:n&&1,...e.selectedPricingType&&{pricing_kind_not_eq:e.selectedPricingType}}),f=(e,t,i)=>"all"===e||"selected"===e&&(null==t?void 0:t.includes(i)),m=(e,t)=>t.userSubscriptions.filter(t=>{const i=t.providerPlan;return f(null==i?void 0:i.klassesScope,null==i?void 0:i.klassIds,e.klassId)&&f(null==i?void 0:i.branchesScope,null==i?void 0:i.branchIds,e.branchId)}).map(e=>({...e,providerPlan:t.providerPlans.find(i=>{var s;return!t.providerPlanPriceRefactorFlag&&(null===(s=i.planChainIds)||void 0===s?void 0:s.length)>0?i.planChainIds.includes(e.providerPlanId):i.id===e.providerPlanId})??{}})),p=e=>{if((0,l.hd)({errors:e})){const e=new Error("RATE_LIMIT");throw e.__isRateLimit=!0,e}throw new Error("GraphQL errors")},g=async({apolloClient:e,filterSelection:t,isPersonalTraining:i,from:s,to:n,hasLimit:r,isLoggedIn:a,userId:o,waitlistEnabled:l,lookups:d})=>{var u,f;const g=h(t,i,s,n),v=await e.query({query:c.AW,variables:{filter:g,...r&&{limit:1},...!r&&{limit:1e6},...a&&{userId:o},isAuthenticated:a,waitlistEnabled:l,waitlistAuthenticated:l&&a}});if(!v)throw new Error("No response");null!==(u=v.errors)&&void 0!==u&&u.length&&p(v.errors);const y=null===(f=v.data)||void 0===f||null===(f=f.branchSchedules)||void 0===f?void 0:f.collection;if(!Array.isArray(y))throw new Error("Invalid response structure");return y.map(e=>((e,t)=>{var i,s,n;return{...e,branch:t.getBranchById(e.branchId)??(null===(i=e.visualData)||void 0===i?void 0:i.branch)??null,klass:t.getKlassById(e.klassId)??(null===(s=e.visualData)||void 0===s?void 0:s.klass)??null,staff:t.getStaffById(e.staffId)??(null===(n=e.visualData)||void 0===n?void 0:n.staff)??null,userSubscriptions:m(e,t)}})(e,d))},v=async({restInstance:e,filterSelection:t,isPersonalTraining:i,from:s,to:n,hasLimit:r,isLoggedIn:a})=>{const{data:{branchSchedules:{collection:o}}}=await e({requiresAuth:a}).get("/api/partners/branch_schedules",{params:u(t,i,s,n,r)});return o};var y={methods:{fetchPublicDataIfNeeded(){"undefined"!=typeof window&&"function"==typeof this.isPublicContentSeeded&&"function"==typeof this.fetchPublicContent&&this.fetchPublicContent(this.isPublicContentSeeded())}}},b=i(73009),S={name:"venueOnline",components:{WaitingList:()=>i.e(8429).then(i.bind(i,90810)),CalendarView:()=>i.e(5172).then(i.bind(i,95172)),ControlSchedule:()=>i.e(4414).then(i.bind(i,74414)),VenueOnlineHeader:()=>i.e(1650).then(i.bind(i,51650)),VenueOnlineList:()=>i.e(6110).then(i.bind(i,86110))},mixins:[a.A,o.A,y,b.A],beforeRouteEnter(e,t,i){try{i(i=>{("Login"===t.name||"Oauth"===t.name)&&e.query.activityId&&i.isLoggedIn&&(i.scheduleId=e.query.activityId,i.openWaitlistModal())})}catch(e){i(!1)}},data(){var e,t,i,s,n,r;const a=this.seedForRoute(),o=a?((null===(e=a.data)||void 0===e||null===(e=e.branchSchedules)||void 0===e?void 0:e.collection)??[]).map(e=>({...e,visualData:{bookingsCount:e.bookingsCount,includedInCourse:e.includedInCourse}})):[],l=(null==a||null===(t=a.resolved)||void 0===t?void 0:t.date)??this.$moment.tz(this.$store.state.savedTimezone||"UTC").format("YYYY-MM-DD"),d=(this.$store.getters["theme/isEmbed"]?this.$store.state.embed:this.$store.state.website)||{};return{isLoading:!a,selectedDate:this.$moment().utc().format("YYYY-MM-DD HH:mm:ss"),groupSchedules:a?[{[l]:o}]:[],scheduleId:0,isList:Boolean(a),groupWeekly:{},settingView:d.schedules_view_setup??null,week:"week",showDaysAhead:!1,currentDate:null,lastDate:null,scheduleRollingDays:0,day:"day",list:"list",checkoutCustomization:d.paygo_checkout??null,dateFormatUtc:"YYYY-MM-DD HH:mm:ss",isLoadingNextAvailableSchedule:!1,nextAvailableScheduleDate:null,filterSelection:{selectedWt:(null===(i=this.$route.query)||void 0===i?void 0:i.q_klass_id_eq)||"",selectedLocation:(null===(s=this.$route.query)||void 0===s?void 0:s.q_branch_id_eq)||"",selectedTrainer:(null===(n=this.$route.query)||void 0===n?void 0:n.q_trainer_id_eq)||"",selectedWorkoutStyle:(null===(r=this.$route.query)||void 0===r?void 0:r.location_environment_eq)||""},calendarGraphqlFF:!1,locationDropdownFlag:!1,providerPlanPriceRefactorFlag:!1,ldReady:!1,ldLoading:!1,userSubscriptionsFetchPromise:null,userSubscriptionsSyncedForLogin:!1,isInitializing:!1,filters:{activities:[],locations:[],staff:[]},branchCache:new Map,klassCache:new Map,staffCache:new Map,userSubscriptions:[],providerPlans:[],_venueOnlineDestroyed:!1,filterRefreshId:0,reduceBranchScheduleFlag:!1}},computed:{...(0,s.L8)({isLoggedIn:"auth/isLoggedIn",bodyFont:"theme/bodyFont",isLight:"theme/isLight",isEmbed:"theme/isEmbed"}),...(0,s.aH)(["embed","website","savedTimezone","websiteClosed","user"]),isPersonalTraining(){return this.$route.name.includes("PersonalTraining")},showLocationPicker(){var e;const t=!!(0,d.h6)(this.$route.query)||!!this.$store.getters["googleReserve/grParams"];return this.locationDropdownFlag&&((null===(e=this.settingView)||void 0===e||null===(e=e.schedule_filters)||void 0===e?void 0:e.filter_location)||t)}},watch:{async isLoggedIn(e){if(!e)return this.userSubscriptionsSyncedForLogin=!1,void(this.userSubscriptionsFetchPromise=null);const t=await this.ensureCalendarGraphqlFFResolved();this._venueOnlineDestroyed||!t&&this.ldReady&&this.calendarGraphqlFF&&(await this.ensureUserSubscriptionsFetchedForLogin(),this._venueOnlineDestroyed)||this.refreshData()},"$screen.isMobile":{handler(e){if(!this.settingView)return;const t=!!this.settingView,i=t&&this.settingView.view!==this.list;e?(this.isList=!0,t&&!i||this.filterByKlassName({replace:i})):i&&(this.isList=!1,this.filterByWeekly())}},currentDate(e){if(e){let t=e.split(" ")[0],i={...this.$route.query};i.date=t,this.websiteClosed||this.$router.replace({query:i,params:{savePosition:!0}}).catch(()=>{}),this.getCurrentDateActivities(t)}}
161,selectedDate(){this.isList||(this.groupSchedules=[])},groupSchedules:{handler:async function(e){if(e.length>0){const t=(0,r.last)(e);if(null==t||"object"!=typeof t)return;if((0,r.every)(t,e=>(0,r.every)(e,e=>(0,r.isEmpty)(e)))&&!this.isLoadingNextAvailableSchedule){this.isLoadingNextAvailableSchedule=!0;try{const e=Object.keys(t)[0];if(!e)return;const i=this.$moment.tz(e,"YYYY-MM-DD",this.savedTimezone).add(1,"day").startOf("day").utc().format(this.dateFormatUtc),s=this.$moment.tz(e,"YYYY-MM-DD",this.savedTimezone).add(30,"days").endOf("day").utc().format(this.dateFormatUtc);let n;if(this.calendarGraphqlFF)n=await this.fetchNextAvailableScheduleDate(i,s);else{const e=await this.getSchedules({from:i,to:s,hasLimit:!0});n=(null==e?void 0:e.collection)??[]}if(this._venueOnlineDestroyed)return;this.nextAvailableScheduleDate=n&&n.length>0?this.$moment.utc(n[0].startAt).format("YYYY-MM-DD HH:mm:ss"):null}catch(e){(0,l.hd)(e)||this.handleNotification()}finally{this._venueOnlineDestroyed||(this.isLoadingNextAvailableSchedule=!1)}}}},deep:!1}},beforeDestroy(){this._venueOnlineDestroyed=!0},created(){const e=(0,d.h6)(this.$route.query);e&&this.$store.dispatch("googleReserve/setGrParams",e);const t=this.$store.getters["googleReserve/grParams"];this.needsGrLocationSync()&&(this.filterSelection.selectedLocation=String(t.gr_branch_id)),null!=t&&t.q_pricing_kind_not_eq&&(this.filterSelection.selectedPricingType=null==t?void 0:t.q_pricing_kind_not_eq),this.fetchPublicDataIfNeeded()},mounted(){this.consumeSeed()},methods:{...(0,s.i0)(["getCurrentDateActivities"]),ssrSeedStoreKey(){return"listingContent"},ssrSeedMutation(){return"setListingContent"},matchesSeedForRoute(e){var t,i;const s=this.$route.name.includes("PersonalTraining");if(this.needsGrLocationSync()||this.$store.getters["auth/isLoggedIn"])return!1;if(e.kind!==(s?"personal-training":"activities"))return!1;const n=(null===(t=this.$route.query)||void 0===t?void 0:t.date)||this.$moment.tz(this.$store.state.savedTimezone||"UTC").format("YYYY-MM-DD");return(null===(i=e.resolved)||void 0===i?void 0:i.date)===n&&["q_klass_id_eq","q_branch_id_eq","q_trainer_id_eq","location_environment_eq"].every(t=>{var i,s;return((null===(i=this.$route.query)||void 0===i?void 0:i[t])||void 0)===(null===(s=e.resolved)||void 0===s?void 0:s[t])})},needsGrLocationSync(){var e;const t=this.$store.getters["googleReserve/grParams"];return(null==t?void 0:t.gr_branch_id)&&!(null!==(e=this.$route.query)&&void 0!==e&&e.q_branch_id_eq)},isPublicContentSeeded(){return Boolean(this.seedForRoute())},fetchPublicContent(e){this.getSettings({needsFilterSync:this.needsGrLocationSync(),skipInitialFetch:e})},onUpdateFilter(e){this.filterSelection={...e,...!("selectedPricingType"in e)&&this.filterSelection.selectedPricingType?{selectedPricingType:this.filterSelection.selectedPricingType}:{}};const t=this.$store.getters["googleReserve/grParams"];if(t&&"selectedLocation"in e){const i={...t};e.selectedLocation?i.gr_branch_id=e.selectedLocation:delete i.gr_branch_id,this.$store.dispatch("googleReserve/setGrParams",i)}this.filterChanged()},refreshData(){this.filterRefreshId++,this.nextAvailableScheduleDate=null,this.isList?this.filterByKlassName({replace:!0}):this.filterByWeekly()},selectedDateList(e){this.selectedDate=e,this.refreshData()},async filterByWeekly(){const e=this.filterRefreshId;this.isLoading=!0;try{this.currentDate=this.$moment.utc(this.selectedDate).tz(this.savedTimezone).format("YYYY-MM-DD");const t=this.$moment.utc(this.selectedDate).tz(this.savedTimezone).startOf("isoweek").utc().format(this.dateFormatUtc),{groupedFormatSchedules:i}
161=await this.getSchedules({from:t,to:this.$moment.utc(t).tz(this.savedTimezone).add(6,"days").endOf("day").utc().format(this.dateFormatUtc)});if(this._venueOnlineDestroyed)return;if(e!==this.filterRefreshId)return;this.groupWeekly=(e=>{let t={};for(const i in e)if(Object.prototype.hasOwnProperty.call(e,i)){const s=e[i];t={...t,...s}}return t})(i)}catch(e){(0,l.hd)(e)||this.handleNotification()}finally{this._venueOnlineDestroyed||(this.isLoading=!1)}},getSettings({skipInitialFetch:e=!1,needsFilterSync:t=!1}={}){this.isInitializing=!0;const i=this.isEmbed?this.embed:this.website,{schedules_view_setup:s,paygo_checkout:n}=i;this.settingView=s,this.checkoutCustomization=n;const r=!!this.settingView&&this.settingView.view===this.list;this.isList=r||this.$screen.isMobile,e||(t?(this.$route.query.date&&(this.selectedDate=this.$moment.tz(this.$route.query.date,this.savedTimezone).startOf("day").utc().format(this.dateFormatUtc)),this.filterChanged()):this.$route.query.date?this.selectedDateList(this.$moment.tz(this.$route.query.date,this.savedTimezone).startOf("day").utc().format(this.dateFormatUtc)):this.isList?this.filterByKlassName():this.filterByWeekly()),this.scheduleRollingDays=this.website.klass_display_days,this.lastDate=this.$moment().add(this.scheduleRollingDays,"days").format("YYYY-MM-DD"),this.$nextTick(()=>{this.isInitializing=!1})},filterChanged(){const{date:e}=this.$route.query,t={...e&&{date:e},q_klass_id_eq:this.filterSelection.selectedWt,q_branch_id_eq:this.filterSelection.selectedLocation,q_trainer_id_eq:this.filterSelection.selectedTrainer,location_environment_eq:this.filterSelection.selectedWorkoutStyle};let i="";for(const e in t)t[e]&&(i+=`${e}=${t[e]}&`);const s=`${this.$route.path}${i?`?${i.slice(0,-1)}`:""}`;this.$route.fullPath!==s&&this.$router.push({path:s}).catch(()=>{}),this.refreshData()},checkLastDate(){this.showDaysAhead=this.currentDate===this.lastDate||this.$moment(this.currentDate,"YYYY-MM-DD").isAfter(this.lastDate,"YYYY-MM-DD")},async filterByKlassName({replace:e=!1}={}){const t=this.filterRefreshId;this.isLoading=!0,this.currentDate=this.$moment.utc(this.selectedDate).tz(this.savedTimezone).format("YYYY-MM-DD"),this.checkLastDate();const i=this.$moment.utc(this.selectedDate).tz(this.savedTimezone).isAfter(this.$moment(),"day")?this.$moment.utc(this.selectedDate).tz(this.savedTimezone).startOf("day").utc().format(this.dateFormatUtc):this.$moment().utc().format(this.dateFormatUtc);this.selectedDate=i;try{var s;const{collection:n}
161=await this.getSchedules({from:i,to:this.$moment.utc(i).tz(this.savedTimezone).endOf("day").utc().format(this.dateFormatUtc)});if(this._venueOnlineDestroyed)return;if(t!==this.filterRefreshId)return;const r={},a=this.$moment.utc().isAfter(this.$moment.utc(i),"day");r[this.$moment.utc(i).tz(this.savedTimezone).format("YYYY-MM-DD")]=a?[]:n,e?this.groupSchedules=[r]:this.groupSchedules.push(r),null!==(s=this.$refs)&&void 0!==s&&null!==(s=s.venueOnlineList)&&void 0!==s&&s.enableScroll&&this.$refs.venueOnlineList.setupScrollListener()}catch(e){(0,l.hd)(e)||this.handleNotification()}finally{this._venueOnlineDestroyed||(this.isLoading=!1)}},async nextDay(){if(!this.isLoading)try{if(!this.selectedDate)return;const e=this.$moment.utc(this.selectedDate).tz(this.savedTimezone),t=e.clone().add(1,"days").startOf("day"),i=e.clone().endOf("isoweek"),s=t.utc().format(this.dateFormatUtc);if(t.isAfter(i))return this.$refs.controlSchedule?(this.isLoading=!0,void await this.$refs.controlSchedule.nextCycle()):void 0;this.selectedDate=s,await this.filterByKlassName()}catch(e){(0,l.hd)(e)||this.handleNotification()}},selectedSchedule(e){this.scheduleId=e,this.$modal.show("waiting-list")},openWaitlistModal(){setTimeout(()=>{this.$modal.show("waiting-list")},1e3)},mutateSchedule(e){const t=e=>({...e,userInWaitlist:!0});this.isList?((e,t,i)=>{for(let s=0;s<e.length;s++){const n=e[s],r=Object.keys(n)[0],a=n[r].findIndex(e=>e.id===t);if(a>=0){const t=i(n[r][a]);return e[s][r].splice(a,1,t),!0}}})(this.groupSchedules,e,t):((e,t,i)=>{for(const s in e)if(Object.prototype.hasOwnProperty.call(e,s)){const n=e[s].findIndex(e=>e.id===t);if(n>=0){const t=i(e[s][n]);return e[s].splice(n,1,t),!0}}})(this.groupWeekly,e,t)},scheduleLookups(){return{getBranchById:this.getBranchById,getKlassById:this.getKlassById,getStaffById:this.getStaffById,userSubscriptions:this.userSubscriptions,providerPlans:this.providerPlans,providerPlanPriceRefactorFlag:this.providerPlanPriceRefactorFlag}},async fetchNextAvailableScheduleDate(e,t){return await this.ensureCalendarGraphqlFFResolved(),(async({apolloClient:e,filterSelection:t,isPersonalTraining:i,from:s,to:n})=>{var r,a;const o=h(t,i,s,n),l=await e.query({query:c.NP,variables:{filter:o,limit:1}});null!=l&&null!==(r=l.errors)&&void 0!==r&&r.length&&p(l.errors);const d=null==l||null===(a=l.data)||void 0===a||null===(a=a.branchSchedules)||void 0===a?void 0:a.collection;return Array.isArray(d)?d:[]})({apolloClient:this.$apollo,filterSelection:this.filterSelection,isPersonalTraining:this.isPersonalTraining,from:e,to:t})},async getSchedules({to:e="",from:t="",hasLimit:i=!1}){var s,a;return await this.ensureCalendarGraphqlFFResolved(),(async({useGraphql:e,isList:t,moment:i,timezone:s,from:n,to:a,...o})=>{const l=e?g:v,d=await l({...o,from:n,to:a}),c=d.map(e=>{var t,i;return{...e,visualData:{...e.visualData,bookingsCount:(null===(t=e.visualData)||void 0===t?void 0:t.bookingsCount)??e.bookingsCount??0,includedInCourse:(null===(i=e.visualData)||void 0===i?void 0:i.includedInCourse)??e.includedInCourse??!1}}}),h={collection:(0,r.cloneDeep)(c),groupedFormatSchedules:[]};return t||(h.groupedFormatSchedules=((e,t,i,s)=>{const n=[];let r=0;n[r]=[];const a=[],o=e.utc(i).tz(s).format("YYYY-MM-DD");for(let t=0;t<7;t++)a.push(e(o).add(t,"days").format("YYYY-MM-DD"));for(let i=0;i<a.length;i++){const o=a[i],l=[...t];for(let i=0;i<l.length;i++){const a=e.utc(l[i].startAt).tz(s).format("YYYY-MM-DD");if(e(a).isAfter(o)){r++,n[r]=[];break}e(a).isSame(o)&&(n[r].push(l[i]),t.splice(t.findIndex(e=>e.id===l[i].id),1))}n.length<i+1&&n.push([])}return n.map((e,t)=>({[a[t]]:e}))})(i,c,n,s)),h})({apolloClient:this.$apollo,restInstance:n.A,useGraphql:this.calendarGraphqlFF,filterSelection:this.filterSelection,isPersonalTraining:this.isPersonalTraining,from:t,to:e,hasLimit:i,isLoggedIn:this.isLoggedIn,userId:null===(s=this.user)||void 0===s?void 0:s.uid,waitlistEnabled:null===(a=this.website)||void 0===a?void 0:a.waitlist_enabled,lookups:this.scheduleLookups(),isList:this.isList,moment:this.$moment,timezone:this.savedTimezone})},handleNotification(){this.$notify({group:"webapp",type:"error",title:this.$t("error-title"),text:this.$t("error-description"),duration:1e4,speed:300,position:"top right",max:1}
161)},async ensureCalendarGraphqlFFResolved(){return this.ldReady||this.ldLoading?(this.ldLoading&&await this.waitForLdReady(),!1):(await this.getCalendarGraphqlFF(),!0)},async getCalendarGraphqlFF(){if(!this.ldLoading&&!this.ldReady){this.ldLoading=!0;try{const e=this.$store.getters.ldClient;if(!e)return;if(await e.waitForInitialization(5),this._venueOnlineDestroyed)return;if(this.calendarGraphqlFF=e.variation("calendar-refactor-graphql-only",!1),this.locationDropdownFlag=e.variation("fit-5152-webapp-location-dropdown",!1),this.providerPlanPriceRefactorFlag=e.variation("fit-5035-provider-plan-price-versioning",!1),this.reduceBranchScheduleFlag=e.variation("fit-5317-reduce-calendar-weight-on-website",!1),this.isLoggedIn&&this.calendarGraphqlFF&&await this.ensureUserSubscriptionsFetchedForLogin(),this._venueOnlineDestroyed)return;if(this.calendarGraphqlFF){const e=await this.fetchCalendarFiltersGraphql("klass");if(!e)return;this.filters.activities=e.klasses,this.filters.locations=e.branches,this.filters.staff=e.staffs}else{const e=await(0,n.A)({requiresAuth:!1}).get("/api/partner/filter_collection_activities");this.filters.activities=e.data.data.klasses.collection,this.filters.locations=e.data.data.branches.collection,this.filters.staff=e.data.data.staffs.collection}this.ldReady=!0}catch(e){(0,l.hd)(e)||this.$notify({group:"webapp",type:"error",title:this.$t("error-title"),text:`LaunchDarkly: ${this.$t("error-description")}`,duration:1e4,speed:300,position:"top right"})}finally{this._venueOnlineDestroyed||(this.ldLoading=!1)}}},async waitForLdReady(){const e=Date.now();for(;!this.ldReady&&Date.now()-e<5e3;)await new Promise(e=>setTimeout(e,100))},getBranchById(e){if(this.branchCache.has(e))return this.branchCache.get(e);const t=this.filters.locations.find(t=>t.id===e)||null;return t&&this.branchCache.set(e,t),t},getKlassById(e){if(this.klassCache.has(e))return this.klassCache.get(e);const t=this.filters.activities.find(t=>t.id===e)||null;return t&&this.klassCache.set(e,t),t},getStaffById(e){if(this.staffCache.has(e))return this.staffCache.get(e);const t=this.filters.staff.find(t=>t.id===e)||null;return t&&this.staffCache.set(e,t),t},ensureUserSubscriptionsFetchedForLogin(){return this.userSubscriptionsSyncedForLogin?Promise.resolve():(this.userSubscriptionsSyncedForLogin=!0,this.fetchUserSubscriptionsAndProviderPlansOnce())},fetchUserSubscriptionsAndProviderPlansOnce(){if(!this.userSubscriptionsFetchPromise){const e=this.getUserSubscriptionsAndProviderPlans().finally(()=>{this.userSubscriptionsFetchPromise===e&&(this.userSubscriptionsFetchPromise=null)});this.userSubscriptionsFetchPromise=e}return this.userSubscriptionsFetchPromise},async getUserSubscriptionsAndProviderPlans(){try{var e;const t=await(async({apolloClient:e,userId:t,providerPlanPriceRefactorFlag:i,getCurrentUserId:s})=>{var n,r;const[a,o]=await Promise.all([e.query({query:c.M,variables:{userId:t}}),e.query({query:c.Gb,variables:{includePlanChainIds:!i}})]);return s()!==t?null:{userSubscriptions:(null===(n=a.data)||void 0===n||null===(n=n.userSubscriptions)||void 0===n?void 0:n.collection)??[],providerPlans:(null===(r=o.data)||void 0===r||null===(r=r.providerPlans)||void 0===r?void 0:r.collection)??[]}})({apolloClient:this.$apollo,userId:null===(e=this.user)||void 0===e?void 0:e.uid,providerPlanPriceRefactorFlag:this.providerPlanPriceRefactorFlag,getCurrentUserId:()=>{var e;return null===(e=this.user)||void 0===e?void 0:e.uid}});if(!t)return;this.userSubscriptions=t.userSubscriptions,this.providerPlans=t.providerPlans}catch{this.handleNotification()}}}},w=(0,i(14486).A)(S,function(){var e,t=this,s=t._self._c;return s("section",{staticClass:"services-width-container min-h-full",class:t.isLoading?"min-h-screen":null},[s("loading",{attrs:{active:t.isLoading},on:{"update:active":function(e){t.isLoading=e}}}),t._v(" "),s("modal",{attrs:{name:"waiting-list",adaptive:!0,clickToClose:!1,width:"510",height:"auto"}},[s("waiting-list",{class:t.isLight?"":"embed-background-dark",attrs:{schedule:t.scheduleId},on:{joined:t.mutateSchedule}})],1),t._v(" "),s("main",{},[s("VenueOnlineHeader",{attrs:{filters:t.filters,"filter-selection":t.filterSelection,settingView:t.settingView,"show-location-picker":t.showLocationPicker},on:{changedTimeZone:t.refreshData,updateFilter:t.onUpdateFilter}}),t._v(" "),s("div",{attrs:{id:"livestream"}},[s("control-schedule",{ref:"controlSchedule",attrs:{isList:t.isList,selectedDate:t.selectedDate,settingView:t.settingView},on:{selectedDateList:t.selectedDateList,changed:t.refreshData},model:{value:t.selectedDate,callback:function(e){t.selectedDate=e},expression:"selectedDate"}}),t._v(" "),s("div",{staticClass:"pb-10 pt-0 sm:pt-4"},[s("div",[s("div",{staticClass:"w-full",class:t.isList?"":"px-0"},[t.isList?s("VenueOnlineList",{ref:"venueOnlineList",staticClass:"schedules",attrs:{id:"list",settingView:t.settingView,groupSchedules:t.groupSchedules,nextAvailableScheduleDate:t.nextAvailableScheduleDate,showDaysAhead:t.showDaysAhead,checkoutCustomization:t.checkoutCustomization,isLoadingNextAvailableSchedule:t.isLoadingNextAvailableSchedule,lastDate:t.lastDate,reduceBranchScheduleFlag:t.reduceBranchScheduleFlag},on:{getSelectedSchedule:t.selectedSchedule,getNextDay:t.nextDay,"go-to-date":function(e){return t.selectedDateList(e)},refreshData:t.refreshData,"reset-next-available-schedule-date":function(e){t.nextAvailableScheduleDate=null}}}):s("div",{staticClass:"calendar-schedules",attrs:{id:"calendar"}},[t.$screen.isMobile?t._e():s("CalendarView",{attrs:{groupSchedules:t.groupWeekly,settingView:(null===(e=t.settingView)||void 0===e?void 0:e.sc
161hedule_info)||{},lastDate:t.lastDate,scheduleRollingDays:t.scheduleRollingDays,checkoutCustomization:t.checkoutCustomization,one:t.isPersonalTraining},on:{waitlist:t.selectedSchedule,refreshData:t.refreshData}})],1),t._v(" "),t.website.display_powered_by?s("div",{staticClass:"w-full mt-6 md:mt-8 pl-4 md:pl-0"},[s("div",{staticClass:"flex"},[s("img",{staticClass:"powered-branding cursor-pointer",staticStyle:{position:"unset"},attrs:{src:i(64667),alt:"Powered by Fitune"},on:{click:t.redirectToFitune}})])]):t._e()],1)])])],1)],1)],1)},[],!1,null,null,null).exports},73009:function(e,t){t.A={methods:{seedForRoute(){const e=this.$store.state[this.ssrSeedStoreKey()];return e&&this.matchesSeedForRoute(e)?e:null},consumeSeed(){"undefined"!=typeof window&&this.$store.commit(this.ssrSeedMutation(),null)}}}}}]);
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.