willba-component-library 0.4.3 → 0.4.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -16,7 +16,7 @@ Paste these two lines into any page — WordPress, plain HTML, anywhere. Set `do
16
16
  domain="customer.willba.store"
17
17
  mode="dark"
18
18
  ></willba-filter-bar>
19
- <script src="https://cdn.jsdelivr.net/npm/willba-component-library@0.4.3/lib/embed.umd.js"></script>
19
+ <script src="https://cdn.jsdelivr.net/npm/willba-component-library@0.4.4/lib/embed.umd.js"></script>
20
20
  ```
21
21
 
22
22
  The filter bar is fully self-contained and runs isolated from the rest of the page — your theme, plugins, and other scripts won't interfere with it, and it won't affect them.
package/lib/embed.esm.js CHANGED
@@ -70,5 +70,5 @@ var t=Object.getOwnPropertySymbols,n=Object.prototype.hasOwnProperty,r=Object.pr
70
70
  \******************************/function(e,t,n){var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var a=n(/*! react */"react"),o=r(n(/*! matchmediaquery */"./node_modules/matchmediaquery/index.js")),i=r(n(/*! hyphenate-style-name */"./node_modules/hyphenate-style-name/index.js")),l=n(/*! shallow-equal */"./node_modules/shallow-equal/dist/index.esm.js"),s=r(n(/*! ./toQuery */"./src/toQuery.ts")),u=r(n(/*! ./Context */"./src/Context.ts")),c=function(e){if(e)return Object.keys(e).reduce(function(t,n){return t[(0,i.default)(n)]=e[n],t},{})},d=function(){var e=(0,a.useRef)(!1);return(0,a.useEffect)(function(){e.current=!0},[]),e.current},f=function(e){var t=function(){return function(e){return e.query||(0,s.default)(e)}(e)},n=(0,a.useState)(t),r=n[0],o=n[1];return(0,a.useEffect)(function(){var e=t();r!==e&&o(e)},[e]),r};t.default=function(e,t,n){var r=function(e){var t=(0,a.useContext)(u.default),n=function(){return c(e)||c(t)},r=(0,a.useState)(n),o=r[0],i=r[1];return(0,a.useEffect)(function(){var e=n();(0,l.shallowEqualObjects)(o,e)||i(e)},[e,t]),o}(t),i=f(e);if(!i)throw new Error("Invalid or missing MediaQuery!");var s=function(e,t){var n=function(){return(0,o.default)(e,t||{},!!t)},r=(0,a.useState)(n),i=r[0],l=r[1],s=d();return(0,a.useEffect)(function(){if(s){var e=n();return l(e),function(){e&&e.dispose()}}},[e,t]),i}(i,r),p=function(e){var t=(0,a.useState)(e.matches),n=t[0],r=t[1];return(0,a.useEffect)(function(){var t=function(e){r(e.matches)};return e.addListener(t),r(e.matches),function(){e.removeListener(t)}},[e]),n}(s),h=d();return(0,a.useEffect)(function(){h&&n&&n(p)},[p]),(0,a.useEffect)(function(){return function(){s&&s.dispose()}},[]),p}},react:
