PageSourceSearch

https://www.treatwell.es/nmp/asset/Error404Page~Error410Page-da26a7.js

js treatwell.es collected 2026-09-25 23:43:27 UTC 36,518 bytes, 2 lines download raw bytes

1(window.webpackJsonp=window.webpackJsonp||[]).push([[5],{1002:function(e,t,n){"use strict";n.d(t,"a",(function(){return l})),n.d(t,"b",(function(){return i}));var a=n(80),o=n(100),r=n(974);const l=n.n(r)()((({country:e,isWebMobile:t,triggerContext:n,searchType:r,searchTerm:l,language:i})=>{Object(o.a)("no_matching_results_shown",a.c.Other,{country:e,platform:"web",is_web_mobile:t,trigger_context:n,search_type:r,search_term:l,language:i})}),300),i=(e,t,n)=>{Object(o.a)("search_treatment_bar_clicked",a.c.Other,{country:e,platform:"web",is_web_mobile:t,trigger_context:n})}},1040:function(e,t,n){"use strict";n.d(t,"a",(function(){return L}));var a=n(0),o=n.n(a),r=n(979),l=n(119),i=n(53),c=n(936),u=n(14),s=n(917),m=n(921),d=n(170),p=n(150),h=n(918),f=n(910);const y=a.forwardRef((({recentSearches:e=[],...t},n)=>{const o=a.useRef(null),{t:r}=Object(p.d)();function l(){if(!e)return;const n=t.cmsCommonControls.search["recent-searches-heading"];if("string"!=typeof n)return;return{heading:n,items:e.slice(0,f.b).map((e=>{if(!Object(f.c)(e.entityType))throw new Error(`unexpected entityType: ${e.entityType}`);return e.entityType===f.a.Venue?Object(f.d)({entity:{entityType:e.entityType,entityValue:e.entityValue,name:e.name,entityId:e.entityId,shortAddress:e.shortAddress,rating:e.rating,primaryImage:e.primaryImage},section:"recent"}):Object(f.d)({entity:{entityType:e.entityType,entityValue:e.entityValue,name:e.name,entityId:e.entityId,treatmentGroupId:e.treatmentGroupId},section:"recent"})}))}}function i(e){return"object"==typeof e&&null!==e&&(Boolean(e.name)&&Boolean(e.normalisedName))}function c(){const e=t.cmsCommonControls.search["treatment-popular-heading"],n=t.cmsCommonControls.search["treatments-popular"].treatment;if("string"!=typeof e||!(n instanceof Array))return void console.warn("invalid popular treatments data in cms");return{heading:e,items:n.filter(i).map((e=>e["treatment-id"]?Object(f.d)({entity:{entityType:f.a.Treatments,entityValue:e.normalisedName,name:e.name,entityId:e["treatment-id"]},section:"popular"}):Object(f.d)({entity:{entityType:f.a.TreatmentType,entityValue:e.normalisedName,name:e.name,entityId:e["treatment-type-id"]},section:"popular"})))}}return a.useImperativeHandle(n,(()=>({setSelectedItemKey(e){null!==o.current&&o.current.setSelectedItemKey(e)}}))),a.createElement(h.a,{inputId:t.inputId,cmsCommonControls:t.cmsCommonControls,ref:o,icon:a.createElement(d.a,{size:24}),placeholder:r("homePage.experimentUnifiedSearch.inputPlaceholder"),searchResultsHeading:t.cmsCommonControls.search["treatment-results-heading"],dataForNoSearch:Object(m.a)([l(),c()]).filter((e=>e.items.length>0)),searchFunction:t.searchFunction,isErrorStyling:t.isErrorStyling,isHotJarWhiteList:!0,isFocusOnClear:!1,onChange:t.onChange,onComplete:t.onComplete,onBlur:t.onBlur,onFocus:t.onFocus,isTreatmentVenueSearch:!0})}));y.displayName="TreatmentVenueSearchInput";var b=n(465),g=n(909),v=n(875),T=n(167),C=n(136),D=n(44),E=n(47),w=n(63),O=n(1002),S=n(915);const k=e=>{if(e){return I(e)}},I=e=>{if(e.entityId)switch(e.entityType){case S.a.Treatments:return{searchType:"treatment",treatmentId:e.entityId};case S.a.TreatmentType:return{searchType:"treatment_type",treatmentTypeId:e.entityId};case S.a.VenueType:return{searchType:"venue_type",venueTypeId:e.entityId}}};var M=n(4),N=n(193),j=n(920);const B=a.forwardRef((({recentLocations:e=[],hasCurrentLocationOption:t=!1,...n},o)=>{var r;const l=a.useRef(null),i=a.useMemo((()=>Object(j.b)(200,j.a.NormalisedName)),[]);function c(){const e=n.cmsCommonControls.search["location-current-location-label"];return{...Object(S.d)({entity:{entityType:S.a.CurrentLocation,entityValue:"",name:e}}),type:S.a.CurrentLocation}}function u(){if(!e)return;const t=n.cmsCommonControls.search["recent-searches-heading"];let a;try{a=e.filter((e=>e.entityType!==S.a.CurrentLocation)).slice(0,S.b).map((e=>{if(!Object(S.c)(e.entityType))throw new Error(`unexpected entityType: ${e.entityType}`);return Object(S.d)({entity:{entityType:e.entityType,entityValue:e.entityValue,name:e.name},section:"recent"})}))}catch(o){return void console.error(o)}return{heading:t,items:a}}function s(){if(!n.popularLocations)return;return{heading:n.cmsCommonControls.search["location-popular-heading"],items:n.popularLocations.map((e=>Object(S.d)({entity:{entityType:S.a.Location,entityValue:e.normalisedName,name:e.name},section:"popular"})))}}return a.useImperativeHandle(o,(()=>({clear(){null!==l.current&&l.current.clear()},setSelectedItemKey(e){null!==l.current&&l.current.setSelectedItemKey(e)},currentLocationItem:c}))),a.createElement(h.a,{inputId:n.inputId,cmsCommonControls:n.cmsCommonControls,ref:l,icon:a.createElement(N.a,{size:24}),placeholder:null!==(r=n.placeholder)&&void 0!==r?r:n.cmsCommonControls.search["location-placeholder-local"],searchResultsHeading:n.cmsCommonControls.search["location-results-heading"],dataForNoSearch:Object(m.a)([u(),s()]).filter((e=>e.items.length>0)),dataAlwaysInDropdown:t?[{items:[c()]}]:void 0,searchFunction:async function(e){const t=await i(n.pageData,e);return n.onSearchResultsChange&&n.onSearchResultsChange(e,t),t},isErrorStyling:n.isErrorStyling,isHotJarWhiteList:!0,onChange:n.onChange,onComplete:n.onComplete,onBlur:n.onBlur,onFocus:n.onFocus,isPatternedBackgroun
1d:n.isPatternedBackground})}));B.displayName="LocationSearchInput";var x=n(1071),A=n.n(x);function _({generateUri:e,normalisedName:t}){window.location=e("venue",{normalisedName:t})}var R=n(80),F=n(100);const V=({countryCode:e,isMobile:t,isValid:n,searchType:a,treatmentTypeId:o,treatmentId:r,venueTypeId:l,venueId:i,locationType:c,locationName:u,triggerContext:s})=>{Object(F.a)("search_button_clicked",R.c.Other,{country:e,platform:"web",is_web_mobile:t,trigger_context:s,is_valid:n,search_type:a,treatment_type_id:o,treatment_id:r,venue_type_id:l,venue_id:i,location_type:c,location_name:u})};function L(e){const[t,n]=o.a.useState(!1),[a,m]=o.a.useState(!0),[d,p]=o.a.useState(!0),[h,S]=o.a.useState([]),[I,N]=o.a.useState([]),[x,R]=o.a.useState(""),F=Object(j.d)(200,j.a.NormalisedName),[L,H]=o.a.useState(!1),[W,$]=o.a.useState(0),z=o.a.useRef(null),P=e.pageData.channel.languageCode,{isMobile:Y}=Object(v.a)(),q=o.a.useRef(null),U=o.a.useRef(null),G=o.a.useRef(null),K=o.a.useRef(!0),J=o.a.useRef(null),Z=o.a.useRef(null),Q=o.a.useRef(null),X=o.a.useRef(null),ee=o.a.useRef(!1),te=o.a.useRef(!1),ne=Object(g.a)(t);o.a.useEffect((()=>{const e=u.e()&&null!==U.current?U.current.currentLocationItem().data:null,{recentTreatments:t,recentLocations:n}=Object(s.a)(P,null,e,null,null);N(n),S(t)}),[P]),o.a.useEffect((()=>{var e,t,n;const a=u.e()&&null!==U.current?U.current.currentLocationItem().data:null,{lastSearch:o}=Object(s.a)(P,null,a,null,null);if(o.treatment&&null!==q.current&&(null===(e=q.current)||void 0===e||e.setSelectedItemKey(`recent:${o.treatment.entityType}:${o.treatment.entityValue}`)),o.location&&null!==U.current){const e=o.location.entityType===f.a.CurrentLocation?U.current.currentLocationItem().key:`recent:${o.location.entityType}:${o.location.entityValue}`;U.current.setSelectedItemKey(e)}(o.date||o.time)&&null!==G.current&&G.current.setDateTime(o.date,(null===(t=o.time)||void 0===t?void 0:t.from)||null,(null===(n=o.time)||void 0===n?void 0:n.to)||null)}),[h,I,P]),o.a.useEffect((()=>{!ne&&t&&Z.current&&Z.current.entityType===f.a.CurrentLocation&&(null!==U.current&&U.current.clear(),m(!1))}),[t,ne]);const{cmsCommon:ae}=e,oe=o.a.createElement(o.a.Fragment,null,o.a.createElement(y,{inputId:"treatment-venue-search",cmsCommonControls:ae.controls,ref:q,recentSearches:h,searchFunction:async t=>{const n=await F(e.pageData,t);return 0===n.length&&Object(O.a)({country:e.pageData.channel.country.countryCode,isWebMobile:Y,triggerContext:e.triggerContext,searchType:"treatment",searchTerm:t,language:P}),n},isErrorStyling:!d,onChange:(e,t,n,a)=>{K.current=0===e.trim().length,J.current=n},onFocus:()=>{Object(O.b)(e.pageData.channel.country.countryCode,Y,e.triggerContext)},onComplete:()=>{const t=J.current;if((null==t?void 0:t.entityType)===f.a.Venue){H(!0),Object(s.b)(t,null,null,null,P);const n={countryCode:e.pageData.channel.country.countryCode,isMobile:Y,isValid:!0,searchType:"venue",venueId:t.entityId,triggerContext:e.triggerContext};V(n),_({generateUri:e.generateUri,normalisedName:t.entityValue})}}}),o.a.createElement(B,{inputId:"location-search",cmsCommonControls:ae.controls,pageData:e.pageData,ref:U,recentLocations:I,popularLocations:e.popularLocations,hasCurrentLocationOption:!t,isErrorStyling:!a,onChange:(e,t,n,o)=>{Z.current=n,a||null===n||m(!0),R(e)}}),o.a.createElement(r.a,{inputId:"date-time-input",cmsCalendar:e.cmsCommon,cmsCommonControls:ae.controls,ref:G,selectableToEndOfMonth:!0,maxDaysInFuture:90,onChange:(e,t,n,a)=>{Q.current=e,X.current=t&&n?{from:t,to:n}:null},placeholder:e.cmsCommon.controls["datetime-input"]["date-time-placeholder"],onTrack:e=>{Object(i.c)({category:"treatment_search_form",...e})},dateTimeDialogRatio:e.dateTimeDialogRatio}),o.a.createElement(C.a,{"data-cy":"SearchBoxButton",onClick:async()=>{var t;"inline"===e.layout&&z.current&&$(z.current.getBoundingClientRect().width);const a=J.current;if((null==a?void 0:a.entityType)===f.a.Venue){H(!0),Object(s.b)(a,null,null,null,P);const t={countryCode:e.pageData.channel.country.countryCode,isMobile:Y,isValid:!0,searchType:"venue",venueId:a.entityId,triggerContext:e.triggerContext};return V(t),void _({generateUri:e.generateUri,normalisedName:a.entityValue})}const o=null!==a||K.current,r="true"===e.cmsSearch["location-required"];let i=!0,u=null,d=!0,h={countryCode:e.pageData.channel.country.countryCode,isMobile:Y,isValid:!1,triggerContext:e.triggerContext};if(H(!0),te.current){const e=k(a);return e&&(h={...h,...e}),V(h),void H(!1)}if(null===Z.current&&r)i=!1;else if((null===(t=Z.current)||void 0===t?void 0:t.entityType)===f.a.CurrentLocation){te.current=!0;try{u=await c.a()}catch(y){c.b(y)?y.code===y.PERMISSION_DENIED?alert(e.cmsCommon.errors["location-blocked"]):(console.warn(y),alert(e.cmsCommon.errors["location-error"])):console.warn(y),i=!1,n(!0)}te.current=!1}if(p(o),m(i),!i&&o&&""!==x&&(d=!1),!i&&o&&""===x&&(d=!1),!o&&i&&(d=!1),i||o||""===x||(d=!1),i||o||""!==x||(d=!1),!d){const e=k(a);return e&&(h={...h,...e}),V(h),void H(!1)}if(Object(s.b)(a,Z.current,Q.current,X.current,P),h.isValid=!0,a){const e=(e=>{if(e.entityId)switch(e.entityType){case f.a.Treatments:return{searchType:"treatment",treatmentId:e.entityId};case f.a.TreatmentType:return{searchType:"treatment_type",treatmentTypeId:e.entityId};case f.a.VenueType:return{searchType:"venue_type",venueTypeId:e.entityId};case f.a.Venue:return{searchType:"venue",venueId:e.entityId}}})(a);T.a.session.setItem("searchAliasTreatment",null==a?void 0:a.aliasId),e&&(h={...h,...e})}Z.current&&(h.locationType=Z.current.entityType,h.locationName=Z.current.name),V(
1h),async function(t){const n=t?Object(l.b)(t):await Object(l.c)(e.pageData,Z.current);if(ee.current)return;b.b(P),b.c(n,P);const a={offerResultType:"LOCAL",...n,venueType:"",...Object(l.a)(Q.current),"timeRange.from":X.current&&X.current.from,"timeRange.to":X.current&&X.current.to},o=J.current;if(o)switch(o.entityType){case"venueType":a.venueType=o.entityValue;break;case"treatments":a.treatments=o.entityValue;break;case"treatmentType":a.treatmentType=o.entityValue}window.location=e.generateUri("browse",a)}(u?u.coords:null)},isLoading:L,ref:z,style:{minWidth:W||void 0}},o.a.createElement(D.a,null,e.cmsSearch["search-button"])));return"inline"===e.layout?o.a.createElement(E.a,{space:"base",align:"stretch",justify:"center",className:Object(M.a)(A.a.container,A.a.inline,e.className),"data-cy":"ExperimentSearchBox"},oe):o.a.createElement(w.a,{space:"base",className:Object(M.a)(A.a.container,e.className),"data-cy":"ExperimentSearchBox"},oe)}},1071:function(e,t,n){e.exports={container:"SearchBox-module--container--067826",inline:"SearchBox-module--inline--f91878"}},908:function(e,t,n){e.exports={"text-regular":"14px","text-large":"16px","highlight-orange":"rgba(255, 102, 65, 0.2)","highlight-teal":"rgba(0, 168, 175, 0.2)","highlight-blue":"rgba(0, 30, 98, 0.2)",datepicker:"Datepicker-module--datepicker--e6ae51",monthHeader:"Datepicker-module--monthHeader--2a0944",disabledNav:"Datepicker-module--disabledNav--d08d13",weekHeader:"Datepicker-module--weekHeader--f55af4",weekday:"Datepicker-module--weekday--bb16b3",monthView:"Datepicker-module--monthView--569a68",weekRow:"Datepicker-module--weekRow--859dec",dayWrap:"Datepicker-module--dayWrap--e681f0",dayInner:"Datepicker-module--dayInner--bbb8b7",available:"Datepicker-module--available--36d5d2",unavailable:"Datepicker-module--unavailable--e17cb1",otherMonth:"Datepicker-module--otherMonth--01b95a",selectedStart:"Datepicker-module--selectedStart--a60178",highlightOrange:"Datepicker-module--highlightOrange--21b00b",highlightTeal:"Datepicker-module--highlightTeal--42d555",highlightBlue:"Datepicker-module--highlightBlue--03b92b",buffer:"Datepicker-module--buffer--b37f60",bufferStart:"Datepicker-module--bufferStart--db770c",bufferEnd:"Datepicker-module--bufferEnd--1b49b7",selectedRange:"Datepicker-module--selectedRange--56eb77",selectedEnd:"Datepicker-module--selectedEnd--ba050a",tooltip:"Datepicker-module--tooltip--21a3b1"}},909:function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));var a=n(0),o=n.n(a);function r(e){const t=o.a.useRef(void 0);return o.a.useEffect((()=>{t.current=e})),t.current}},912:function(e,t,n){"use strict";n.d(t,"b",(function(){return o})),n.d(t,"a",(function(){return r}));n(925);const a=25;function o(e){const t=Math.floor(document.body.getBoundingClientRect().top),n=Math.abs(t-e);let o=Math.abs(t);const r=n-o,l=r/a;let i=0;const c=()=>{o+=l,i+=Math.abs(l),window.scrollTo(0,o),i+Math.abs(l)<Math.abs(r)?window.requestAnimationFrame(c):window.scrollTo(0,n)};window.requestAnimationFrame(c)}function r(e,t,n){const o=Math.floor(e.scrollTop);let r=Math.abs(o);const l=n-r,i=l/a;let c=0;const u=Math.floor(e.scrollLeft);let s=Math.abs(u);const m=t-s,d=m/a;let p=0;const h=()=>{r+=i,c+=Math.abs(i),s+=d,p+=Math.abs(d),e.scrollTo(s,r),p+Math.abs(d)<Math.abs(m)||c+Math.abs(i)<Math.abs(l)?window.requestAnimationFrame(h):e.scrollTo(t,n)};window.requestAnimationFrame(h)}},914:function(e,t,n){"use strict";function a(e){const[t,n]=e.split(":"),a=parseInt(t,10),o=a>=12&&24!==a,r=o||24===a?a-12:a;return[`${0===r?"12":r}:${n}`,o?"PM":"AM"]}function o(e){const[t,n]=a(e);return`${t} ${n}`}function r(e,t,n=t){const a=[];for(let r=t;r<=n;r++){const t=r<10?`0${r.toString()}`:r.toString(),n=`${t}00`,l=e?o(`${t}:00`):`${t}:00`;a.push({value:n,label:l})}return a}function l(e,t){let n=parseInt(e.substring(0,2),10)+t;n<0&&(n+=24),n>24&&(n%=24);const a=e.substring(2,4);return(n<10?`0${n.toString()}`:n.toString())+a}function i(e,t){return c(e)-c(t)}function c(e){const t=function(e){return{hours:parseInt(e.substring(0,2),10),minutes:parseInt(e.substring(2,4),10)}}(e);return 60*t.hours+t.minutes}function u(e,t){if(n=t,["US","GB","PH","CA","AU","NZ","IN","EG","SA","CO","PK","MY"].some((e=>n.toUpperCase()===e.toUpperCase())))return a(e);var n;return[e&&e.length<5?`0${e}`:e,void 0]}function s(e){const t=`${e}00`;return t&&t.length<4?`0${t}`:t}n.d(t,"c",(function(){return r})),n.d(t,"a",(function(){return l})),n.d(t,"d",(function(){return i})),n.d(t,"e",(function(){return u})),n.d(t,"b",(function(){return s}))},917:function(e,t,n){"use strict";n.d(t,"a",(function(){return c})),n.d(t,"b",(function(){return u}));var a,o=n(167);!function(e){e.Treatment="treatment",e.Salon="salon"}(a||(a={}));const r="homepage-search-data",l=5;function i(e){if(!p(e))return null;const t=e.lastSearch;if(!p(t))return null;let n,a,o,r;try{n=m(t.treatment),a=m(t.location),o=function(e){if(null===e)return null;return function(e){if("string"!=typeof e||Number.isNaN(Date.parse(e)))throw new TypeError("invalid date");return new Date(e)}(e)}(t.date),r=function(e){if(!p(e))return null;if("string"!=typeof e.from||"string"!=typeof e.to)return null;return e}(t.time)}
1catch(l){return null}return{treatment:n,location:a,date:o,time:r}}function c(e,t=null,n=null,o=null,r=null){var c;const u=null===(c=y(e))||void 0===c?void 0:c[a.Treatment];let s={treatment:t,location:n,date:o,time:r},m=[],p=[];if(u)try{s=i(u)||s,m=u.recentTreatments.map(d).filter((e=>e.entityValue)).slice(0,l),p=u.recentLocations.map(d).slice(0,l)}catch(h){}return{lastSearch:s,recentTreatments:m,recentLocations:p}}function u(e,t,n,o,r){const{recentTreatments:l,recentLocations:i}=c(r);b(a.Treatment,{lastSearch:{treatment:m(e),location:m(t),date:n,time:o},recentTreatments:s(e,l),recentLocations:s(t,i)},r)}function s(e,t){let n;try{n=d(e)}catch(a){return t}return[n,...t.filter((e=>{return a=e,!((t=n).name===a.name||t.entityType===a.entityType&&t.entityValue===a.entityValue);var t,a}))].slice(0,l)}function m(e){return null===e?null:d(e)}function d(e){if(!p(e)||"string"!=typeof e.entityType||"string"!=typeof e.entityValue||"string"!=typeof e.name||void 0!==e.entityId&&"string"!=typeof e.entityId)throw new TypeError(`invalid data : ${JSON.stringify(e)}`);return e}function p(e){return"object"==typeof e&&null!==e&&e.constructor===Object}const h=({entityId:e})=>void 0!==e,f=e=>{const t={...e};if(e[a.Treatment]){const n=e[a.Treatment].recentTreatments.filter(h),o=e[a.Treatment].lastSearch&&e[a.Treatment].lastSearch.treatment&&void 0!==e[a.Treatment].lastSearch.treatment.entityId?e.treatment.lastSearch.treatment:null;t[a.Treatment]={...e[a.Treatment],recentTreatments:n,lastSearch:{...e[a.Treatment].lastSearch,treatment:o}}}if(e[a.Salon]){const n=e[a.Salon].recentSalons.filter(h);t[a.Salon]={...e[a.Salon],recentSalons:n}}return o.a.local.setItem(r,JSON.stringify(t)),t};function y(e){const t=o.a.local.getItem(r);if((!t||e===t.languageCode)&&p(t))return f(t)}function b(e,t,n){o.a.local.setItem(r,JSON.stringify({...y(n),[e]:t,lastSearchTab:e,languageCode:n}))}},925:function(e,t,n){(function(e){for(var t="undefined"==typeof window?e:window,n=0,a=["ms","moz","webkit","o"],o=0;o<a.length&&!t.requestAnimationFrame;++o)t.requestAnimationFrame=t["".concat(a[o],"RequestAnimationFrame")],t.cancelAnimationFrame=t["".concat(a[o],"CancelAnimationFrame")]||t["".concat(a[o],"CancelRequestAnimationFrame")];t.requestAnimationFrame||(t.requestAnimationFrame=function(e){var a=(new Date).getTime(),o=Math.max(0,16-(a-n)),r=t.setTimeout((function(){e(a+o)}),o);return n=a+o,r}),t.cancelAnimationFrame||(t.cancelAnimationFrame=function(e){clearTimeout(e)})}).call(this,n(64))},979:function(e,t,n){"use strict";n.d(t,"a",(function(){return me})),n.d(t,"b",(function(){return se}));var a=n(0),o=n.n(a),r=n(458),l=n(914),i=n(452),c=n(913),u=n(4),s=n(908),m=n.n(s);function d({dateStr:e,onClick:t,isAvailable:n,visibleMonth:a,bookingStart:r,bookingEnd:l,daySquareSize:c}){const s=r===e,d=s&&r&&l&&l>r,p=l!==r&&l===e,h=r&&l&&e>r&&e<l,f=Object(i.k)(e),y=a&&f.getMonth()!==a.getMonth(),b={[m.a.selectedStart]:s,[m.a.dayInner]:!0,[m.a.selectedEnd]:p},g=c?{width:c,height:c}:{},v={[m.a.dayWrap]:!0,[m.a.available]:n,[m.a.unavailable]:!n,[m.a.otherMonth]:y,[m.a.selectedRange]:h},T={[m.a.buffer]:!0,[m.a.bufferStart]:s,[m.a.bufferEnd]:p};return o.a.createElement("div",{className:Object(u.a)(v)},d?o.a.createElement("div",{className:Object(u.a)(T)}):null,o.a.createElement("div",{className:Object(u.a)(b),style:g,onClick:y?void 0:()=>t(e,n)},y?"":f.getDate()))}const p=({days:e=[],availableDates:t,onDateSelect:n,visibleMonth:a,bookingStart:r,bookingEnd:l,daySquareSize:i})=>{const c=i?{height:i}:{};return o.a.createElement("div",{className:m.a.weekRow,style:c},e.map(((e,c)=>o.a.createElement(d,{key:c,dateStr:e,isAvailable:t.includes(e),visibleMonth:a,bookingStart:r,bookingEnd:l,onClick:n,daySquareSize:i}))))};var h=n(470);const f=864e5,y=(e,t)=>{const n=Object(i.k)(e);return n&&n.setDate(n.getDate()+t),Object(i.c)(n)},b=e=>{const t=new Date(e);return t.setDate(1),t.setMonth(e.getMonth()+1),t},g=e=>{const t=new Date(e);return t.setDate(1),t.setMonth(e.getMonth()-1),t},v=e=>e?Object(i.c)(new Date(e.getUTCFullYear(),e.getMonth(),1)):"",T=e=>e?Object(i.c)(new Date(e.getUTCFullYear(),e.getMonth()+1,0)):"",C=(e,t)=>{const n=Object(h.a)(e,i.b,new Date),a=Object(h.a)(t,i.b,new Date),o=[];for(let r=n;r<=a;r.setDate(r.getDate()+1))o.push(Object(i.c)(r));return o},D=(e,t=[])=>e.filter((e=>t.indexOf(e)>-1)),E=({month:e,onDateSelect:t,availableDates:n,bookingStart:a,bookingEnd:r,daySquareSize:l})=>{const c=(e=>{const t=new Date(e).getTime(),n=[];for(let a=0;a<6;a++){const e=[];for(let n=0;n<7;n++){const o=new Date(t+f*(7*a+n));e.push(Object(i.c)(o))}n.push(e)}return n})(((e,t=0)=>{const n=new Date(Date.UTC(e.getUTCFullYear(),e.getMonth(),1)),a=(7+n.getDay()-t)%7,o=new Date(n.getTime()-a*f);return o.setHours(12),o}
1)(e,1));return o.a.createElement("div",{className:m.a.monthView},c.map(((i,c)=>o.a.createElement(p,{key:c,days:i,visibleMonth:e,onDateSelect:t,availableDates:D(i,n),bookingStart:a,bookingEnd:r,daySquareSize:l}))))};var w=n(400);const O=({date:e,onMonthChange:t,disabledNextMonth:n,disabledPrevMonth:a,monthNames:r})=>o.a.createElement("div",{className:Object(u.a)(m.a.monthHeader)},o.a.createElement("div",{onClick:a?void 0:()=>t("prev"),"data-cy":"prev"},o.a.createElement(w.a,{"data-testid":"prev",colour:"bloomGreyNavy500",direction:w.b.Left,disabled:a,className:Object(u.a)({[m.a.disabledNav]:a})})),o.a.createElement("div",{"data-cy":"monthHeader"},((e,t)=>`${t[e.getMonth()]} ${e.getUTCFullYear()}`)(e,r)),o.a.createElement("div",{onClick:n?void 0:()=>t("next"),"data-cy":"next"},o.a.createElement(w.a,{"data-testid":"next",colour:"bloomGreyNavy500",direction:w.b.Right,disabled:n,className:Object(u.a)({[m.a.disabledNav]:n})}))),S=({weekdays:e})=>o.a.createElement("div",{className:Object(u.a)(m.a.weekHeader)},(e=>e.map(((e,t)=>o.a.createElement("div",{className:m.a.weekday,key:t},e))))(e));function k(e){let t=e.selectedDate||null;const n=t?Object(i.k)(t):new Date,a=function(e){return C(e.first,e.last)}(e.availableDates),[r,l]=o.a.useState(n),[c,s]=o.a.useState(null),d=o.a.useRef(null);o.a.useEffect((()=>(p(),window.addEventListener("resize",p),()=>window.removeEventListener("resize",p))),[]);const p=()=>{if(!d.current||!d.current.clientWidth)return;const e=d.current.clientWidth/7;s(e<=0||e>=48?null:`${e}px`)};function h(e){const t=a.slice(-1)[0];return void 0!==t&&v(b(e))>t}function f(e){const t=a[0];return void 0!==t&&T(g(e))<t}function D(e,t){"next"===e?l(b(t)):"prev"===e&&l(g(t))}const{cmsCalendar:w}=e;t&&!a.includes(t)&&(t=null);const k=t?y(t,0):null,I=[];for(let o=1;o<=7;o++){const e=`${o}`;I.push(w.calendar["day-names-short"][e])}const M=h(r),N=f(r),j=Object(u.a)(m.a.datepicker,m.a.highlightBlue);return o.a.createElement("div",{className:j,ref:d,"data-cy":"datePicker"},o.a.createElement(O,{monthNames:w.calendar["month-names"],date:r,onMonthChange:e=>D(e,r),disabledNextMonth:M,disabledPrevMonth:N}),o.a.createElement(S,{weekdays:I}),o.a.createElement(E,{month:r,bookingStart:t,bookingEnd:k,availableDates:a,onDateSelect:(t,n)=>function(t,n,a){const o=Object(i.k)(t),r=o&&o.getMonth()!==(null==a?void 0:a.getMonth()),l=v(o)<v(a)?"prev":"next";if(r){if("prev"===l&&f(a))return;if("next"===l&&h(a))return;D(l,a)}if(n)return e.onDateSelect(t,Object(i.k)(t))}(t,n,r),daySquareSize:c}))}var I=n(935),M=n(970),N=n(971);function j(){return Object(I.a)()}function B(e,t){const n=Object(r.a)(Object(I.a)(),e);return t?Object(M.a)(n):n}function x(e,t,n){if(null===e)return null;const a=j(),o=B(t,n);return Object(N.a)(e,{start:a,end:o})?e:null}function A({selectableToEndOfMonth:e=!0,...t}){const n={first:Object(i.c)(j()),last:Object(i.c)(B(t.maxDaysInFuture,e))},o=t.selectedDate?Object(i.c)(t.selectedDate):null;return a.createElement(k,{availableDates:n,selectedDate:o,onDateSelect:t.onDateSelect,cmsCalendar:t.cmsCalendar})}var _,R=n(169);!function(e){e.CHOOSE_TIME="CHOOSE_TIME",e.ANY_TIME="ANY_TIME",e.ANY_DATE="ANY_DATE",e.TODAY="TODAY",e.TOMORROW="TOMORROW",e.CHOOSE_DATE="CHOOSE_DATE"}(_||(_={}));var F,V=n(972),L=n(955),H=n(912),W=n(62),$=n(330);!function(e){e.Top="top",e.Right="right",e.Bottom="bottom",e.Left="left"}(F||(F={}));var z=n(994),P=n.n(z);function Y(e){const[t,n]=a.useState(!1),o=a.useRef(null);function r(t){var a;n(!1),null===(a=e.onChange)||void 0===a||a.call(e,t.target.value),requestAnimationFrame((()=>{null!==o.current&&o.current===document.activeElement&&o.current.blur()}))}function l(){var t;n(!0),null===(t=e.onFocus)||void 0===t||t.call(e)}function i(){n(!1)}const c=Object(u.a)(P.a.nativeSelectInput,{[P.a.active]:t},e.positioningClassname),{optionValues:s,selectedValue:m}=e,d=s.filter((e=>e.value===m)),p=d.length>0?d[0].label:"";return a.createElement("div",{className:c},a.createElement("div",{className:P.a.inputValue},p),a.createElement(w.a,{containerStyle:{marginLeft:12,marginRight:12},colour:t?"bloomBaseNavy800":"bloomGreyNavy300",direction:t?w.b.Up:w.b.Down,animated:!0}),function(){const{optionValues:t}=e;return a.createElement("select",{className:P.a.selectBox,value:e.selectedValue,onChange:r,onBlur:i,onFocus:l,ref:o},t.map((e=>a.createElement("option",{value:e.value,key:e.value},e.label))))}())}var q=n(909),U=n(945);function G({positioningClassName:e}){return a.createElement("svg",{className:e,xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},a.createElement("g",{fill:"none",fillRule:"evenodd"},a.createElement("path",{d:"M0 0h24v24H0z"}),a.createElement("circle",{cx:"12",cy:"12",r:"9",stroke:"var(--color-grey-70)",strokeWidth:"2"}),a.createElement("path",{stroke:"var(--color-grey-70)",strokeWidth:"2",d:"M12 6v6l3 3"})))}function K({positioningClassName:e}){return a.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",className:e},a.createElement("g",{fill:"none",fillRule:"evenodd"},a.createElement("path",{d:"M0 0h24v24H0z"}),a.createElement("path",{stroke:"var(--color-grey-70)",strokeWidth:"2",d:"M11 5h5m3 0c.552 0 1 .445 1 1v14c0 .552-.445 1-1 1H5c-.552 0-1-.445-1-1V6a1 1 0 0 1 1.01-1H8"}),a.createElement("path",{fill:"var(--color-grey-70)",d:"M7 12h2v2H7zM11 12h2v2h-2zM11 16h2v2h-2zM15 12h2v2h-2zM7 16h2v2H7zM7 2h2v6H7zM15 2h2v6h-2z"})))}var J=n(995),Z=n.n(J);function Q({icon:e,header:t,children:n,dataCy:o}){return a.createElement(a.Fragment,null,a.createElement("div",{className:Z.a.header},e,a.createElement("span",{className:Z.a.headerText},t)),a.createElement("div",{className:Z.a.buttonGroup,"data-cy":o},n))}var X=n(15),ee=n.n(X),te=n(117),ne=n(996),ae=n.n(ne);class oe extends o.a.PureComponent{render(){return o.a.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",className:this.props.positioningClassname,width:"24",height:"12",viewBox:"0 0 24 12",version:"1.1",onClick:this.props.onClick},o.a.createElement("g",{stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},o.a.createElement("g",{transform:"\n              translate(12.000000, 7.410000)\n              rotate(180.000000)\n              translate(-12.000000, -7.410000)\n              translate(0.000000, 1.590000)\n            "},o.a.createElement("polygon",{transform:"translate(0.000000, -1.0)",fill:this.props.fillColour,fillRule:"nonzero",points:"12 0.41 24 12.41 0 12.41"}),o.a.createElement("polygon",{fill:this.props.outlineColour,fillRule:"nonzero",points:"12 1.85 24 13.85 0 13.85"}),o.a.createElement("rect",{stroke:"#FFFFFF",fill:"#D8D8D8",x:"0.5",y:"13.91",width:"23",height:"1"}))))}}class re extends o.a.PureComponent{render(){const e=Object(u.a)(ae.a.buttonArrow,this.props.positioningClassname),t=this.props.showArrow?$.a.BlueOutline:$.a.White;return o.a.createElement("div",{className:e},o.a.createElement(W.a,{...this.props,colour:t,positioningClassname:ae.a.button}),this.props.showArrow&&o.a.createElement(oe,{positioningClassname:Object(u.a)(ae.a.arrowSvg,ae.a[this.props.arrowPosition]),fillColour:te.colors.baseNavy,outlineColour:te.colors.white,onClick:this.props.onClick}))}}function le(e){return a.createElement(a.Fragment,null,e.buttons.map((t=>{const n={colour:t.key===e.activeButtonKey?$.a.BlueOutline:$.a.White,label:t.label,onClick:()=>e.onClick(t.key)};return t.arrow?a.createElement(re,{key:t.key,...n,showArrow:t.key===e.activeButtonKey,arrowPosition:e.arrowPosition}):a.createElement(W.a,{key:t.key,...n})})))}
1re.propTypes={positioningClassname:ee.a.string,showArrow:ee.a.bool,arrowPosition:ee.a.oneOf([F.Right,F.Top,F.Left,F.Bottom]),label:ee.a.string.isRequired,onClick:ee.a.func},re.defaultProps={showArrow:!0,arrowPosition:F.Bottom};var ie=n(997),ce=n.n(ie);function ue({isDesktop:e=!1,...t}){const n=a.useRef(null),o=Object(q.a)(t.activeTimeButton);function r(e,n){t.onDateSelect&&t.onDateSelect(n),y({property:"calendar",action:"select",label:"day",value:Object(L.a)(n,new Date)})}function i(){y({property:"min_time",action:"expand"})}function c(e){if(y({property:"min_time",action:"select",label:`${e.substr(0,2)}:${e.substr(2,4)}`}),!t.onTimeSelect)return;let n=t.selectedTimeTo;Object(l.d)(e,n)>=0&&(n=Object(l.a)(e,1)),t.onTimeSelect(e,n)}function s(){y({property:"max_time",action:"expand"})}function m(e){if(y({property:"max_time",action:"select",label:`${e.substr(0,2)}:${e.substr(2,4)}`}),!t.onTimeSelect)return;let n=t.selectedTimeFrom;Object(l.d)(n,e)>=0&&(n=Object(l.a)(e,-1)),t.onTimeSelect(n,e)}function d(){return t.showDatepicker?a.createElement("div",{className:ce.a.datepickerWrap},a.createElement(A,{selectableToEndOfMonth:t.selectableToEndOfMonth,maxDaysInFuture:t.maxDaysInFuture,selectedDate:t.selectedDate,onDateSelect:r,cmsCalendar:t.cmsCalendar})):null}function p(){return t.activeTimeButton===_.CHOOSE_TIME}function h(e){if(e===_.CHOOSE_DATE)t.onDateButtonSelect(e),t.onDatepickerToggle(!0);else{const n=function(e){let t;switch(e){case _.TODAY:t=Object(I.a)();break;case _.TOMORROW:t=Object(V.a)();break;default:t=null}return t}(e);t.onDateButtonSelect(e),t.onDatepickerToggle(!1),t.onDateSelect&&t.onDateSelect(n)}y({property:"date_filter",action:"select",label:t.dateButtons.find((t=>t.key===e)).label})}function f(e){t.onTimeButtonSelect&&(t.onTimeButtonSelect(e),y({property:"time_filter",action:"select",label:t.timeButtons.find((t=>t.key===e)).label}))}function y(e){t.onTrack&&t.onTrack(e)}a.useEffect((()=>{p()&&o!==t.activeTimeButton&&null!==n.current&&Object(H.a)(n.current,0,n.current.scrollHeight)}),[o,t.activeTimeButton]);const b={[ce.a.dialog]:!0,[ce.a.withDatepickerDesktop]:t.showDatepicker&&e,[ce.a.dialogMobile]:!e};return a.createElement("div",{className:Object(u.a)(b),ref:n},a.createElement("div",{className:ce.a.controls},a.createElement(Q,{icon:a.createElement(K,null),header:t.cmsCommonControls["datetime-input"]["date-header"],dataCy:"DateOptionsButtonGroup"},a.createElement(le,{buttons:t.dateButtons,onClick:h,arrowPosition:e?F.Right:F.Bottom,activeButtonKey:t.activeDateButton})),e?null:d(),function(){if(!Object(U.a)())return a.createElement(Q,{icon:a.createElement(G,null),header:t.cmsCommonControls["datetime-input"]["time-header"]},a.createElement(le,{buttons:t.timeButtons,onClick:f,activeButtonKey:t.activeTimeButton}),p()&&function(){const e=Object(l.c)(!1,0,23),n=Object(l.c)(!1,1,24);return a.createElement(a.Fragment,null,a.createElement("div",null,a.createElement("div",{className:ce.a.selectLabel},t.cmsCommonControls["datetime-input"]["time-from-label"]),a.createElement(Y,{optionValues:e,selectedValue:t.selectedTimeFrom,onChange:c,onFocus:i})),a.createElement("div",null,a.createElement("div",{className:ce.a.selectLabel},t.cmsCommonControls["datetime-input"]["time-to-label"]),a.createElement(Y,{optionValues:n,selectedValue:t.selectedTimeTo,onChange:m,onFocus:s})))}())}(),a.createElement("div",{className:ce.a.applyButtonContainer},a.createElement(W.a,{positioningClassname:Object(u.a)(e?ce.a.applyButtonDesktop:ce.a.applyButtonMobile),label:t.cmsCommonControls["datetime-input"]["complete-button"],colour:$.a.Blue,onClick:t.onDone}))),e?d():null)}function se(e,t,n,a){const o=x(t,90,!0),r=null!==n&&null!==a?{from:n,to:a}:null;return Object(i.d)({dateFormat:e["date-input"].format,dateTimeFormat:e["datetime-input"]["datetime-format"],timeRangeFormat:e["datetime-input"]["timerange-format"]},o,r)}const me=a.forwardRef((({selectableToEndOfMonth:e=!0,isClearable:t=c.a.Clearable,...n},o)=>{var i;
1const u=a.useRef(null),[s,m]=a.useState(null),[d,p]=a.useState(!1),[h,f]=a.useState(_.ANY_DATE),[y,b]=a.useState(_.ANY_TIME),[g,v]=a.useState("0800"),[T,C]=a.useState("2000");a.useImperativeHandle(o,(()=>({setDateTime:w})));const D=[{key:_.ANY_TIME,label:n.cmsCommonControls["datetime-input"]["time-any-time-button"]},{key:_.CHOOSE_TIME,label:n.cmsCommonControls["datetime-input"]["time-choose-time-button"],arrow:!0}],E=[{key:_.ANY_DATE,label:n.cmsCommonControls["datetime-input"]["date-any-date-button"]},{key:_.TODAY,label:n.cmsCommonControls["datetime-input"]["date-today-button"]},{key:_.TOMORROW,label:n.cmsCommonControls["datetime-input"]["date-tomorrow-button"]},{key:_.CHOOSE_DATE,label:n.cmsCommonControls["datetime-input"]["date-choose-date-button"],arrow:!0}];function w(t=null,a=null,o=null){const l=x(t,n.maxDaysInFuture,e),i=O(a),c=O(o),s=i&&c?{from:i,to:c}:null,d=function(e){if(!e)return _.ANY_DATE;const t=new Date,n=Object(r.a)(t,1);switch(e.toDateString()){case t.toDateString():return _.TODAY;case n.toDateString():return _.TOMORROW;default:return _.CHOOSE_DATE}}(l),h=s?_.CHOOSE_TIME:_.ANY_TIME;const y=se(n.cmsCommonControls,l,i,c);u.current&&u.current.setValue(y),m(l),f(d),b(h),p(d===_.CHOOSE_DATE),v(a||g),C(o||T),n.onChange&&n.onChange(l,i,c,y)}function O(e){return Object(l.c)(!1,0,24).some((t=>t.value===e))?e:null}function S(e){n.onTrack&&n.onTrack(e)}const k=d?2:1;return a.createElement(c.b,{inputId:n.inputId,ref:u,icon:a.createElement(R.a,{size:24}),isClearable:t,isTextEditable:!1,placeholder:n.placeholder,isFocusOnClear:!1,isHotJarWhiteList:!0,closeButtonText:n.cmsCommonControls["dropdown-input"]["close-button"],dropdownWidthRatio:k*(null!==(i=n.dateTimeDialogRatio)&&void 0!==i?i:1),onChange:function(e,t){t&&""===e&&w(null,null,null)},onBlur:function(){var e;null===(e=n.onBlur)||void 0===e||e.call(n)},onFocus:function(){var e;null===(e=n.onFocus)||void 0===e||e.call(n)},onOpen:function(){S({property:"date_and_time",action:"open"})},onClose:function(){S({property:"date_and_time",action:"close"})},isPatternedBackground:n.isPatternedBackground},a.createElement(ue,{cmsCalendar:n.cmsCalendar,cmsCommonControls:n.cmsCommonControls,maxDaysInFuture:n.maxDaysInFuture,selectedDate:s||void 0,selectedTimeFrom:g,selectedTimeTo:T,selectableToEndOfMonth:e,timeButtons:D,dateButtons:E,activeTimeButton:y,activeDateButton:h,showDatepicker:d,onDatepickerToggle:function(e){p(e)},onDateButtonSelect:function(e){f(e)},onDateSelect:function(e){y===_.CHOOSE_TIME?w(e,g,T):w(e,null,null)},onTimeSelect:function(e,t){w(s,e,t)},onTimeButtonSelect:function(e){e===_.CHOOSE_TIME?w(s,g,T):w(s,null,null),b(e)},onDone:function(){u.current&&u.current.blur()},onTrack:S}))}));me.displayName="DateTimeInput"},994:function(e,t,n){e.exports={nativeSelectInput:"NativeSelectInput-module--nativeSelectInput--735a31",inputValue:"NativeSelectInput-module--inputValue--91c5d8",selectBox:"NativeSelectInput-module--selectBox--3f4bda",active:"NativeSelectInput-module--active--52c48b"}},995:function(e,t,n){e.exports={header:"DateTimeOptions-module--header--5f0716",headerText:"DateTimeOptions-module--headerText--71557e",buttonGroup:"DateTimeOptions-module--buttonGroup--676221"}},996:function(e,t,n){e.exports={buttonArrow:"ButtonArrow-module--buttonArrow--fa672b",button:"ButtonArrow-module--button--dbf653",arrowSvg:"ButtonArrow-module--arrowSvg--d3842d",top:"ButtonArrow-module--top--6e5a3c",bottom:"ButtonArrow-module--bottom--9d8dd4",left:"ButtonArrow-module--left--00f3bf",right:"ButtonArrow-module--right--53f6f5",blue:"ButtonArrow-module--blue--a92afa"}},997:function(e,t,n){e.exports={"tablet-layout-width":"520px","breakpoint-tablet":"(min-width: 520px)",tabletBreakpointWidth:"520px",dialog:"DateTimeDialog-module--dialog--945fe6",dialogMobile:"DateTimeDialog-module--dialogMobile--fcebfd",controls:"DateTimeDialog-module--controls--b95976",datepickerWrap:"DateTimeDialog-module--datepickerWrap--b88695",applyButtonContainer:"DateTimeDialog-module--applyButtonContainer--04412f",applyButtonMobile:"DateTimeDialog-module--applyButtonMobile--d12d57",applyButtonDesktop:"DateTimeDialog-module--applyButtonDesktop--2f640b",selectLabel:"DateTimeDialog-module--selectLabel--0d817f",withDatepickerDesktop:"DateTimeDialog-module--withDatepickerDesktop--5d2d1f"}}}]);
2//# sourceMappingURL=Error404Page~Error410Page-da26a7.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.