71
71
  /*!**************************************************************************************!*\
72
72
  !*** external {"commonjs":"react","commonjs2":"react","amd":"react","root":"React"} ***!
73
- \**************************************************************************************/t=>{t.exports=e}},n={};function r(e){var a=n[e];if(void 0!==a)return a.exports;var o=n[e]={exports:{}};return t[e].call(o.exports,o,o.exports,r),o.exports}return r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r("./src/index.ts")})(),pa.exports=e(i()));var e}var ma=ha();const ga=({fill:e,size:t,icon:n})=>{switch(n){case"spinner":return p.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:`${t||25}`,height:`${t||25}`,viewBox:"0 0 24 24"},p.createElement("style",null,"\n .spinner_z9k8 {\n transform-origin: center;\n animation: spinner_StKS .75s infinite linear;\n }\n @keyframes spinner_StKS {\n 100% {\n transform: rotate(360deg);\n }\n }\n "),p.createElement("path",{d:"M12,1A11,11,0,1,0,23,12,11,11,0,0,0,12,1Zm0,19a8,8,0,1,1,8-8A8,8,0,0,1,12,20Z",opacity:".25",fill:e}),p.createElement("path",{d:"M12,4a8,8,0,0,1,7.89,6.7A1.53,1.53,0,0,0,21.38,12h0a1.5,1.5,0,0,0,1.48-1.75,11,11,0,0,0-21.72,0A1.5,1.5,0,0,0,2.62,12h0a1.53,1.53,0,0,0,1.49-1.3A8,8,0,0,1,12,4Z",className:"spinner_z9k8",fill:e}));case"warning":return p.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:`${t||25}`,height:`${t||25}`,className:"svg-icon",style:{verticalAlign:"middle",fill:e,overflow:"hidden",minWidth:"25px",minHeight:"25px"},viewBox:"0 0 1024 1024",version:"1.1"},p.createElement("path",{d:"M42.666667 896h938.666666L512 85.333333 42.666667 896z m512-128h-85.333334v-85.333333h85.333334v85.333333z m0-170.666667h-85.333334v-170.666666h85.333334v170.666666z"}));default:return null}},va=({calendarRange:e,disabledDates:t,overlappingDate:n,rangeContext:r,findFirstPossibleRangeContextCheckIn:a,findLastPossibleRangeContextCheckOut:o,currentSelectionLastCheckoutDate:i})=>{const l=(null==e?void 0:e.from)&&rt(e.from),s=(null==e?void 0:e.to)&&rt(e.to),u=(null==r?void 0:r.from)&&rt(r.from),c=(null==r?void 0:r.to)&&rt(r.to),d=n?n.filter(e=>{const t=e.from?rt(e.from):null,n=t&&(null==a?void 0:a.checkIn)&&rn(t,null==a?void 0:a.checkIn),r=t&&(null==o?void 0:o.lastCheckOut)&&nn(t,rt(null==o?void 0:o.lastCheckOut));return!(n||r)}).map(e=>({from:e.from})):[];return{booked:t||[],disabledAfterCheckIn:l?[{after:l}]:[],overlappingDate:!l&&d.length?d.map(e=>({from:e.from})):[],noActiveSelectionStart:u||[],noActiveSelectionMid:[u&&c?{after:u,before:c}:[]],noActiveSelectionEnd:c||[],checkoutOptionsMid:[...l&&!s&&(null==i?void 0:i.lastCheckOut)?[{after:l,before:Ae(i.lastCheckOut,1)}]:[]],checkInOnly:[...(null==a?void 0:a.checkIn)&&r&&u?[{from:a.checkIn,to:Ae(u,-1)}]:[]],checkOutOnly:[...(null==o?void 0:o.checkIn)&&o.lastCheckOut?[{from:Ae(o.checkIn,1),to:o.lastCheckOut}]:[]]}},ya=e=>{const t=null==e?void 0:e.getRootNode();return t instanceof ShadowRoot?t:document},ba=f.forwardRef(({selectedPath:e,calendarRange:t,setCalendarRange:n,language:r,disableCalendarDates:a,requestDates:o,disabledDates:i,updateCalendarMonthNavigation:l,setUpdateCalendarMonthNavigation:s,updateCalendarDefaultMonth:u,loadingData:c,showFeedback:d,palette:h,setCalendarHasError:m,setUpdatedForSubmit:g,rangeContext:v,calendarHasError:y,autoFocus:b},w)=>{var k;const{t:x}=j("common"),S=F(b),C=ma.useMediaQuery({maxWidth:960}),E=qe(new Date),N=null==t?void 0:t.from,O=null==v?void 0:v.from,{newDisableCalendarDates:_,overlappingDate:P,lastPossibleCheckout:L}=(({disableCalendarDates:e,calendarRange:t,updateCalendarMonthNavigation:n,updateCalendarDefaultMonth:r})=>{const[a,o]=f.useState(void 0),[i,l]=f.useState([]);return{newDisableCalendarDates:f.useMemo(()=>{var t;if(null==e?void 0:e.availableDates){const n="dd-MM-yyyy",{disabledDates:r}=e,{updatedDisabledDates:a,newOverlappingDates:i}=(r||[]).reduce((t,r)=>{var a,o;const i=Gt(r.from,n),l=Gt(r.to,n),s=null===(a=e.availableDates)||void 0===a?void 0:a.some(e=>Gt(e.lastCheckOut,n)===i&&Gt(e.lastCheckOut,n)===l),u=null===(o=e.availableDates)||void 0===o?void 0:o.some(e=>Gt(e.lastCheckOut,n)===i&&Gt(e.lastCheckOut,n)!==l);return s?t.newOverlappingDates.push(r):u?(t.newOverlappingDates.push(r),t.updatedDisabledDates.push(Object.assign(Object.assign({},r),{from:Ae(r.from,1)}))):t.updatedDisabledDates.push(r),t},{updatedDisabledDates:[],newOverlappingDates:[]}),s=null===(t=e.availableDates.at(-1))||void 0===t?void 0:t.lastCheckOut;return s&&l({after:s}),i.length&&o([...i]),Object.assign(Object.assign({},e),{disabledDates:a})}return e},[e,t,n,r]),overlappingDate:a,lastPossibleCheckout:i}})({disableCalendarDates:a,calendarRange:t,updateCalendarMonthNavigation:l,updateCalendarDefaultMonth:u}),D=(({newDisableCalendarDates:e,selectedPath:t,today:n})=>{var r,a,o;const i=(null==e?void 0:e.disabledDatesByPage)&&t?[null===(r=null==e?void 0:e.disabledDatesByPage)||void 0===r?void 0:r.find(e=>t===e.page)]:[];return i.length?[{from:Ae(n,null!==(o=null===(a=i[0])||void 0===a?void 0:a.offset)&&void 0!==o?o:-1),to:Ae(n,-100)}]:[]})({today:E,selectedPath:e,newDisableCalendarDates:_});(({showFeedback:e,rootRef:t})=>{f.useEffect(()=>{if("undefined"==typeof document||!e)return;const n=ya(null==t?void 0:t.current),r=n.querySelector(".will-calendar-tooltip"),a=n.querySelector(".will-calendar-tooltip-check-out"),o=n.querySelector(".will-calendar-tooltip-overlapping-date"),i=n.querySelector(".will-filter-bar-calendar .will-calendar-spinner"),l=n.querySelector(".will-calendar-tooltip-check-in-only"),s=n.querySelector(".will-calendar-tooltip-check-out-only"),u=n.querySelectorAll(".will-filter-bar-calendar .rdp-cell:has(.booked):not(:has(.disabled-after-check-in))"),c=n.querySelectorAll(".will-filter-bar-calendar .rdp-cell:has(.booked.disabled-after-check-in)"),d=n.querySelector(".will-filter-bar-calendar .rdp-months"),f=n.querySelectorAll(".will-filter-bar-calendar .rdp-cell:has(.overlapping-date)"),p=n.querySelectorAll(".will-filter-bar-calendar .rdp-cell:has(.check-in-only)"),h=n.querySelectorAll(".will-filter-bar-calendar .rdp-cell:has(.check-out-only)"),m=[],g=[],v=[],y=[],b=[],w=[];if(r&&u.length>0&&u.forEach(e=>{const t=r.cloneNode(!0);e.appendChild(t),m.push(t)}),a&&c.length>0&&c.forEach(e=>{const t=a.cloneNode(!0);e.appendChild(t),g.push(t)}),s&&h.length>0&&h.forEach(e=>{const t=s.cloneNode(!0);e.appendChild(t),y.push(t)}),l&&p.length>0&&p.forEach(e=>{const t=l.cloneNode(!0);e.appendChild(t),v.push(t)}),i&&d){const e=i.cloneNode(!0);d.appendChild(e),b.push(e)}return o&&f.length>0&&f.forEach(e=>{const t=o.cloneNode(!0);e.appendChild(t),w.push(t)}),()=>{m.forEach(e=>e.remove()),g.forEach(e=>e.remove()),b.forEach(e=>e.remove()),w.forEach(e=>e.remove()),v.forEach(e=>e.remove()),y.forEach(e=>e.remove())}})})({showFeedback:d,rootRef:S}),(({loadingData:e,rootRef:t})=>{f.useEffect(()=>{if("undefined"==typeof document)return;const n=ya(null==t?void 0:t.current).querySelector(".will-filter-bar-calendar .rdp-months .will-calendar-spinner");e?n&&(n.style.display="flex"):n&&(n.style.display="none")})})({loadingData:c,rootRef:S});const M=e=>{m&&y&&m(!1),(({range:e,newDisableCalendarDates:t,setCalendarRange:n,calendarRange:r,overlappingDate:a,setCalendarHasError:o,rangeContext:i})=>{var l;const s=(null==e?void 0:e.from)?rt(e.from):null,u=(null==e?void 0:e.to)?rt(e.to):null,c=(null==r?void 0:r.from)?rt(r.from):null,d=(null==r?void 0:r.to)?rt(r.to):null,f=(null==i?void 0:i.from)?rt(i.from):null,p=(null==i?void 0:i.to)?rt(i.to):null,h=!e&&c&&d?c:s,m=(null==a?void 0:a.length)?a.find(e=>!(!e.from||!h)&&an(rt(e.from),h)):null,g=(null==a?void 0:a.length)?a.find(e=>!(!e.from||!u)&&an(rt(e.from),u)):null,v=(null===(l=null==t?void 0:t.availableDates)||void 0===l?void 0:l.length)?t.availableDates.find(e=>!(!e.checkIn||!s)&&an(rt(e.checkIn),s)):null;c&&m&&s&&!an(s,c)||!e||c&&d&&g&&u&&!an(u,d)?n(void 0):s&&p&&nn(s,p)||c&&d&&p&&u&&!an(u,d)&&nn(u,p)?(o&&o(!0),n(void 0)):s&&u&&an(s,u)?n({from:s,to:void 0}):c&&d&&!e?n({from:c,to:void 0}):i&&u&&(null==v?void 0:v.lastCheckOut)&&nn(u,rt(v.lastCheckOut))&&(d&&!an(u,d)||!d)&&nn(u,rt(i.to))?(o&&o(!0),n(void 0)):s&&c&&rn(s,c)?n({from:s,to:void 0}):u&&(null==v?void 0:v.lastCheckOut)&&nn(u,rt(v.lastCheckOut))?n(g?void 0:{from:u,to:void 0}):c&&s&&!an(c,s)?n({from:s,to:void 0}):d&&u&&!an(d,u)?n({from:u,to:void 0}):s&&u&&f&&rn(u,f)?(o&&o(!0),n({from:u,to:void 0})):n(e)})({range:e,newDisableCalendarDates:_,setCalendarRange:n,calendarRange:t,overlappingDate:P,setCalendarHasError:m,rangeContext:v}),g&&g(!0)},{findFirstPossibleRangeContextCheckIn:T,findLastPossibleRangeContextCheckOut:R,firstPossibleRangeContextCheckIn:z,lastPossibleRangeContextCheckOut:I,currentSelectionAvailability:A}=(({rangeContext:e,availableDates:t,calendarRange:n})=>{let r,a,o=[],i=[];const l=(null==e?void 0:e.from)&&rt(e.from),s=(null==e?void 0:e.to)&&rt(e.to),u=(null==n?void 0:n.from)&&rt(n.from);return e&&(null==t?void 0:t.length)&&(r=null==t?void 0:t.find(e=>l&&rt(e.checkIn)<l&&rt(e.lastCheckOut)>=l),(null==r?void 0:r.checkIn)&&o.push({before:r.checkIn}),a=null==t?void 0:t.find(e=>s&&an(s,rt(e.checkIn))),(null==a?void 0:a.checkIn)&&i.push({after:a.lastCheckOut})),{findFirstPossibleRangeContextCheckIn:r,findLastPossibleRangeContextCheckOut:a,firstPossibleRangeContextCheckIn:o,lastPossibleRangeContextCheckOut:i,currentSelectionAvailability:null==t?void 0:t.find(e=>!!u&&an(rt(e.checkIn),u))}})({rangeContext:v,availableDates:null==_?void 0:_.availableDates,calendarRange:t});(({setCalendarHasError:e,rangeContext:t,calendarRange:n,calendarHasError:r,disabledDates:a})=>{const o=(null==n?void 0:n.from)&&rt(n.from),i=(null==n?void 0:n.to)&&rt(n.to),l=(null==t?void 0:t.from)&&rt(t.from),s=(null==t?void 0:t.to)&&rt(t.to),u=o&&s?rn(o,s)||an(o,s):null,c=i&&l&&s?nn(i,l)||an(i,l):null,d=null==a?void 0:a.find(e=>{const t=rt(e.from),n=rt(e.to);return l&&s&&Je({start:l,end:s},{start:t,end:n})&&o&&i&&Je({start:o,end:i},{start:t,end:n})});f.useEffect(()=>{(t&&o&&!u||t&&i&&!c||d)&&e&&!r&&e(!0)})})({setCalendarHasError:m,rangeContext:v,calendarRange:t,calendarHasError:y,disabledDates:null==_?void 0:_.disabledDates});const $=D.length?D:(null==i?void 0:i.length)?i:(null==_?void 0:_.disabledDates)||[],U=D.length?$:[L,...$,...z,...I,...(null==t?void 0:t.to)||!A||Ae(A.checkIn,1)>=A.firstCheckOut?[]:[{from:Ae(A.checkIn,1),to:Ae(A.firstCheckOut,-1)}]];return p.createElement("div",{className:"will-filter-bar-calendar",ref:w},p.createElement("div",{className:"will-calendar-filter-container",ref:S},p.createElement(da,{key:u,id:"will-calendar",mode:"range",locale:"en"===r?Bt:Wn,numberOfMonths:C?1:2,weekStartsOn:1,selected:t,onSelect:e=>M(e),captionLayout:"dropdown-buttons",defaultMonth:(null==t?void 0:t.from)||N||O||((null===(k=null==_?void 0:_.disabledDates)||void 0===k?void 0:k.length)?_.disabledDates[0].from:E),disabled:U,fromMonth:E,onMonthChange:e=>{null==o||o(e),null==s||s(e=>!e)},classNames:{day_range_start:(null==t?void 0:t.from)?"rdp-day_range_start":"",day_range_end:(null==t?void 0:t.to)?"rdp-day_range_end":""},modifiersClassNames:{today:"my-today",booked:"booked",disabledAfterCheckIn:"disabled-after-check-in",overlappingDate:"overlapping-date",noActiveSelectionStart:"no-active-selection-start",noActiveSelectionMid:"no-active-selection-mid",noActiveSelectionEnd:"no-active-selection-end",checkoutOptionsMid:"rdp-day_selected rdp-day_range_middle checkout-option",checkInOnly:"check-in-only",checkOutOnly:"check-out-only"},modifiers:va({calendarRange:t,disabledDates:U,overlappingDate:P,rangeContext:v,findFirstPossibleRangeContextCheckIn:T,findLastPossibleRangeContextCheckOut:R,currentSelectionLastCheckoutDate:A})}),p.createElement("div",{className:"will-calendar-tooltip"},p.createElement("div",null,x("noCheckIn"))),p.createElement("div",{className:"will-calendar-tooltip-check-out"},p.createElement("div",null,x("noCheckOut"))),p.createElement("div",{className:"will-calendar-tooltip-overlapping-date"},p.createElement("div",null,x("checkOutOnly"))),p.createElement("div",{className:"will-calendar-tooltip-check-in-only"},p.createElement("div",null,x("checkInOnly"))),p.createElement("div",{className:"will-calendar-tooltip-check-out-only"},p.createElement("div",null,x("checkOutOnly"))),p.createElement("div",{className:"will-calendar-spinner"},p.createElement(ga,{fill:(null==h?void 0:h.primary)||"inherit",size:50,icon:"spinner"}))))}),wa=({title:e,action:t})=>p.createElement("div",{className:"will-filter-section-header"},p.createElement("h3",{className:"will-filter-section-title"},e),t&&p.createElement("div",{className:"will-filter-section-action"},t)),ka=f.forwardRef(({onClose:e,autoFocus:t,calendarRange:n,setCalendarRange:r,disableCalendarDates:a,selectedPath:o,language:i},l)=>p.createElement("div",{id:"will-filter-bar-dates",ref:l},p.createElement(wa,{title:"",action:e&&p.createElement(On,{handleClose:e})}),p.createElement("div",{className:"will-dates-filter-container"},p.createElement(ba,{autoFocus:t,calendarRange:n,setCalendarRange:r,disableCalendarDates:a,selectedPath:o,language:i}))));ka.displayName="Dates";const xa=({label:e,sortOrder:t,id:n,updateGuestsCount:r,count:a,minVal:o})=>{f.useEffect(()=>{o&&o>a&&r(`guests-${n}`,o)},[]);return p.createElement("div",{className:"will-guests-filter-inner",style:{order:`${t}`}},p.createElement("p",{className:"will-guests-filter-label"},e),p.createElement("div",{className:"will-guests-filter-counter"},p.createElement("button",{className:"will-guests-filter-counter-button",onClick:()=>{a>o&&r(`guests-${n}`,a-1)},disabled:o&&a<=o||!a,style:{cursor:o&&a<=o||!a?"initial":"pointer",paddingBottom:"4px",opacity:o&&a<=o||!a?.4:1}},p.createElement("svg",{width:"10",height:"10",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},p.createElement("path",{d:"M4 10H16",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"}))),p.createElement("span",{className:"will-guests-filter-count"},a),p.createElement("button",{className:"will-guests-filter-counter-button",onClick:()=>{r(`guests-${n}`,a+1)}},p.createElement("svg",{width:"15",height:"15",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},p.createElement("path",{d:"M10 4V16M4 10H16",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})))))},Sa=f.forwardRef(({ageCategories:e,updateGuestsCount:t,ageCategoryCounts:n,autoFocus:r,onClose:a},o)=>{const{t:i}=j("filterBar"),l=F(r);return p.createElement("div",{id:"will-filter-bar-guests",ref:o},p.createElement(wa,{title:i("guests.title"),action:a&&p.createElement(On,{handleClose:a})}),p.createElement("div",{className:"will-guests-filter-container",ref:l},null==e?void 0:e.map(e=>p.createElement(xa,{key:e.id,id:e.id,label:e.name,minVal:e.minVal,sortOrder:e.sortOrder,updateGuestsCount:t,count:n[`guests-${e.id}`]||0}))))});Sa.displayName="Guests";const Ca=f.forwardRef(({title:e,description:t,imageUrl:n,isSelected:r,onClick:a},o)=>{const i=`${e}${t?`, ${t}`:""}`;return p.createElement("div",{ref:o,className:"will-image-card "+(r?"is-selected":""),onClick:a,onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),null==a||a())},role:"button",tabIndex:0,"aria-pressed":r,"aria-label":i},p.createElement("div",{className:"will-image-card-content"},p.createElement("h3",null,e),t&&p.createElement("p",null,t)),p.createElement("div",{className:"will-image-card-image"},n&&p.createElement("img",{src:n,alt:e||"Location image"})))});Ca.displayName="ImageCard";const Ea=f.forwardRef(({locations:e,selectedLocations:t,setSelectedLocations:n,autoFocus:r,multiSelect:a=!1,onClose:o},i)=>{const{t:l}=j("filterBar"),s=f.useRef(null);f.useEffect(()=>{r&&s.current&&s.current.focus()},[r]);return p.createElement("div",{id:"will-filter-bar-locations",ref:i},p.createElement(wa,{title:l("locations.title"),action:o&&p.createElement(On,{handleClose:o})}),p.createElement("div",{className:"will-locations-filter-container"},!!(null==e?void 0:e.length)&&e.map((e,r)=>p.createElement(Ca,{key:e.id,ref:0===r?s:null,title:e.label,description:e.description,imageUrl:e.imageUrl,isSelected:t.some(t=>t.id===e.id),onClick:()=>(e=>{if(a){const r=t.some(t=>t.id===e.id);n(r?t.filter(t=>t.id!==e.id):[...t,e])}else n([e]),null==o||o()})(e)}))))});Ea.displayName="Locations";const Na=({categories:e,setCategories:t})=>{const{t:n}=j("filterBar"),[r,a]=f.useState("");return p.createElement("div",{id:"will-filter-bar-categories"},p.createElement("h3",{className:"will-categories-filter-title"},n("categories.label")),p.createElement("div",{className:"will-categories-filter-inner"},["Weekend","Week","Summer camp","Winter camp"].map((e,n)=>p.createElement("div",{key:n},p.createElement("input",{type:"radio",value:e,checked:r===e,onChange:()=>(e=>{a(e),t(e)})(e)}),p.createElement("span",null,e)))))};Na.displayName="Categories";const Oa=()=>{const{categories:e,calendarRange:t,selectedFilter:n,selectedPath:r,ageCategoryCounts:a,selectedLocations:o,mode:i,tabs:l,disableCalendarDates:s,ageCategories:u,locations:c,language:d,isMobile:h,panelRef:m,buttonRefs:g,filtersRef:v,setSelectedLocations:y,setCalendarRange:b,handleSelectedFilter:w,updateGuestsCount:k,setCategories:x}=mn(),{filterSectionRef:S}=(({handleSelectedFilter:e})=>{const t=f.useRef(null);return f.useEffect(()=>{const n=n=>{t.current&&(n.composedPath().includes(t.current)||e(!1))};return document.addEventListener("mousedown",n),()=>{document.removeEventListener("mousedown",n)}},[t]),{filterSectionRef:t}})({handleSelectedFilter:w}),{left:C,top:E}=(({selectedFilter:e,panelRef:t,filtersRef:n,buttonRefs:r,isMobile:a,tabs:o})=>{const[i,l]=f.useState(),s=o&&o.length>1,u=a?s?60:0:s?125:66;return f.useLayoutEffect(()=>{if(!e||"string"!=typeof e||a)return void l(void 0);const o=t.current,i=n.current,s=r.current[e];if(!o||!i||!s)return;const u=o.getBoundingClientRect(),c=i.getBoundingClientRect(),d=s.getBoundingClientRect().left-c.left-10,f=Math.max(0,Math.min(d,c.width-u.width));l(f)},[e,a]),{top:u,left:i}})({selectedFilter:n,panelRef:m,filtersRef:v,buttonRefs:g,isMobile:h,tabs:l});return n&&p.createElement("div",{ref:m,className:`will-filter-bar-panels ${i||"light"}`,style:{left:C,top:E}},(()=>{switch(n){case Te.CALENDAR:return p.createElement(ka,{autoFocus:!0,ref:S,onClose:()=>w(!1),calendarRange:t,setCalendarRange:b,disableCalendarDates:s,selectedPath:r,language:d});case Te.GUESTS:return p.createElement(Sa,{autoFocus:!0,ref:S,ageCategories:u,ageCategoryCounts:a,updateGuestsCount:k,onClose:()=>w(!1)});case Te.CATEGORIES:return p.createElement(Na,{categories:e,setCategories:x});case Te.LOCATIONS:return p.createElement(Ea,{autoFocus:!0,ref:S,locations:null==c?void 0:c.data,selectedLocations:o,setSelectedLocations:y,multiSelect:null==c?void 0:c.multiSelect,onClose:()=>w(!1)});default:return null}})())},_a=()=>{var e;const{t:t}=j("filterBar"),{calendarRange:n,selectedFilter:r,selectedPath:a,ageCategoryCounts:o,selectedLocations:i,mode:l,tabs:s,ageCategories:u,locations:c,innerLoading:d,outerLoading:h,handleSubmit:m,handleSelectedFilter:g,previouslyFocusedButtonRef:v,buttonRefs:y,tabsRef:b,filtersRef:w}=mn();f.useEffect(()=>{!r&&v.current&&(v.current.focus(),v.current=null)},[r]);const k=(({calendarRange:e})=>(null==e?void 0:e.to)&&(null==e?void 0:e.from)?`${Gt(e.from,"dd.MM.yyyy")} -\n${Gt(e.to,"dd.MM.yyyy")}`:null)({calendarRange:n}),x=(({guestLabel:e,guestsLabel:t,guestsPlaceholder:n,ageCategoryCounts:r,ageCategories:a})=>{const o=Object.entries(r).reduce((e,[t,n])=>{const r=t.split("-");if(r.length<2)return e;const o=r[1];return(null==a?void 0:a.find(e=>e.id===o))&&n?{total:e.total+n,html:[...e.html,`${n}`]}:e},{total:0,html:[]});if(!o.total)return{content:n,data:o};const i=o.html.length>1?o.html.join(" + "):null;return{content:p.createElement(p.Fragment,null,p.createElement("span",{className:"will-guest-count"},o.total)," ",o.total>1?t:e,i&&p.createElement(p.Fragment,null,"   ( ",i," )")),data:o}})({ageCategoryCounts:o,ageCategories:u,guestsPlaceholder:t("guests.labelPlaceholder"),guestLabel:t("guests.guestLabel"),guestsLabel:t("guests.guestsLabel")}),S=(({selectedLocations:e,locationsPlaceholder:t,locationsSelectedLabel:n="locations"})=>{if(!e.length)return t;if(1===e.length){return e[0].label||t}return`${e.length} ${n}`})({selectedLocations:i,locationsPlaceholder:t("locations.placeholder"),locationsSelectedLabel:t("locations.selected")});return p.createElement("div",{className:`will-filter-bar-controls ${l||"light"} ${r?"disabled":""}`,ref:e=>{w.current=e,1===(null==s?void 0:s.length)&&(b.current=e)}},!!(null===(e=null==c?void 0:c.data)||void 0===e?void 0:e.length)&&c.data.length>1&&p.createElement(p.Fragment,null,p.createElement(Le,{ref:e=>y.current[Te.LOCATIONS]=e,label:t("locations.label"),description:S,onClick:e=>{v.current=e.currentTarget,g(Te.LOCATIONS)},active:!!i.length,disabled:null==c?void 0:c.disabled,ariaExpanded:r===Te.LOCATIONS,ariaControls:"will-filter-bar-locations"}),p.createElement(Me,null)),p.createElement(Le,{ref:e=>y.current[Te.CALENDAR]=e,label:t("calendar.label"),description:k||(a===Re.ROOMS?t("calendar.roomsLabelPlaceholder"):t("calendar.eventsLabelPlaceholder")),onClick:e=>{v.current=e.currentTarget,g(Te.CALENDAR)},active:!!k,ariaExpanded:r===Te.CALENDAR,ariaControls:"will-filter-bar-dates"}),a!==Re.EVENTS&&p.createElement(p.Fragment,null,p.createElement(Me,null),p.createElement(Le,{ref:e=>y.current[Te.GUESTS]=e,label:t("guests.label"),description:x.content,onClick:e=>{v.current=e.currentTarget,g(Te.GUESTS)},active:!!x.data.total,ariaExpanded:r===Te.GUESTS,ariaControls:"will-guests-filter"})),p.createElement(En,{onClick:m,startIcon:p.createElement(Sn,null),label:t("common:search"),isLoading:d||h}))},Pa=()=>{const{t:e}=j("filterBar"),{selectedPath:t,mode:n,tabs:r,tabsRef:a,handleSelectedFilter:o,setSelectedPath:i,handleResetFilters:l}=mn(),s=f.useMemo(()=>[...null!=r?r:[]].sort((e,t)=>e.order-t.order),[r]);return s.length<=1?null:p.createElement("div",{className:"will-filter-bar-tabs",ref:a},s.map(r=>p.createElement(De,{key:r.path,label:r.label||e(`tabs.${r.path.slice(1)}`),onClick:()=>{return e=r.path,i(e),l(),void o(!1);var e},active:t===r.path,mode:n})))},La=e=>p.createElement(Pe,{language:e.language},p.createElement(Da,Object.assign({},e))),Da=({language:e,ageCategories:t,redirectUrl:n=Ma,palette:r,onSubmit:a,fullWidth:o,disableCalendarDates:i,mode:l,tabs:s,outerLoading:u,locations:c})=>{const d=(({palette:e})=>({"--will-primary":null==e?void 0:e.primary,"--will-secondary":null==e?void 0:e.secondary,"--will-error":null==e?void 0:e.error}))({palette:r});return(({language:e})=>{const{i18n:t}=j();f.useEffect(()=>{e&&t.language!==e&&t.changeLanguage(e)},[e,t])})({language:e}),(()=>{const[e,t]=f.useState(!1);if(f.useEffect(()=>{t(!0)},[]),!e);})(),p.createElement(hn,{language:e,ageCategories:t,redirectUrl:n,palette:r,onSubmit:a,fullWidth:o,disableCalendarDates:i,mode:l,tabs:s,outerLoading:u,locations:c},p.createElement("div",{className:"will-root "+(o?"is-full-width":""),style:d},p.createElement(Pa,null),p.createElement(_a,null),p.createElement(Oa,null)))},Ma="http://localhost:3000/";var Ta="\n\n.will-root * {\n font-family: 'Montserrat', sans-serif;\n}\n\n.will-root {\n \n box-sizing: border-box;\n font-size: 14px;\n \n color: #1E1E1E;\n \n /* Palette */\n --will-primary: #374269;\n --will-secondary: #374269;\n --will-grey: #ABA7AF;\n --will-light-grey: #C8C8C8;\n --will-white: #fff;\n --will-white-transparent: #ffffffcf;\n --will-black: #000;\n --will-onahau: #CDEEFF;\n --will-text: #5A5959;\n --will-charcoal-blue: #384265;\n --will-error: #d32f2f;\n\n /* Transparent */\n --will-transparent-black: rgba(0, 0, 0, 0.5);\n --will-transparent-white: rgba(255, 255, 255, 0.30);\n --will-transparent-lavender: rgba(171, 167, 175, 0.30);\n\n /* Color mix */\n --will-primary-lighter: color-mix(in srgb, var(--will-primary), white 50%);\n --will-primary-lightest: color-mix(in srgb, var(--will-primary), white 80%);\n\n\n /* Shadows */\n --will-box-shadow-dark: 0px 2px 12px 2px #a1a1a180;\n --will-box-shadow-light: 0px 2px 12px 2px #bcb9b980;\n\n /* Breakpoints */\n --will-lg: 1140px;\n --will-md: 960px;\n --will-sm: 600px;\n --will-xl: 1280px;\n --will-xs: 0px;\n}\n\n/* Typography */\n\n.will-root h1, h2, h3, h4, h5, h6 {\n font-weight: 700;\n} \n\n.will-root p, h1, h2, h3, h4, h5, h6, span {\n margin: 0;\n padding: 0;\n}\n\n\n/* Integration fixes */\n\n.will-root p {\n margin: 0 !important;\n}\n\n.will-root button {\n line-height: normal !important;\n}\n\n.storybook-button {\n font-family: 'Nunito Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;\n font-weight: 700;\n border: 0;\n border-radius: 3em;\n cursor: pointer;\n display: inline-block;\n line-height: 1;\n}\n.storybook-button--primary {\n color: white;\n background-color: #1ea7fd;\n}\n.storybook-button--secondary {\n color: #333;\n background-color: transparent;\n box-shadow: rgba(0, 0, 0, 0.15) 0px 0px 0px 1px inset;\n}\n.storybook-button--small {\n font-size: 12px;\n padding: 10px 16px;\n}\n.storybook-button--medium {\n font-size: 14px;\n padding: 11px 20px;\n}\n.storybook-button--large {\n font-size: 16px;\n padding: 12px 24px;\n}\n.will-filter-bar-divider {\n width: 1px;\n margin: 0 10px;\n background-color: var(--will-charcoal-blue);\n}\n\n@media (max-width: 960px) {\n .will-filter-bar-divider {\n width: auto;\n margin: 0 10px;\n height: 1px;\n background-color: var(--will-charcoal-blue);\n }\n}\n.will-filter-bar-controls {\n display: flex;\n justify-content: space-between;\n padding: 10px;\n position: relative;\n z-index: 222;\n border-radius: 40px;\n background-color: var(--will-white);\n}\n\n@media (max-width: 960px) {\n .will-filter-bar-controls {\n flex-direction: column;\n padding: 20px;\n border-radius: 25px;\n overflow: hidden;\n }\n\n .will-filter-bar-controls.disabled {\n opacity: 0.1;\n }\n}\n\n#will-filter-bar-categories {\n text-align: center;\n}\n\n.will-categories-filter-title {\n font-size: 16px;\n text-transform: uppercase;\n margin: 10px 0 30px 0;\n}\n\n.will-categories-filter-inner {\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 20px;\n}\n\n.will-categories-filter-inner input {\n cursor: pointer;\n margin-right: 10px;\n}\n\n.will-dates-filter-container {\n padding: 0 30px 16px 30px;\n}\n\n@media (max-width: 960px) {\n .will-dates-filter-container {\n padding: 0 20px 16px 20px;\n }\n}\n\n.will-filter-bar-panels {\n background-color: var(--will-white);\n min-height: 100px;\n position: absolute;\n z-index: 111;\n border-radius: 25px;\n box-shadow: var(--will-box-shadow);\n}\n\n@media (max-width: 960px) {\n .will-root {\n width: 100%;\n min-width: auto;\n max-height: 100vh;\n z-index: 3;\n }\n\n .will-filter-bar-panels {\n width: 100%;\n z-index: 999;\n }\n}\n\n.will-guests-filter-label,\n.will-guests-filter-count {\n font-size: 18px;\n color: var(--will-text);\n}\n\n.will-guests-filter-inner {\n display: flex;\n align-items: center;\n justify-content: space-between;\n}\n\n.will-guests-filter-label {\n display: block;\n font-weight: 600;\n margin-bottom: 10px;\n}\n\n.will-guests-filter-inner .will-guests-filter-counter {\n display: flex;\n align-items: center;\n}\n\n.will-guests-filter-count {\n margin: 0 10px;\n min-width: 30px;\n text-align: center;\n}\n\n.will-guests-filter-counter-button {\n border-radius: 50%;\n background-color: transparent;\n border: 1px solid var(--will-grey);\n width: 30px;\n height: 30px;\n display: flex;\n justify-content: center;\n align-items: center;\n font-size: 20px;\n cursor: pointer;\n color: var(--will-black);\n\n padding: 0;\n margin: 0;\n -webkit-appearance: none;\n appearance: none;\n}\n\n.will-guests-filter-counter-button:hover {\n background-color: var(--will-onahau);\n}\n\n@media (max-width: 960px) {\n .will-guests-filter-inner {\n width: 100%;\n justify-content: space-between;\n }\n}\n\n#will-filter-bar-guests {\n text-align: initial;\n}\n\n.will-guests-filter-container {\n display: flex;\n flex-direction: column;\n min-width: 400px;\n gap: 20px;\n padding: 0 30px 16px 30px;\n}\n\n@media (max-width: 960px) {\n .will-guests-filter-container {\n min-width: auto;\n padding: 0 20px 16px 20px;\n }\n}\n\n/**/\n.will-guest-count {\n display: inline-block;\n min-width: 10px;\n}\n\n#will-filter-bar-locations {\n text-align: initial;\n}\n\n.will-locations-filter-container {\n display: flex;\n flex-direction: column;\n min-width: 400px;\n padding-bottom: 16px;\n}\n\n@media (max-width: 960px) {\n .will-locations-filter-container {\n min-width: 100%;\n }\n}\n\n.will-filter-section-header {\n display: flex;\n justify-content: space-between;\n align-items: center;\n padding: 16px 30px;\n}\n\n.will-filter-section-title {\n font-size: 22px;\n margin: 0;\n}\n\n.will-filter-section-action {\n display: flex;\n gap: 8px;\n align-items: center;\n}\n\n.will-filter-section-action .will-filter-bar-close-button {\n position: relative;\n top: auto;\n right: auto;\n margin: 0;\n}\n\n@media (max-width: 960px) {\n .will-filter-section-header {\n padding: 16px 20px;\n }\n\n .will-filter-section-title {\n font-size: 18px;\n }\n}\n\n.will-filter-bar-tabs {\n display: flex;\n align-items: center;\n justify-content: center;\n position: relative;\n z-index: 222;\n background: transparent;\n padding: 10px;\n gap: 10px;\n}\n\n.will-image-card {\n display: flex;\n gap: 20px;\n justify-content: space-between;\n align-items: center;\n padding: 8px 30px;\n cursor: pointer;\n user-select: none;\n min-height: 40px;\n}\n\n.will-image-card.is-selected {\n background-color: var(--will-transparent-lavender);\n}\n\n.will-image-card:hover {\n background-color: var(--will-transparent-lavender);\n}\n\n.will-image-card-image img {\n width: 120px;\n height: 68px;\n object-fit: cover;\n}\n\n@media (max-width: 960px) {\n .will-image-card {\n padding: 8px 20px;\n }\n}\n\n.will-filter-bar-select-button {\n width: 100%;\n height: auto;\n background-color: transparent;\n border: none;\n padding: 0 20px;\n border-radius: 20px;\n cursor: pointer;\n font-size: 14px;\n text-align: initial;\n user-select: none;\n}\n\n.will-filter-bar-select-button.disabled {\n cursor: not-allowed;\n}\n\n.will-filter-bar-select-button .select-button-wrapper {\n display: flex;\n align-items: center;\n flex-wrap: wrap;\n gap: 10px;\n}\n\n.will-filter-bar-select-button .select-button-wrapper > div {\n display: grid;\n}\n\n.will-filter-bar-select-button .select-button-label {\n color: var(--will-black);\n font-weight: 600;\n}\n\n.will-filter-bar-select-button .select-button-description {\n color: var(--will-black);\n font-weight: 400;\n opacity: 0.5;\n white-space: nowrap;\n min-height: 19px;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\n.will-filter-bar-select-button .select-button-description span {\n font: inherit;\n}\n\n.will-filter-bar-select-button .select-button-label.active,\n.will-filter-bar-select-button .select-button-description.active {\n font-weight: 700;\n font-size: 15px;\n opacity: 1;\n}\n\n@media (max-width: 960px) {\n .will-filter-bar-select-button {\n padding: 15px 0;\n }\n\n .will-filter-bar-select-button:first-child {\n padding: 0 0 15px 0;\n }\n\n .will-filter-bar-select-button .select-button-wrapper {\n justify-content: center;\n text-align: center;\n }\n\n .will-filter-bar-select-button .select-button-description {\n white-space: wrap;\n }\n\n .will-filter-bar-select-button .select-button-divider {\n display: none;\n }\n}\n\n.will-filter-bar-tab-button {\n width: auto;\n height: auto;\n padding: 10px 20px;\n cursor: pointer;\n border: none;\n white-space: nowrap;\n font-size: 16px;\n display: flex;\n align-items: center;\n background-color: transparent;\n user-select: none;\n font-weight: 600;\n border-radius: 50px;\n }\n\n .will-filter-bar-tab-button.light {\n color: var(--will-white)\n }\n\n .will-filter-bar-tab-button.dark {\n color: var(--will-black)\n }\n\n .will-filter-bar-tab-button.light.active,\n .will-filter-bar-tab-button:hover {\n background-color: var(--will-transparent-white);\n }\n\n .will-filter-bar-tab-button.dark.active,\n .will-filter-bar-tab-button:hover {\n background-color: var(--will-transparent-lavender);\n }\n\n \n\n\n.will-root {\n z-index: 999;\n width: fit-content;\n min-width: 796px;\n max-height: 100vh;\n position: relative;\n}\n\n.will-root.is-full-width {\n width: 100%;\n}\n\n.will-filter-bar {\n box-sizing: border-box;\n position: relative;\n}\n\n@media (max-width: 960px) {\n .will-root {\n width: 100%;\n min-width: auto;\n }\n}\n\n/* Common */\n\n.will-filter-bar-controls.dark,\n.will-filter-bar-panels.dark {\n box-shadow: var(--will-box-shadow-dark);\n}\n\n.will-filter-bar-controls.light,\n.will-filter-bar-panels.light {\n box-shadow: var(--will-box-shadow-light);\n}\n\n.will-root .will-calendar-wrapper {\n box-shadow: var(--will-box-shadow-dark);\n border-radius: 20px;\n background-color: var(--will-white);\n position: absolute;\n top: 0;\n left: 0;\n \n}\n\n.will-root .will-calendar-wrapper .will-calendar-header,\n.will-root .will-calendar-wrapper .will-calendar-main,\n.will-root .will-calendar-wrapper .will-calendar-footer {\n padding: 20px;\n}\n\n/* Header */\n\n.will-root .will-calendar-wrapper .will-calendar-header {\n display: flex;\n justify-content: space-between;\n border-bottom: 1px solid var(--will-grey);\n align-items: center;\n}\n\n/* Footer */\n\n.will-root .will-calendar-wrapper .will-calendar-footer {\n border-top: 1px solid var(--will-grey);\n}\n\n/* Footer actions */\n\n.will-root .will-calendar-wrapper .will-calendar-footer-actions-wrapper {\n display: flex;\n justify-content: space-between;\n}\n\n.will-root .will-calendar-wrapper .will-calendar-footer-dates > div {\n margin-bottom: 5px;\n}\n\n.will-root .will-calendar-wrapper .will-calendar-footer-dates-separator {\n margin: 0 15px;\n}\n\n.will-root .will-calendar-wrapper .will-calendar-footer-dates .will-calendar-footer-booked {\n display: flex;\n min-height: 20.5px;\n margin-top: 10px;\n}\n\n.will-root .will-calendar-wrapper .will-calendar-footer-error {\n display: flex;\n max-width: 80%;\n}\n\n.will-root .will-calendar-wrapper .will-calendar-footer-error span {\n display: inline-block;\n margin-left: 10px;\n}\n\n@media (max-width: 960px) {\n .will-root .will-calendar-wrapper {\n width: -webkit-fill-available;\n margin: 0 -6%;\n }\n\n .will-root .will-calendar-wrapper .will-calendar-header,\n .will-root .will-calendar-wrapper .will-calendar-main,\n .will-root .will-calendar-wrapper .will-calendar-footer {\n padding: 20px 10px;\n }\n\n .will-root .will-calendar-wrapper .will-calendar-footer-actions-wrapper {\n flex-direction: column;\n }\n\n .will-root .will-calendar-wrapper .will-calendar-footer-dates {\n text-align: center;\n }\n\n .will-root .will-calendar-wrapper .will-calendar-footer-dates .will-calendar-footer-booked {\n justify-content: center;\n }\n\n .will-root .will-calendar-wrapper .will-calendar-footer-actions {\n flex-direction: column;\n width: 100%;\n }\n\n .will-root .will-calendar-wrapper .will-calendar-footer-actions button{\n width: 100%;\n margin-top: 10px;\n }\n\n .will-root .will-calendar-wrapper .will-calendar-footer-error {\n max-width: 100%;\n }\n\n .will-root .will-calendar-wrapper .will-calendar-footer-error span {\n text-align: center;\n margin-left: 5px;\n }\n }\n\n.will-root .will-calendar-wrapper .will-calendar-header .will-filter-bar-close-button {\n position: initial;\n}\n.will-filter-bar-close-button {\n width: auto;\n height: auto;\n /* background-color: var(--will-grey); */\n color: var(--will-grey);\n padding: 2px 7px;\n border-radius: 50%;\n cursor: pointer;\n border: none;\n display: flex;\n align-items: center;\n font-size: 23px;\n /* display: none; */\n\n position: absolute;\n top: 10px;\n right: 10px;\n\n min-height: 35px;\n}\n\n@media (max-width: 960px) {\n .will-filter-bar-close-button {\n top: 10px;\n right: 10px;\n\n border-radius: 25px;\n margin-left:0;\n \n display: flex;\n justify-content: center;\n }\n}\n\n.will-filter-bar-submit-button {\n width: auto;\n height: auto;\n padding: 10px 20px;\n border-radius: 20px;\n cursor: pointer;\n border: none;\n white-space: nowrap;\n text-transform: uppercase;\n font-size: 12px;\n display: flex;\n align-items: center;\n user-select: none;\n}\n\n/* Submit button variants */\n.will-filter-bar-submit-button.default {\n background-color: var(--will-primary);\n color: var(--will-white);\n}\n\n.will-filter-bar-submit-button.text {\n background-color: transparent;\n color: var(--will-black);\n text-decoration: underline;\n font-weight: 500;\n font-size: 15px;\n padding: 0 10px;\n}\n\n.will-filter-bar-submit-button span {\n margin-right: 10px;\n display: flex;\n}\n\nbutton.will-filter-bar-submit-button:disabled {\n opacity: 0.5;\n cursor: not-allowed;\n}\n\n\n@media (max-width: 960px) {\n .will-filter-bar-submit-button {\n justify-content: center;\n \n }\n}\n\n/* --- */\n\n@keyframes spin {\n 0% { transform: rotate(0deg); }\n 100% { transform: rotate(360deg); }\n}\n\n.will-calendar-filter-container {\n display: flex;\n justify-content: center;\n user-select: none;\n}\n\n/* Calendar overrides */\n.will-calendar-filter-container .rdp {\n margin: 0;\n}\n\n.will-calendar-filter-container .DayPicker {\n font-size: 25px;\n}\n\n.will-calendar-filter-container .rdp-month {\n position: relative;\n}\n\n.will-calendar-filter-container .rdp-month.rdp-caption_start {\n padding-left: 70px;\n}\n\n.will-calendar-filter-container .rdp-month.rdp-caption_end {\n padding-right: 70px;\n}\n\n.will-calendar-filter-container .rdp-month .rdp-nav {\n border: 1px solid var(--will-primary);\n border-radius: 50%;\n}\n\n.will-calendar-filter-container .rdp-month .rdp-nav svg {\n color: var(--will-primary);\n}\n\n.will-calendar-filter-container .rdp-month .rdp-caption {\n position: initial;\n}\n\n.will-calendar-filter-container .rdp-month .rdp-caption > .rdp-caption_label,\n.will-calendar-filter-container .rdp-table .rdp-head {\n opacity: 0.6;\n}\n\n.will-calendar-filter-container .rdp-table {\n border-collapse: separate;\n border-spacing: 0px 2px;\n}\n\n.will-calendar-filter-container\n .rdp-button_reset.rdp-button.rdp-day.rdp-day_selected {\n background-color: var(--will-primary);\n opacity: 1;\n color: var(--will-white);\n}\n\n.will-calendar-filter-container .my-today:not(.rdp-day_selected) {\n font-weight: 700;\n opacity: 1;\n color: var(--will-primary);\n}\n\n.will-calendar-filter-container .rdp-cell {\n position: relative;\n}\n\n.will-calendar-filter-container .rdp-cell button {\n font-weight: 500;\n}\n\n.will-calendar-filter-container .rdp-cell button.booked {\n font-weight: 400;\n cursor: not-allowed;\n}\n\n.will-calendar-filter-container .rdp-cell .rdp-button[disabled] {\n color: var(--will-transparent-black);\n opacity: 1;\n}\n\n@media (max-width: 960px) {\n .will-calendar-filter-container .rdp-month .rdp-nav {\n border: none;\n border-radius: initial;\n }\n\n .will-calendar-filter-container .rdp-month.rdp-caption_start {\n padding-left: 10px;\n }\n\n .will-calendar-filter-container .rdp-month.rdp-caption_end {\n padding-right: 10px;\n }\n}\n\n/* Tooltips */\n.will-root .will-calendar-filter-container .will-calendar-tooltip,\n.will-root .will-calendar-filter-container .will-calendar-tooltip-check-out,\n.will-root\n .will-calendar-filter-container\n .will-calendar-tooltip-overlapping-date,\n.will-root\n .will-calendar-filter-container\n .will-calendar-tooltip-check-out-only,\n.will-root\n .will-calendar-filter-container\n .will-calendar-tooltip-check-in-only {\n position: absolute;\n top: -42px;\n transform: translateX(calc(-50% + 20px));\n display: none;\n white-space: nowrap;\n z-index: 2;\n}\n\n.will-root .will-calendar-filter-container .will-calendar-tooltip > div,\n.will-root\n .will-calendar-filter-container\n .will-calendar-tooltip-check-out\n > div,\n.will-root\n .will-calendar-filter-container\n .will-calendar-tooltip-overlapping-date\n > div,\n.will-root\n .will-calendar-filter-container\n .will-calendar-tooltip-check-out-only\n > div,\n.will-root\n .will-calendar-filter-container\n .will-calendar-tooltip-check-in-only\n > div {\n background-color: white;\n position: relative;\n padding: 5px 10px;\n border: 1px solid var(--will-primary);\n border-radius: 5px;\n}\n\n.will-root .will-calendar-filter-container .will-calendar-tooltip::before,\n.will-root\n .will-calendar-filter-container\n .will-calendar-tooltip-check-out::before,\n.will-root\n .will-calendar-filter-container\n .will-calendar-tooltip-overlapping-date::before,\n.will-root\n .will-calendar-filter-container\n .will-calendar-tooltip-check-out-only::before,\n.will-root\n .will-calendar-filter-container\n .will-calendar-tooltip-check-in-only::before {\n content: '';\n width: 10px;\n height: 10px;\n border: 1px solid var(--will-primary);\n position: absolute;\n bottom: -4px;\n left: calc(50% - 5.555px);\n rotate: 45deg;\n z-index: 0;\n background-color: var(--will-white);\n}\n\n.will-root\n .will-calendar-filter-container\n .rdp-cell:hover\n .will-calendar-tooltip,\n.will-root\n .will-calendar-filter-container\n .rdp-cell:hover\n .will-calendar-tooltip-check-out,\n.will-root\n .will-calendar-filter-container\n .rdp-cell:hover\n .will-calendar-tooltip-overlapping-date,\n.will-root\n .will-calendar-filter-container\n .rdp-cell:hover\n .will-calendar-tooltip-check-out-only,\n.will-root\n .will-calendar-filter-container\n .rdp-cell:hover\n .will-calendar-tooltip-check-in-only {\n display: block;\n}\n\n/* Loading spinner */\n\n.will-root .will-calendar-filter-container .rdp-months {\n position: relative;\n}\n\n.will-root .will-calendar-filter-container .will-calendar-spinner {\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n background-color: var(--will-white-transparent);\n z-index: 3;\n display: none;\n justify-content: center;\n align-items: center;\n font-weight: 600;\n}\n\n/* No active selection */\n\n.will-root .will-calendar-filter-container .no-active-selection-start,\n.will-root .will-calendar-filter-container .no-active-selection-mid,\n.will-root .will-calendar-filter-container .no-active-selection-end {\n position: initial;\n}\n\n.will-root .will-calendar-filter-container .no-active-selection-start::before,\n.will-root .will-calendar-filter-container .no-active-selection-mid::before,\n.will-root .will-calendar-filter-container .no-active-selection-end::before {\n content: '';\n position: absolute;\n width: 100%;\n height: 100%;\n border: 2px solid var(--will-light-grey);\n box-sizing: border-box;\n}\n\n.will-root .will-calendar-filter-container .no-active-selection-start::before {\n border-right: none;\n border-top-left-radius: 50%;\n border-bottom-left-radius: 50%;\n}\n\n.will-root .will-calendar-filter-container .no-active-selection-mid::before {\n border-right: none;\n border-left: none;\n}\n\n.will-root .will-calendar-filter-container .no-active-selection-end::before {\n border-left: none;\n border-top-right-radius: 50%;\n border-bottom-right-radius: 50%;\n}\n\n.will-root\n .will-calendar-filter-container\n .rdp-day_selected.rdp-day_range_middle.checkout-option {\n background-color: var(--will-primary-lightest);\n color: inherit;\n}\n\n/* Overlapping date */\n\n.will-root .will-calendar-filter-container .overlapping-date {\n user-select: none;\n pointer-events: none;\n}\n\n.will-root .will-calendar-filter-container .overlapping-date:hover {\n cursor: not-allowed;\n}\n\n@media (max-width: 600px) {\n /* Tooltips */\n .will-root .will-calendar-filter-container .will-calendar-tooltip,\n .will-root .will-calendar-filter-container .will-calendar-tooltip-check-out,\n .will-root\n .will-calendar-filter-container\n .will-calendar-tooltip-overlapping-date,\n .will-root\n .will-calendar-filter-container\n .will-calendar-tooltip-check-out-only,\n .will-root\n .will-calendar-filter-container\n .will-calendar-tooltip-check-in-only {\n top: -70px;\n white-space: wrap;\n max-width: 120px;\n }\n}\n\n/* Container for the embed's React tree inside the Shadow DOM.\n Mirrors .will-root sizing so the React tree has a parent that\n resolves percentage widths correctly inside the host's layout. */\n\n.willba-embed-root.is-full-width {\n display: block;\n width: 100%;\n}\n\n@media (max-width: 960px) {\n .willba-embed-root {\n display: block;\n width: 100%;\n }\n}\n\n.rdp {\n --rdp-cell-size: 40px;\n --rdp-caption-font-size: 18px;\n --rdp-accent-color: #0000ff;\n --rdp-background-color: #e7edff;\n --rdp-accent-color-dark: #3003e1;\n --rdp-background-color-dark: #180270;\n --rdp-outline: 2px solid var(--rdp-accent-color); /* Outline border for focused elements */\n --rdp-outline-selected: 3px solid var(--rdp-accent-color); /* Outline border for focused _and_ selected elements */\n\n margin: 1em;\n}\n\n/* Hide elements for devices that are not screen readers */\n.rdp-vhidden {\n box-sizing: border-box;\n padding: 0;\n margin: 0;\n background: transparent;\n border: 0;\n -moz-appearance: none;\n -webkit-appearance: none;\n appearance: none;\n position: absolute !important;\n top: 0;\n width: 1px !important;\n height: 1px !important;\n padding: 0 !important;\n overflow: hidden !important;\n clip: rect(1px, 1px, 1px, 1px) !important;\n border: 0 !important;\n}\n\n/* Buttons */\n.rdp-button_reset {\n appearance: none;\n position: relative;\n margin: 0;\n padding: 0;\n cursor: default;\n color: inherit;\n background: none;\n font: inherit;\n\n -moz-appearance: none;\n -webkit-appearance: none;\n}\n\n.rdp-button_reset:focus-visible {\n /* Make sure to reset outline only when :focus-visible is supported */\n outline: none;\n}\n\n.rdp-button {\n border: 2px solid transparent;\n}\n\n.rdp-button[disabled]:not(.rdp-day_selected) {\n opacity: 0.25;\n}\n\n.rdp-button:not([disabled]) {\n cursor: pointer;\n}\n\n.rdp-button:focus-visible:not([disabled]) {\n color: inherit;\n background-color: var(--rdp-background-color);\n border: var(--rdp-outline);\n}\n\n.rdp-button:hover:not([disabled]):not(.rdp-day_selected) {\n background-color: var(--rdp-background-color);\n}\n\n.rdp-months {\n display: flex;\n}\n\n.rdp-month {\n margin: 0 1em;\n}\n\n.rdp-month:first-child {\n margin-left: 0;\n}\n\n.rdp-month:last-child {\n margin-right: 0;\n}\n\n.rdp-table {\n margin: 0;\n max-width: calc(var(--rdp-cell-size) * 7);\n border-collapse: collapse;\n}\n\n.rdp-with_weeknumber .rdp-table {\n max-width: calc(var(--rdp-cell-size) * 8);\n border-collapse: collapse;\n}\n\n.rdp-caption {\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: 0;\n text-align: left;\n}\n\n.rdp-multiple_months .rdp-caption {\n position: relative;\n display: block;\n text-align: center;\n}\n\n.rdp-caption_dropdowns {\n position: relative;\n display: inline-flex;\n}\n\n.rdp-caption_label {\n position: relative;\n z-index: 1;\n display: inline-flex;\n align-items: center;\n margin: 0;\n padding: 0 0.25em;\n white-space: nowrap;\n color: currentColor;\n border: 0;\n border: 2px solid transparent;\n font-family: inherit;\n font-size: var(--rdp-caption-font-size);\n font-weight: bold;\n}\n\n.rdp-nav {\n white-space: nowrap;\n}\n\n.rdp-multiple_months .rdp-caption_start .rdp-nav {\n position: absolute;\n top: 50%;\n left: 0;\n transform: translateY(-50%);\n}\n\n.rdp-multiple_months .rdp-caption_end .rdp-nav {\n position: absolute;\n top: 50%;\n right: 0;\n transform: translateY(-50%);\n}\n\n.rdp-nav_button {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: var(--rdp-cell-size);\n height: var(--rdp-cell-size);\n padding: 0.25em;\n border-radius: 100%;\n}\n\n/* ---------- */\n/* Dropdowns */\n/* ---------- */\n\n.rdp-dropdown_year,\n.rdp-dropdown_month {\n position: relative;\n display: inline-flex;\n align-items: center;\n}\n\n.rdp-dropdown {\n appearance: none;\n position: absolute;\n z-index: 2;\n top: 0;\n bottom: 0;\n left: 0;\n width: 100%;\n margin: 0;\n padding: 0;\n cursor: inherit;\n opacity: 0;\n border: none;\n background-color: transparent;\n font-family: inherit;\n font-size: inherit;\n line-height: inherit;\n}\n\n.rdp-dropdown[disabled] {\n opacity: unset;\n color: unset;\n}\n\n.rdp-dropdown:focus-visible:not([disabled]) + .rdp-caption_label {\n background-color: var(--rdp-background-color);\n border: var(--rdp-outline);\n border-radius: 6px;\n}\n\n.rdp-dropdown_icon {\n margin: 0 0 0 5px;\n}\n\n.rdp-head {\n border: 0;\n}\n\n.rdp-head_row,\n.rdp-row {\n height: 100%;\n}\n\n.rdp-head_cell {\n vertical-align: middle;\n font-size: 0.75em;\n font-weight: 700;\n text-align: center;\n height: 100%;\n height: var(--rdp-cell-size);\n padding: 0;\n text-transform: uppercase;\n}\n\n.rdp-tbody {\n border: 0;\n}\n\n.rdp-tfoot {\n margin: 0.5em;\n}\n\n.rdp-cell {\n width: var(--rdp-cell-size);\n height: 100%;\n height: var(--rdp-cell-size);\n padding: 0;\n text-align: center;\n}\n\n.rdp-weeknumber {\n font-size: 0.75em;\n}\n\n.rdp-weeknumber,\n.rdp-day {\n display: flex;\n overflow: hidden;\n align-items: center;\n justify-content: center;\n box-sizing: border-box;\n width: var(--rdp-cell-size);\n max-width: var(--rdp-cell-size);\n height: var(--rdp-cell-size);\n margin: 0;\n border: 2px solid transparent;\n border-radius: 100%;\n}\n\n.rdp-day_today:not(.rdp-day_outside) {\n font-weight: bold;\n}\n\n.rdp-day_selected,\n.rdp-day_selected:focus-visible,\n.rdp-day_selected:hover {\n color: white;\n opacity: 1;\n background-color: var(--rdp-accent-color);\n}\n\n.rdp-day_outside {\n opacity: 0.5;\n}\n\n.rdp-day_selected:focus-visible {\n /* Since the background is the same use again the outline */\n outline: var(--rdp-outline);\n outline-offset: 2px;\n z-index: 1;\n}\n\n.rdp:not([dir='rtl']) .rdp-day_range_start:not(.rdp-day_range_end) {\n border-top-right-radius: 0;\n border-bottom-right-radius: 0;\n}\n\n.rdp:not([dir='rtl']) .rdp-day_range_end:not(.rdp-day_range_start) {\n border-top-left-radius: 0;\n border-bottom-left-radius: 0;\n}\n\n.rdp[dir='rtl'] .rdp-day_range_start:not(.rdp-day_range_end) {\n border-top-left-radius: 0;\n border-bottom-left-radius: 0;\n}\n\n.rdp[dir='rtl'] .rdp-day_range_end:not(.rdp-day_range_start) {\n border-top-right-radius: 0;\n border-bottom-right-radius: 0;\n}\n\n.rdp-day_range_end.rdp-day_range_start {\n border-radius: 100%;\n}\n\n.rdp-day_range_middle {\n border-radius: 0;\n}\n\n/*# sourceMappingURL=style.css.map */";const Ra="willba-embed-fonts",ja="willba-filter-bar";let za=null;const Fa="undefined"!=typeof Document&&"adoptedStyleSheets"in Document.prototype,Ia=new WeakMap;class Aa extends HTMLElement{connectedCallback(){(e=>{if(Ia.has(e))return;Ua();const t=e.attachShadow({mode:"open"});Wa(t);const n=document.createElement("div");n.className="willba-embed-root",e.hasAttribute("full-width")&&n.classList.add("is-full-width"),t.appendChild(n),Ia.set(e,k.createRoot(n));const r=e.getAttribute("domain");r&&Ha(e,r)})(this)}disconnectedCallback(){(e=>{const t=Ia.get(e);t&&(t.unmount(),Ia.delete(e))})(this)}}const $a=e=>{const t=Object.assign(document.createElement("link"),e);document.head.appendChild(t)},Ua=()=>{"undefined"!=typeof document&&(document.getElementById(Ra)||($a({rel:"preconnect",href:"https://fonts.googleapis.com"}),$a({rel:"preconnect",href:"https://fonts.gstatic.com",crossOrigin:""}),$a({id:Ra,rel:"stylesheet",href:"https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400;500;600;700&display=swap"})))},Wa=e=>{const t=(()=>{if(!Fa)return null;if(za)return za;try{return za=new CSSStyleSheet,za.replaceSync(Ta),za}catch(e){return null}})();if(t)return void(e.adoptedStyleSheets=[t]);const n=document.createElement("style");n.textContent=Ta,e.appendChild(n)},Ha=async(e,t)=>{try{const n=(e=>e.startsWith("localhost")||e.startsWith("127.")||e.startsWith("0.0.0.0"))(t)?"http":"https",r=("undefined"!=typeof navigator&&navigator.language||"fi").split("-")[0],a=`${n}://${t}/api/services/filter-bar-config?locale=${r}`,o=await fetch(a,{headers:{Accept:"application/json"},signal:AbortSignal.timeout(1e4)});if(!o.ok)return;const i=await o.json(),l=null==i?void 0:i.filterBarConfig;if(!l)return;const s=e.getAttribute("mode"),u="dark"===s||"light"===s?{mode:s}:{},c=e.hasAttribute("full-width")?{fullWidth:!0}:{},d=Ia.get(e);if(!d)return;((e,t)=>{e.render(p.createElement(La,Object.assign({},t)))})(d,Object.assign(Object.assign(Object.assign(Object.assign({},l),{language:r,redirectUrl:`${n}://${t}`}),u),c))}catch(e){console.error(`[${ja}] Failed to load config:`,e)}};"undefined"==typeof customElements||customElements.get(ja)||customElements.define(ja,Aa);
73
+ \**************************************************************************************/t=>{t.exports=e}},n={};function r(e){var a=n[e];if(void 0!==a)return a.exports;var o=n[e]={exports:{}};return t[e].call(o.exports,o,o.exports,r),o.exports}return r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r("./src/index.ts")})(),pa.exports=e(i()));var e}var ma=ha();const ga=({fill:e,size:t,icon:n})=>{switch(n){case"spinner":return p.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:`${t||25}`,height:`${t||25}`,viewBox:"0 0 24 24"},p.createElement("style",null,"\n .spinner_z9k8 {\n transform-origin: center;\n animation: spinner_StKS .75s infinite linear;\n }\n @keyframes spinner_StKS {\n 100% {\n transform: rotate(360deg);\n }\n }\n "),p.createElement("path",{d:"M12,1A11,11,0,1,0,23,12,11,11,0,0,0,12,1Zm0,19a8,8,0,1,1,8-8A8,8,0,0,1,12,20Z",opacity:".25",fill:e}),p.createElement("path",{d:"M12,4a8,8,0,0,1,7.89,6.7A1.53,1.53,0,0,0,21.38,12h0a1.5,1.5,0,0,0,1.48-1.75,11,11,0,0,0-21.72,0A1.5,1.5,0,0,0,2.62,12h0a1.53,1.53,0,0,0,1.49-1.3A8,8,0,0,1,12,4Z",className:"spinner_z9k8",fill:e}));case"warning":return p.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:`${t||25}`,height:`${t||25}`,className:"svg-icon",style:{verticalAlign:"middle",fill:e,overflow:"hidden",minWidth:"25px",minHeight:"25px"},viewBox:"0 0 1024 1024",version:"1.1"},p.createElement("path",{d:"M42.666667 896h938.666666L512 85.333333 42.666667 896z m512-128h-85.333334v-85.333333h85.333334v85.333333z m0-170.666667h-85.333334v-170.666666h85.333334v170.666666z"}));default:return null}},va=({calendarRange:e,disabledDates:t,overlappingDate:n,rangeContext:r,findFirstPossibleRangeContextCheckIn:a,findLastPossibleRangeContextCheckOut:o,currentSelectionLastCheckoutDate:i})=>{const l=(null==e?void 0:e.from)&&rt(e.from),s=(null==e?void 0:e.to)&&rt(e.to),u=(null==r?void 0:r.from)&&rt(r.from),c=(null==r?void 0:r.to)&&rt(r.to),d=n?n.filter(e=>{const t=e.from?rt(e.from):null,n=t&&(null==a?void 0:a.checkIn)&&rn(t,null==a?void 0:a.checkIn),r=t&&(null==o?void 0:o.lastCheckOut)&&nn(t,rt(null==o?void 0:o.lastCheckOut));return!(n||r)}).map(e=>({from:e.from})):[];return{booked:t||[],disabledAfterCheckIn:l?[{after:l}]:[],overlappingDate:!l&&d.length?d.map(e=>({from:e.from})):[],noActiveSelectionStart:u||[],noActiveSelectionMid:[u&&c?{after:u,before:c}:[]],noActiveSelectionEnd:c||[],checkoutOptionsMid:[...l&&!s&&(null==i?void 0:i.lastCheckOut)?[{after:l,before:Ae(i.lastCheckOut,1)}]:[]],checkInOnly:[...(null==a?void 0:a.checkIn)&&r&&u?[{from:a.checkIn,to:Ae(u,-1)}]:[]],checkOutOnly:[...(null==o?void 0:o.checkIn)&&o.lastCheckOut?[{from:Ae(o.checkIn,1),to:o.lastCheckOut}]:[]]}},ya=e=>{const t=null==e?void 0:e.getRootNode();return t instanceof ShadowRoot?t:document},ba=f.forwardRef(({selectedPath:e,calendarRange:t,setCalendarRange:n,language:r,disableCalendarDates:a,requestDates:o,disabledDates:i,updateCalendarMonthNavigation:l,setUpdateCalendarMonthNavigation:s,updateCalendarDefaultMonth:u,loadingData:c,showFeedback:d,palette:h,setCalendarHasError:m,setUpdatedForSubmit:g,rangeContext:v,calendarHasError:y,autoFocus:b},w)=>{var k;const{t:x}=j("common"),S=F(b),C=ma.useMediaQuery({maxWidth:960}),E=qe(new Date),N=null==t?void 0:t.from,O=null==v?void 0:v.from,{newDisableCalendarDates:_,overlappingDate:P,lastPossibleCheckout:L}=(({disableCalendarDates:e,calendarRange:t,updateCalendarMonthNavigation:n,updateCalendarDefaultMonth:r})=>{const[a,o]=f.useState(void 0),[i,l]=f.useState([]);return{newDisableCalendarDates:f.useMemo(()=>{var t;if(null==e?void 0:e.availableDates){const n="dd-MM-yyyy",{disabledDates:r}=e,{updatedDisabledDates:a,newOverlappingDates:i}=(r||[]).reduce((t,r)=>{var a,o;const i=Gt(r.from,n),l=Gt(r.to,n),s=null===(a=e.availableDates)||void 0===a?void 0:a.some(e=>Gt(e.lastCheckOut,n)===i&&Gt(e.lastCheckOut,n)===l),u=null===(o=e.availableDates)||void 0===o?void 0:o.some(e=>Gt(e.lastCheckOut,n)===i&&Gt(e.lastCheckOut,n)!==l);return s?t.newOverlappingDates.push(r):u?(t.newOverlappingDates.push(r),t.updatedDisabledDates.push(Object.assign(Object.assign({},r),{from:Ae(r.from,1)}))):t.updatedDisabledDates.push(r),t},{updatedDisabledDates:[],newOverlappingDates:[]}),s=null===(t=e.availableDates.at(-1))||void 0===t?void 0:t.lastCheckOut;return s&&l({after:s}),i.length&&o([...i]),Object.assign(Object.assign({},e),{disabledDates:a})}return e},[e,t,n,r]),overlappingDate:a,lastPossibleCheckout:i}})({disableCalendarDates:a,calendarRange:t,updateCalendarMonthNavigation:l,updateCalendarDefaultMonth:u}),D=(({newDisableCalendarDates:e,selectedPath:t,today:n})=>{var r,a,o;const i=(null==e?void 0:e.disabledDatesByPage)&&t?[null===(r=null==e?void 0:e.disabledDatesByPage)||void 0===r?void 0:r.find(e=>t===e.page)]:[];return i.length?[{from:Ae(n,null!==(o=null===(a=i[0])||void 0===a?void 0:a.offset)&&void 0!==o?o:-1),to:Ae(n,-100)}]:[]})({today:E,selectedPath:e,newDisableCalendarDates:_});(({showFeedback:e,rootRef:t})=>{f.useEffect(()=>{if("undefined"==typeof document||!e)return;const n=ya(null==t?void 0:t.current),r=n.querySelector(".will-calendar-tooltip"),a=n.querySelector(".will-calendar-tooltip-check-out"),o=n.querySelector(".will-calendar-tooltip-overlapping-date"),i=n.querySelector(".will-filter-bar-calendar .will-calendar-spinner"),l=n.querySelector(".will-calendar-tooltip-check-in-only"),s=n.querySelector(".will-calendar-tooltip-check-out-only"),u=n.querySelectorAll(".will-filter-bar-calendar .rdp-cell:has(.booked):not(:has(.disabled-after-check-in))"),c=n.querySelectorAll(".will-filter-bar-calendar .rdp-cell:has(.booked.disabled-after-check-in)"),d=n.querySelector(".will-filter-bar-calendar .rdp-months"),f=n.querySelectorAll(".will-filter-bar-calendar .rdp-cell:has(.overlapping-date)"),p=n.querySelectorAll(".will-filter-bar-calendar .rdp-cell:has(.check-in-only)"),h=n.querySelectorAll(".will-filter-bar-calendar .rdp-cell:has(.check-out-only)"),m=[],g=[],v=[],y=[],b=[],w=[];if(r&&u.length>0&&u.forEach(e=>{const t=r.cloneNode(!0);e.appendChild(t),m.push(t)}),a&&c.length>0&&c.forEach(e=>{const t=a.cloneNode(!0);e.appendChild(t),g.push(t)}),s&&h.length>0&&h.forEach(e=>{const t=s.cloneNode(!0);e.appendChild(t),y.push(t)}),l&&p.length>0&&p.forEach(e=>{const t=l.cloneNode(!0);e.appendChild(t),v.push(t)}),i&&d){const e=i.cloneNode(!0);d.appendChild(e),b.push(e)}return o&&f.length>0&&f.forEach(e=>{const t=o.cloneNode(!0);e.appendChild(t),w.push(t)}),()=>{m.forEach(e=>e.remove()),g.forEach(e=>e.remove()),b.forEach(e=>e.remove()),w.forEach(e=>e.remove()),v.forEach(e=>e.remove()),y.forEach(e=>e.remove())}})})({showFeedback:d,rootRef:S}),(({loadingData:e,rootRef:t})=>{f.useEffect(()=>{if("undefined"==typeof document)return;const n=ya(null==t?void 0:t.current).querySelector(".will-filter-bar-calendar .rdp-months .will-calendar-spinner");e?n&&(n.style.display="flex"):n&&(n.style.display="none")})})({loadingData:c,rootRef:S});const M=e=>{m&&y&&m(!1),(({range:e,newDisableCalendarDates:t,setCalendarRange:n,calendarRange:r,overlappingDate:a,setCalendarHasError:o,rangeContext:i})=>{var l;const s=(null==e?void 0:e.from)?rt(e.from):null,u=(null==e?void 0:e.to)?rt(e.to):null,c=(null==r?void 0:r.from)?rt(r.from):null,d=(null==r?void 0:r.to)?rt(r.to):null,f=(null==i?void 0:i.from)?rt(i.from):null,p=(null==i?void 0:i.to)?rt(i.to):null,h=!e&&c&&d?c:s,m=(null==a?void 0:a.length)?a.find(e=>!(!e.from||!h)&&an(rt(e.from),h)):null,g=(null==a?void 0:a.length)?a.find(e=>!(!e.from||!u)&&an(rt(e.from),u)):null,v=(null===(l=null==t?void 0:t.availableDates)||void 0===l?void 0:l.length)?t.availableDates.find(e=>!(!e.checkIn||!s)&&an(rt(e.checkIn),s)):null;c&&m&&s&&!an(s,c)||!e||c&&d&&g&&u&&!an(u,d)?n(void 0):s&&p&&nn(s,p)||c&&d&&p&&u&&!an(u,d)&&nn(u,p)?(o&&o(!0),n(void 0)):s&&u&&an(s,u)?n({from:s,to:void 0}):c&&d&&!e?n({from:c,to:void 0}):i&&u&&(null==v?void 0:v.lastCheckOut)&&nn(u,rt(v.lastCheckOut))&&(d&&!an(u,d)||!d)&&nn(u,rt(i.to))?(o&&o(!0),n(void 0)):s&&c&&rn(s,c)?n({from:s,to:void 0}):u&&(null==v?void 0:v.lastCheckOut)&&nn(u,rt(v.lastCheckOut))?n(g?void 0:{from:u,to:void 0}):c&&s&&!an(c,s)?n({from:s,to:void 0}):d&&u&&!an(d,u)?n({from:u,to:void 0}):s&&u&&f&&rn(u,f)?(o&&o(!0),n({from:u,to:void 0})):n(e)})({range:e,newDisableCalendarDates:_,setCalendarRange:n,calendarRange:t,overlappingDate:P,setCalendarHasError:m,rangeContext:v}),g&&g(!0)},{findFirstPossibleRangeContextCheckIn:T,findLastPossibleRangeContextCheckOut:R,firstPossibleRangeContextCheckIn:z,lastPossibleRangeContextCheckOut:I,currentSelectionAvailability:A}=(({rangeContext:e,availableDates:t,calendarRange:n})=>{let r,a,o=[],i=[];const l=(null==e?void 0:e.from)&&rt(e.from),s=(null==e?void 0:e.to)&&rt(e.to),u=(null==n?void 0:n.from)&&rt(n.from);return e&&(null==t?void 0:t.length)&&(r=null==t?void 0:t.find(e=>l&&rt(e.checkIn)<l&&rt(e.lastCheckOut)>=l),(null==r?void 0:r.checkIn)&&o.push({before:r.checkIn}),a=null==t?void 0:t.find(e=>s&&an(s,rt(e.checkIn))),(null==a?void 0:a.checkIn)&&i.push({after:a.lastCheckOut})),{findFirstPossibleRangeContextCheckIn:r,findLastPossibleRangeContextCheckOut:a,firstPossibleRangeContextCheckIn:o,lastPossibleRangeContextCheckOut:i,currentSelectionAvailability:null==t?void 0:t.find(e=>!!u&&an(rt(e.checkIn),u))}})({rangeContext:v,availableDates:null==_?void 0:_.availableDates,calendarRange:t});(({setCalendarHasError:e,rangeContext:t,calendarRange:n,calendarHasError:r,disabledDates:a})=>{const o=(null==n?void 0:n.from)&&rt(n.from),i=(null==n?void 0:n.to)&&rt(n.to),l=(null==t?void 0:t.from)&&rt(t.from),s=(null==t?void 0:t.to)&&rt(t.to),u=o&&s?rn(o,s)||an(o,s):null,c=i&&l&&s?nn(i,l)||an(i,l):null,d=null==a?void 0:a.find(e=>{const t=rt(e.from),n=rt(e.to);return l&&s&&Je({start:l,end:s},{start:t,end:n})&&o&&i&&Je({start:o,end:i},{start:t,end:n})});f.useEffect(()=>{(t&&o&&!u||t&&i&&!c||d)&&e&&!r&&e(!0)})})({setCalendarHasError:m,rangeContext:v,calendarRange:t,calendarHasError:y,disabledDates:null==_?void 0:_.disabledDates});const $=D.length?D:(null==i?void 0:i.length)?i:(null==_?void 0:_.disabledDates)||[],U=D.length?$:[L,...$,...z,...I,...(null==t?void 0:t.to)||!A||Ae(A.checkIn,1)>=A.firstCheckOut?[]:[{from:Ae(A.checkIn,1),to:Ae(A.firstCheckOut,-1)}]];return p.createElement("div",{className:"will-filter-bar-calendar",ref:w},p.createElement("div",{className:"will-calendar-filter-container",ref:S},p.createElement(da,{key:u,id:"will-calendar",mode:"range",locale:"en"===r?Bt:Wn,numberOfMonths:C?1:2,weekStartsOn:1,selected:t,onSelect:e=>M(e),captionLayout:"dropdown-buttons",defaultMonth:(null==t?void 0:t.from)||N||O||((null===(k=null==_?void 0:_.disabledDates)||void 0===k?void 0:k.length)?_.disabledDates[0].from:E),disabled:U,fromMonth:E,onMonthChange:e=>{null==o||o(e),null==s||s(e=>!e)},classNames:{day_range_start:(null==t?void 0:t.from)?"rdp-day_range_start":"",day_range_end:(null==t?void 0:t.to)?"rdp-day_range_end":""},modifiersClassNames:{today:"my-today",booked:"booked",disabledAfterCheckIn:"disabled-after-check-in",overlappingDate:"overlapping-date",noActiveSelectionStart:"no-active-selection-start",noActiveSelectionMid:"no-active-selection-mid",noActiveSelectionEnd:"no-active-selection-end",checkoutOptionsMid:"rdp-day_selected rdp-day_range_middle checkout-option",checkInOnly:"check-in-only",checkOutOnly:"check-out-only"},modifiers:va({calendarRange:t,disabledDates:U,overlappingDate:P,rangeContext:v,findFirstPossibleRangeContextCheckIn:T,findLastPossibleRangeContextCheckOut:R,currentSelectionLastCheckoutDate:A})}),p.createElement("div",{className:"will-calendar-tooltip"},p.createElement("div",null,x("noCheckIn"))),p.createElement("div",{className:"will-calendar-tooltip-check-out"},p.createElement("div",null,x("noCheckOut"))),p.createElement("div",{className:"will-calendar-tooltip-overlapping-date"},p.createElement("div",null,x("checkOutOnly"))),p.createElement("div",{className:"will-calendar-tooltip-check-in-only"},p.createElement("div",null,x("checkInOnly"))),p.createElement("div",{className:"will-calendar-tooltip-check-out-only"},p.createElement("div",null,x("checkOutOnly"))),p.createElement("div",{className:"will-calendar-spinner"},p.createElement(ga,{fill:(null==h?void 0:h.primary)||"inherit",size:50,icon:"spinner"}))))}),wa=({title:e,action:t})=>p.createElement("div",{className:"will-filter-section-header"},p.createElement("h3",{className:"will-filter-section-title"},e),t&&p.createElement("div",{className:"will-filter-section-action"},t)),ka=f.forwardRef(({onClose:e,autoFocus:t,calendarRange:n,setCalendarRange:r,disableCalendarDates:a,selectedPath:o,language:i},l)=>p.createElement("div",{id:"will-filter-bar-dates",ref:l},p.createElement(wa,{title:"",action:e&&p.createElement(On,{handleClose:e})}),p.createElement("div",{className:"will-dates-filter-container"},p.createElement(ba,{autoFocus:t,calendarRange:n,setCalendarRange:r,disableCalendarDates:a,selectedPath:o,language:i}))));ka.displayName="Dates";const xa=({label:e,sortOrder:t,id:n,updateGuestsCount:r,count:a,minVal:o})=>{f.useEffect(()=>{o&&o>a&&r(`guests-${n}`,o)},[]);return p.createElement("div",{className:"will-guests-filter-inner",style:{order:`${t}`}},p.createElement("p",{className:"will-guests-filter-label"},e),p.createElement("div",{className:"will-guests-filter-counter"},p.createElement("button",{className:"will-guests-filter-counter-button",onClick:()=>{a>o&&r(`guests-${n}`,a-1)},disabled:o&&a<=o||!a,style:{cursor:o&&a<=o||!a?"initial":"pointer",paddingBottom:"4px",opacity:o&&a<=o||!a?.4:1}},p.createElement("svg",{width:"10",height:"10",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},p.createElement("path",{d:"M4 10H16",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"}))),p.createElement("span",{className:"will-guests-filter-count"},a),p.createElement("button",{className:"will-guests-filter-counter-button",onClick:()=>{r(`guests-${n}`,a+1)}},p.createElement("svg",{width:"15",height:"15",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},p.createElement("path",{d:"M10 4V16M4 10H16",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})))))},Sa=f.forwardRef(({ageCategories:e,updateGuestsCount:t,ageCategoryCounts:n,autoFocus:r,onClose:a},o)=>{const{t:i}=j("filterBar"),l=F(r);return p.createElement("div",{id:"will-filter-bar-guests",ref:o},p.createElement(wa,{title:i("guests.title"),action:a&&p.createElement(On,{handleClose:a})}),p.createElement("div",{className:"will-guests-filter-container",ref:l},null==e?void 0:e.map(e=>p.createElement(xa,{key:e.id,id:e.id,label:e.name,minVal:e.minVal,sortOrder:e.sortOrder,updateGuestsCount:t,count:n[`guests-${e.id}`]||0}))))});Sa.displayName="Guests";const Ca=f.forwardRef(({title:e,description:t,imageUrl:n,isSelected:r,onClick:a},o)=>{const i=`${e}${t?`, ${t}`:""}`;return p.createElement("div",{ref:o,className:"will-image-card "+(r?"is-selected":""),onClick:a,onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),null==a||a())},role:"button",tabIndex:0,"aria-pressed":r,"aria-label":i},p.createElement("div",{className:"will-image-card-content"},p.createElement("h3",null,e),t&&p.createElement("p",null,t)),p.createElement("div",{className:"will-image-card-image"},n&&p.createElement("img",{src:n,alt:e||"Location image"})))});Ca.displayName="ImageCard";const Ea=f.forwardRef(({locations:e,selectedLocations:t,setSelectedLocations:n,autoFocus:r,multiSelect:a=!1,onClose:o},i)=>{const{t:l}=j("filterBar"),s=f.useRef(null);f.useEffect(()=>{r&&s.current&&s.current.focus()},[r]);return p.createElement("div",{id:"will-filter-bar-locations",ref:i},p.createElement(wa,{title:l("locations.title"),action:o&&p.createElement(On,{handleClose:o})}),p.createElement("div",{className:"will-locations-filter-container"},!!(null==e?void 0:e.length)&&e.map((e,r)=>p.createElement(Ca,{key:e.id,ref:0===r?s:null,title:e.label,description:e.description,imageUrl:e.imageUrl,isSelected:t.some(t=>t.id===e.id),onClick:()=>(e=>{if(a){const r=t.some(t=>t.id===e.id);n(r?t.filter(t=>t.id!==e.id):[...t,e])}else n([e]),null==o||o()})(e)}))))});Ea.displayName="Locations";const Na=({categories:e,setCategories:t})=>{const{t:n}=j("filterBar"),[r,a]=f.useState("");return p.createElement("div",{id:"will-filter-bar-categories"},p.createElement("h3",{className:"will-categories-filter-title"},n("categories.label")),p.createElement("div",{className:"will-categories-filter-inner"},["Weekend","Week","Summer camp","Winter camp"].map((e,n)=>p.createElement("div",{key:n},p.createElement("input",{type:"radio",value:e,checked:r===e,onChange:()=>(e=>{a(e),t(e)})(e)}),p.createElement("span",null,e)))))};Na.displayName="Categories";const Oa=()=>{const{categories:e,calendarRange:t,selectedFilter:n,selectedPath:r,ageCategoryCounts:a,selectedLocations:o,mode:i,tabs:l,disableCalendarDates:s,ageCategories:u,locations:c,language:d,isMobile:h,panelRef:m,buttonRefs:g,filtersRef:v,setSelectedLocations:y,setCalendarRange:b,handleSelectedFilter:w,updateGuestsCount:k,setCategories:x}=mn(),{filterSectionRef:S}=(({handleSelectedFilter:e})=>{const t=f.useRef(null);return f.useEffect(()=>{const n=n=>{t.current&&(n.composedPath().includes(t.current)||e(!1))};return document.addEventListener("mousedown",n),()=>{document.removeEventListener("mousedown",n)}},[t]),{filterSectionRef:t}})({handleSelectedFilter:w}),{left:C,top:E}=(({selectedFilter:e,panelRef:t,filtersRef:n,buttonRefs:r,isMobile:a,tabs:o})=>{const[i,l]=f.useState(),s=o&&o.length>1,u=a?s?60:0:s?125:66;return f.useLayoutEffect(()=>{if(!e||"string"!=typeof e||a)return void l(void 0);const o=t.current,i=n.current,s=r.current[e];if(!o||!i||!s)return;const u=o.getBoundingClientRect(),c=i.getBoundingClientRect(),d=s.getBoundingClientRect().left-c.left-10,f=Math.max(0,Math.min(d,c.width-u.width));l(f)},[e,a]),{top:u,left:i}})({selectedFilter:n,panelRef:m,filtersRef:v,buttonRefs:g,isMobile:h,tabs:l});return n&&p.createElement("div",{ref:m,className:`will-filter-bar-panels ${i||"light"}`,style:{left:C,top:E}},(()=>{switch(n){case Te.CALENDAR:return p.createElement(ka,{autoFocus:!0,ref:S,onClose:()=>w(!1),calendarRange:t,setCalendarRange:b,disableCalendarDates:s,selectedPath:r,language:d});case Te.GUESTS:return p.createElement(Sa,{autoFocus:!0,ref:S,ageCategories:u,ageCategoryCounts:a,updateGuestsCount:k,onClose:()=>w(!1)});case Te.CATEGORIES:return p.createElement(Na,{categories:e,setCategories:x});case Te.LOCATIONS:return p.createElement(Ea,{autoFocus:!0,ref:S,locations:null==c?void 0:c.data,selectedLocations:o,setSelectedLocations:y,multiSelect:null==c?void 0:c.multiSelect,onClose:()=>w(!1)});default:return null}})())},_a=()=>{var e;const{t:t}=j("filterBar"),{calendarRange:n,selectedFilter:r,selectedPath:a,ageCategoryCounts:o,selectedLocations:i,mode:l,tabs:s,ageCategories:u,locations:c,innerLoading:d,outerLoading:h,handleSubmit:m,handleSelectedFilter:g,previouslyFocusedButtonRef:v,buttonRefs:y,tabsRef:b,filtersRef:w}=mn();f.useEffect(()=>{!r&&v.current&&(v.current.focus(),v.current=null)},[r]);const k=(({calendarRange:e})=>(null==e?void 0:e.to)&&(null==e?void 0:e.from)?`${Gt(e.from,"dd.MM.yyyy")} -\n${Gt(e.to,"dd.MM.yyyy")}`:null)({calendarRange:n}),x=(({guestLabel:e,guestsLabel:t,guestsPlaceholder:n,ageCategoryCounts:r,ageCategories:a})=>{const o=Object.entries(r).reduce((e,[t,n])=>{const r=t.split("-");if(r.length<2)return e;const o=r[1];return(null==a?void 0:a.find(e=>e.id===o))&&n?{total:e.total+n,html:[...e.html,`${n}`]}:e},{total:0,html:[]});if(!o.total)return{content:n,data:o};const i=o.html.length>1?o.html.join(" + "):null;return{content:p.createElement(p.Fragment,null,p.createElement("span",{className:"will-guest-count"},o.total)," ",o.total>1?t:e,i&&p.createElement(p.Fragment,null,"   ( ",i," )")),data:o}})({ageCategoryCounts:o,ageCategories:u,guestsPlaceholder:t("guests.labelPlaceholder"),guestLabel:t("guests.guestLabel"),guestsLabel:t("guests.guestsLabel")}),S=(({selectedLocations:e,locationsPlaceholder:t,locationsSelectedLabel:n="locations"})=>{if(!e.length)return t;if(1===e.length){return e[0].label||t}return`${e.length} ${n}`})({selectedLocations:i,locationsPlaceholder:t("locations.placeholder"),locationsSelectedLabel:t("locations.selected")});return p.createElement("div",{className:`will-filter-bar-controls ${l||"light"} ${r?"disabled":""}`,ref:e=>{w.current=e,1===(null==s?void 0:s.length)&&(b.current=e)}},!!(null===(e=null==c?void 0:c.data)||void 0===e?void 0:e.length)&&c.data.length>1&&p.createElement(p.Fragment,null,p.createElement(Le,{ref:e=>y.current[Te.LOCATIONS]=e,label:t("locations.label"),description:S,onClick:e=>{v.current=e.currentTarget,g(Te.LOCATIONS)},active:!!i.length,disabled:null==c?void 0:c.disabled,ariaExpanded:r===Te.LOCATIONS,ariaControls:"will-filter-bar-locations"}),p.createElement(Me,null)),p.createElement(Le,{ref:e=>y.current[Te.CALENDAR]=e,label:t("calendar.label"),description:k||(a===Re.ROOMS?t("calendar.roomsLabelPlaceholder"):t("calendar.eventsLabelPlaceholder")),onClick:e=>{v.current=e.currentTarget,g(Te.CALENDAR)},active:!!k,ariaExpanded:r===Te.CALENDAR,ariaControls:"will-filter-bar-dates"}),a!==Re.EVENTS&&p.createElement(p.Fragment,null,p.createElement(Me,null),p.createElement(Le,{ref:e=>y.current[Te.GUESTS]=e,label:t("guests.label"),description:x.content,onClick:e=>{v.current=e.currentTarget,g(Te.GUESTS)},active:!!x.data.total,ariaExpanded:r===Te.GUESTS,ariaControls:"will-guests-filter"})),p.createElement(En,{onClick:m,startIcon:p.createElement(Sn,null),label:t("common:search"),isLoading:d||h}))},Pa=()=>{const{t:e}=j("filterBar"),{selectedPath:t,mode:n,tabs:r,tabsRef:a,handleSelectedFilter:o,setSelectedPath:i,handleResetFilters:l}=mn(),s=f.useMemo(()=>[...null!=r?r:[]].sort((e,t)=>e.order-t.order),[r]);return s.length<=1?null:p.createElement("div",{className:"will-filter-bar-tabs",ref:a},s.map(r=>p.createElement(De,{key:r.path,label:r.label||e(`tabs.${r.path.slice(1)}`),onClick:()=>{return e=r.path,i(e),l(),void o(!1);var e},active:t===r.path,mode:n})))},La=e=>p.createElement(Pe,{language:e.language},p.createElement(Da,Object.assign({},e))),Da=({language:e,ageCategories:t,redirectUrl:n=Ma,palette:r,onSubmit:a,fullWidth:o,disableCalendarDates:i,mode:l,tabs:s,outerLoading:u,locations:c})=>{const d=(({palette:e})=>({"--will-primary":null==e?void 0:e.primary,"--will-secondary":null==e?void 0:e.secondary,"--will-error":null==e?void 0:e.error}))({palette:r});return(({language:e})=>{const{i18n:t}=j();f.useEffect(()=>{e&&t.language!==e&&t.changeLanguage(e)},[e,t])})({language:e}),(()=>{const[e,t]=f.useState(!1);if(f.useEffect(()=>{t(!0)},[]),!e);})(),p.createElement(hn,{language:e,ageCategories:t,redirectUrl:n,palette:r,onSubmit:a,fullWidth:o,disableCalendarDates:i,mode:l,tabs:s,outerLoading:u,locations:c},p.createElement("div",{className:"will-root "+(o?"is-full-width":""),style:d},p.createElement(Pa,null),p.createElement(_a,null),p.createElement(Oa,null)))},Ma="http://localhost:3000/";var Ta="\n\n.will-root * {\n font-family: 'Montserrat', sans-serif;\n}\n\n.will-root {\n \n box-sizing: border-box;\n font-size: 14px;\n \n color: #1E1E1E;\n \n /* Palette */\n --will-primary: #374269;\n --will-secondary: #374269;\n --will-grey: #ABA7AF;\n --will-light-grey: #C8C8C8;\n --will-white: #fff;\n --will-white-transparent: #ffffffcf;\n --will-black: #000;\n --will-onahau: #CDEEFF;\n --will-text: #5A5959;\n --will-charcoal-blue: #384265;\n --will-error: #d32f2f;\n\n /* Transparent */\n --will-transparent-black: rgba(0, 0, 0, 0.5);\n --will-transparent-white: rgba(255, 255, 255, 0.30);\n --will-transparent-lavender: rgba(171, 167, 175, 0.30);\n\n /* Color mix */\n --will-primary-lighter: color-mix(in srgb, var(--will-primary), white 50%);\n --will-primary-lightest: color-mix(in srgb, var(--will-primary), white 80%);\n\n\n /* Shadows */\n --will-box-shadow-dark: 0px 2px 12px 2px #a1a1a180;\n --will-box-shadow-light: 0px 2px 12px 2px #bcb9b980;\n\n /* Breakpoints */\n --will-lg: 1140px;\n --will-md: 960px;\n --will-sm: 600px;\n --will-xl: 1280px;\n --will-xs: 0px;\n}\n\n/* Typography */\n\n.will-root h1, h2, h3, h4, h5, h6 {\n font-weight: 700;\n} \n\n.will-root p, h1, h2, h3, h4, h5, h6, span {\n margin: 0;\n padding: 0;\n}\n\n\n/* Integration fixes */\n\n.will-root p {\n margin: 0 !important;\n}\n\n.will-root button {\n line-height: normal !important;\n}\n\n.storybook-button {\n font-family: 'Nunito Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;\n font-weight: 700;\n border: 0;\n border-radius: 3em;\n cursor: pointer;\n display: inline-block;\n line-height: 1;\n}\n.storybook-button--primary {\n color: white;\n background-color: #1ea7fd;\n}\n.storybook-button--secondary {\n color: #333;\n background-color: transparent;\n box-shadow: rgba(0, 0, 0, 0.15) 0px 0px 0px 1px inset;\n}\n.storybook-button--small {\n font-size: 12px;\n padding: 10px 16px;\n}\n.storybook-button--medium {\n font-size: 14px;\n padding: 11px 20px;\n}\n.storybook-button--large {\n font-size: 16px;\n padding: 12px 24px;\n}\n.will-filter-bar-divider {\n width: 1px;\n margin: 0 10px;\n background-color: var(--will-charcoal-blue);\n}\n\n@media (max-width: 960px) {\n .will-filter-bar-divider {\n width: auto;\n margin: 0 10px;\n height: 1px;\n background-color: var(--will-charcoal-blue);\n }\n}\n.will-filter-bar-controls {\n display: flex;\n justify-content: space-between;\n padding: 10px;\n position: relative;\n z-index: 222;\n border-radius: 40px;\n background-color: var(--will-white);\n}\n\n@media (max-width: 960px) {\n .will-filter-bar-controls {\n flex-direction: column;\n padding: 20px;\n border-radius: 25px;\n overflow: hidden;\n }\n\n .will-filter-bar-controls.disabled {\n opacity: 0.1;\n }\n}\n\n#will-filter-bar-categories {\n text-align: center;\n}\n\n.will-categories-filter-title {\n font-size: 16px;\n text-transform: uppercase;\n margin: 10px 0 30px 0;\n}\n\n.will-categories-filter-inner {\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 20px;\n}\n\n.will-categories-filter-inner input {\n cursor: pointer;\n margin-right: 10px;\n}\n\n.will-dates-filter-container {\n padding: 0 30px 16px 30px;\n}\n\n@media (max-width: 960px) {\n .will-dates-filter-container {\n padding: 0 20px 16px 20px;\n }\n}\n\n.will-filter-bar-panels {\n background-color: var(--will-white);\n min-height: 100px;\n position: absolute;\n z-index: 111;\n border-radius: 25px;\n box-shadow: var(--will-box-shadow);\n}\n\n@media (max-width: 960px) {\n .will-root {\n width: 100%;\n min-width: auto;\n max-height: 100vh;\n z-index: 3;\n }\n\n .will-filter-bar-panels {\n width: 100%;\n z-index: 999;\n }\n}\n\n.will-guests-filter-label,\n.will-guests-filter-count {\n font-size: 18px;\n color: var(--will-text);\n}\n\n.will-guests-filter-inner {\n display: flex;\n align-items: center;\n justify-content: space-between;\n}\n\n.will-guests-filter-label {\n display: block;\n font-weight: 600;\n margin-bottom: 10px;\n}\n\n.will-guests-filter-inner .will-guests-filter-counter {\n display: flex;\n align-items: center;\n}\n\n.will-guests-filter-count {\n margin: 0 10px;\n min-width: 30px;\n text-align: center;\n}\n\n.will-guests-filter-counter-button {\n border-radius: 50%;\n background-color: transparent;\n border: 1px solid var(--will-grey);\n width: 30px;\n height: 30px;\n display: flex;\n justify-content: center;\n align-items: center;\n font-size: 20px;\n cursor: pointer;\n color: var(--will-black);\n\n padding: 0;\n margin: 0;\n -webkit-appearance: none;\n appearance: none;\n}\n\n.will-guests-filter-counter-button:hover {\n background-color: var(--will-onahau);\n}\n\n@media (max-width: 960px) {\n .will-guests-filter-inner {\n width: 100%;\n justify-content: space-between;\n }\n}\n\n#will-filter-bar-guests {\n text-align: initial;\n}\n\n.will-guests-filter-container {\n display: flex;\n flex-direction: column;\n min-width: 400px;\n gap: 20px;\n padding: 0 30px 16px 30px;\n}\n\n@media (max-width: 960px) {\n .will-guests-filter-container {\n min-width: auto;\n padding: 0 20px 16px 20px;\n }\n}\n\n/**/\n.will-guest-count {\n display: inline-block;\n min-width: 10px;\n}\n\n#will-filter-bar-locations {\n text-align: initial;\n}\n\n.will-locations-filter-container {\n display: flex;\n flex-direction: column;\n min-width: 400px;\n padding-bottom: 16px;\n}\n\n@media (max-width: 960px) {\n .will-locations-filter-container {\n min-width: 100%;\n }\n}\n\n.will-filter-section-header {\n display: flex;\n justify-content: space-between;\n align-items: center;\n padding: 16px 30px;\n}\n\n.will-filter-section-title {\n font-size: 22px;\n margin: 0;\n}\n\n.will-filter-section-action {\n display: flex;\n gap: 8px;\n align-items: center;\n}\n\n.will-filter-section-action .will-filter-bar-close-button {\n position: relative;\n top: auto;\n right: auto;\n margin: 0;\n}\n\n@media (max-width: 960px) {\n .will-filter-section-header {\n padding: 16px 20px;\n }\n\n .will-filter-section-title {\n font-size: 18px;\n }\n}\n\n.will-filter-bar-tabs {\n display: flex;\n align-items: center;\n justify-content: center;\n position: relative;\n z-index: 222;\n background: transparent;\n padding: 10px;\n gap: 10px;\n}\n\n.will-image-card {\n display: flex;\n gap: 20px;\n justify-content: space-between;\n align-items: center;\n padding: 8px 30px;\n cursor: pointer;\n user-select: none;\n min-height: 40px;\n}\n\n.will-image-card.is-selected {\n background-color: var(--will-transparent-lavender);\n}\n\n.will-image-card:hover {\n background-color: var(--will-transparent-lavender);\n}\n\n.will-image-card-image img {\n width: 120px;\n height: 68px;\n object-fit: cover;\n}\n\n@media (max-width: 960px) {\n .will-image-card {\n padding: 8px 20px;\n }\n}\n\n.will-filter-bar-select-button {\n width: 100%;\n height: auto;\n background-color: transparent;\n border: none;\n padding: 0 20px;\n border-radius: 20px;\n cursor: pointer;\n font-size: 14px;\n text-align: initial;\n user-select: none;\n}\n\n.will-filter-bar-select-button.disabled {\n cursor: not-allowed;\n}\n\n.will-filter-bar-select-button .select-button-wrapper {\n display: flex;\n align-items: center;\n flex-wrap: wrap;\n gap: 10px;\n}\n\n.will-filter-bar-select-button .select-button-wrapper > div {\n display: grid;\n}\n\n.will-filter-bar-select-button .select-button-label {\n color: var(--will-black);\n font-weight: 600;\n}\n\n.will-filter-bar-select-button .select-button-description {\n color: var(--will-black);\n font-weight: 400;\n opacity: 0.5;\n white-space: nowrap;\n min-height: 19px;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\n.will-filter-bar-select-button .select-button-description span {\n font: inherit;\n}\n\n.will-filter-bar-select-button .select-button-label.active,\n.will-filter-bar-select-button .select-button-description.active {\n font-weight: 700;\n font-size: 15px;\n opacity: 1;\n}\n\n@media (max-width: 960px) {\n .will-filter-bar-select-button {\n padding: 15px 0;\n }\n\n .will-filter-bar-select-button:first-child {\n padding: 0 0 15px 0;\n }\n\n .will-filter-bar-select-button .select-button-wrapper {\n justify-content: center;\n text-align: center;\n }\n\n .will-filter-bar-select-button .select-button-description {\n white-space: wrap;\n }\n\n .will-filter-bar-select-button .select-button-divider {\n display: none;\n }\n}\n\n.will-filter-bar-tab-button {\n width: auto;\n height: auto;\n padding: 10px 20px;\n cursor: pointer;\n border: none;\n white-space: nowrap;\n font-size: 16px;\n display: flex;\n align-items: center;\n background-color: transparent;\n user-select: none;\n font-weight: 600;\n border-radius: 50px;\n }\n\n .will-filter-bar-tab-button.light {\n color: var(--will-white)\n }\n\n .will-filter-bar-tab-button.dark {\n color: var(--will-black)\n }\n\n .will-filter-bar-tab-button.light.active,\n .will-filter-bar-tab-button:hover {\n background-color: var(--will-transparent-white);\n }\n\n .will-filter-bar-tab-button.dark.active,\n .will-filter-bar-tab-button:hover {\n background-color: var(--will-transparent-lavender);\n }\n\n \n\n\n.will-root {\n z-index: 999;\n width: fit-content;\n min-width: 796px;\n max-height: 100vh;\n position: relative;\n}\n\n.will-root.is-full-width {\n width: 100%;\n}\n\n.will-filter-bar {\n box-sizing: border-box;\n position: relative;\n}\n\n@media (max-width: 960px) {\n .will-root {\n width: 100%;\n min-width: auto;\n }\n}\n\n/* Common */\n\n.will-filter-bar-controls.dark,\n.will-filter-bar-panels.dark {\n box-shadow: var(--will-box-shadow-dark);\n}\n\n.will-filter-bar-controls.light,\n.will-filter-bar-panels.light {\n box-shadow: var(--will-box-shadow-light);\n}\n\n.will-root .will-calendar-wrapper {\n box-shadow: var(--will-box-shadow-dark);\n border-radius: 20px;\n background-color: var(--will-white);\n position: absolute;\n top: 0;\n left: 0;\n \n}\n\n.will-root .will-calendar-wrapper .will-calendar-header,\n.will-root .will-calendar-wrapper .will-calendar-main,\n.will-root .will-calendar-wrapper .will-calendar-footer {\n padding: 20px;\n}\n\n/* Header */\n\n.will-root .will-calendar-wrapper .will-calendar-header {\n display: flex;\n justify-content: space-between;\n border-bottom: 1px solid var(--will-grey);\n align-items: center;\n}\n\n/* Footer */\n\n.will-root .will-calendar-wrapper .will-calendar-footer {\n border-top: 1px solid var(--will-grey);\n}\n\n/* Footer actions */\n\n.will-root .will-calendar-wrapper .will-calendar-footer-actions-wrapper {\n display: flex;\n justify-content: space-between;\n}\n\n.will-root .will-calendar-wrapper .will-calendar-footer-dates > div {\n margin-bottom: 5px;\n}\n\n.will-root .will-calendar-wrapper .will-calendar-footer-dates-separator {\n margin: 0 15px;\n}\n\n.will-root .will-calendar-wrapper .will-calendar-footer-dates .will-calendar-footer-booked {\n display: flex;\n min-height: 20.5px;\n margin-top: 10px;\n}\n\n.will-root .will-calendar-wrapper .will-calendar-footer-error {\n display: flex;\n max-width: 80%;\n}\n\n.will-root .will-calendar-wrapper .will-calendar-footer-error span {\n display: inline-block;\n margin-left: 10px;\n}\n\n@media (max-width: 960px) {\n .will-root .will-calendar-wrapper {\n width: -webkit-fill-available;\n margin: 0 -6%;\n }\n\n .will-root .will-calendar-wrapper .will-calendar-header,\n .will-root .will-calendar-wrapper .will-calendar-main,\n .will-root .will-calendar-wrapper .will-calendar-footer {\n padding: 20px 10px;\n }\n\n .will-root .will-calendar-wrapper .will-calendar-footer-actions-wrapper {\n flex-direction: column;\n }\n\n .will-root .will-calendar-wrapper .will-calendar-footer-dates {\n text-align: center;\n }\n\n .will-root .will-calendar-wrapper .will-calendar-footer-dates .will-calendar-footer-booked {\n justify-content: center;\n }\n\n .will-root .will-calendar-wrapper .will-calendar-footer-actions {\n flex-direction: column;\n width: 100%;\n }\n\n .will-root .will-calendar-wrapper .will-calendar-footer-actions button{\n width: 100%;\n margin-top: 10px;\n }\n\n .will-root .will-calendar-wrapper .will-calendar-footer-error {\n max-width: 100%;\n }\n\n .will-root .will-calendar-wrapper .will-calendar-footer-error span {\n text-align: center;\n margin-left: 5px;\n }\n }\n\n.will-root .will-calendar-wrapper .will-calendar-header .will-filter-bar-close-button {\n position: initial;\n}\n.will-filter-bar-close-button {\n width: auto;\n height: auto;\n /* background-color: var(--will-grey); */\n color: var(--will-grey);\n padding: 2px 7px;\n border-radius: 50%;\n cursor: pointer;\n border: none;\n display: flex;\n align-items: center;\n font-size: 23px;\n /* display: none; */\n\n position: absolute;\n top: 10px;\n right: 10px;\n\n min-height: 35px;\n}\n\n@media (max-width: 960px) {\n .will-filter-bar-close-button {\n top: 10px;\n right: 10px;\n\n border-radius: 25px;\n margin-left:0;\n \n display: flex;\n justify-content: center;\n }\n}\n\n.will-filter-bar-submit-button {\n width: auto;\n height: auto;\n padding: 10px 20px;\n border-radius: 20px;\n cursor: pointer;\n border: none;\n white-space: nowrap;\n text-transform: uppercase;\n font-size: 12px;\n display: flex;\n align-items: center;\n user-select: none;\n}\n\n/* Submit button variants */\n.will-filter-bar-submit-button.default {\n background-color: var(--will-primary);\n color: var(--will-white);\n}\n\n.will-filter-bar-submit-button.text {\n background-color: transparent;\n color: var(--will-black);\n text-decoration: underline;\n font-weight: 500;\n font-size: 15px;\n padding: 0 10px;\n}\n\n.will-filter-bar-submit-button span {\n margin-right: 10px;\n display: flex;\n}\n\nbutton.will-filter-bar-submit-button:disabled {\n opacity: 0.5;\n cursor: not-allowed;\n}\n\n\n@media (max-width: 960px) {\n .will-filter-bar-submit-button {\n justify-content: center;\n \n }\n}\n\n/* --- */\n\n@keyframes spin {\n 0% { transform: rotate(0deg); }\n 100% { transform: rotate(360deg); }\n}\n\n.will-calendar-filter-container {\n display: flex;\n justify-content: center;\n user-select: none;\n}\n\n/* Calendar overrides */\n.will-calendar-filter-container .rdp {\n margin: 0;\n}\n\n.will-calendar-filter-container .DayPicker {\n font-size: 25px;\n}\n\n.will-calendar-filter-container .rdp-month {\n position: relative;\n}\n\n.will-calendar-filter-container .rdp-month.rdp-caption_start {\n padding-left: 70px;\n}\n\n.will-calendar-filter-container .rdp-month.rdp-caption_end {\n padding-right: 70px;\n}\n\n.will-calendar-filter-container .rdp-month .rdp-nav {\n border: 1px solid var(--will-primary);\n border-radius: 50%;\n}\n\n.will-calendar-filter-container .rdp-month .rdp-nav svg {\n color: var(--will-primary);\n}\n\n.will-calendar-filter-container .rdp-month .rdp-caption {\n position: initial;\n}\n\n.will-calendar-filter-container .rdp-month .rdp-caption > .rdp-caption_label,\n.will-calendar-filter-container .rdp-table .rdp-head {\n opacity: 0.6;\n}\n\n.will-calendar-filter-container .rdp-table {\n border-collapse: separate;\n border-spacing: 0px 2px;\n}\n\n.will-calendar-filter-container\n .rdp-button_reset.rdp-button.rdp-day.rdp-day_selected {\n background-color: var(--will-primary);\n opacity: 1;\n color: var(--will-white);\n}\n\n.will-calendar-filter-container .my-today:not(.rdp-day_selected) {\n font-weight: 700;\n opacity: 1;\n color: var(--will-primary);\n}\n\n.will-calendar-filter-container .rdp-cell {\n position: relative;\n}\n\n.will-calendar-filter-container .rdp-cell button {\n font-weight: 500;\n}\n\n.will-calendar-filter-container .rdp-cell button.booked {\n font-weight: 400;\n cursor: not-allowed;\n}\n\n.will-calendar-filter-container .rdp-cell .rdp-button[disabled] {\n color: var(--will-transparent-black);\n opacity: 1;\n}\n\n@media (max-width: 960px) {\n .will-calendar-filter-container .rdp-month .rdp-nav {\n border: none;\n border-radius: initial;\n }\n\n .will-calendar-filter-container .rdp-month.rdp-caption_start {\n padding-left: 10px;\n }\n\n .will-calendar-filter-container .rdp-month.rdp-caption_end {\n padding-right: 10px;\n }\n}\n\n/* Tooltips */\n.will-root .will-calendar-filter-container .will-calendar-tooltip,\n.will-root .will-calendar-filter-container .will-calendar-tooltip-check-out,\n.will-root\n .will-calendar-filter-container\n .will-calendar-tooltip-overlapping-date,\n.will-root\n .will-calendar-filter-container\n .will-calendar-tooltip-check-out-only,\n.will-root\n .will-calendar-filter-container\n .will-calendar-tooltip-check-in-only {\n position: absolute;\n top: -42px;\n transform: translateX(calc(-50% + 20px));\n display: none;\n white-space: nowrap;\n z-index: 2;\n}\n\n.will-root .will-calendar-filter-container .will-calendar-tooltip > div,\n.will-root\n .will-calendar-filter-container\n .will-calendar-tooltip-check-out\n > div,\n.will-root\n .will-calendar-filter-container\n .will-calendar-tooltip-overlapping-date\n > div,\n.will-root\n .will-calendar-filter-container\n .will-calendar-tooltip-check-out-only\n > div,\n.will-root\n .will-calendar-filter-container\n .will-calendar-tooltip-check-in-only\n > div {\n background-color: white;\n position: relative;\n padding: 5px 10px;\n border: 1px solid var(--will-primary);\n border-radius: 5px;\n}\n\n.will-root .will-calendar-filter-container .will-calendar-tooltip::before,\n.will-root\n .will-calendar-filter-container\n .will-calendar-tooltip-check-out::before,\n.will-root\n .will-calendar-filter-container\n .will-calendar-tooltip-overlapping-date::before,\n.will-root\n .will-calendar-filter-container\n .will-calendar-tooltip-check-out-only::before,\n.will-root\n .will-calendar-filter-container\n .will-calendar-tooltip-check-in-only::before {\n content: '';\n width: 10px;\n height: 10px;\n border: 1px solid var(--will-primary);\n position: absolute;\n bottom: -4px;\n left: calc(50% - 5.555px);\n rotate: 45deg;\n z-index: 0;\n background-color: var(--will-white);\n}\n\n.will-root\n .will-calendar-filter-container\n .rdp-cell:hover\n .will-calendar-tooltip,\n.will-root\n .will-calendar-filter-container\n .rdp-cell:hover\n .will-calendar-tooltip-check-out,\n.will-root\n .will-calendar-filter-container\n .rdp-cell:hover\n .will-calendar-tooltip-overlapping-date,\n.will-root\n .will-calendar-filter-container\n .rdp-cell:hover\n .will-calendar-tooltip-check-out-only,\n.will-root\n .will-calendar-filter-container\n .rdp-cell:hover\n .will-calendar-tooltip-check-in-only {\n display: block;\n}\n\n/* Loading spinner */\n\n.will-root .will-calendar-filter-container .rdp-months {\n position: relative;\n}\n\n.will-root .will-calendar-filter-container .will-calendar-spinner {\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n background-color: var(--will-white-transparent);\n z-index: 3;\n display: none;\n justify-content: center;\n align-items: center;\n font-weight: 600;\n}\n\n/* No active selection */\n\n.will-root .will-calendar-filter-container .no-active-selection-start,\n.will-root .will-calendar-filter-container .no-active-selection-mid,\n.will-root .will-calendar-filter-container .no-active-selection-end {\n position: initial;\n}\n\n.will-root .will-calendar-filter-container .no-active-selection-start::before,\n.will-root .will-calendar-filter-container .no-active-selection-mid::before,\n.will-root .will-calendar-filter-container .no-active-selection-end::before {\n content: '';\n position: absolute;\n width: 100%;\n height: 100%;\n border: 2px solid var(--will-light-grey);\n box-sizing: border-box;\n}\n\n.will-root .will-calendar-filter-container .no-active-selection-start::before {\n border-right: none;\n border-top-left-radius: 50%;\n border-bottom-left-radius: 50%;\n}\n\n.will-root .will-calendar-filter-container .no-active-selection-mid::before {\n border-right: none;\n border-left: none;\n}\n\n.will-root .will-calendar-filter-container .no-active-selection-end::before {\n border-left: none;\n border-top-right-radius: 50%;\n border-bottom-right-radius: 50%;\n}\n\n.will-root\n .will-calendar-filter-container\n .rdp-day_selected.rdp-day_range_middle.checkout-option {\n background-color: var(--will-primary-lightest);\n color: inherit;\n}\n\n/* Overlapping date */\n\n.will-root .will-calendar-filter-container .overlapping-date {\n user-select: none;\n pointer-events: none;\n}\n\n.will-root .will-calendar-filter-container .overlapping-date:hover {\n cursor: not-allowed;\n}\n\n@media (max-width: 600px) {\n /* Tooltips */\n .will-root .will-calendar-filter-container .will-calendar-tooltip,\n .will-root .will-calendar-filter-container .will-calendar-tooltip-check-out,\n .will-root\n .will-calendar-filter-container\n .will-calendar-tooltip-overlapping-date,\n .will-root\n .will-calendar-filter-container\n .will-calendar-tooltip-check-out-only,\n .will-root\n .will-calendar-filter-container\n .will-calendar-tooltip-check-in-only {\n top: -70px;\n white-space: wrap;\n max-width: 120px;\n }\n}\n\n/* Container for the embed's React tree inside the Shadow DOM.\n Mirrors .will-root sizing so the React tree has a parent that\n resolves percentage widths correctly inside the host's layout. */\n\n.willba-embed-root.is-full-width {\n display: block;\n width: 100%;\n}\n\n@media (max-width: 960px) {\n .willba-embed-root {\n display: block;\n width: 100%;\n }\n}\n\n.rdp {\n --rdp-cell-size: 40px;\n --rdp-caption-font-size: 18px;\n --rdp-accent-color: #0000ff;\n --rdp-background-color: #e7edff;\n --rdp-accent-color-dark: #3003e1;\n --rdp-background-color-dark: #180270;\n --rdp-outline: 2px solid var(--rdp-accent-color); /* Outline border for focused elements */\n --rdp-outline-selected: 3px solid var(--rdp-accent-color); /* Outline border for focused _and_ selected elements */\n\n margin: 1em;\n}\n\n/* Hide elements for devices that are not screen readers */\n.rdp-vhidden {\n box-sizing: border-box;\n padding: 0;\n margin: 0;\n background: transparent;\n border: 0;\n -moz-appearance: none;\n -webkit-appearance: none;\n appearance: none;\n position: absolute !important;\n top: 0;\n width: 1px !important;\n height: 1px !important;\n padding: 0 !important;\n overflow: hidden !important;\n clip: rect(1px, 1px, 1px, 1px) !important;\n border: 0 !important;\n}\n\n/* Buttons */\n.rdp-button_reset {\n appearance: none;\n position: relative;\n margin: 0;\n padding: 0;\n cursor: default;\n color: inherit;\n background: none;\n font: inherit;\n\n -moz-appearance: none;\n -webkit-appearance: none;\n}\n\n.rdp-button_reset:focus-visible {\n /* Make sure to reset outline only when :focus-visible is supported */\n outline: none;\n}\n\n.rdp-button {\n border: 2px solid transparent;\n}\n\n.rdp-button[disabled]:not(.rdp-day_selected) {\n opacity: 0.25;\n}\n\n.rdp-button:not([disabled]) {\n cursor: pointer;\n}\n\n.rdp-button:focus-visible:not([disabled]) {\n color: inherit;\n background-color: var(--rdp-background-color);\n border: var(--rdp-outline);\n}\n\n.rdp-button:hover:not([disabled]):not(.rdp-day_selected) {\n background-color: var(--rdp-background-color);\n}\n\n.rdp-months {\n display: flex;\n}\n\n.rdp-month {\n margin: 0 1em;\n}\n\n.rdp-month:first-child {\n margin-left: 0;\n}\n\n.rdp-month:last-child {\n margin-right: 0;\n}\n\n.rdp-table {\n margin: 0;\n max-width: calc(var(--rdp-cell-size) * 7);\n border-collapse: collapse;\n}\n\n.rdp-with_weeknumber .rdp-table {\n max-width: calc(var(--rdp-cell-size) * 8);\n border-collapse: collapse;\n}\n\n.rdp-caption {\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: 0;\n text-align: left;\n}\n\n.rdp-multiple_months .rdp-caption {\n position: relative;\n display: block;\n text-align: center;\n}\n\n.rdp-caption_dropdowns {\n position: relative;\n display: inline-flex;\n}\n\n.rdp-caption_label {\n position: relative;\n z-index: 1;\n display: inline-flex;\n align-items: center;\n margin: 0;\n padding: 0 0.25em;\n white-space: nowrap;\n color: currentColor;\n border: 0;\n border: 2px solid transparent;\n font-family: inherit;\n font-size: var(--rdp-caption-font-size);\n font-weight: bold;\n}\n\n.rdp-nav {\n white-space: nowrap;\n}\n\n.rdp-multiple_months .rdp-caption_start .rdp-nav {\n position: absolute;\n top: 50%;\n left: 0;\n transform: translateY(-50%);\n}\n\n.rdp-multiple_months .rdp-caption_end .rdp-nav {\n position: absolute;\n top: 50%;\n right: 0;\n transform: translateY(-50%);\n}\n\n.rdp-nav_button {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: var(--rdp-cell-size);\n height: var(--rdp-cell-size);\n padding: 0.25em;\n border-radius: 100%;\n}\n\n/* ---------- */\n/* Dropdowns */\n/* ---------- */\n\n.rdp-dropdown_year,\n.rdp-dropdown_month {\n position: relative;\n display: inline-flex;\n align-items: center;\n}\n\n.rdp-dropdown {\n appearance: none;\n position: absolute;\n z-index: 2;\n top: 0;\n bottom: 0;\n left: 0;\n width: 100%;\n margin: 0;\n padding: 0;\n cursor: inherit;\n opacity: 0;\n border: none;\n background-color: transparent;\n font-family: inherit;\n font-size: inherit;\n line-height: inherit;\n}\n\n.rdp-dropdown[disabled] {\n opacity: unset;\n color: unset;\n}\n\n.rdp-dropdown:focus-visible:not([disabled]) + .rdp-caption_label {\n background-color: var(--rdp-background-color);\n border: var(--rdp-outline);\n border-radius: 6px;\n}\n\n.rdp-dropdown_icon {\n margin: 0 0 0 5px;\n}\n\n.rdp-head {\n border: 0;\n}\n\n.rdp-head_row,\n.rdp-row {\n height: 100%;\n}\n\n.rdp-head_cell {\n vertical-align: middle;\n font-size: 0.75em;\n font-weight: 700;\n text-align: center;\n height: 100%;\n height: var(--rdp-cell-size);\n padding: 0;\n text-transform: uppercase;\n}\n\n.rdp-tbody {\n border: 0;\n}\n\n.rdp-tfoot {\n margin: 0.5em;\n}\n\n.rdp-cell {\n width: var(--rdp-cell-size);\n height: 100%;\n height: var(--rdp-cell-size);\n padding: 0;\n text-align: center;\n}\n\n.rdp-weeknumber {\n font-size: 0.75em;\n}\n\n.rdp-weeknumber,\n.rdp-day {\n display: flex;\n overflow: hidden;\n align-items: center;\n justify-content: center;\n box-sizing: border-box;\n width: var(--rdp-cell-size);\n max-width: var(--rdp-cell-size);\n height: var(--rdp-cell-size);\n margin: 0;\n border: 2px solid transparent;\n border-radius: 100%;\n}\n\n.rdp-day_today:not(.rdp-day_outside) {\n font-weight: bold;\n}\n\n.rdp-day_selected,\n.rdp-day_selected:focus-visible,\n.rdp-day_selected:hover {\n color: white;\n opacity: 1;\n background-color: var(--rdp-accent-color);\n}\n\n.rdp-day_outside {\n opacity: 0.5;\n}\n\n.rdp-day_selected:focus-visible {\n /* Since the background is the same use again the outline */\n outline: var(--rdp-outline);\n outline-offset: 2px;\n z-index: 1;\n}\n\n.rdp:not([dir='rtl']) .rdp-day_range_start:not(.rdp-day_range_end) {\n border-top-right-radius: 0;\n border-bottom-right-radius: 0;\n}\n\n.rdp:not([dir='rtl']) .rdp-day_range_end:not(.rdp-day_range_start) {\n border-top-left-radius: 0;\n border-bottom-left-radius: 0;\n}\n\n.rdp[dir='rtl'] .rdp-day_range_start:not(.rdp-day_range_end) {\n border-top-left-radius: 0;\n border-bottom-left-radius: 0;\n}\n\n.rdp[dir='rtl'] .rdp-day_range_end:not(.rdp-day_range_start) {\n border-top-right-radius: 0;\n border-bottom-right-radius: 0;\n}\n\n.rdp-day_range_end.rdp-day_range_start {\n border-radius: 100%;\n}\n\n.rdp-day_range_middle {\n border-radius: 0;\n}\n\n/*# sourceMappingURL=style.css.map */";const Ra="willba-embed-fonts",ja="willba-filter-bar";let za=null;const Fa="undefined"!=typeof Document&&"adoptedStyleSheets"in Document.prototype,Ia=new WeakMap;class Aa extends HTMLElement{connectedCallback(){(e=>{if(Ia.has(e))return;if(Ua(),!e.shadowRoot){const t=e.attachShadow({mode:"open"});Wa(t);const n=document.createElement("div");n.className="willba-embed-root",e.hasAttribute("full-width")&&n.classList.add("is-full-width"),t.appendChild(n)}const t=e.shadowRoot.querySelector(".willba-embed-root");Ia.set(e,k.createRoot(t));const n=e.getAttribute("domain");n&&Ha(e,n)})(this)}disconnectedCallback(){(e=>{const t=Ia.get(e);t&&(t.unmount(),Ia.delete(e))})(this)}}const $a=e=>{const t=Object.assign(document.createElement("link"),e);document.head.appendChild(t)},Ua=()=>{"undefined"!=typeof document&&(document.getElementById(Ra)||($a({rel:"preconnect",href:"https://fonts.googleapis.com"}),$a({rel:"preconnect",href:"https://fonts.gstatic.com",crossOrigin:""}),$a({id:Ra,rel:"stylesheet",href:"https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400;500;600;700&display=swap"})))},Wa=e=>{const t=(()=>{if(!Fa)return null;if(za)return za;try{return za=new CSSStyleSheet,za.replaceSync(Ta),za}catch(e){return null}})();if(t)return void(e.adoptedStyleSheets=[t]);const n=document.createElement("style");n.textContent=Ta,e.appendChild(n)},Ha=async(e,t)=>{try{const n=(e=>e.startsWith("localhost")||e.startsWith("127.")||e.startsWith("0.0.0.0"))(t)?"http":"https",r=("undefined"!=typeof navigator&&navigator.language||"fi").split("-")[0],a=`${n}://${t}/api/services/filter-bar-config?locale=${r}`,o=await fetch(a,{headers:{Accept:"application/json"},signal:AbortSignal.timeout(1e4)});if(!o.ok)return;const i=await o.json(),l=null==i?void 0:i.filterBarConfig;if(!l)return;const s=e.getAttribute("mode"),u="dark"===s||"light"===s?{mode:s}:{},c=e.hasAttribute("full-width")?{fullWidth:!0}:{},d=Ia.get(e);if(!d)return;((e,t)=>{e.render(p.createElement(La,Object.assign({},t)))})(d,Object.assign(Object.assign(Object.assign(Object.assign({},l),{language:r,redirectUrl:`${n}://${t}`}),u),c))}catch(e){console.error(`[${ja}] Failed to load config:`,e)}};"undefined"==typeof customElements||customElements.get(ja)||customElements.define(ja,Aa);
74
74
  //# sourceMappingURL=embed.esm.js.map