@calcom/atoms 1.0.16 → 1.0.17
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/dist/{AddressInput-cIDIXZR5.js → AddressInput-2mgl0lyR.js} +1 -1
- package/dist/{AlbyPriceComponent-uF9-LcAK.js → AlbyPriceComponent-pvsGnCwS.js} +1 -1
- package/dist/{Card-Qu35sWa4.js → Card-zRo4OuhG.js} +1 -1
- package/dist/{DatePicker-N4quiwfu.js → DatePicker-cCCY0o_q.js} +1 -1
- package/dist/{PhoneInput-sA8pk7KE.js → PhoneInput-OwM4ptIW.js} +2 -2
- package/dist/{PoweredBy-JBDcogLe.js → PoweredBy-l6TxbHkw.js} +1 -1
- package/dist/{UnpublishedEntity-biq4bJFm.js → UnpublishedEntity-xCb8jM6g.js} +1 -1
- package/dist/booker/BookerPlatformWrapper.d.ts +0 -22
- package/dist/booker/BookerPlatformWrapper.d.ts.map +1 -1
- package/dist/cal-atoms.js +1 -1
- package/dist/cal-atoms.umd.cjs +2 -2
- package/dist/{framer-features-lnvDtjtt.js → framer-features-AEF3NKfo.js} +1 -1
- package/dist/{index-B0A1-P95.js → index-0NLe4Yyc.js} +3 -3
- package/dist/{index-cMxclDv0.js → index-HLaWGAF2.js} +1 -1
- package/dist/index-J7apBMlg.js +4 -0
- package/dist/{index-Pu1Uo6ng.js → index-LugnGhAc.js} +2 -2
- package/dist/{index-6BNdKZsX.js → index-RvYZ-ROA.js} +24 -23
- package/dist/{index-80GbUG65.js → index-rvhB8hBr.js} +2 -2
- package/dist/{isSupportedCountry-VDos3uQZ.js → isSupportedCountry-PzuVRP6F.js} +1 -1
- package/package.json +1 -1
- package/dist/index-84ezy2f4.js +0 -4
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { aL as ee, aM as F, aN as re, aq as K, a6 as ne, ar as te, aO as oe } from "./index-
|
|
1
|
+
import { aL as ee, aM as F, aN as re, aq as K, a6 as ne, ar as te, aO as oe } from "./index-RvYZ-ROA.js";
|
|
2
2
|
import J from "react";
|
|
3
3
|
var ie = { exports: {} }, D = { exports: {} };
|
|
4
4
|
const ae = {}, se = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { as as N, ar as d, aC as m, aq as r, h as u, aD as p } from "./index-
|
|
1
|
+
import { as as N, ar as d, aC as m, aq as r, h as u, aD as p } from "./index-RvYZ-ROA.js";
|
|
2
2
|
const c = p("", {
|
|
3
3
|
// Variants won't have any style by default. Style will only be applied if the variants are combined.
|
|
4
4
|
// So, style is defined in compoundVariants.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import Lt, { useState as Rt, useEffect as zt } from "react";
|
|
2
|
-
import { aK as Bt, aq as Gt, aC as $t, aJ as Vt } from "./index-
|
|
3
|
-
import { i as Kt } from "./isSupportedCountry-
|
|
2
|
+
import { aK as Bt, aq as Gt, aC as $t, aJ as Vt } from "./index-RvYZ-ROA.js";
|
|
3
|
+
import { i as Kt } from "./isSupportedCountry-PzuVRP6F.js";
|
|
4
4
|
var qt = function(Z) {
|
|
5
5
|
var Q = {};
|
|
6
6
|
function l(u) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { an as r, ao as d, ap as m, aq as a, ar as e, as as x, at as h, au as t, av as i } from "./index-
|
|
1
|
+
import { an as r, ao as d, ap as m, aq as a, ar as e, as as x, at as h, au as t, av as i } from "./index-RvYZ-ROA.js";
|
|
2
2
|
const u = ({
|
|
3
3
|
logoOnly: l
|
|
4
4
|
}) => {
|
|
@@ -1,28 +1,6 @@
|
|
|
1
1
|
import type { BookerProps } from "@calcom/features/bookings/Booker";
|
|
2
2
|
import type { BookingResponse } from "@calcom/platform-libraries";
|
|
3
3
|
import type { ApiErrorResponse, ApiSuccessResponse, ApiSuccessResponseWithoutData } from "@calcom/platform-types";
|
|
4
|
-
export type CustomClassNames = {
|
|
5
|
-
bookerContainer?: string;
|
|
6
|
-
eventMetaCustomClassname?: {
|
|
7
|
-
eventMetaContainer?: string;
|
|
8
|
-
eventMetaTitle?: string;
|
|
9
|
-
eventMetaTimezoneSelect?: string;
|
|
10
|
-
};
|
|
11
|
-
datePickerCustomClassname?: {
|
|
12
|
-
datePickerContainer?: string;
|
|
13
|
-
datePickerTitle?: string;
|
|
14
|
-
datePickerDays?: string;
|
|
15
|
-
datePickerDate?: string;
|
|
16
|
-
datePickerDatesActive?: string;
|
|
17
|
-
datePickerToggle?: string;
|
|
18
|
-
};
|
|
19
|
-
availableTimeSlotsCustomClassname?: {
|
|
20
|
-
availableTimeSlotsContainer?: string;
|
|
21
|
-
availableTimeSlotsTitle?: string;
|
|
22
|
-
availableTimeSlotsTimeFormatToggle?: string;
|
|
23
|
-
availableTimes?: string;
|
|
24
|
-
};
|
|
25
|
-
};
|
|
26
4
|
type BookerPlatformWrapperAtomProps = Omit<BookerProps, "entity"> & {
|
|
27
5
|
rescheduleUid?: string;
|
|
28
6
|
bookingUid?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BookerPlatformWrapper.d.ts","sourceRoot":"","sources":["../../booker/BookerPlatformWrapper.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kCAAkC,CAAC;AAWpE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAClE,OAAO,KAAK,EACV,gBAAgB,EAChB,kBAAkB,EAClB,6BAA6B,EAC9B,MAAM,wBAAwB,CAAC;AAgBhC,
|
|
1
|
+
{"version":3,"file":"BookerPlatformWrapper.d.ts","sourceRoot":"","sources":["../../booker/BookerPlatformWrapper.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kCAAkC,CAAC;AAWpE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAClE,OAAO,KAAK,EACV,gBAAgB,EAChB,kBAAkB,EAClB,6BAA6B,EAC9B,MAAM,wBAAwB,CAAC;AAgBhC,KAAK,8BAA8B,GAAG,IAAI,CAAC,WAAW,EAAE,QAAQ,CAAC,GAAG;IAClE,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,sBAAsB,CAAC,EAAE,CAAC,IAAI,EAAE,kBAAkB,CAAC,eAAe,CAAC,KAAK,IAAI,CAAC;IAC7E,oBAAoB,CAAC,EAAE,CAAC,IAAI,EAAE,gBAAgB,GAAG,KAAK,KAAK,IAAI,CAAC;IAChE,+BAA+B,CAAC,EAAE,CAAC,IAAI,EAAE,kBAAkB,CAAC,eAAe,EAAE,CAAC,KAAK,IAAI,CAAC;IACxF,6BAA6B,CAAC,EAAE,CAAC,IAAI,EAAE,gBAAgB,GAAG,KAAK,KAAK,IAAI,CAAC;IACzE,6BAA6B,CAAC,EAAE,CAAC,IAAI,EAAE,kBAAkB,CAAC,eAAe,CAAC,KAAK,IAAI,CAAC;IACpF,2BAA2B,CAAC,EAAE,CAAC,IAAI,EAAE,gBAAgB,GAAG,KAAK,KAAK,IAAI,CAAC;IACvE,oBAAoB,CAAC,EAAE,CAAC,IAAI,EAAE,kBAAkB,CAAC,MAAM,CAAC,KAAK,IAAI,CAAC;IAClE,kBAAkB,CAAC,EAAE,CAAC,IAAI,EAAE,gBAAgB,KAAK,IAAI,CAAC;IACtD,mBAAmB,CAAC,EAAE,CAAC,IAAI,EAAE,6BAA6B,KAAK,IAAI,CAAC;IACpE,iBAAiB,CAAC,EAAE,CAAC,IAAI,EAAE,gBAAgB,KAAK,IAAI,CAAC;CACtD,CAAC;AAEF,eAAO,MAAM,qBAAqB,UAAW,8BAA8B,gBAsQ1E,CAAC"}
|
package/dist/cal-atoms.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { b1 as a, b2 as o, a$ as t, b0 as b, b4 as n, b8 as i, b5 as u, b6 as l, b9 as r, ba as C, b7 as c, b3 as B } from "./index-
|
|
1
|
+
import { b1 as a, b2 as o, a$ as t, b0 as b, b4 as n, b8 as i, b5 as u, b6 as l, b9 as r, ba as C, b7 as c, b3 as B } from "./index-RvYZ-ROA.js";
|
|
2
2
|
export {
|
|
3
3
|
a as AvailabilitySettings,
|
|
4
4
|
o as Booker,
|
package/dist/cal-atoms.umd.cjs
CHANGED
|
@@ -184,7 +184,7 @@ error stack:
|
|
|
184
184
|
`),r=0;r<n.length;){var a=n[r]=n[r].replace(/\s+$/g,"");a?r>0&&a[0]===" "?(n[r-1]+=a.slice(1),n.splice(r,1)):r+=1:n.splice(r,1)}return n}function vde(e){e.forEach(function(t){if(!/(VALUE=DATE(-TIME)?)|(TZID=)/.test(t))throw new Error("unsupported RDATE/EXDATE parm: "+t)})}function qD(e,t){return vde(t),e.split(",").map(function(n){return Yn.untilStringToDate(n)})}function ZD(e){var t=this;return function(n){if(n!==void 0&&(t["_".concat(e)]=n),t["_".concat(e)]!==void 0)return t["_".concat(e)];for(var r=0;r<t._rrule.length;r++){var a=t._rrule[r].origOptions[e];if(a)return a}}}var _de=function(e){o6(t,e);function t(n){n===void 0&&(n=!1);var r=e.call(this,{},n)||this;return r.dtstart=ZD.apply(r,["dtstart"]),r.tzid=ZD.apply(r,["tzid"]),r._rrule=[],r._rdate=[],r._exrule=[],r._exdate=[],r}return t.prototype._iter=function(n){return dde(n,this._rrule,this._exrule,this._rdate,this._exdate,this.tzid())},t.prototype.rrule=function(n){YD(n,this._rrule)},t.prototype.exrule=function(n){YD(n,this._exrule)},t.prototype.rdate=function(n){XD(n,this._rdate)},t.prototype.exdate=function(n){XD(n,this._exdate)},t.prototype.rrules=function(){return this._rrule.map(function(n){return WD(n.toString())})},t.prototype.exrules=function(){return this._exrule.map(function(n){return WD(n.toString())})},t.prototype.rdates=function(){return this._rdate.map(function(n){return new Date(n.getTime())})},t.prototype.exdates=function(){return this._exdate.map(function(n){return new Date(n.getTime())})},t.prototype.valueOf=function(){var n=[];return!this._rrule.length&&this._dtstart&&(n=n.concat(c6({dtstart:this._dtstart}))),this._rrule.forEach(function(r){n=n.concat(r.toString().split(`
|
|
185
185
|
`))}),this._exrule.forEach(function(r){n=n.concat(r.toString().split(`
|
|
186
186
|
`).map(function(a){return a.replace(/^RRULE:/,"EXRULE:")}).filter(function(a){return!/^DTSTART/.test(a)}))}),this._rdate.length&&n.push(JD("RDATE",this._rdate,this.tzid())),this._exdate.length&&n.push(JD("EXDATE",this._exdate,this.tzid())),n},t.prototype.toString=function(){return this.valueOf().join(`
|
|
187
|
-
`)},t.prototype.clone=function(){var n=new t(!!this._cache);return this._rrule.forEach(function(r){return n.rrule(r.clone())}),this._exrule.forEach(function(r){return n.exrule(r.clone())}),this._rdate.forEach(function(r){return n.rdate(new Date(r.getTime()))}),this._exdate.forEach(function(r){return n.exdate(new Date(r.getTime()))}),n},t}(pn);function YD(e,t){if(!(e instanceof pn))throw new TypeError(String(e)+" is not RRule instance");Rr(t.map(String),String(e))||t.push(e)}function XD(e,t){if(!(e instanceof Date))throw new TypeError(String(e)+" is not Date instance");Rr(t.map(Number),Number(e))||(t.push(e),Yn.sort(t))}function JD(e,t,n){var r=!n||n.toUpperCase()==="UTC",a=r?"".concat(e,":"):"".concat(e,";TZID=").concat(n,":"),o=t.map(function(i){return Yn.timeToUntilString(i.valueOf(),r)}).join(",");return"".concat(a).concat(o)}const ti={getItem(e){try{return window.localStorage.getItem(e)}catch{return null}},setItem(e,t){try{window.localStorage.setItem(e,t)}catch{return}},removeItem:e=>{try{window.localStorage.removeItem(e)}catch{return}}},KD="timeOption.is24hClock";var Vh=(e=>(e.TWELVE_HOUR="h:mma",e.TWENTY_FOUR_HOUR="HH:mm",e))(Vh||{});const d6=e=>ti.setItem(KD,e.toString()),bde=()=>{const e=ti.getItem(KD);return e===null?null:e==="true"},QD=(()=>{const e=bde();return e===!0?!0:e===!1?!1:new Intl.DateTimeFormat(void 0,{hour:"numeric"}).format(0).match(/M/i)?(d6(!1),!1):(d6(!0),!0)})()?"HH:mm":"h:mma",kde=/^(.*)([+-])(\d{2}):(\d{2})|(Z)$/;function wde(e,t,n,r){if(typeof e!="string")return Xe(e,t,n,r);const a=e.match(kde);if(a===null)return;if(a[0]==="Z")return Xe(e,{utc:!0,...typeof t=="string"?{format:t}:{...t}},n,r);const[,o,i,s,c]=a,l=parseInt(s)*60+parseInt(c,10),u=i==="+"?l:-l;return Xe(o,{$offset:u,...typeof t=="string"?{format:t}:{...t}},n,r)}const xde=(e,t,n,r)=>{const a=wde(e);return a!=null&&a.isValid()?`${a==null?void 0:a.format(r!=null&&r.withDefaultTimeFormat?Vh.TWELVE_HOUR:(r==null?void 0:r.selectedTimeFormat)||QD)}, ${Xe(e).toDate().toLocaleString(t,{dateStyle:"full",timeZone:n})}`:"Invalid date"},eR=({startDate:e,timeZone:t,recurringEvent:n,recurringCount:r,selectedTimeFormat:a,withDefaultTimeFormat:o},i)=>{const{count:s,...c}=n||{},l=new pn({...c,count:r,dtstart:new Date(Xe(e).valueOf())}),u=Xe(e).utcOffset(),d=l.all().map(m=>Xe.utc(m).add(u-Xe(m).utcOffset(),"minute"));return[d.map(m=>xde(m.tz(t),i,t,{selectedTimeFormat:a,withDefaultTimeFormat:o})),d.map(m=>m.toDate())]},Cde=({t:e,recurringEvent:t})=>t.interval&&t.freq?e("every_for_freq",{freq:`${t.interval>1?t.interval:""} ${e(Gx[t.freq].toString().toLowerCase(),{count:t.interval})}`}):"",tR="timeOption.preferredTimeZone",Si=n_(e=>({timeFormat:QD,setTimeFormat:t=>{d6(t===Vh.TWENTY_FOUR_HOUR),e({timeFormat:t})},timezone:ti.getItem(tR)||Xe.tz.guess()||"Europe/London",setTimezone:t=>{ti.setItem(tR,t),e({timezone:t})}}));var E_,Sde=new Uint8Array(16);function Mde(){if(!E_&&(E_=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto<"u"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),!E_))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return E_(Sde)}const Ade=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function Ede(e){return typeof e=="string"&&Ade.test(e)}for(var wo=[],f6=0;f6<256;++f6)wo.push((f6+256).toString(16).substr(1));function Ide(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=(wo[e[t+0]]+wo[e[t+1]]+wo[e[t+2]]+wo[e[t+3]]+"-"+wo[e[t+4]]+wo[e[t+5]]+"-"+wo[e[t+6]]+wo[e[t+7]]+"-"+wo[e[t+8]]+wo[e[t+9]]+"-"+wo[e[t+10]]+wo[e[t+11]]+wo[e[t+12]]+wo[e[t+13]]+wo[e[t+14]]+wo[e[t+15]]).toLowerCase();if(!Ede(n))throw TypeError("Stringified UUID is invalid");return n}function Tde(e,t,n){e=e||{};var r=e.random||(e.rng||Mde)();if(r[6]=r[6]&15|64,r[8]=r[8]&63|128,t){n=n||0;for(var a=0;a<16;++a)t[n+a]=r[a];return t}return Ide(r)}const h6=({values:e,event:t,date:n,duration:r,timeZone:a,language:o,rescheduleUid:i,username:s,metadata:c,bookingUid:l,seatReferenceUid:u,hashedLink:d})=>({...e,user:s,start:Xe(n).format(),end:Xe(n).add(r||t.length,"minute").format(),eventTypeId:t.id,eventTypeSlug:t.slug,timeZone:a,language:o,rescheduleUid:i,metadata:c||{},hasHashedBookingLink:!!d,bookingUid:l,seatReferenceUid:u,hashedLink:d}),$de=(e,t)=>{const n=Tde(),[,r]=eR({startDate:e.date,timeZone:e.timeZone,recurringEvent:e.event.recurringEvent,recurringCount:t,withDefaultTimeFormat:!0},e.language),a=h6({...e,bookingUid:void 0});return r.map(o=>({...a,start:Xe(o).format(),end:Xe(o).add(e.duration||e.event.length,"minute").format(),recurringEventId:n,schedulingType:e.event.schedulingType||void 0,recurringCount:r.length}))},Pde=({event:e})=>{var v;const t=((v=e.recurringEvent)==null?void 0:v.count)||null,{t:n,i18n:r}=At(),[a,o,i,s]=Ot(g=>[g.setRecurringEventCount,g.recurringEventCount,g.setOccurenceCount,g.occurenceCount]),c=Ot(g=>g.selectedTimeslot),l=Ot(g=>g.state),{timezone:u,timeFormat:d}=Si(),[h,m]=w.useState(!1);if(w.useEffect(()=>{var g;(g=e.recurringEvent)!=null&&g.count&&(i(s||e.recurringEvent.count),a(o||e.recurringEvent.count),s&&(s>e.recurringEvent.count||s<1)&&m(!0))},[a,e.recurringEvent,o,i,s]),!e.recurringEvent)return null;if(l==="booking"&&o&&c){const[g]=eR({startDate:c,timeZone:u,recurringEvent:e.recurringEvent,recurringCount:o,selectedTimeFormat:d},r.language);return ue("div",{"data-testid":"recurring-dates",children:[g.slice(0,5).map((_,k)=>b("p",{children:_},k)),g.length>5&&b(Ta,{content:g.slice(5).map((_,k)=>b("p",{children:_},k)),children:ue("p",{className:" text-sm",children:["+ ",n("plus_more",{count:g.length-5})]})})]})}return ue(vt,{children:[Cde({t:n,recurringEvent:e.recurringEvent}),b("br",{}),b(Ii,{className:"my-1 mr-3 inline-flex h-[26px] w-[46px] px-1 py-0",type:"number",min:"1",max:e.recurringEvent.count,defaultValue:s||e.recurringEvent.count,"data-testid":"occurrence-input",onChange:g=>{const _=/^(?=.*[0-9])\S+$/,k=parseInt(g.target.value);i(k),!_.test(g.target.value)||k<1||t&&k>t?(m(!0),a(t)):(m(!1),a(k))}}),n("occurrence",{count:o||e.recurringEvent.count}),h&&b("div",{className:"-ml-4 mr-4 mt-2 flex",children:b(kf,{severity:"warning",title:n("enter_number_between_range",{maxOccurences:t})})})]})},Ode=["BIF","CLP","DJF","GNF","JPY","KMF","KRW","MGA","PYG","RWF","UGX","VND","VUV","XAF","XOF","XPF"],Nde=(e,t)=>Ode.includes(t.toUpperCase())?e:e/100,Dde=(e,t,n="en")=>{switch(t){case"BTC":return`${e} sats`;default:return t=(t==null?void 0:t.toUpperCase())||"USD",`${Intl.NumberFormat(n,{style:"currency",currency:t}).format(Nde(e,t))}`}},Rde=Su(()=>Promise.resolve().then(()=>hYe).then(e=>e.AlbyPriceComponent),{ssr:!1}),Lde=({price:e,currency:t,displayAlternateSymbol:n=!0})=>{if(e===0)return null;const r=Dde(e,t);return t!=="BTC"?b(vt,{children:r}):b(Rde,{displaySymbol:n,price:e,formattedPrice:r})},Fde=[Sc.REQUIRES_CONFIRMATION,Sc.DURATION,Sc.OCCURENCES,Sc.LOCATION,Sc.PRICE],Cl=({customIcon:e,icon:t,iconUrl:n,children:r,highlight:a,contentClassName:o,className:i,isDark:s})=>w.Children.count(r)?ue("div",{className:Fe("flex items-start justify-start text-sm",a?"text-emphasis":"text-text",i),children:[n?b("img",{src:n,alt:"",className:Fe("mr-2 mt-[2px] h-4 w-4 flex-shrink-0",s===void 0&&"[filter:invert(0.5)_brightness(0.5)]",(s===void 0||s)&&"dark:[filter:invert(0.65)_brightness(0.9)]")}):b(vt,{children:e||!!t&&b(Mt,{name:t,className:"relative z-20 mr-2 mt-[2px] h-4 w-4 flex-shrink-0 rtl:ml-2"})}),b("div",{className:Fe("relative z-10 max-w-full break-words",o),children:r})]}):null,jde=({event:e,blocks:t=Fde})=>{const{t:n}=At(),r=Ot(o=>o.rescheduleUid),a=Ot(o=>o.isInstantMeeting);return b(vt,{children:t.map(o=>{var i;if(typeof o=="function")return b(w.Fragment,{children:o(e)},o.name);switch(o){case Sc.DURATION:return b(Cl,{icon:"clock",children:b(Sue,{event:e})},o);case Sc.LOCATION:return!((i=e==null?void 0:e.locations)!=null&&i.length)||a?null:b(Cl,{children:b(Cue,{locations:e.locations})},o);case Sc.REQUIRES_CONFIRMATION:return e.requiresConfirmation?b(Cl,{icon:"square-check",children:n("requires_confirmation")},o):null;case Sc.OCCURENCES:return!e.recurringEvent||r?null:b(Cl,{icon:"refresh-ccw",children:b(Pde,{event:e})},o);case Sc.PRICE:const s=OD(e);return e.price<=0||s.price<=0?null:b(Cl,{customIcon:b(_ue,{currency:e.currency}),children:b(Lde,{price:s.price,currency:e.currency,displayAlternateSymbol:!1})},o)}})})},Bde=({children:e,as:t,className:n})=>b(t||"h1",{"data-testid":"event-title",className:Fe("text-text text-xl font-semibold",n),children:e}),Vde=()=>ue("div",{className:"flex flex-col",children:[b(Jn,{className:"h-6 w-6 rounded-full"}),b(Jn,{className:"mt-2 h-5 w-32"}),b(Jn,{className:"mt-2 h-8 w-48"}),b("div",{className:"mt-8",children:Array.from({length:4}).map((e,t)=>ue("div",{className:"mb-2 flex flex-row items-center",children:[b(Jn,{className:"mr-3 h-5 w-5 rounded-full"}),b(Jn,{className:Fe("h-6",t>1?"w-24":"w-32")})]},t))})]}),zde=({schedulingType:e,users:t,profile:n,entity:r})=>{const a=Vu(),i=e!==Iy.ROUND_ROBIN&&!a?t:[],s=n.name&&e===Iy.ROUND_ROBIN||!t.length||n.name!==t[0].name&&e===Iy.COLLECTIVE;return ue(vt,{children:[r.orgSlug?b(S9,{size:"sm",className:"border-muted",organization:{slug:r.orgSlug,name:r.name||""},users:i}):b(ej,{size:"sm",className:"border-muted",users:i}),b("p",{className:"text-subtle mt-2 text-sm font-semibold",children:s?n.name:i.map(c=>c.name).filter(c=>c).join(", ")})]})};function Bs(e){var t;return((t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Ac(e){return Bs(e).getComputedStyle(e)}function nR(e){return e instanceof Bs(e).Node}function of(e){return nR(e)?(e.nodeName||"").toLowerCase():""}function Ec(e){return e instanceof Bs(e).HTMLElement}function rs(e){return e instanceof Bs(e).Element}function rR(e){return typeof ShadowRoot>"u"?!1:e instanceof Bs(e).ShadowRoot||e instanceof ShadowRoot}function Py(e){const{overflow:t,overflowX:n,overflowY:r,display:a}=Ac(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(a)}function Hde(e){return["table","td","th"].includes(of(e))}function p6(e){const t=m6(),n=Ac(e);return n.transform!=="none"||n.perspective!=="none"||!t&&!!n.backdropFilter&&n.backdropFilter!=="none"||!t&&!!n.filter&&n.filter!=="none"||["transform","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function m6(){return!(typeof CSS>"u"||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function I_(e){return["html","body","#document"].includes(of(e))}const aR=Math.min,Oy=Math.max,T_=Math.round;function oR(e){const t=Ac(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const a=Ec(e),o=a?e.offsetWidth:n,i=a?e.offsetHeight:r,s=T_(n)!==o||T_(r)!==i;return s&&(n=o,r=i),{width:n,height:r,fallback:s}}function iR(e){return rs(e)?e:e.contextElement}const sR={x:1,y:1};function Y1(e){const t=iR(e);if(!Ec(t))return sR;const n=t.getBoundingClientRect(),{width:r,height:a,fallback:o}=oR(t);let i=(o?T_(n.width):n.width)/r,s=(o?T_(n.height):n.height)/a;return i&&Number.isFinite(i)||(i=1),s&&Number.isFinite(s)||(s=1),{x:i,y:s}}const cR={x:0,y:0};function lR(e,t,n){var r,a;if(t===void 0&&(t=!0),!m6())return cR;const o=e?Bs(e):window;return!n||t&&n!==o?cR:{x:((r=o.visualViewport)==null?void 0:r.offsetLeft)||0,y:((a=o.visualViewport)==null?void 0:a.offsetTop)||0}}function zh(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const a=e.getBoundingClientRect(),o=iR(e);let i=sR;t&&(r?rs(r)&&(i=Y1(r)):i=Y1(e));const s=lR(o,n,r);let c=(a.left+s.x)/i.x,l=(a.top+s.y)/i.y,u=a.width/i.x,d=a.height/i.y;if(o){const h=Bs(o),m=r&&rs(r)?Bs(r):r;let v=h.frameElement;for(;v&&r&&m!==h;){const g=Y1(v),_=v.getBoundingClientRect(),k=getComputedStyle(v);_.x+=(v.clientLeft+parseFloat(k.paddingLeft))*g.x,_.y+=(v.clientTop+parseFloat(k.paddingTop))*g.y,c*=g.x,l*=g.y,u*=g.x,d*=g.y,c+=_.x,l+=_.y,v=Bs(v).frameElement}}return p1({width:u,height:d,x:c,y:l})}function sf(e){return((nR(e)?e.ownerDocument:e.document)||window.document).documentElement}function $_(e){return rs(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function uR(e){return zh(sf(e)).left+$_(e).scrollLeft}function X1(e){if(of(e)==="html")return e;const t=e.assignedSlot||e.parentNode||rR(e)&&e.host||sf(e);return rR(t)?t.host:t}function dR(e){const t=X1(e);return I_(t)?t.ownerDocument.body:Ec(t)&&Py(t)?t:dR(t)}function Ny(e,t){var n;t===void 0&&(t=[]);const r=dR(e),a=r===((n=e.ownerDocument)==null?void 0:n.body),o=Bs(r);return a?t.concat(o,o.visualViewport||[],Py(r)?r:[]):t.concat(r,Ny(r))}function fR(e,t,n){let r;if(t==="viewport")r=function(a,o){const i=Bs(a),s=sf(a),c=i.visualViewport;let l=s.clientWidth,u=s.clientHeight,d=0,h=0;if(c){l=c.width,u=c.height;const m=m6();(!m||m&&o==="fixed")&&(d=c.offsetLeft,h=c.offsetTop)}return{width:l,height:u,x:d,y:h}}(e,n);else if(t==="document")r=function(a){const o=sf(a),i=$_(a),s=a.ownerDocument.body,c=Oy(o.scrollWidth,o.clientWidth,s.scrollWidth,s.clientWidth),l=Oy(o.scrollHeight,o.clientHeight,s.scrollHeight,s.clientHeight);let u=-i.scrollLeft+uR(a);const d=-i.scrollTop;return Ac(s).direction==="rtl"&&(u+=Oy(o.clientWidth,s.clientWidth)-c),{width:c,height:l,x:u,y:d}}(sf(e));else if(rs(t))r=function(a,o){const i=zh(a,!0,o==="fixed"),s=i.top+a.clientTop,c=i.left+a.clientLeft,l=Ec(a)?Y1(a):{x:1,y:1};return{width:a.clientWidth*l.x,height:a.clientHeight*l.y,x:c*l.x,y:s*l.y}}(t,n);else{const a=lR(e);r={...t,x:t.x-a.x,y:t.y-a.y}}return p1(r)}function hR(e,t){const n=X1(e);return!(n===t||!rs(n)||I_(n))&&(Ac(n).position==="fixed"||hR(n,t))}function pR(e,t){return Ec(e)&&Ac(e).position!=="fixed"?t?t(e):e.offsetParent:null}function mR(e,t){const n=Bs(e);if(!Ec(e))return n;let r=pR(e,t);for(;r&&Hde(r)&&Ac(r).position==="static";)r=pR(r,t);return r&&(of(r)==="html"||of(r)==="body"&&Ac(r).position==="static"&&!p6(r))?n:r||function(a){let o=X1(a);for(;Ec(o)&&!I_(o);){if(p6(o))return o;o=X1(o)}return null}(e)||n}function Ude(e,t,n){const r=Ec(t),a=sf(t),o=n==="fixed",i=zh(e,!0,o,t);let s={scrollLeft:0,scrollTop:0};const c={x:0,y:0};if(r||!r&&!o)if((of(t)!=="body"||Py(a))&&(s=$_(t)),Ec(t)){const l=zh(t,!0,o,t);c.x=l.x+t.clientLeft,c.y=l.y+t.clientTop}else a&&(c.x=uR(a));return{x:i.left+s.scrollLeft-c.x,y:i.top+s.scrollTop-c.y,width:i.width,height:i.height}}const Gde={getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:a}=e;const o=n==="clippingAncestors"?function(l,u){const d=u.get(l);if(d)return d;let h=Ny(l).filter(_=>rs(_)&&of(_)!=="body"),m=null;const v=Ac(l).position==="fixed";let g=v?X1(l):l;for(;rs(g)&&!I_(g);){const _=Ac(g),k=p6(g);k||_.position!=="fixed"||(m=null),(v?!k&&!m:!k&&_.position==="static"&&m&&["absolute","fixed"].includes(m.position)||Py(g)&&!k&&hR(l,g))?h=h.filter(x=>x!==g):m=_,g=X1(g)}return u.set(l,h),h}(t,this._c):[].concat(n),i=[...o,r],s=i[0],c=i.reduce((l,u)=>{const d=fR(t,u,a);return l.top=Oy(d.top,l.top),l.right=aR(d.right,l.right),l.bottom=aR(d.bottom,l.bottom),l.left=Oy(d.left,l.left),l},fR(t,s,a));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}},convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{rect:t,offsetParent:n,strategy:r}=e;const a=Ec(n),o=sf(n);if(n===o)return t;let i={scrollLeft:0,scrollTop:0},s={x:1,y:1};const c={x:0,y:0};if((a||!a&&r!=="fixed")&&((of(n)!=="body"||Py(o))&&(i=$_(n)),Ec(n))){const l=zh(n);s=Y1(n),c.x=l.x+n.clientLeft,c.y=l.y+n.clientTop}return{width:t.width*s.x,height:t.height*s.y,x:t.x*s.x-i.scrollLeft*s.x+c.x,y:t.y*s.y-i.scrollTop*s.y+c.y}},isElement:rs,getDimensions:function(e){return oR(e)},getOffsetParent:mR,getDocumentElement:sf,getScale:Y1,async getElementRects(e){let{reference:t,floating:n,strategy:r}=e;const a=this.getOffsetParent||mR,o=this.getDimensions;return{reference:Ude(t,await a(n),r),floating:{x:0,y:0,...await o(n)}}},getClientRects:e=>Array.from(e.getClientRects()),isRTL:e=>Ac(e).direction==="rtl"};function Wde(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:a=!0,ancestorResize:o=!0,elementResize:i=!0,animationFrame:s=!1}=r,c=a||o?[...rs(e)?Ny(e):e.contextElement?Ny(e.contextElement):[],...Ny(t)]:[];c.forEach(h=>{const m=!rs(h)&&h.toString().includes("V");!a||s&&!m||h.addEventListener("scroll",n,{passive:!0}),o&&h.addEventListener("resize",n)});let l,u=null;i&&(u=new ResizeObserver(()=>{n()}),rs(e)&&!s&&u.observe(e),rs(e)||!e.contextElement||s||u.observe(e.contextElement),u.observe(t));let d=s?zh(e):null;return s&&function h(){const m=zh(e);!d||m.x===d.x&&m.y===d.y&&m.width===d.width&&m.height===d.height||n(),d=m,l=requestAnimationFrame(h)}(),n(),()=>{var h;c.forEach(m=>{a&&m.removeEventListener("scroll",n),o&&m.removeEventListener("resize",n)}),(h=u)==null||h.disconnect(),u=null,s&&cancelAnimationFrame(l)}}const qde=(e,t,n)=>{const r=new Map,a={platform:Gde,...n},o={...a.platform,_c:r};return nM(e,t,{...a,platform:o})},Zde=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:a}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?v2({element:r.current,padding:a}).fn(n):{}:r?v2({element:r,padding:a}).fn(n):{}}}};var P_=typeof document<"u"?w.useLayoutEffect:w.useEffect;function O_(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,a;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!=t.length)return!1;for(r=n;r--!==0;)if(!O_(e[r],t[r]))return!1;return!0}if(a=Object.keys(e),n=a.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,a[r]))return!1;for(r=n;r--!==0;){const o=a[r];if(!(o==="_owner"&&e.$$typeof)&&!O_(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function yR(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function gR(e,t){const n=yR(e);return Math.round(t*n)/n}function vR(e){const t=Te.useRef(e);return P_(()=>{t.current=e}),t}function Yde(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:a,elements:{reference:o,floating:i}={},transform:s=!0,whileElementsMounted:c,open:l}=e,[u,d]=Te.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[h,m]=Te.useState(r);O_(h,r)||m(r);const[v,g]=Te.useState(null),[_,k]=Te.useState(null),x=Te.useCallback(K=>{K!=T.current&&(T.current=K,g(K))},[g]),S=Te.useCallback(K=>{K!==$.current&&($.current=K,k(K))},[k]),M=o||v,E=i||_,T=Te.useRef(null),$=Te.useRef(null),D=Te.useRef(u),F=vR(c),G=vR(a),z=Te.useCallback(()=>{if(!T.current||!$.current)return;const K={placement:t,strategy:n,middleware:h};G.current&&(K.platform=G.current),qde(T.current,$.current,K).then(Q=>{const he={...Q,isPositioned:!0};Z.current&&!O_(D.current,he)&&(D.current=he,kS.flushSync(()=>{d(he)}))})},[h,t,n,G]);P_(()=>{l===!1&&D.current.isPositioned&&(D.current.isPositioned=!1,d(K=>({...K,isPositioned:!1})))},[l]);const Z=Te.useRef(!1);P_(()=>(Z.current=!0,()=>{Z.current=!1}),[]),P_(()=>{if(M&&(T.current=M),E&&($.current=E),M&&E){if(F.current)return F.current(M,E,z);z()}},[M,E,z,F]);const H=Te.useMemo(()=>({reference:T,floating:$,setReference:x,setFloating:S}),[x,S]),j=Te.useMemo(()=>({reference:M,floating:E}),[M,E]),Y=Te.useMemo(()=>{const K={position:n,left:0,top:0};if(!j.floating)return K;const Q=gR(j.floating,u.x),he=gR(j.floating,u.y);return s?{...K,transform:"translate("+Q+"px, "+he+"px)",...yR(j.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:Q,top:he}},[n,s,j.floating,u.x,u.y]);return Te.useMemo(()=>({...u,update:z,refs:H,elements:j,floatingStyles:Y}),[u,z,H,j,Y])}const _R="Popper",[bR,kR]=$o(_R),[Xde,wR]=bR(_R),Jde=e=>{const{__scopePopper:t,children:n}=e,[r,a]=w.useState(null);return w.createElement(Xde,{scope:t,anchor:r,onAnchorChange:a},n)},Kde="PopperAnchor",Qde=w.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...a}=e,o=wR(Kde,n),i=w.useRef(null),s=Sr(t,i);return w.useEffect(()=>{o.onAnchorChange((r==null?void 0:r.current)||i.current)}),r?null:w.createElement(Cn.div,rt({},a,{ref:s}))}),xR="PopperContent",[efe,Bzt]=bR(xR),tfe=w.forwardRef((e,t)=>{var n,r,a,o,i,s,c,l;const{__scopePopper:u,side:d="bottom",sideOffset:h=0,align:m="center",alignOffset:v=0,arrowPadding:g=0,avoidCollisions:_=!0,collisionBoundary:k=[],collisionPadding:x=0,sticky:S="partial",hideWhenDetached:M=!1,updatePositionStrategy:E="optimized",onPlaced:T,...$}=e,D=wR(xR,u),[F,G]=w.useState(null),z=Sr(t,re=>G(re)),[Z,H]=w.useState(null),j=A0(Z),Y=(n=j==null?void 0:j.width)!==null&&n!==void 0?n:0,K=(r=j==null?void 0:j.height)!==null&&r!==void 0?r:0,Q=d+(m!=="center"?"-"+m:""),he=typeof x=="number"?x:{top:0,right:0,bottom:0,left:0,...x},ne=Array.isArray(k)?k:[k],le=ne.length>0,ae={padding:he,boundary:ne.filter(nfe),altBoundary:le},{refs:ve,floatingStyles:Oe,placement:pe,isPositioned:te,middlewareData:Ee}=Yde({strategy:"fixed",placement:Q,whileElementsMounted:(...re)=>Wde(...re,{animationFrame:E==="always"}),elements:{reference:D.anchor},middleware:[lM({mainAxis:h+K,alignmentAxis:v}),_&&dM({mainAxis:!0,crossAxis:!1,limiter:S==="partial"?fM():void 0,...ae}),_&&oM({...ae}),hM({...ae,apply:({elements:re,rects:be,availableWidth:we,availableHeight:Ze})=>{const{width:Ve,height:Se}=be.reference,Ie=re.floating.style;Ie.setProperty("--radix-popper-available-width",`${we}px`),Ie.setProperty("--radix-popper-available-height",`${Ze}px`),Ie.setProperty("--radix-popper-anchor-width",`${Ve}px`),Ie.setProperty("--radix-popper-anchor-height",`${Se}px`)}}),Z&&Zde({element:Z,padding:g}),rfe({arrowWidth:Y,arrowHeight:K}),M&&cM({strategy:"referenceHidden",...ae})]}),[Re,Ge]=CR(pe),Ue=za(T);mc(()=>{te&&(Ue==null||Ue())},[te,Ue]);const at=(a=Ee.arrow)===null||a===void 0?void 0:a.x,ct=(o=Ee.arrow)===null||o===void 0?void 0:o.y,et=((i=Ee.arrow)===null||i===void 0?void 0:i.centerOffset)!==0,[wt,lt]=w.useState();return mc(()=>{F&<(window.getComputedStyle(F).zIndex)},[F]),w.createElement("div",{ref:ve.setFloating,"data-radix-popper-content-wrapper":"",style:{...Oe,transform:te?Oe.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:wt,"--radix-popper-transform-origin":[(s=Ee.transformOrigin)===null||s===void 0?void 0:s.x,(c=Ee.transformOrigin)===null||c===void 0?void 0:c.y].join(" ")},dir:e.dir},w.createElement(efe,{scope:u,placedSide:Re,onArrowChange:H,arrowX:at,arrowY:ct,shouldHideArrow:et},w.createElement(Cn.div,rt({"data-side":Re,"data-align":Ge},$,{ref:z,style:{...$.style,animation:te?void 0:"none",opacity:(l=Ee.hide)!==null&&l!==void 0&&l.referenceHidden?0:void 0}}))))});function nfe(e){return e!==null}const rfe=e=>({name:"transformOrigin",options:e,fn(t){var n,r,a,o,i;const{placement:s,rects:c,middlewareData:l}=t,d=((n=l.arrow)===null||n===void 0?void 0:n.centerOffset)!==0,h=d?0:e.arrowWidth,m=d?0:e.arrowHeight,[v,g]=CR(s),_={start:"0%",center:"50%",end:"100%"}[g],k=((r=(a=l.arrow)===null||a===void 0?void 0:a.x)!==null&&r!==void 0?r:0)+h/2,x=((o=(i=l.arrow)===null||i===void 0?void 0:i.y)!==null&&o!==void 0?o:0)+m/2;let S="",M="";return v==="bottom"?(S=d?_:`${k}px`,M=`${-m}px`):v==="top"?(S=d?_:`${k}px`,M=`${c.floating.height+m}px`):v==="right"?(S=`${-m}px`,M=d?_:`${x}px`):v==="left"&&(S=`${c.floating.width+m}px`,M=d?_:`${x}px`),{data:{x:S,y:M}}}});function CR(e){const[t,n="center"]=e.split("-");return[t,n]}const afe=Jde,ofe=Qde,ife=tfe,sfe=w.forwardRef((e,t)=>{var n;const{container:r=globalThis==null||(n=globalThis.document)===null||n===void 0?void 0:n.body,...a}=e;return r?Br.createPortal(w.createElement(Cn.div,rt({},a,{ref:t})),r):null}),y6="dismissableLayer.update",cfe="dismissableLayer.pointerDownOutside",lfe="dismissableLayer.focusOutside";let SR;const ufe=w.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),dfe=w.forwardRef((e,t)=>{var n;const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:i,onInteractOutside:s,onDismiss:c,...l}=e,u=w.useContext(ufe),[d,h]=w.useState(null),m=(n=d==null?void 0:d.ownerDocument)!==null&&n!==void 0?n:globalThis==null?void 0:globalThis.document,[,v]=w.useState({}),g=Sr(t,D=>h(D)),_=Array.from(u.layers),[k]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),x=_.indexOf(k),S=d?_.indexOf(d):-1,M=u.layersWithOutsidePointerEventsDisabled.size>0,E=S>=x,T=ffe(D=>{const F=D.target,G=[...u.branches].some(z=>z.contains(F));!E||G||(o==null||o(D),s==null||s(D),D.defaultPrevented||c==null||c())},m),$=hfe(D=>{const F=D.target;[...u.branches].some(z=>z.contains(F))||(i==null||i(D),s==null||s(D),D.defaultPrevented||c==null||c())},m);return Pw(D=>{S===u.layers.size-1&&(a==null||a(D),!D.defaultPrevented&&c&&(D.preventDefault(),c()))},m),w.useEffect(()=>{if(d)return r&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(SR=m.body.style.pointerEvents,m.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),MR(),()=>{r&&u.layersWithOutsidePointerEventsDisabled.size===1&&(m.body.style.pointerEvents=SR)}},[d,m,r,u]),w.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),MR())},[d,u]),w.useEffect(()=>{const D=()=>v({});return document.addEventListener(y6,D),()=>document.removeEventListener(y6,D)},[]),w.createElement(Cn.div,rt({},l,{ref:g,style:{pointerEvents:M?E?"auto":"none":void 0,...e.style},onFocusCapture:Bt(e.onFocusCapture,$.onFocusCapture),onBlurCapture:Bt(e.onBlurCapture,$.onBlurCapture),onPointerDownCapture:Bt(e.onPointerDownCapture,T.onPointerDownCapture)}))});function ffe(e,t=globalThis==null?void 0:globalThis.document){const n=za(e),r=w.useRef(!1),a=w.useRef(()=>{});return w.useEffect(()=>{const o=s=>{if(s.target&&!r.current){let l=function(){AR(cfe,n,c,{discrete:!0})};const c={originalEvent:s};s.pointerType==="touch"?(t.removeEventListener("click",a.current),a.current=l,t.addEventListener("click",a.current,{once:!0})):l()}else t.removeEventListener("click",a.current);r.current=!1},i=window.setTimeout(()=>{t.addEventListener("pointerdown",o)},0);return()=>{window.clearTimeout(i),t.removeEventListener("pointerdown",o),t.removeEventListener("click",a.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function hfe(e,t=globalThis==null?void 0:globalThis.document){const n=za(e),r=w.useRef(!1);return w.useEffect(()=>{const a=o=>{o.target&&!r.current&&AR(lfe,n,{originalEvent:o},{discrete:!1})};return t.addEventListener("focusin",a),()=>t.removeEventListener("focusin",a)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function MR(){const e=new CustomEvent(y6);document.dispatchEvent(e)}function AR(e,t,n,{discrete:r}){const a=n.originalEvent.target,o=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&a.addEventListener(e,t,{once:!0}),r?k0(a,o):a.dispatchEvent(o)}let g6;const ER="HoverCard",[IR,Vzt]=$o(ER,[kR]),v6=kR(),[pfe,N_]=IR(ER),mfe=e=>{const{__scopeHoverCard:t,children:n,open:r,defaultOpen:a,onOpenChange:o,openDelay:i=700,closeDelay:s=300}=e,c=v6(t),l=w.useRef(0),u=w.useRef(0),d=w.useRef(!1),h=w.useRef(!1),[m=!1,v]=Ps({prop:r,defaultProp:a,onChange:o}),g=w.useCallback(()=>{clearTimeout(u.current),l.current=window.setTimeout(()=>v(!0),i)},[i,v]),_=w.useCallback(()=>{clearTimeout(l.current),!d.current&&!h.current&&(u.current=window.setTimeout(()=>v(!1),s))},[s,v]),k=w.useCallback(()=>v(!1),[v]);return w.useEffect(()=>()=>{clearTimeout(l.current),clearTimeout(u.current)},[]),w.createElement(pfe,{scope:t,open:m,onOpenChange:v,onOpen:g,onClose:_,onDismiss:k,hasSelectionRef:d,isPointerDownOnContentRef:h},w.createElement(afe,c,n))},yfe="HoverCardTrigger",gfe=w.forwardRef((e,t)=>{const{__scopeHoverCard:n,...r}=e,a=N_(yfe,n),o=v6(n);return w.createElement(ofe,rt({asChild:!0},o),w.createElement(Cn.a,rt({"data-state":a.open?"open":"closed"},r,{ref:t,onPointerEnter:Bt(e.onPointerEnter,D_(a.onOpen)),onPointerLeave:Bt(e.onPointerLeave,D_(a.onClose)),onFocus:Bt(e.onFocus,a.onOpen),onBlur:Bt(e.onBlur,a.onClose),onTouchStart:Bt(e.onTouchStart,i=>i.preventDefault())})))}),TR="HoverCardPortal",[vfe,_fe]=IR(TR,{forceMount:void 0}),bfe=e=>{const{__scopeHoverCard:t,forceMount:n,children:r,container:a}=e,o=N_(TR,t);return w.createElement(vfe,{scope:t,forceMount:n},w.createElement(ki,{present:n||o.open},w.createElement(sfe,{asChild:!0,container:a},r)))},_6="HoverCardContent",kfe=w.forwardRef((e,t)=>{const n=_fe(_6,e.__scopeHoverCard),{forceMount:r=n.forceMount,...a}=e,o=N_(_6,e.__scopeHoverCard);return w.createElement(ki,{present:r||o.open},w.createElement(wfe,rt({"data-state":o.open?"open":"closed"},a,{onPointerEnter:Bt(e.onPointerEnter,D_(o.onOpen)),onPointerLeave:Bt(e.onPointerLeave,D_(o.onClose)),ref:t})))}),wfe=w.forwardRef((e,t)=>{const{__scopeHoverCard:n,onEscapeKeyDown:r,onPointerDownOutside:a,onFocusOutside:o,onInteractOutside:i,...s}=e,c=N_(_6,n),l=v6(n),u=w.useRef(null),d=Sr(t,u),[h,m]=w.useState(!1);return w.useEffect(()=>{if(h){const v=document.body;return g6=v.style.userSelect||v.style.webkitUserSelect,v.style.userSelect="none",v.style.webkitUserSelect="none",()=>{v.style.userSelect=g6,v.style.webkitUserSelect=g6}}},[h]),w.useEffect(()=>{if(u.current){const v=()=>{m(!1),c.isPointerDownOnContentRef.current=!1,setTimeout(()=>{var g;((g=document.getSelection())===null||g===void 0?void 0:g.toString())!==""&&(c.hasSelectionRef.current=!0)})};return document.addEventListener("pointerup",v),()=>{document.removeEventListener("pointerup",v),c.hasSelectionRef.current=!1,c.isPointerDownOnContentRef.current=!1}}},[c.isPointerDownOnContentRef,c.hasSelectionRef]),w.useEffect(()=>{u.current&&xfe(u.current).forEach(g=>g.setAttribute("tabindex","-1"))}),w.createElement(dfe,{asChild:!0,disableOutsidePointerEvents:!1,onInteractOutside:i,onEscapeKeyDown:r,onPointerDownOutside:a,onFocusOutside:Bt(o,v=>{v.preventDefault()}),onDismiss:c.onDismiss},w.createElement(ife,rt({},l,s,{onPointerDown:Bt(s.onPointerDown,v=>{v.currentTarget.contains(v.target)&&m(!0),c.hasSelectionRef.current=!1,c.isPointerDownOnContentRef.current=!0}),ref:d,style:{...s.style,userSelect:h?"text":void 0,WebkitUserSelect:h?"text":void 0,"--radix-hover-card-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-hover-card-content-available-width":"var(--radix-popper-available-width)","--radix-hover-card-content-available-height":"var(--radix-popper-available-height)","--radix-hover-card-trigger-width":"var(--radix-popper-anchor-width)","--radix-hover-card-trigger-height":"var(--radix-popper-anchor-height)"}})))});function D_(e){return t=>t.pointerType==="touch"?void 0:e()}function xfe(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});for(;n.nextNode();)t.push(n.currentNode);return t}const Cfe=mfe,Sfe=gfe,Mfe=bfe,Afe=kfe,$R=()=>{const e=ga.useSearchParams()??new URLSearchParams,t=ga.useParams()??{},n=new URLSearchParams(e.toString());return Object.getOwnPropertyNames(t).forEach(r=>{n.delete(r);const a=t[r]||"";(typeof a=="string"?a.split("/"):a).forEach(i=>{n.append(r,i)})}),new ga.ReadonlyURLSearchParams(n)},PR=e=>{const{t}=At(),{fromUser:n,toUser:r,emoji:a="🏝️",borderDashed:o=!0,date:i,className:s}=e,c=$R(),l=ga.useRouter();return!n||!r?null:b("div",{className:Fe("relative h-full pb-5",s),children:ue("div",{className:Fe("flex h-full flex-col items-center justify-start rounded-md border bg-white px-4 py-4 font-normal dark:bg-transparent",o&&"border-dashed"),children:[b("div",{className:"bg-emphasis flex h-14 w-14 flex-col items-center justify-center rounded-full",children:b("span",{className:"m-auto text-center text-lg",children:a})}),ue("div",{className:"space-y-2 text-center",children:[b("p",{className:"mt-2 text-base font-bold",children:t("ooo_user_is_ooo",{displayName:n.displayName})}),(n==null?void 0:n.displayName)&&(r==null?void 0:r.displayName)&&b("p",{className:"text-center text-sm",children:b(bP,{i18nKey:"ooo_slots_returning",values:{displayName:r.displayName},default:"<1>{{ displayName }}</1> can take their meetings while they are away.",components:[b("strong",{children:"username"},"username")]})})]}),(r==null?void 0:r.id)&&b(Sn,{className:"mt-8 max-w-[90%]",variant:"button",color:"secondary",onClick:()=>{const u=c.get("month"),d=c.get("layout"),h=c.get("date")||i;l.push(`/${r.username}?${u?`month=${u}&`:""}date=${h}${d?`&layout=${d}`:""}`)},children:b("span",{className:"block overflow-hidden text-ellipsis whitespace-nowrap",children:t("ooo_slots_book_with",{displayName:r.displayName})})})]})})},cf=n_(e=>({overlayBusyDates:void 0,setOverlayBusyDates:t=>{e({overlayBusyDates:t})},calendarSettingsOverlayModal:!1,setCalendarSettingsOverlayModal:t=>{e({calendarSettingsOverlayModal:t})},continueWithProviderModal:!1,setContinueWithProviderModal:t=>{e({continueWithProviderModal:t})}}));function OR(e){const t=e.getHours().toString().padStart(2,"0"),n=e.getMinutes().toString().padStart(2,"0");return`${t}:${n}`}function Efe({start:e,selectedDuration:t,offset:n}){const r=cf(s=>s.overlayBusyDates);let a=null,o=null;return{isOverlapping:r&&r.some(s=>{const c=Xe(s.start),l=Xe(s.end),u=Xe(e.add(n,"hours")).add(t??0,"minute"),d=(u.isSame(c)||u.isAfter(c))&&e.add(n,"hours")<l&&u>c;return a=d?OR(c.toDate()):null,o=d?OR(l.toDate()):null,d}),overlappingTimeStart:a,overlappingTimeEnd:o}}const NR=({showExact:e=!0,bookedSeats:t,totalSeats:n,variant:r="whole"})=>{const{t:a}=At(),o=n-t,i=t/n>=.5,s=t/n>=.83;return b("span",{className:Fe(e&&"lowercase","truncate"),children:e?`${o}${r==="fraction"?` / ${n}`:""} ${a("seats_available",{count:o})}`:s?a("seats_nearly_full"):i?a("seats_half_full"):a("seats_available",{count:o})})},Ife=({slot:e,seatsPerTimeSlot:t,selectedSlots:n,onTimeSelect:r,showAvailableSeatsCount:a,event:o,customClassnames:i})=>{const{t:s}=At(),c=pl("overlayCalendar")==="true"||ti.getItem("overlayCalendarSwitchDefault"),[l,u]=Si(H=>[H.timeFormat,H.timezone]),d=Ot(H=>H.bookingData),h=Ot(H=>H.layout),{data:m}=o,v=!!t,g=Xe.utc(e.time).tz(u),_=!!(v&&e.attendees&&e.attendees>=t),k=e.attendees&&t&&e.attendees/t>=.5,S=e.attendees&&t&&e.attendees/t>=.83?"bg-rose-600":k?"bg-yellow-500":"bg-emerald-400",M=Xe(),T=(M.tz(u).utcOffset()-M.utcOffset())/60,{isOverlapping:$,overlappingTimeEnd:D,overlappingTimeStart:F}=Efe({start:g,selectedDuration:(m==null?void 0:m.length)??0,offset:T}),[G,z]=w.useState(!1),Z=w.useCallback(()=>{if(!c){r(e.time,(e==null?void 0:e.attendees)||0,t,e.bookingUid);return}if($&&G){z(!1);return}if($&&!G){z(!0);return}G||r(e.time,(e==null?void 0:e.attendees)||0,t,e.bookingUid)},[c,$,G,r,e.time,e==null?void 0:e.attendees,e.bookingUid,t]);return b(LT,{children:ue("div",{className:"flex gap-2",children:[ue(Sn,{disabled:_||!!(e.bookingUid&&e.bookingUid===(d==null?void 0:d.uid)),"data-testid":"time","data-disabled":_,"data-time":e.time,onClick:Z,className:Fe("min-h-9 hover:border-brand-default mb-2 flex h-auto w-full flex-grow flex-col justify-center py-2",(n==null?void 0:n.includes(e.time))&&"border-brand-default",`${i}`),color:"secondary",children:[ue("div",{className:"flex items-center gap-2",children:[!v&&c&&b("span",{className:Fe("inline-block h-2 w-2 rounded-full",$?"bg-rose-600":"bg-emerald-400")}),g.format(l)]}),_&&b("p",{className:"text-sm",children:s("booking_full")}),v&&!_&&ue("p",{className:"flex items-center text-sm",children:[b("span",{className:Fe(S,"mr-1 inline-block h-2 w-2 rounded-full"),"aria-hidden":!0}),b(NR,{showExact:!!a,totalSeats:t,bookedSeats:e.attendees||0})]})]},e.time),G&&$&&ue(Cfe,{children:[b(Sfe,{asChild:!0,children:b(K0.div,{initial:{width:0},animate:{width:"auto"},exit:{width:0},children:b(Sn,{variant:h==="column_view"?"icon":"button",StartIcon:h==="column_view"?"chevron-right":void 0,onClick:()=>r(e.time,(e==null?void 0:e.attendees)||0,t,e.bookingUid),children:h!=="column_view"&&s("confirm")})})}),b(Mfe,{children:b(Afe,{side:"top",align:"end",sideOffset:2,children:ue("div",{className:"text-emphasis bg-inverted w-[var(--booker-timeslots-width)] rounded-md p-3",children:[b("div",{className:"flex items-center gap-2",children:b("p",{children:"Busy"})}),ue("p",{className:"text-muted",children:[F," - ",D]})]})})})]})]})})},Tfe=({slots:e,onTimeSelect:t,seatsPerTimeSlot:n,showAvailableSeatsCount:r,showTimeFormatToggle:a=!0,className:o,selectedSlots:i,event:s,customClassnames:c})=>{const{t:l}=At();if(e.every(m=>m.away))return b(b6,{...e[0]});const d=e[0]&&e[0].away,h=e[e.length-1]&&e[e.length-1].away;return b("div",{className:Fe("text-default flex flex-col",o),children:ue("div",{className:"h-full pb-4",children:[!e.length&&ue("div",{"data-testId":"no-slots-available",className:"bg-subtle border-subtle flex h-full flex-col items-center rounded-md border p-6 dark:bg-transparent",children:[b(Mt,{name:"calendar-x-2",className:"text-muted mb-2 h-4 w-4"}),b("p",{className:Fe("text-muted",a?"-mt-1 text-lg":"text-sm"),children:l("all_booked_today")})]}),d&&!h&&b(b6,{...e[0]}),e.map(m=>m.away?null:b(Ife,{customClassnames:c,onTimeSelect:t,slot:m,selectedSlots:i,seatsPerTimeSlot:n,showAvailableSeatsCount:r,event:s},m.time)),h&&!d&&b(b6,{...e[e.length-1],className:"pb-0"})]})})},b6=e=>{const{fromUser:t,toUser:n,reason:r,emoji:a,time:o,className:i=""}=e;return b(PR,{fromUser:t,toUser:n,date:Xe(o).format("YYYY-MM-DD"),reason:r,emoji:a,borderDashed:!0,className:i})},$fe=()=>b("div",{className:"flex w-[20%] flex-col only:w-full",children:Array.from({length:Math.floor(Math.random()*6)+1}).map((e,t)=>b(Jn,{className:"mb-4 h-6 w-full"},t))}),DR=({customClassname:e})=>{const t=Si(a=>a.timeFormat),n=Si(a=>a.setTimeFormat),{t:r}=At();return b(sC,{customClassnames:e,onValueChange:a=>{a&&a!==t&&n(a)},defaultValue:t,value:t,options:[{value:Vh.TWELVE_HOUR,label:r("12_hour_short")},{value:Vh.TWENTY_FOUR_HOUR,label:r("24_hour_short")}]})},Pfe=({date:e,showTimeFormatToggle:t=!0,availableMonth:n,customClassnames:r})=>{const{t:a,i18n:o}=At(),[i]=Ot(u=>[u.layout],Ua),s=i===Nn.COLUMN_VIEW,c=i===Nn.MONTH_VIEW,l=Xe().isSame(e,"day");return ue("header",{className:Fe("dark:bg-muted dark:before:bg-muted mb-3 flex w-full flex-row items-center font-medium","bg-default before:bg-default",r==null?void 0:r.availableTimeSlotContainer),children:[ue("span",{className:Fe(s&&"w-full text-center",s?"text-subtle text-xs uppercase":"text-emphasis font-semibold"),children:[b("span",{className:Fe(l&&!(r!=null&&r.availableTimeSlotTitle)&&"!text-default",r==null?void 0:r.availableTimeSlotTitle),children:gx(o.language,Number(e.format("d")),"short")}),ue("span",{className:Fe(s&&l&&"bg-brand-default text-brand ml-2","inline-flex items-center justify-center rounded-3xl px-1 pt-0.5 font-medium",c?`text-default text-sm ${r==null?void 0:r.availableTimeSlotTitle}`:`text-xs ${r==null?void 0:r.availableTimeSlotTitle}`),children:[e.format("DD"),n&&`, ${n}`]})]}),t&&b("div",{className:"ml-auto rtl:mr-auto",children:b(DR,{customClassname:r==null?void 0:r.availableTimeSlotTimeFormatToggle})})]})},Ofe=({extraDays:e,limitHeight:t,seatsPerTimeSlot:n,showAvailableSeatsCount:r,schedule:a,isLoading:o,event:i,customClassnames:s})=>{const c=Ot(M=>M.selectedDate),l=Ot(M=>M.setSelectedTimeslot),u=Ot(M=>M.setSeatedEventData),d=c||Xe().format("YYYY-MM-DD"),[h]=Ot(M=>[M.layout]),m=h===Nn.COLUMN_VIEW,v=w.useRef(null),g=(M,E,T,$)=>{l(M),T&&u({seatsPerTimeSlot:T,attendees:E,bookingUid:$,showAvailableSeatsCount:r})},k=e6(a==null?void 0:a.slots).filter(M=>Xe(c).diff(M,"day")<=0),x=e?k.length>0?k.slice(0,e):[]:[d],S=mue(x,a==null?void 0:a.slots);return ue(vt,{children:[b("div",{className:Fe("flex",`${s==null?void 0:s.availableTimeSlotsContainer}`),children:o?b("div",{className:"mb-3 h-8"}):S.length>0&&S.map(M=>b(Pfe,{customClassnames:{availableTimeSlotTitle:s==null?void 0:s.availableTimeSlotsTitle,availableTimeSlotTimeFormatToggle:s==null?void 0:s.availableTimeSlotsTimeFormatToggle},date:Xe(M.date),showTimeFormatToggle:!m,availableMonth:Xe(c).format("MM")!==Xe(M.date).format("MM")?Xe(M.date).format("MMM"):void 0},M.date))}),ue("div",{ref:v,className:Fe(t&&"scroll-bar flex-grow overflow-auto md:h-[400px]",!t&&"flex h-full w-full flex-row gap-4",`${s==null?void 0:s.availableTimeSlotsContainer}`),children:[o&&Array.from({length:1+(e??0)}).map((M,E)=>b($fe,{},E)),!o&&S.length>0&&S.map(M=>b("div",{className:"scroll-bar h-full w-full overflow-y-auto overflow-x-hidden",children:b(Tfe,{className:s==null?void 0:s.availableTimeSlotsContainer,customClassnames:s==null?void 0:s.availableTimes,showTimeFormatToggle:!m,onTimeSelect:g,slots:M.slots,seatsPerTimeSlot:n,showAvailableSeatsCount:r,event:i})},M.date))]})]})},Nfe=e=>!!e;function Dfe(e,t){return e.map(n=>{const r=x_(n.type),a=ID(n);if(typeof a!="string"||!r)return null;const o=r.type;return{label:a.search(/^https?:/)!==-1?a:t(a),value:o,inputPlaceholder:t((r==null?void 0:r.attendeeInputPlaceholder)||"")}}).filter(Nfe)}var Rfe=function(e){var t=e.as,n=e.errors,r=e.name,a=e.message,o=e.render,i=function(h,m){if(h==null)return{};var v,g,_={},k=Object.keys(h);for(g=0;g<k.length;g++)m.indexOf(v=k[g])>=0||(_[v]=h[v]);return _}(e,["as","errors","name","message","render"]),s=Rs(),c=Nt(n||s.formState.errors,r);if(!c)return null;var l=c.message,u=c.types,d=Object.assign({},i,{children:l||a});return Te.isValidElement(t)?Te.cloneElement(t,d):o?o({message:l||a,messages:u}):Te.createElement(t||Te.Fragment,d)};const R_=Su(async()=>(await Promise.resolve().then(()=>CZe)).SelectWithValidation),Lfe=e=>{const{value:t,setValue:n,readOnly:r,placeholder:a,maxLength:o,customProps:i,...s}=e;return b(qb,{value:t||"",placeholder:a,disabled:r,onChange:u=>{const d=u.target.value;n(d)},maxLength:o,...i,...s})},Ffe=e=>{const{value:t,noLabel:n,setValue:r,readOnly:a,placeholder:o,customProps:i,type:s="text",...c}=e;return b(a8,{containerClassName:"w-full",type:s,value:t||"",labelSrOnly:n,placeholder:o,disabled:a,onChange:d=>{const h=d.target.value;r(h)},...c,...i})};function jfe({value:e,setValue:t,...n}){return b(a8,{type:"number",labelSrOnly:n.noLabel,containerClassName:"w-full",className:"bg-default border-default disabled:bg-emphasis focus:ring-brand-default dark:focus:border-emphasis focus:border-subtle block w-full rounded-md text-sm disabled:hover:cursor-not-allowed",value:e,onChange:r=>{t(r.target.value)},...n})}const Bfe=({listValues:e,setValue:t,value:n,...r})=>{if(!e)return null;const a=e.map(i=>({label:i.title,value:i.value})),o=a.filter(i=>n==null?void 0:n.includes(i.value));return b(R_,{"aria-label":"multi-select-dropdown",className:"mb-2",onChange:i=>{t(i==null?void 0:i.map(s=>s.value))},value:o,isMulti:!0,isDisabled:r.readOnly,options:a,...r})};function Vfe({listValues:e,setValue:t,value:n,...r}){if(!e)return null;const a=e.map(i=>({label:i.title,value:i.value})),o=a.find(i=>i.value===n);return b(R_,{"aria-label":"select-dropdown",className:"data-testid-select mb-2",onChange:i=>{i&&t(i.value)},isDisabled:r.readOnly,value:o,options:a,...r})}function zfe({config:e,type:t,label:n,onClick:r,readonly:a}){if(t==="delRule"||t=="delGroup")return b("button",{className:"ml-5",children:b(Mt,{name:"trash",className:"text-subtle m-0 h-4 w-4",onClick:r})});let o="";return t==="addRule"?(n=e!=null&&e.operators.__calReporting?"Add Filter":"Add rule",o="add-rule"):t=="addGroup"&&(n="Add rule group",o="add-rule-group"),b(Sn,{StartIcon:"plus","data-testid":o,type:"button",color:"secondary",disabled:a,onClick:r,children:n})}function Hfe({children:e}){return e instanceof Array?b(vt,{children:e.map((t,n)=>t?b("div",{className:"mb-2",children:t},n):null)}):null}function Ufe({not:e,setNot:t,config:n,conjunctionOptions:r,setConjunction:a,disabled:o}){if(!n||!r)return null;const i=Object.keys(r).length,s=o,{forceShowConj:c}=n.settings,l=c||i>1&&!s,u=[{label:"All",value:"all"},{label:"Any",value:"any"},{label:"None",value:"none"}];return l?(()=>{const{checked:h}=r.AND,{checked:m}=r.OR,v=e;let g=h?"all":m?"any":"all";v&&(g=g=="any"?"none":"all");const _=u.find(x=>x.value===g),k=n.operators.__calReporting?"Query where":"Rule group when";return ue("div",{className:"flex items-center text-sm",children:[b("span",{children:k}),b(R_,{className:"flex px-2",defaultValue:_,options:u,onChange:x=>{x&&(x.value==="all"?(a("AND"),t(!1)):x.value==="any"?(a("OR"),t(!1)):x.value==="none"&&(a("OR"),t(!0)))}}),b("span",{children:"match"})]})})():null}const J1={TextWidget:Ffe,TextAreaWidget:Lfe,SelectWidget:Vfe,NumberWidget:jfe,MultiSelectWidget:Bfe,FieldSelect:function(t){const{items:n,setField:r,selectedKey:a}=t,o=n.map(s=>({...s,value:s.key})),i=o.find(s=>s.value===a);return b(R_,{className:"data-testid-field-select mb-2",menuPosition:"fixed",onChange:s=>{s&&r(s.value)},defaultValue:i,options:o})},Button:zfe,ButtonGroup:Hfe,Conjs:Ufe,Provider:({children:e})=>e},Gfe={boolean:e=>typeof e=="boolean",multiselect:e=>e instanceof Array&&e.every(t=>typeof t=="string"),objectiveWithInput:e=>typeof e=="object"&&e!==null?"value"in e:!1,select:e=>typeof e=="string",text:e=>typeof e=="string",textList:e=>e instanceof Array&&e.every(t=>typeof t=="string"),variants:e=>typeof e=="object"&&e!==null||typeof e=="string"},Wfe={text:{propsType:Qo.text,factory:e=>b(J1.TextWidget,{noLabel:!0,...e})},textarea:{propsType:Qo.textarea,factory:e=>b(J1.TextAreaWidget,{rows:3,...e})},number:{propsType:Qo.number,factory:e=>b(J1.NumberWidget,{noLabel:!0,...e})},name:{propsType:Qo.name,factory:e=>{const{variant:t="fullName"}=e,n=(o,i)=>{let s=e.value;typeof s!="object"&&(s={}),e.setValue({...s,[o]:i})};if(!e.variants)throw new Error("'variants' is required for 'name' type of field");if(t!=="firstAndLastName"&&t!=="fullName")throw new Error(`Invalid variant name '${t}' for 'name' type of field`);const r=XN(t,e.value);if(t==="fullName"){if(typeof r!="string")throw new Error("Invalid value for 'fullName' variant");const i=e.variants[t].fields[0];return b(fm,{name:"name",showAsteriskIndicator:!0,placeholder:i.placeholder,label:i.label,containerClassName:"w-full",readOnly:e.readOnly,value:r,required:i.required,type:"text",onChange:s=>{e.setValue(s.target.value)}})}const a=e.variants[t];if(typeof r!="object")throw new Error("Invalid value for 'fullName' variant");return b("div",{className:"flex space-x-4",children:a.fields.map(o=>b(fm,{className:"!mb-0",showAsteriskIndicator:!0,name:o.name,readOnly:e.readOnly,placeholder:o.placeholder,label:o.label,containerClassName:`w-full testid-${o.name}`,value:r[o.name],required:o.required,type:"text",onChange:i=>n(o.name,i.target.value)},o.name))})}},phone:{propsType:Qo.phone,factory:({setValue:e,readOnly:t,...n})=>n?b(FH,{disabled:t,onChange:r=>{e(r)},...n}):b("div",{})},email:{propsType:Qo.email,factory:e=>e?b(J1.TextWidget,{type:"email",noLabel:!0,...e}):b("div",{})},address:{propsType:Qo.address,factory:e=>b(LH,{onChange:t=>{e.setValue(t)},...e})},multiemail:{propsType:Qo.multiemail,factory:function({value:t,readOnly:n,label:r,setValue:a,...o}){const i=o.placeholder,{t:s}=At();t=t||[];const c="dark:placeholder:text-muted focus:border-emphasis border-subtle block w-full rounded-md border-default text-sm focus:ring-black disabled:bg-emphasis disabled:hover:cursor-not-allowed dark:selection:bg-green-500 disabled:dark:text-subtle bg-default";return ue(vt,{children:[t.length?ue("div",{children:[b("label",{htmlFor:"guests",className:"text-default mb-1 block text-sm font-medium",children:r}),b("ul",{children:t.map((l,u)=>b("li",{children:b(OB,{disabled:n,value:t[u],className:c,onChange:d=>{t[u]=d.target.value,a(t)},placeholder:i,label:b(vt,{}),required:!0,onClickAddon:()=>{t.splice(u,1),a(t)},addOnSuffix:n?null:b(Ta,{content:"Remove email",children:b("button",{className:"m-1",type:"button",children:b(Mt,{name:"x",width:12,className:"text-default"})})})})},u))}),!n&&b(Sn,{"data-testid":"add-another-guest",type:"button",color:"minimal",StartIcon:"user-plus",className:"my-2.5",onClick:()=>{t.push(""),a(t)},children:s("add_another")})]}):b(vt,{}),!t.length&&!n&&b(Sn,{"data-testid":"add-guests",color:"minimal",variant:"button",StartIcon:"user-plus",onClick:()=>{t.push(""),a(t)},className:"mr-auto",children:r})]})}},multiselect:{propsType:Qo.multiselect,factory:e=>{const t={...e,listValues:e.options.map(n=>({title:n.label,value:n.value}))};return b(J1.MultiSelectWidget,{...t})}},select:{propsType:Qo.select,factory:e=>{const t={...e,listValues:e.options.map(n=>({title:n.label,value:n.value}))};return b(J1.SelectWidget,{...t})}},checkbox:{propsType:Qo.checkbox,factory:({options:e,readOnly:t,setValue:n,value:r})=>(r=r||[],b("div",{children:e.map((a,o)=>ue("label",{className:"block",children:[b("input",{type:"checkbox",disabled:t,onChange:i=>{const s=r.filter(c=>c!==a.value);i.target.checked&&s.push(a.value),n(s)},className:"border-default dark:border-default hover:bg-subtle checked:hover:bg-brand-default checked:bg-brand-default dark:checked:bg-brand-default dark:bg-darkgray-100 dark:hover:bg-subtle dark:checked:hover:bg-brand-default h-4 w-4 cursor-pointer rounded ltr:mr-2 rtl:ml-2",value:a.value,checked:r.includes(a.value)}),b("span",{className:"text-emphasis me-2 ms-2 text-sm",children:a.label??""})]},o))}))},radio:{propsType:Qo.radio,factory:({setValue:e,name:t,value:n,options:r})=>b(GH,{value:n,onValueChange:a=>{e(a)},children:b(vt,{children:r.map((a,o)=>b(qH,{label:a.label,value:a.label,id:`${t}.option.${o}.radio`},`option.${o}.radio`))})})},radioInput:{propsType:Qo.radioInput,factory:function({name:t,options:n,optionsInputs:r,value:a,setValue:o,readOnly:i}){var l;w.useEffect(()=>{var u;a||o({value:(u=n[0])==null?void 0:u.value,optionValue:""})},[n,o,a]);const{t:s}=At(),c=u=>u.label?u.label.search(/^https?:\/\//)!==-1?b("a",{href:u.label,target:"_blank",children:b("span",{className:"underline",children:u.label})}):u.label:"";return ue("div",{children:[b("div",{children:b("div",{className:"mb-2",children:n.length>1?n.map((u,d)=>ue("label",{className:"mb-1 flex items-center",children:[b("input",{type:"radio",disabled:i,name:t,className:"bg-default after:bg-default border-emphasis focus:ring-brand-default hover:bg-subtle hover:after:bg-subtle dark:checked:after:bg-brand-accent flex h-4 w-4 cursor-pointer items-center justify-center text-[--cal-brand] after:h-[6px] after:w-[6px] after:rounded-full after:content-[''] after:hover:block focus:ring-2 focus:ring-offset-0 ltr:mr-2 rtl:ml-2 dark:checked:hover:text-[--cal-brand]",value:u.value,onChange:h=>{o({value:h.target.value,optionValue:""})},checked:(a==null?void 0:a.value)===u.value}),b("span",{className:"text-emphasis me-2 ms-2 text-sm",children:c(u)??""}),b("span",{children:u.value==="phone"&&b(Cb,{content:s("number_in_international_format")})})]},d)):b(vt,{children:ue(Oc,{className:"flex",children:[n[0].label,!i&&((l=r[n[0].value])!=null&&l.required)?b("span",{className:"text-default mb-1 ml-1 text-sm font-medium",children:"*"}):null,n[0].value==="phone"&&b(Cb,{content:s("number_in_international_format")})]})})})}),(()=>{const u=r[a==null?void 0:a.value];return u?b("div",{children:b(RR,{readOnly:!!i,field:{...u,name:"optionField"},value:a==null?void 0:a.optionValue,setValue:d=>{o({value:a==null?void 0:a.value,optionValue:d||""})}})}):null})()]})}},boolean:{propsType:Qo.boolean,factory:({readOnly:e,name:t,label:n,value:r,setValue:a})=>b("div",{className:"flex",children:b(Jy,{name:t,onChange:o=>{o.target.checked?a(!0):a(!1)},placeholder:"",checked:r,disabled:e,description:"",descriptionAsSafeHtml:n??""})})}},qfe=["boolean"],Zfe=({field:e,readOnly:t,className:n})=>{const{t:r}=At(),{control:a,formState:o}=Rs(),{hidden:i,placeholder:s,label:c}=Xfe(e,r);return b("div",{"data-fob-field-name":e.name,className:Fe(n,i?"hidden":""),children:b(qd,{control:a,name:`responses.${e.name}`,render:({field:{value:l,onChange:u},fieldState:{error:d}})=>ue("div",{children:[b(RR,{field:{...e,label:c,placeholder:s,hidden:i},value:l,readOnly:t,setValue:h=>{u(h)}}),b(Rfe,{name:"responses",errors:o.errors,render:({message:h})=>(h=h||"",!(h.replace(/\{([^}]+)\}.*/,"$1")===e.name)&&!d?null:(h=h.replace(/\{[^}]+\}(.*)/,"$1").trim(),i&&console.error(`Error message for hidden field:${e.name} => ${h}`),ue("div",{"data-testid":`error-message-${e.name}`,className:"mt-2 flex items-center text-sm text-red-700 ",children:[b(Mt,{name:"info",className:"h-3 w-3 ltr:mr-2 rtl:ml-2"}),b("p",{children:r(h||"invalid_input")})]})))})]})})})};function Yfe(e){throw new Error(`Don't know how to handle ${JSON.stringify(e)}`)}const K1=({field:e,children:t,readOnly:n})=>{const{t:r}=At();return ue("div",{children:[e.type!=="boolean"&&e.type!=="multiemail"&&e.label&&b("div",{className:"mb-2 flex items-center",children:ue(Oc,{className:"!mb-0 flex",children:[b("span",{children:e.label}),b("span",{className:"text-emphasis -mb-1 ml-1 text-sm font-medium leading-none",children:!n&&e.required?"*":""}),e.type==="phone"&&b(Cb,{content:r("number_in_international_format")})]})}),t]})};function Xfe(e,t){var i;let n=!1,r=!!e.hidden;if(e.type==="radioInput"){const s=e.options;if((s==null?void 0:s.length)===1){if(!e.optionsInputs)throw new Error("radioInput must have optionsInputs");e.optionsInputs[s[0].value]?n=!0:r=!0}}if(qfe.includes(e.type)&&e.labelAsSafeHtml===void 0)throw new Error(`${e.name}:${e.type} type must have labelAsSafeHtml set`);const a=n?"":e.labelAsSafeHtml||e.label||t(e.defaultLabel||""),o=e.placeholder||t(e.defaultPlaceholder||"");return(i=e.variantsConfig)!=null&&i.variants&&Object.entries(e.variantsConfig.variants).forEach(([s,c])=>{c.fields.forEach(l=>{var h,m,v,g;const u=(h=Ey[e.type])==null?void 0:h.variantsConfig,d=(g=(v=(m=u==null?void 0:u.variants)==null?void 0:m[s])==null?void 0:v.fieldsMap[l.name])==null?void 0:g.defaultLabel;l.label=l.label||t(d||"")})}),{hidden:r,placeholder:o,label:a}}const RR=({field:e,value:t,setValue:n,readOnly:r})=>{const a=e.type||"text",o=Wfe[a];if(t!==void 0&&!((s,c)=>Gfe[c](s))(t,o.propsType))throw new Error(`Value ${t} is not valid for type ${o.propsType} for field ${e.name}`);if(o.propsType==="text")return b(K1,{field:e,readOnly:r,children:b(o.factory,{placeholder:e.placeholder,name:e.name,label:e.label,readOnly:r,value:t,setValue:n})});if(o.propsType==="boolean")return b(K1,{field:e,readOnly:r,children:b(o.factory,{name:e.name,label:e.label,readOnly:r,value:t,setValue:n,placeholder:e.placeholder})});if(o.propsType==="textList")return b(K1,{field:e,readOnly:r,children:b(o.factory,{placeholder:e.placeholder,name:e.name,label:e.label,readOnly:r,value:t,setValue:n})});if(o.propsType==="select"){if(!e.options)throw new Error("Field options is not defined");return b(K1,{field:e,readOnly:r,children:b(o.factory,{readOnly:r,value:t,name:e.name,placeholder:e.placeholder,setValue:n,options:e.options.map(s=>({...s,title:s.label}))})})}if(o.propsType==="multiselect"){if(!e.options)throw new Error("Field options is not defined");return b(K1,{field:e,readOnly:r,children:b(o.factory,{placeholder:e.placeholder,name:e.name,readOnly:r,value:t,setValue:n,options:e.options.map(s=>({...s,title:s.label}))})})}if(o.propsType==="objectiveWithInput"){if(!e.options)throw new Error("Field options is not defined");if(!e.optionsInputs)throw new Error("Field optionsInputs is not defined");const s=e.options;return e.options.length?b(K1,{field:e,readOnly:r,children:b(o.factory,{placeholder:e.placeholder,readOnly:r,name:e.name,value:t,setValue:n,optionsInputs:e.optionsInputs,options:s,required:e.required})}):null}if(o.propsType==="variants"){const s=JN(e);return s?b(o.factory,{placeholder:e.placeholder,readOnly:r,name:e.name,variant:e.variant,value:t,setValue:n,variants:s.variants}):null}return Yfe(o),null},Hh=R.enum(["name","email","location","title","notes","guests","rescheduleReason","smsReminderNumber"]),Jfe=({fields:e,locations:t,rescheduleUid:n,isDynamicGroupBooking:r,bookingData:a})=>{const{t:o}=At(),{watch:i,setValue:s}=Rs(),c=i("responses.location"),l=n?"reschedule":"",u=Ot(d=>d.isInstantMeeting);return b("div",{children:e.map((d,h)=>{if(u&&d.name==="location")return null;let m=(d.editable==="system"||d.editable==="system-but-optional")&&!!n&&a!==null,v=!!d.hidden;const g=d.views;if(g&&!g.find(_=>_.id===l))return null;if(d.name===Hh.Enum.rescheduleReason){if(a===null)return null;m=!1}if(d.name===Hh.Enum.smsReminderNumber){if((c==null?void 0:c.value)==="phone")return s(`responses.${Hh.Enum.smsReminderNumber}`,c==null?void 0:c.optionValue),null;m=!1}if(d.name===Hh.Enum.guests&&(m=!1,v=r?!0:!!d.hidden),d.name===Hh.Enum.notes&&a!==null)return null;if(d.name===Hh.Enum.location&&(c==null||c.value,m=!1),d.name===Hh.Enum.location&&d.type==="radioInput"){if(!d.optionsInputs)throw new Error("radioInput must have optionsInputs");const _=d.optionsInputs,k=Dfe(t,o);k.forEach(x=>{const S=_[x.value];S&&(S.placeholder=x.inputPlaceholder)}),d.options=k.filter(x=>!!x)}if(d!=null&&d.options){const _=uue(),k={};d.options.forEach(x=>{x.value in k?k[x.value]++:k[x.value]=1}),d.options=d.options.map(x=>({...x,value:_.includes(x.value)&&k[x.value]>1?x.label:x.value}))}return b(Zfe,{className:"mb-4",field:{...d,hidden:v},readOnly:m},h)})})},Kfe=()=>ue("div",{className:"flex flex-col",children:[b(Jn,{className:"h-7 w-32"}),b(Jn,{className:"mt-2 h-7 w-full"}),b(Jn,{className:"mt-4 h-7 w-28"}),b(Jn,{className:"mt-2 h-7 w-full"}),ue("div",{className:"mt-12 flex h-7 w-full flex-row items-center gap-4",children:[b(Jn,{className:"inline h-4 w-4 rounded-full"}),b(Jn,{className:"inline h-7 w-32"})]}),ue("div",{className:"mt-2 flex h-7 w-full flex-row items-center gap-4",children:[b(Jn,{className:"inline h-4 w-4 rounded-full"}),b(Jn,{className:"inline h-7 w-28"})]}),b(Jn,{className:"mt-8 h-7 w-32"}),b(Jn,{className:"mt-2 h-7 w-full"}),b(Jn,{className:"mt-4 h-7 w-28"}),b(Jn,{className:"mt-2 h-7 w-full"}),ue("div",{className:"mt-6 flex flex-row gap-3",children:[b(Jn,{className:"ml-auto h-8 w-20"}),b(Jn,{className:"h-8 w-20"})]})]}),Qfe=({onCancel:e,eventQuery:t,rescheduleUid:n,onSubmit:r,errorRef:a,errors:o,loadingStates:i,renderConfirmNotVerifyEmailButtonCond:s,bookingForm:c,children:l,extraOptions:u,isPlatform:d=!1})=>{const h=t.data,m=Ot(E=>E.setFormValues),v=Ot(E=>E.bookingData),g=Ot(E=>E.selectedTimeslot),_=Ot(E=>E.username),k=Ot(E=>E.isInstantMeeting),[x]=w.useState(null),{t:S}=At(),M=w.useMemo(()=>{if(!(h!=null&&h.price))return!1;const E=OD(h);return(h==null?void 0:h.price)>0&&!Number.isNaN(E.price)&&E.price>0},[h]);return t.isError?b(kf,{severity:"warning",message:S("error_booking_event")}):t.isPending||!t.data?b(Kfe,{}):g?h?ue("div",{className:"flex h-full flex-col",children:[ue(Zb,{className:"flex h-full flex-col",onChange:()=>{const E=c.getValues();m(E)},form:c,handleSubmit:r,noValidate:!0,children:[b(Jfe,{isDynamicGroupBooking:!!(_&&_.indexOf("+")>-1),fields:h.bookingFields,locations:h.locations,rescheduleUid:n||void 0,bookingData:v}),(o.hasFormErrors||o.hasDataErrors)&&b("div",{"data-testid":"booking-fail",children:b(kf,{ref:a,className:"my-2",severity:"info",title:S(n?"reschedule_fail":"booking_fail"),message:ehe(o.formErrors,o.dataErrors,S,x)})}),!d&&rv&&b("div",{className:"text-subtle my-3 w-full text-xs opacity-80",children:ue(bP,{i18nKey:"signing_up_terms",children:["By proceeding, you agree to our"," ",b(ya,{className:"text-emphasis hover:underline",href:`${wu}/terms`,target:"_blank",children:b("a",{children:"Terms"})})," ","and"," ",b(ya,{className:"text-emphasis hover:underline",href:`${wu}/privacy`,target:"_blank",children:b("a",{children:"Privacy Policy"})}),"."]})}),b("div",{className:"modalsticky mt-auto flex justify-end space-x-2 rtl:space-x-reverse",children:k?b(Sn,{type:"submit",color:"primary",loading:i.creatingInstantBooking,children:S(M?"pay_and_book":"confirm")}):ue(vt,{children:[!!e&&b(Sn,{color:"minimal",type:"button",onClick:e,"data-testid":"back",children:S("back")}),b(Sn,{type:"submit",color:"primary",loading:i.creatingBooking||i.creatingRecurringBooking,"data-testid":n&&v?"confirm-reschedule-button":"confirm-book-button",children:S(n&&v?"reschedule":s?M?"pay_and_book":"confirm":"verify_email_email_button")})]})})]}),l]}):(console.warn("No event type found for event",u),b(kf,{severity:"warning",message:S("error_booking_event")})):b(Uk,{headline:S("timeslot_missing_title"),description:S("timeslot_missing_description"),Icon:"calendar",buttonText:S("timeslot_missing_cta"),buttonOnClick:e})},ehe=(e,t,n,r)=>{if(e)return e==null?void 0:e.message;const a=t;return a!=null&&a.message?ue(vt,{children:[r??""," ",n(a.message)]}):b(vt,{children:n("can_you_try_again")})},the=({date:e,timeFormat:t,timeZone:n,language:r})=>{const a=new Date(e),o=new Intl.DateTimeFormat(r,{timeZone:n,dateStyle:"full"}).format(a),i=new Intl.DateTimeFormat(r,{timeZone:n,timeStyle:"short",hour12:t===Vh.TWELVE_HOUR}).format(a).toLowerCase();return{date:o,time:i}},nhe=({date:e,duration:t,timeFormat:n,timeZone:r,language:a})=>{const o=new Date(e),i=t?new Date(new Date(e).setMinutes(o.getMinutes()+t)):o,s=new Intl.DateTimeFormat(a,{timeZone:r,dateStyle:"full"}).formatRange(o,i),c=new Intl.DateTimeFormat(a,{timeZone:r,timeStyle:"short",hour12:n===Vh.TWELVE_HOUR}).formatRange(o,i).toLowerCase();return{date:s,time:c}},LR=e=>{const t=nhe(e);return ue(vt,{children:[t.date,b("br",{}),t.time]})},rhe=e=>{const t=the(e);return ue(vt,{children:[t.date,", ",t.time]})},ahe=()=>{const[e,t]=Ot(o=>[o.username,o.eventSlug],Ua),n=Ot(o=>o.isTeamEvent),r=Ot(o=>o.org),a=Jr.viewer.public.event.useQuery({username:e??"",eventSlug:t??"",isTeamEvent:n,org:r??null},{refetchOnWindowFocus:!1,enabled:!!e&&!!t});return{data:a==null?void 0:a.data,isSuccess:a==null?void 0:a.isSuccess,isError:a==null?void 0:a.isError,isPending:a==null?void 0:a.isPending}},ohe=({children:e,onCancel:t})=>{const{data:n}=ahe();return b(FR,{child:e,eventLength:n==null?void 0:n.length,onCancel:t})},ihe=({children:e,onCancel:t})=>{const n=Ot(a=>a.eventId),{data:r}=wF(n);return b(FR,{child:e,eventLength:r==null?void 0:r.eventType.length,onCancel:t})},FR=({child:e,eventLength:t})=>{const{i18n:n,t:r}=At(),a=Ot(c=>c.selectedTimeslot),o=Ot(c=>c.selectedDuration),{timeFormat:i,timezone:s}=Si();return a?ue(vt,{children:[ue("h1",{className:"font-cal text-emphasis text-xl leading-5",children:[r("confirm_your_details")," "]}),ue("div",{className:"my-4 flex flex-wrap gap-2 rounded-md leading-none",children:[b(yf,{variant:"grayWithoutHover",startIcon:"calendar",size:"lg",children:b(rhe,{date:a,timeFormat:i,timeZone:s,language:n.language})}),(o||t)&&b(yf,{variant:"grayWithoutHover",startIcon:"clock",size:"lg",children:b("span",{children:t6(o||t,r)})})]}),e]}):null},she=({visible:e,onCancel:t,children:n})=>{const r=Vu();return b(Ju,{open:e,onOpenChange:t,children:b(Dl,{type:void 0,enableOverflow:!0,className:"[&_.modalsticky]:border-t-subtle [&_.modalsticky]:bg-default max-h-[80vh] pb-0 [&_.modalsticky]:sticky [&_.modalsticky]:bottom-0 [&_.modalsticky]:left-0 [&_.modalsticky]:right-0 [&_.modalsticky]:-mx-8 [&_.modalsticky]:border-t [&_.modalsticky]:px-8 [&_.modalsticky]:py-4",children:r?b(ihe,{onCancel:t,children:n}):b(ohe,{onCancel:t,children:n})})})},L_={variants:{visible:{opacity:1,x:0},hidden:{opacity:0,x:20}},initial:"hidden",exit:"hidden",animate:"visible",transition:{ease:"easeInOut",delay:.1}},k6={variants:{visible:{opacity:1,y:0},hidden:{opacity:0,y:20}},initial:"hidden",exit:"hidden",animate:"visible",transition:{ease:"easeInOut",delay:.1}},jR={mobile:{default:{width:"100%",minHeight:"0px",gridTemplateAreas:`
|
|
187
|
+
`)},t.prototype.clone=function(){var n=new t(!!this._cache);return this._rrule.forEach(function(r){return n.rrule(r.clone())}),this._exrule.forEach(function(r){return n.exrule(r.clone())}),this._rdate.forEach(function(r){return n.rdate(new Date(r.getTime()))}),this._exdate.forEach(function(r){return n.exdate(new Date(r.getTime()))}),n},t}(pn);function YD(e,t){if(!(e instanceof pn))throw new TypeError(String(e)+" is not RRule instance");Rr(t.map(String),String(e))||t.push(e)}function XD(e,t){if(!(e instanceof Date))throw new TypeError(String(e)+" is not Date instance");Rr(t.map(Number),Number(e))||(t.push(e),Yn.sort(t))}function JD(e,t,n){var r=!n||n.toUpperCase()==="UTC",a=r?"".concat(e,":"):"".concat(e,";TZID=").concat(n,":"),o=t.map(function(i){return Yn.timeToUntilString(i.valueOf(),r)}).join(",");return"".concat(a).concat(o)}const ti={getItem(e){try{return window.localStorage.getItem(e)}catch{return null}},setItem(e,t){try{window.localStorage.setItem(e,t)}catch{return}},removeItem:e=>{try{window.localStorage.removeItem(e)}catch{return}}},KD="timeOption.is24hClock";var Vh=(e=>(e.TWELVE_HOUR="h:mma",e.TWENTY_FOUR_HOUR="HH:mm",e))(Vh||{});const d6=e=>ti.setItem(KD,e.toString()),bde=()=>{const e=ti.getItem(KD);return e===null?null:e==="true"},QD=(()=>{const e=bde();return e===!0?!0:e===!1?!1:new Intl.DateTimeFormat(void 0,{hour:"numeric"}).format(0).match(/M/i)?(d6(!1),!1):(d6(!0),!0)})()?"HH:mm":"h:mma",kde=/^(.*)([+-])(\d{2}):(\d{2})|(Z)$/;function wde(e,t,n,r){if(typeof e!="string")return Xe(e,t,n,r);const a=e.match(kde);if(a===null)return;if(a[0]==="Z")return Xe(e,{utc:!0,...typeof t=="string"?{format:t}:{...t}},n,r);const[,o,i,s,c]=a,l=parseInt(s)*60+parseInt(c,10),u=i==="+"?l:-l;return Xe(o,{$offset:u,...typeof t=="string"?{format:t}:{...t}},n,r)}const xde=(e,t,n,r)=>{const a=wde(e);return a!=null&&a.isValid()?`${a==null?void 0:a.format(r!=null&&r.withDefaultTimeFormat?Vh.TWELVE_HOUR:(r==null?void 0:r.selectedTimeFormat)||QD)}, ${Xe(e).toDate().toLocaleString(t,{dateStyle:"full",timeZone:n})}`:"Invalid date"},eR=({startDate:e,timeZone:t,recurringEvent:n,recurringCount:r,selectedTimeFormat:a,withDefaultTimeFormat:o},i)=>{const{count:s,...c}=n||{},l=new pn({...c,count:r,dtstart:new Date(Xe(e).valueOf())}),u=Xe(e).utcOffset(),d=l.all().map(m=>Xe.utc(m).add(u-Xe(m).utcOffset(),"minute"));return[d.map(m=>xde(m.tz(t),i,t,{selectedTimeFormat:a,withDefaultTimeFormat:o})),d.map(m=>m.toDate())]},Cde=({t:e,recurringEvent:t})=>t.interval&&t.freq?e("every_for_freq",{freq:`${t.interval>1?t.interval:""} ${e(Gx[t.freq].toString().toLowerCase(),{count:t.interval})}`}):"",tR="timeOption.preferredTimeZone",Si=n_(e=>({timeFormat:QD,setTimeFormat:t=>{d6(t===Vh.TWENTY_FOUR_HOUR),e({timeFormat:t})},timezone:ti.getItem(tR)||Xe.tz.guess()||"Europe/London",setTimezone:t=>{ti.setItem(tR,t),e({timezone:t})}}));var E_,Sde=new Uint8Array(16);function Mde(){if(!E_&&(E_=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto<"u"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),!E_))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return E_(Sde)}const Ade=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function Ede(e){return typeof e=="string"&&Ade.test(e)}for(var wo=[],f6=0;f6<256;++f6)wo.push((f6+256).toString(16).substr(1));function Ide(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=(wo[e[t+0]]+wo[e[t+1]]+wo[e[t+2]]+wo[e[t+3]]+"-"+wo[e[t+4]]+wo[e[t+5]]+"-"+wo[e[t+6]]+wo[e[t+7]]+"-"+wo[e[t+8]]+wo[e[t+9]]+"-"+wo[e[t+10]]+wo[e[t+11]]+wo[e[t+12]]+wo[e[t+13]]+wo[e[t+14]]+wo[e[t+15]]).toLowerCase();if(!Ede(n))throw TypeError("Stringified UUID is invalid");return n}function Tde(e,t,n){e=e||{};var r=e.random||(e.rng||Mde)();if(r[6]=r[6]&15|64,r[8]=r[8]&63|128,t){n=n||0;for(var a=0;a<16;++a)t[n+a]=r[a];return t}return Ide(r)}const h6=({values:e,event:t,date:n,duration:r,timeZone:a,language:o,rescheduleUid:i,username:s,metadata:c,bookingUid:l,seatReferenceUid:u,hashedLink:d})=>({...e,user:s,start:Xe(n).format(),end:Xe(n).add(r||t.length,"minute").format(),eventTypeId:t.id,eventTypeSlug:t.slug,timeZone:a,language:o,rescheduleUid:i,metadata:c||{},hasHashedBookingLink:!!d,bookingUid:l,seatReferenceUid:u,hashedLink:d}),$de=(e,t)=>{const n=Tde(),[,r]=eR({startDate:e.date,timeZone:e.timeZone,recurringEvent:e.event.recurringEvent,recurringCount:t,withDefaultTimeFormat:!0},e.language),a=h6({...e,bookingUid:void 0});return r.map(o=>({...a,start:Xe(o).format(),end:Xe(o).add(e.duration||e.event.length,"minute").format(),recurringEventId:n,schedulingType:e.event.schedulingType||void 0,recurringCount:r.length}))},Pde=({event:e})=>{var v;const t=((v=e.recurringEvent)==null?void 0:v.count)||null,{t:n,i18n:r}=At(),[a,o,i,s]=Ot(g=>[g.setRecurringEventCount,g.recurringEventCount,g.setOccurenceCount,g.occurenceCount]),c=Ot(g=>g.selectedTimeslot),l=Ot(g=>g.state),{timezone:u,timeFormat:d}=Si(),[h,m]=w.useState(!1);if(w.useEffect(()=>{var g;(g=e.recurringEvent)!=null&&g.count&&(i(s||e.recurringEvent.count),a(o||e.recurringEvent.count),s&&(s>e.recurringEvent.count||s<1)&&m(!0))},[a,e.recurringEvent,o,i,s]),!e.recurringEvent)return null;if(l==="booking"&&o&&c){const[g]=eR({startDate:c,timeZone:u,recurringEvent:e.recurringEvent,recurringCount:o,selectedTimeFormat:d},r.language);return ue("div",{"data-testid":"recurring-dates",children:[g.slice(0,5).map((_,k)=>b("p",{children:_},k)),g.length>5&&b(Ta,{content:g.slice(5).map((_,k)=>b("p",{children:_},k)),children:ue("p",{className:" text-sm",children:["+ ",n("plus_more",{count:g.length-5})]})})]})}return ue(vt,{children:[Cde({t:n,recurringEvent:e.recurringEvent}),b("br",{}),b(Ii,{className:"my-1 mr-3 inline-flex h-[26px] w-[46px] px-1 py-0",type:"number",min:"1",max:e.recurringEvent.count,defaultValue:s||e.recurringEvent.count,"data-testid":"occurrence-input",onChange:g=>{const _=/^(?=.*[0-9])\S+$/,k=parseInt(g.target.value);i(k),!_.test(g.target.value)||k<1||t&&k>t?(m(!0),a(t)):(m(!1),a(k))}}),n("occurrence",{count:o||e.recurringEvent.count}),h&&b("div",{className:"-ml-4 mr-4 mt-2 flex",children:b(kf,{severity:"warning",title:n("enter_number_between_range",{maxOccurences:t})})})]})},Ode=["BIF","CLP","DJF","GNF","JPY","KMF","KRW","MGA","PYG","RWF","UGX","VND","VUV","XAF","XOF","XPF"],Nde=(e,t)=>Ode.includes(t.toUpperCase())?e:e/100,Dde=(e,t,n="en")=>{switch(t){case"BTC":return`${e} sats`;default:return t=(t==null?void 0:t.toUpperCase())||"USD",`${Intl.NumberFormat(n,{style:"currency",currency:t}).format(Nde(e,t))}`}},Rde=Su(()=>Promise.resolve().then(()=>hYe).then(e=>e.AlbyPriceComponent),{ssr:!1}),Lde=({price:e,currency:t,displayAlternateSymbol:n=!0})=>{if(e===0)return null;const r=Dde(e,t);return t!=="BTC"?b(vt,{children:r}):b(Rde,{displaySymbol:n,price:e,formattedPrice:r})},Fde=[Sc.REQUIRES_CONFIRMATION,Sc.DURATION,Sc.OCCURENCES,Sc.LOCATION,Sc.PRICE],Cl=({customIcon:e,icon:t,iconUrl:n,children:r,highlight:a,contentClassName:o,className:i,isDark:s})=>w.Children.count(r)?ue("div",{className:Fe("flex items-start justify-start text-sm",a?"text-emphasis":"text-text",i),children:[n?b("img",{src:n,alt:"",className:Fe("mr-2 mt-[2px] h-4 w-4 flex-shrink-0",s===void 0&&"[filter:invert(0.5)_brightness(0.5)]",(s===void 0||s)&&"dark:[filter:invert(0.65)_brightness(0.9)]")}):b(vt,{children:e||!!t&&b(Mt,{name:t,className:"relative z-20 mr-2 mt-[2px] h-4 w-4 flex-shrink-0 rtl:ml-2"})}),b("div",{className:Fe("relative z-10 max-w-full break-words",o),children:r})]}):null,jde=({event:e,blocks:t=Fde})=>{const{t:n}=At(),r=Ot(o=>o.rescheduleUid),a=Ot(o=>o.isInstantMeeting);return b(vt,{children:t.map(o=>{var i;if(typeof o=="function")return b(w.Fragment,{children:o(e)},o.name);switch(o){case Sc.DURATION:return b(Cl,{icon:"clock",children:b(Sue,{event:e})},o);case Sc.LOCATION:return!((i=e==null?void 0:e.locations)!=null&&i.length)||a?null:b(Cl,{children:b(Cue,{locations:e.locations})},o);case Sc.REQUIRES_CONFIRMATION:return e.requiresConfirmation?b(Cl,{icon:"square-check",children:n("requires_confirmation")},o):null;case Sc.OCCURENCES:return!e.recurringEvent||r?null:b(Cl,{icon:"refresh-ccw",children:b(Pde,{event:e})},o);case Sc.PRICE:const s=OD(e);return e.price<=0||s.price<=0?null:b(Cl,{customIcon:b(_ue,{currency:e.currency}),children:b(Lde,{price:s.price,currency:e.currency,displayAlternateSymbol:!1})},o)}})})},Bde=({children:e,as:t,className:n})=>b(t||"h1",{"data-testid":"event-title",className:Fe("text-text text-xl font-semibold",n),children:e}),Vde=()=>ue("div",{className:"flex flex-col",children:[b(Jn,{className:"h-6 w-6 rounded-full"}),b(Jn,{className:"mt-2 h-5 w-32"}),b(Jn,{className:"mt-2 h-8 w-48"}),b("div",{className:"mt-8",children:Array.from({length:4}).map((e,t)=>ue("div",{className:"mb-2 flex flex-row items-center",children:[b(Jn,{className:"mr-3 h-5 w-5 rounded-full"}),b(Jn,{className:Fe("h-6",t>1?"w-24":"w-32")})]},t))})]}),zde=({schedulingType:e,users:t,profile:n,entity:r})=>{const a=Vu(),i=e!==Iy.ROUND_ROBIN&&!a?t:[],s=n.name&&e===Iy.ROUND_ROBIN||!t.length||n.name!==t[0].name&&e===Iy.COLLECTIVE;return ue(vt,{children:[r.orgSlug?b(S9,{size:"sm",className:"border-muted",organization:{slug:r.orgSlug,name:r.name||""},users:i}):b(ej,{size:"sm",className:"border-muted",users:i}),b("p",{className:"text-subtle mt-2 text-sm font-semibold",children:s?n.name:i.map(c=>c.name).filter(c=>c).join(", ")})]})};function Bs(e){var t;return((t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Ac(e){return Bs(e).getComputedStyle(e)}function nR(e){return e instanceof Bs(e).Node}function of(e){return nR(e)?(e.nodeName||"").toLowerCase():""}function Ec(e){return e instanceof Bs(e).HTMLElement}function rs(e){return e instanceof Bs(e).Element}function rR(e){return typeof ShadowRoot>"u"?!1:e instanceof Bs(e).ShadowRoot||e instanceof ShadowRoot}function Py(e){const{overflow:t,overflowX:n,overflowY:r,display:a}=Ac(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(a)}function Hde(e){return["table","td","th"].includes(of(e))}function p6(e){const t=m6(),n=Ac(e);return n.transform!=="none"||n.perspective!=="none"||!t&&!!n.backdropFilter&&n.backdropFilter!=="none"||!t&&!!n.filter&&n.filter!=="none"||["transform","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function m6(){return!(typeof CSS>"u"||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function I_(e){return["html","body","#document"].includes(of(e))}const aR=Math.min,Oy=Math.max,T_=Math.round;function oR(e){const t=Ac(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const a=Ec(e),o=a?e.offsetWidth:n,i=a?e.offsetHeight:r,s=T_(n)!==o||T_(r)!==i;return s&&(n=o,r=i),{width:n,height:r,fallback:s}}function iR(e){return rs(e)?e:e.contextElement}const sR={x:1,y:1};function Y1(e){const t=iR(e);if(!Ec(t))return sR;const n=t.getBoundingClientRect(),{width:r,height:a,fallback:o}=oR(t);let i=(o?T_(n.width):n.width)/r,s=(o?T_(n.height):n.height)/a;return i&&Number.isFinite(i)||(i=1),s&&Number.isFinite(s)||(s=1),{x:i,y:s}}const cR={x:0,y:0};function lR(e,t,n){var r,a;if(t===void 0&&(t=!0),!m6())return cR;const o=e?Bs(e):window;return!n||t&&n!==o?cR:{x:((r=o.visualViewport)==null?void 0:r.offsetLeft)||0,y:((a=o.visualViewport)==null?void 0:a.offsetTop)||0}}function zh(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const a=e.getBoundingClientRect(),o=iR(e);let i=sR;t&&(r?rs(r)&&(i=Y1(r)):i=Y1(e));const s=lR(o,n,r);let c=(a.left+s.x)/i.x,l=(a.top+s.y)/i.y,u=a.width/i.x,d=a.height/i.y;if(o){const h=Bs(o),m=r&&rs(r)?Bs(r):r;let v=h.frameElement;for(;v&&r&&m!==h;){const g=Y1(v),_=v.getBoundingClientRect(),k=getComputedStyle(v);_.x+=(v.clientLeft+parseFloat(k.paddingLeft))*g.x,_.y+=(v.clientTop+parseFloat(k.paddingTop))*g.y,c*=g.x,l*=g.y,u*=g.x,d*=g.y,c+=_.x,l+=_.y,v=Bs(v).frameElement}}return p1({width:u,height:d,x:c,y:l})}function sf(e){return((nR(e)?e.ownerDocument:e.document)||window.document).documentElement}function $_(e){return rs(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function uR(e){return zh(sf(e)).left+$_(e).scrollLeft}function X1(e){if(of(e)==="html")return e;const t=e.assignedSlot||e.parentNode||rR(e)&&e.host||sf(e);return rR(t)?t.host:t}function dR(e){const t=X1(e);return I_(t)?t.ownerDocument.body:Ec(t)&&Py(t)?t:dR(t)}function Ny(e,t){var n;t===void 0&&(t=[]);const r=dR(e),a=r===((n=e.ownerDocument)==null?void 0:n.body),o=Bs(r);return a?t.concat(o,o.visualViewport||[],Py(r)?r:[]):t.concat(r,Ny(r))}function fR(e,t,n){let r;if(t==="viewport")r=function(a,o){const i=Bs(a),s=sf(a),c=i.visualViewport;let l=s.clientWidth,u=s.clientHeight,d=0,h=0;if(c){l=c.width,u=c.height;const m=m6();(!m||m&&o==="fixed")&&(d=c.offsetLeft,h=c.offsetTop)}return{width:l,height:u,x:d,y:h}}(e,n);else if(t==="document")r=function(a){const o=sf(a),i=$_(a),s=a.ownerDocument.body,c=Oy(o.scrollWidth,o.clientWidth,s.scrollWidth,s.clientWidth),l=Oy(o.scrollHeight,o.clientHeight,s.scrollHeight,s.clientHeight);let u=-i.scrollLeft+uR(a);const d=-i.scrollTop;return Ac(s).direction==="rtl"&&(u+=Oy(o.clientWidth,s.clientWidth)-c),{width:c,height:l,x:u,y:d}}(sf(e));else if(rs(t))r=function(a,o){const i=zh(a,!0,o==="fixed"),s=i.top+a.clientTop,c=i.left+a.clientLeft,l=Ec(a)?Y1(a):{x:1,y:1};return{width:a.clientWidth*l.x,height:a.clientHeight*l.y,x:c*l.x,y:s*l.y}}(t,n);else{const a=lR(e);r={...t,x:t.x-a.x,y:t.y-a.y}}return p1(r)}function hR(e,t){const n=X1(e);return!(n===t||!rs(n)||I_(n))&&(Ac(n).position==="fixed"||hR(n,t))}function pR(e,t){return Ec(e)&&Ac(e).position!=="fixed"?t?t(e):e.offsetParent:null}function mR(e,t){const n=Bs(e);if(!Ec(e))return n;let r=pR(e,t);for(;r&&Hde(r)&&Ac(r).position==="static";)r=pR(r,t);return r&&(of(r)==="html"||of(r)==="body"&&Ac(r).position==="static"&&!p6(r))?n:r||function(a){let o=X1(a);for(;Ec(o)&&!I_(o);){if(p6(o))return o;o=X1(o)}return null}(e)||n}function Ude(e,t,n){const r=Ec(t),a=sf(t),o=n==="fixed",i=zh(e,!0,o,t);let s={scrollLeft:0,scrollTop:0};const c={x:0,y:0};if(r||!r&&!o)if((of(t)!=="body"||Py(a))&&(s=$_(t)),Ec(t)){const l=zh(t,!0,o,t);c.x=l.x+t.clientLeft,c.y=l.y+t.clientTop}else a&&(c.x=uR(a));return{x:i.left+s.scrollLeft-c.x,y:i.top+s.scrollTop-c.y,width:i.width,height:i.height}}const Gde={getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:a}=e;const o=n==="clippingAncestors"?function(l,u){const d=u.get(l);if(d)return d;let h=Ny(l).filter(_=>rs(_)&&of(_)!=="body"),m=null;const v=Ac(l).position==="fixed";let g=v?X1(l):l;for(;rs(g)&&!I_(g);){const _=Ac(g),k=p6(g);k||_.position!=="fixed"||(m=null),(v?!k&&!m:!k&&_.position==="static"&&m&&["absolute","fixed"].includes(m.position)||Py(g)&&!k&&hR(l,g))?h=h.filter(x=>x!==g):m=_,g=X1(g)}return u.set(l,h),h}(t,this._c):[].concat(n),i=[...o,r],s=i[0],c=i.reduce((l,u)=>{const d=fR(t,u,a);return l.top=Oy(d.top,l.top),l.right=aR(d.right,l.right),l.bottom=aR(d.bottom,l.bottom),l.left=Oy(d.left,l.left),l},fR(t,s,a));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}},convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{rect:t,offsetParent:n,strategy:r}=e;const a=Ec(n),o=sf(n);if(n===o)return t;let i={scrollLeft:0,scrollTop:0},s={x:1,y:1};const c={x:0,y:0};if((a||!a&&r!=="fixed")&&((of(n)!=="body"||Py(o))&&(i=$_(n)),Ec(n))){const l=zh(n);s=Y1(n),c.x=l.x+n.clientLeft,c.y=l.y+n.clientTop}return{width:t.width*s.x,height:t.height*s.y,x:t.x*s.x-i.scrollLeft*s.x+c.x,y:t.y*s.y-i.scrollTop*s.y+c.y}},isElement:rs,getDimensions:function(e){return oR(e)},getOffsetParent:mR,getDocumentElement:sf,getScale:Y1,async getElementRects(e){let{reference:t,floating:n,strategy:r}=e;const a=this.getOffsetParent||mR,o=this.getDimensions;return{reference:Ude(t,await a(n),r),floating:{x:0,y:0,...await o(n)}}},getClientRects:e=>Array.from(e.getClientRects()),isRTL:e=>Ac(e).direction==="rtl"};function Wde(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:a=!0,ancestorResize:o=!0,elementResize:i=!0,animationFrame:s=!1}=r,c=a||o?[...rs(e)?Ny(e):e.contextElement?Ny(e.contextElement):[],...Ny(t)]:[];c.forEach(h=>{const m=!rs(h)&&h.toString().includes("V");!a||s&&!m||h.addEventListener("scroll",n,{passive:!0}),o&&h.addEventListener("resize",n)});let l,u=null;i&&(u=new ResizeObserver(()=>{n()}),rs(e)&&!s&&u.observe(e),rs(e)||!e.contextElement||s||u.observe(e.contextElement),u.observe(t));let d=s?zh(e):null;return s&&function h(){const m=zh(e);!d||m.x===d.x&&m.y===d.y&&m.width===d.width&&m.height===d.height||n(),d=m,l=requestAnimationFrame(h)}(),n(),()=>{var h;c.forEach(m=>{a&&m.removeEventListener("scroll",n),o&&m.removeEventListener("resize",n)}),(h=u)==null||h.disconnect(),u=null,s&&cancelAnimationFrame(l)}}const qde=(e,t,n)=>{const r=new Map,a={platform:Gde,...n},o={...a.platform,_c:r};return nM(e,t,{...a,platform:o})},Zde=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:a}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?v2({element:r.current,padding:a}).fn(n):{}:r?v2({element:r,padding:a}).fn(n):{}}}};var P_=typeof document<"u"?w.useLayoutEffect:w.useEffect;function O_(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,a;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!=t.length)return!1;for(r=n;r--!==0;)if(!O_(e[r],t[r]))return!1;return!0}if(a=Object.keys(e),n=a.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,a[r]))return!1;for(r=n;r--!==0;){const o=a[r];if(!(o==="_owner"&&e.$$typeof)&&!O_(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function yR(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function gR(e,t){const n=yR(e);return Math.round(t*n)/n}function vR(e){const t=Te.useRef(e);return P_(()=>{t.current=e}),t}function Yde(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:a,elements:{reference:o,floating:i}={},transform:s=!0,whileElementsMounted:c,open:l}=e,[u,d]=Te.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[h,m]=Te.useState(r);O_(h,r)||m(r);const[v,g]=Te.useState(null),[_,k]=Te.useState(null),x=Te.useCallback(K=>{K!=T.current&&(T.current=K,g(K))},[g]),S=Te.useCallback(K=>{K!==$.current&&($.current=K,k(K))},[k]),M=o||v,E=i||_,T=Te.useRef(null),$=Te.useRef(null),D=Te.useRef(u),F=vR(c),G=vR(a),z=Te.useCallback(()=>{if(!T.current||!$.current)return;const K={placement:t,strategy:n,middleware:h};G.current&&(K.platform=G.current),qde(T.current,$.current,K).then(Q=>{const he={...Q,isPositioned:!0};Z.current&&!O_(D.current,he)&&(D.current=he,kS.flushSync(()=>{d(he)}))})},[h,t,n,G]);P_(()=>{l===!1&&D.current.isPositioned&&(D.current.isPositioned=!1,d(K=>({...K,isPositioned:!1})))},[l]);const Z=Te.useRef(!1);P_(()=>(Z.current=!0,()=>{Z.current=!1}),[]),P_(()=>{if(M&&(T.current=M),E&&($.current=E),M&&E){if(F.current)return F.current(M,E,z);z()}},[M,E,z,F]);const H=Te.useMemo(()=>({reference:T,floating:$,setReference:x,setFloating:S}),[x,S]),j=Te.useMemo(()=>({reference:M,floating:E}),[M,E]),Y=Te.useMemo(()=>{const K={position:n,left:0,top:0};if(!j.floating)return K;const Q=gR(j.floating,u.x),he=gR(j.floating,u.y);return s?{...K,transform:"translate("+Q+"px, "+he+"px)",...yR(j.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:Q,top:he}},[n,s,j.floating,u.x,u.y]);return Te.useMemo(()=>({...u,update:z,refs:H,elements:j,floatingStyles:Y}),[u,z,H,j,Y])}const _R="Popper",[bR,kR]=$o(_R),[Xde,wR]=bR(_R),Jde=e=>{const{__scopePopper:t,children:n}=e,[r,a]=w.useState(null);return w.createElement(Xde,{scope:t,anchor:r,onAnchorChange:a},n)},Kde="PopperAnchor",Qde=w.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...a}=e,o=wR(Kde,n),i=w.useRef(null),s=Sr(t,i);return w.useEffect(()=>{o.onAnchorChange((r==null?void 0:r.current)||i.current)}),r?null:w.createElement(Cn.div,rt({},a,{ref:s}))}),xR="PopperContent",[efe,Bzt]=bR(xR),tfe=w.forwardRef((e,t)=>{var n,r,a,o,i,s,c,l;const{__scopePopper:u,side:d="bottom",sideOffset:h=0,align:m="center",alignOffset:v=0,arrowPadding:g=0,avoidCollisions:_=!0,collisionBoundary:k=[],collisionPadding:x=0,sticky:S="partial",hideWhenDetached:M=!1,updatePositionStrategy:E="optimized",onPlaced:T,...$}=e,D=wR(xR,u),[F,G]=w.useState(null),z=Sr(t,re=>G(re)),[Z,H]=w.useState(null),j=A0(Z),Y=(n=j==null?void 0:j.width)!==null&&n!==void 0?n:0,K=(r=j==null?void 0:j.height)!==null&&r!==void 0?r:0,Q=d+(m!=="center"?"-"+m:""),he=typeof x=="number"?x:{top:0,right:0,bottom:0,left:0,...x},ne=Array.isArray(k)?k:[k],le=ne.length>0,ae={padding:he,boundary:ne.filter(nfe),altBoundary:le},{refs:ve,floatingStyles:Oe,placement:pe,isPositioned:te,middlewareData:Ee}=Yde({strategy:"fixed",placement:Q,whileElementsMounted:(...re)=>Wde(...re,{animationFrame:E==="always"}),elements:{reference:D.anchor},middleware:[lM({mainAxis:h+K,alignmentAxis:v}),_&&dM({mainAxis:!0,crossAxis:!1,limiter:S==="partial"?fM():void 0,...ae}),_&&oM({...ae}),hM({...ae,apply:({elements:re,rects:be,availableWidth:we,availableHeight:Ze})=>{const{width:Ve,height:Se}=be.reference,Ie=re.floating.style;Ie.setProperty("--radix-popper-available-width",`${we}px`),Ie.setProperty("--radix-popper-available-height",`${Ze}px`),Ie.setProperty("--radix-popper-anchor-width",`${Ve}px`),Ie.setProperty("--radix-popper-anchor-height",`${Se}px`)}}),Z&&Zde({element:Z,padding:g}),rfe({arrowWidth:Y,arrowHeight:K}),M&&cM({strategy:"referenceHidden",...ae})]}),[Re,Ge]=CR(pe),Ue=za(T);mc(()=>{te&&(Ue==null||Ue())},[te,Ue]);const at=(a=Ee.arrow)===null||a===void 0?void 0:a.x,ct=(o=Ee.arrow)===null||o===void 0?void 0:o.y,et=((i=Ee.arrow)===null||i===void 0?void 0:i.centerOffset)!==0,[wt,lt]=w.useState();return mc(()=>{F&<(window.getComputedStyle(F).zIndex)},[F]),w.createElement("div",{ref:ve.setFloating,"data-radix-popper-content-wrapper":"",style:{...Oe,transform:te?Oe.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:wt,"--radix-popper-transform-origin":[(s=Ee.transformOrigin)===null||s===void 0?void 0:s.x,(c=Ee.transformOrigin)===null||c===void 0?void 0:c.y].join(" ")},dir:e.dir},w.createElement(efe,{scope:u,placedSide:Re,onArrowChange:H,arrowX:at,arrowY:ct,shouldHideArrow:et},w.createElement(Cn.div,rt({"data-side":Re,"data-align":Ge},$,{ref:z,style:{...$.style,animation:te?void 0:"none",opacity:(l=Ee.hide)!==null&&l!==void 0&&l.referenceHidden?0:void 0}}))))});function nfe(e){return e!==null}const rfe=e=>({name:"transformOrigin",options:e,fn(t){var n,r,a,o,i;const{placement:s,rects:c,middlewareData:l}=t,d=((n=l.arrow)===null||n===void 0?void 0:n.centerOffset)!==0,h=d?0:e.arrowWidth,m=d?0:e.arrowHeight,[v,g]=CR(s),_={start:"0%",center:"50%",end:"100%"}[g],k=((r=(a=l.arrow)===null||a===void 0?void 0:a.x)!==null&&r!==void 0?r:0)+h/2,x=((o=(i=l.arrow)===null||i===void 0?void 0:i.y)!==null&&o!==void 0?o:0)+m/2;let S="",M="";return v==="bottom"?(S=d?_:`${k}px`,M=`${-m}px`):v==="top"?(S=d?_:`${k}px`,M=`${c.floating.height+m}px`):v==="right"?(S=`${-m}px`,M=d?_:`${x}px`):v==="left"&&(S=`${c.floating.width+m}px`,M=d?_:`${x}px`),{data:{x:S,y:M}}}});function CR(e){const[t,n="center"]=e.split("-");return[t,n]}const afe=Jde,ofe=Qde,ife=tfe,sfe=w.forwardRef((e,t)=>{var n;const{container:r=globalThis==null||(n=globalThis.document)===null||n===void 0?void 0:n.body,...a}=e;return r?Br.createPortal(w.createElement(Cn.div,rt({},a,{ref:t})),r):null}),y6="dismissableLayer.update",cfe="dismissableLayer.pointerDownOutside",lfe="dismissableLayer.focusOutside";let SR;const ufe=w.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),dfe=w.forwardRef((e,t)=>{var n;const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:i,onInteractOutside:s,onDismiss:c,...l}=e,u=w.useContext(ufe),[d,h]=w.useState(null),m=(n=d==null?void 0:d.ownerDocument)!==null&&n!==void 0?n:globalThis==null?void 0:globalThis.document,[,v]=w.useState({}),g=Sr(t,D=>h(D)),_=Array.from(u.layers),[k]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),x=_.indexOf(k),S=d?_.indexOf(d):-1,M=u.layersWithOutsidePointerEventsDisabled.size>0,E=S>=x,T=ffe(D=>{const F=D.target,G=[...u.branches].some(z=>z.contains(F));!E||G||(o==null||o(D),s==null||s(D),D.defaultPrevented||c==null||c())},m),$=hfe(D=>{const F=D.target;[...u.branches].some(z=>z.contains(F))||(i==null||i(D),s==null||s(D),D.defaultPrevented||c==null||c())},m);return Pw(D=>{S===u.layers.size-1&&(a==null||a(D),!D.defaultPrevented&&c&&(D.preventDefault(),c()))},m),w.useEffect(()=>{if(d)return r&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(SR=m.body.style.pointerEvents,m.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),MR(),()=>{r&&u.layersWithOutsidePointerEventsDisabled.size===1&&(m.body.style.pointerEvents=SR)}},[d,m,r,u]),w.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),MR())},[d,u]),w.useEffect(()=>{const D=()=>v({});return document.addEventListener(y6,D),()=>document.removeEventListener(y6,D)},[]),w.createElement(Cn.div,rt({},l,{ref:g,style:{pointerEvents:M?E?"auto":"none":void 0,...e.style},onFocusCapture:Bt(e.onFocusCapture,$.onFocusCapture),onBlurCapture:Bt(e.onBlurCapture,$.onBlurCapture),onPointerDownCapture:Bt(e.onPointerDownCapture,T.onPointerDownCapture)}))});function ffe(e,t=globalThis==null?void 0:globalThis.document){const n=za(e),r=w.useRef(!1),a=w.useRef(()=>{});return w.useEffect(()=>{const o=s=>{if(s.target&&!r.current){let l=function(){AR(cfe,n,c,{discrete:!0})};const c={originalEvent:s};s.pointerType==="touch"?(t.removeEventListener("click",a.current),a.current=l,t.addEventListener("click",a.current,{once:!0})):l()}else t.removeEventListener("click",a.current);r.current=!1},i=window.setTimeout(()=>{t.addEventListener("pointerdown",o)},0);return()=>{window.clearTimeout(i),t.removeEventListener("pointerdown",o),t.removeEventListener("click",a.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function hfe(e,t=globalThis==null?void 0:globalThis.document){const n=za(e),r=w.useRef(!1);return w.useEffect(()=>{const a=o=>{o.target&&!r.current&&AR(lfe,n,{originalEvent:o},{discrete:!1})};return t.addEventListener("focusin",a),()=>t.removeEventListener("focusin",a)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function MR(){const e=new CustomEvent(y6);document.dispatchEvent(e)}function AR(e,t,n,{discrete:r}){const a=n.originalEvent.target,o=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&a.addEventListener(e,t,{once:!0}),r?k0(a,o):a.dispatchEvent(o)}let g6;const ER="HoverCard",[IR,Vzt]=$o(ER,[kR]),v6=kR(),[pfe,N_]=IR(ER),mfe=e=>{const{__scopeHoverCard:t,children:n,open:r,defaultOpen:a,onOpenChange:o,openDelay:i=700,closeDelay:s=300}=e,c=v6(t),l=w.useRef(0),u=w.useRef(0),d=w.useRef(!1),h=w.useRef(!1),[m=!1,v]=Ps({prop:r,defaultProp:a,onChange:o}),g=w.useCallback(()=>{clearTimeout(u.current),l.current=window.setTimeout(()=>v(!0),i)},[i,v]),_=w.useCallback(()=>{clearTimeout(l.current),!d.current&&!h.current&&(u.current=window.setTimeout(()=>v(!1),s))},[s,v]),k=w.useCallback(()=>v(!1),[v]);return w.useEffect(()=>()=>{clearTimeout(l.current),clearTimeout(u.current)},[]),w.createElement(pfe,{scope:t,open:m,onOpenChange:v,onOpen:g,onClose:_,onDismiss:k,hasSelectionRef:d,isPointerDownOnContentRef:h},w.createElement(afe,c,n))},yfe="HoverCardTrigger",gfe=w.forwardRef((e,t)=>{const{__scopeHoverCard:n,...r}=e,a=N_(yfe,n),o=v6(n);return w.createElement(ofe,rt({asChild:!0},o),w.createElement(Cn.a,rt({"data-state":a.open?"open":"closed"},r,{ref:t,onPointerEnter:Bt(e.onPointerEnter,D_(a.onOpen)),onPointerLeave:Bt(e.onPointerLeave,D_(a.onClose)),onFocus:Bt(e.onFocus,a.onOpen),onBlur:Bt(e.onBlur,a.onClose),onTouchStart:Bt(e.onTouchStart,i=>i.preventDefault())})))}),TR="HoverCardPortal",[vfe,_fe]=IR(TR,{forceMount:void 0}),bfe=e=>{const{__scopeHoverCard:t,forceMount:n,children:r,container:a}=e,o=N_(TR,t);return w.createElement(vfe,{scope:t,forceMount:n},w.createElement(ki,{present:n||o.open},w.createElement(sfe,{asChild:!0,container:a},r)))},_6="HoverCardContent",kfe=w.forwardRef((e,t)=>{const n=_fe(_6,e.__scopeHoverCard),{forceMount:r=n.forceMount,...a}=e,o=N_(_6,e.__scopeHoverCard);return w.createElement(ki,{present:r||o.open},w.createElement(wfe,rt({"data-state":o.open?"open":"closed"},a,{onPointerEnter:Bt(e.onPointerEnter,D_(o.onOpen)),onPointerLeave:Bt(e.onPointerLeave,D_(o.onClose)),ref:t})))}),wfe=w.forwardRef((e,t)=>{const{__scopeHoverCard:n,onEscapeKeyDown:r,onPointerDownOutside:a,onFocusOutside:o,onInteractOutside:i,...s}=e,c=N_(_6,n),l=v6(n),u=w.useRef(null),d=Sr(t,u),[h,m]=w.useState(!1);return w.useEffect(()=>{if(h){const v=document.body;return g6=v.style.userSelect||v.style.webkitUserSelect,v.style.userSelect="none",v.style.webkitUserSelect="none",()=>{v.style.userSelect=g6,v.style.webkitUserSelect=g6}}},[h]),w.useEffect(()=>{if(u.current){const v=()=>{m(!1),c.isPointerDownOnContentRef.current=!1,setTimeout(()=>{var g;((g=document.getSelection())===null||g===void 0?void 0:g.toString())!==""&&(c.hasSelectionRef.current=!0)})};return document.addEventListener("pointerup",v),()=>{document.removeEventListener("pointerup",v),c.hasSelectionRef.current=!1,c.isPointerDownOnContentRef.current=!1}}},[c.isPointerDownOnContentRef,c.hasSelectionRef]),w.useEffect(()=>{u.current&&xfe(u.current).forEach(g=>g.setAttribute("tabindex","-1"))}),w.createElement(dfe,{asChild:!0,disableOutsidePointerEvents:!1,onInteractOutside:i,onEscapeKeyDown:r,onPointerDownOutside:a,onFocusOutside:Bt(o,v=>{v.preventDefault()}),onDismiss:c.onDismiss},w.createElement(ife,rt({},l,s,{onPointerDown:Bt(s.onPointerDown,v=>{v.currentTarget.contains(v.target)&&m(!0),c.hasSelectionRef.current=!1,c.isPointerDownOnContentRef.current=!0}),ref:d,style:{...s.style,userSelect:h?"text":void 0,WebkitUserSelect:h?"text":void 0,"--radix-hover-card-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-hover-card-content-available-width":"var(--radix-popper-available-width)","--radix-hover-card-content-available-height":"var(--radix-popper-available-height)","--radix-hover-card-trigger-width":"var(--radix-popper-anchor-width)","--radix-hover-card-trigger-height":"var(--radix-popper-anchor-height)"}})))});function D_(e){return t=>t.pointerType==="touch"?void 0:e()}function xfe(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});for(;n.nextNode();)t.push(n.currentNode);return t}const Cfe=mfe,Sfe=gfe,Mfe=bfe,Afe=kfe,$R=()=>{const e=ga.useSearchParams()??new URLSearchParams,t=ga.useParams()??{},n=new URLSearchParams(e.toString());return Object.getOwnPropertyNames(t).forEach(r=>{n.delete(r);const a=t[r]||"";(typeof a=="string"?a.split("/"):a).forEach(i=>{n.append(r,i)})}),new ga.ReadonlyURLSearchParams(n)},PR=e=>{const{t}=At(),{fromUser:n,toUser:r,emoji:a="🏝️",borderDashed:o=!0,date:i,className:s}=e,c=$R(),l=ga.useRouter();return!n||!r?null:b("div",{className:Fe("relative h-full pb-5",s),children:ue("div",{className:Fe("flex h-full flex-col items-center justify-start rounded-md border bg-white px-4 py-4 font-normal dark:bg-transparent",o&&"border-dashed"),children:[b("div",{className:"bg-emphasis flex h-14 w-14 flex-col items-center justify-center rounded-full",children:b("span",{className:"m-auto text-center text-lg",children:a})}),ue("div",{className:"space-y-2 text-center",children:[b("p",{className:"mt-2 text-base font-bold",children:t("ooo_user_is_ooo",{displayName:n.displayName})}),(n==null?void 0:n.displayName)&&(r==null?void 0:r.displayName)&&b("p",{className:"text-center text-sm",children:b(bP,{i18nKey:"ooo_slots_returning",values:{displayName:r.displayName},default:"<1>{{ displayName }}</1> can take their meetings while they are away.",components:[b("strong",{children:"username"},"username")]})})]}),(r==null?void 0:r.id)&&b(Sn,{className:"mt-8 max-w-[90%]",variant:"button",color:"secondary",onClick:()=>{const u=c.get("month"),d=c.get("layout"),h=c.get("date")||i;l.push(`/${r.username}?${u?`month=${u}&`:""}date=${h}${d?`&layout=${d}`:""}`)},children:b("span",{className:"block overflow-hidden text-ellipsis whitespace-nowrap",children:t("ooo_slots_book_with",{displayName:r.displayName})})})]})})},cf=n_(e=>({overlayBusyDates:void 0,setOverlayBusyDates:t=>{e({overlayBusyDates:t})},calendarSettingsOverlayModal:!1,setCalendarSettingsOverlayModal:t=>{e({calendarSettingsOverlayModal:t})},continueWithProviderModal:!1,setContinueWithProviderModal:t=>{e({continueWithProviderModal:t})}}));function OR(e){const t=e.getHours().toString().padStart(2,"0"),n=e.getMinutes().toString().padStart(2,"0");return`${t}:${n}`}function Efe({start:e,selectedDuration:t,offset:n}){const r=cf(s=>s.overlayBusyDates);let a=null,o=null;return{isOverlapping:r&&r.some(s=>{const c=Xe(s.start),l=Xe(s.end),u=Xe(e.add(n,"hours")).add(t??0,"minute"),d=(u.isSame(c)||u.isAfter(c))&&e.add(n,"hours")<l&&u>c;return a=d?OR(c.toDate()):null,o=d?OR(l.toDate()):null,d}),overlappingTimeStart:a,overlappingTimeEnd:o}}const NR=({showExact:e=!0,bookedSeats:t,totalSeats:n,variant:r="whole"})=>{const{t:a}=At(),o=n-t,i=t/n>=.5,s=t/n>=.83;return b("span",{className:Fe(e&&"lowercase","truncate"),children:e?`${o}${r==="fraction"?` / ${n}`:""} ${a("seats_available",{count:o})}`:s?a("seats_nearly_full"):i?a("seats_half_full"):a("seats_available",{count:o})})},Ife=({slot:e,seatsPerTimeSlot:t,selectedSlots:n,onTimeSelect:r,showAvailableSeatsCount:a,event:o,customClassnames:i})=>{const{t:s}=At(),c=pl("overlayCalendar")==="true"||ti.getItem("overlayCalendarSwitchDefault"),[l,u]=Si(H=>[H.timeFormat,H.timezone]),d=Ot(H=>H.bookingData),h=Ot(H=>H.layout),{data:m}=o,v=!!t,g=Xe.utc(e.time).tz(u),_=!!(v&&e.attendees&&e.attendees>=t),k=e.attendees&&t&&e.attendees/t>=.5,S=e.attendees&&t&&e.attendees/t>=.83?"bg-rose-600":k?"bg-yellow-500":"bg-emerald-400",M=Xe(),T=(M.tz(u).utcOffset()-M.utcOffset())/60,{isOverlapping:$,overlappingTimeEnd:D,overlappingTimeStart:F}=Efe({start:g,selectedDuration:(m==null?void 0:m.length)??0,offset:T}),[G,z]=w.useState(!1),Z=w.useCallback(()=>{if(!c){r(e.time,(e==null?void 0:e.attendees)||0,t,e.bookingUid);return}if($&&G){z(!1);return}if($&&!G){z(!0);return}G||r(e.time,(e==null?void 0:e.attendees)||0,t,e.bookingUid)},[c,$,G,r,e.time,e==null?void 0:e.attendees,e.bookingUid,t]);return b(LT,{children:ue("div",{className:"flex gap-2",children:[ue(Sn,{disabled:_||!!(e.bookingUid&&e.bookingUid===(d==null?void 0:d.uid)),"data-testid":"time","data-disabled":_,"data-time":e.time,onClick:Z,className:Fe("min-h-9 hover:border-brand-default mb-2 flex h-auto w-full flex-grow flex-col justify-center py-2",(n==null?void 0:n.includes(e.time))&&"border-brand-default",`${i}`),color:"secondary",children:[ue("div",{className:"flex items-center gap-2",children:[!v&&c&&b("span",{className:Fe("inline-block h-2 w-2 rounded-full",$?"bg-rose-600":"bg-emerald-400")}),g.format(l)]}),_&&b("p",{className:"text-sm",children:s("booking_full")}),v&&!_&&ue("p",{className:"flex items-center text-sm",children:[b("span",{className:Fe(S,"mr-1 inline-block h-2 w-2 rounded-full"),"aria-hidden":!0}),b(NR,{showExact:!!a,totalSeats:t,bookedSeats:e.attendees||0})]})]},e.time),G&&$&&ue(Cfe,{children:[b(Sfe,{asChild:!0,children:b(K0.div,{initial:{width:0},animate:{width:"auto"},exit:{width:0},children:b(Sn,{variant:h==="column_view"?"icon":"button",StartIcon:h==="column_view"?"chevron-right":void 0,onClick:()=>r(e.time,(e==null?void 0:e.attendees)||0,t,e.bookingUid),children:h!=="column_view"&&s("confirm")})})}),b(Mfe,{children:b(Afe,{side:"top",align:"end",sideOffset:2,children:ue("div",{className:"text-emphasis bg-inverted w-[var(--booker-timeslots-width)] rounded-md p-3",children:[b("div",{className:"flex items-center gap-2",children:b("p",{children:"Busy"})}),ue("p",{className:"text-muted",children:[F," - ",D]})]})})})]})]})})},Tfe=({slots:e,onTimeSelect:t,seatsPerTimeSlot:n,showAvailableSeatsCount:r,showTimeFormatToggle:a=!0,className:o,selectedSlots:i,event:s,customClassnames:c})=>{const{t:l}=At();if(e.every(m=>m.away))return b(b6,{...e[0]});const d=e[0]&&e[0].away,h=e[e.length-1]&&e[e.length-1].away;return b("div",{className:Fe("text-default flex flex-col",o),children:ue("div",{className:"h-full pb-4",children:[!e.length&&ue("div",{"data-testId":"no-slots-available",className:"bg-subtle border-subtle flex h-full flex-col items-center rounded-md border p-6 dark:bg-transparent",children:[b(Mt,{name:"calendar-x-2",className:"text-muted mb-2 h-4 w-4"}),b("p",{className:Fe("text-muted",a?"-mt-1 text-lg":"text-sm"),children:l("all_booked_today")})]}),d&&!h&&b(b6,{...e[0]}),e.map(m=>m.away?null:b(Ife,{customClassnames:c,onTimeSelect:t,slot:m,selectedSlots:i,seatsPerTimeSlot:n,showAvailableSeatsCount:r,event:s},m.time)),h&&!d&&b(b6,{...e[e.length-1],className:"pb-0"})]})})},b6=e=>{const{fromUser:t,toUser:n,reason:r,emoji:a,time:o,className:i=""}=e;return b(PR,{fromUser:t,toUser:n,date:Xe(o).format("YYYY-MM-DD"),reason:r,emoji:a,borderDashed:!0,className:i})},$fe=()=>b("div",{className:"flex w-[20%] flex-col only:w-full",children:Array.from({length:Math.floor(Math.random()*6)+1}).map((e,t)=>b(Jn,{className:"mb-4 h-6 w-full"},t))}),DR=({customClassname:e})=>{const t=Si(a=>a.timeFormat),n=Si(a=>a.setTimeFormat),{t:r}=At();return b(sC,{customClassnames:e,onValueChange:a=>{a&&a!==t&&n(a)},defaultValue:t,value:t,options:[{value:Vh.TWELVE_HOUR,label:r("12_hour_short")},{value:Vh.TWENTY_FOUR_HOUR,label:r("24_hour_short")}]})},Pfe=({date:e,showTimeFormatToggle:t=!0,availableMonth:n,customClassnames:r})=>{const{t:a,i18n:o}=At(),[i]=Ot(u=>[u.layout],Ua),s=i===Nn.COLUMN_VIEW,c=i===Nn.MONTH_VIEW,l=Xe().isSame(e,"day");return ue("header",{className:Fe("dark:bg-muted dark:before:bg-muted mb-3 flex w-full flex-row items-center font-medium","bg-default before:bg-default",r==null?void 0:r.availableTimeSlotsHeaderContainer),children:[ue("span",{className:Fe(s&&"w-full text-center",s?"text-subtle text-xs uppercase":"text-emphasis font-semibold"),children:[b("span",{className:Fe(l&&!(r!=null&&r.availableTimeSlotsTitle)&&"!text-default",r==null?void 0:r.availableTimeSlotsTitle),children:gx(o.language,Number(e.format("d")),"short")}),ue("span",{className:Fe(s&&l&&"bg-brand-default text-brand ml-2","inline-flex items-center justify-center rounded-3xl px-1 pt-0.5 font-medium",c?`text-default text-sm ${r==null?void 0:r.availableTimeSlotsTitle}`:`text-xs ${r==null?void 0:r.availableTimeSlotsTitle}`),children:[e.format("DD"),n&&`, ${n}`]})]}),t&&b("div",{className:"ml-auto rtl:mr-auto",children:b(DR,{customClassname:r==null?void 0:r.availableTimeSlotsTimeFormatToggle})})]})},Ofe=({extraDays:e,limitHeight:t,seatsPerTimeSlot:n,showAvailableSeatsCount:r,schedule:a,isLoading:o,event:i,customClassnames:s})=>{const c=Ot(M=>M.selectedDate),l=Ot(M=>M.setSelectedTimeslot),u=Ot(M=>M.setSeatedEventData),d=c||Xe().format("YYYY-MM-DD"),[h]=Ot(M=>[M.layout]),m=h===Nn.COLUMN_VIEW,v=w.useRef(null),g=(M,E,T,$)=>{l(M),T&&u({seatsPerTimeSlot:T,attendees:E,bookingUid:$,showAvailableSeatsCount:r})},k=e6(a==null?void 0:a.slots).filter(M=>Xe(c).diff(M,"day")<=0),x=e?k.length>0?k.slice(0,e):[]:[d],S=mue(x,a==null?void 0:a.slots);return ue(vt,{children:[b("div",{className:Fe("flex",`${s==null?void 0:s.availableTimeSlotsContainer}`),children:o?b("div",{className:"mb-3 h-8"}):S.length>0&&S.map(M=>b(Pfe,{customClassnames:{availableTimeSlotsHeaderContainer:s==null?void 0:s.availableTimeSlotsHeaderContainer,availableTimeSlotsTitle:s==null?void 0:s.availableTimeSlotsTitle,availableTimeSlotsTimeFormatToggle:s==null?void 0:s.availableTimeSlotsTimeFormatToggle},date:Xe(M.date),showTimeFormatToggle:!m,availableMonth:Xe(c).format("MM")!==Xe(M.date).format("MM")?Xe(M.date).format("MMM"):void 0},M.date))}),ue("div",{ref:v,className:Fe(t&&"scroll-bar flex-grow overflow-auto md:h-[400px]",!t&&"flex h-full w-full flex-row gap-4",`${s==null?void 0:s.availableTimeSlotsContainer}`),children:[o&&Array.from({length:1+(e??0)}).map((M,E)=>b($fe,{},E)),!o&&S.length>0&&S.map(M=>b("div",{className:"scroll-bar h-full w-full overflow-y-auto overflow-x-hidden",children:b(Tfe,{className:s==null?void 0:s.availableTimeSlotsContainer,customClassnames:s==null?void 0:s.availableTimes,showTimeFormatToggle:!m,onTimeSelect:g,slots:M.slots,seatsPerTimeSlot:n,showAvailableSeatsCount:r,event:i})},M.date))]})]})},Nfe=e=>!!e;function Dfe(e,t){return e.map(n=>{const r=x_(n.type),a=ID(n);if(typeof a!="string"||!r)return null;const o=r.type;return{label:a.search(/^https?:/)!==-1?a:t(a),value:o,inputPlaceholder:t((r==null?void 0:r.attendeeInputPlaceholder)||"")}}).filter(Nfe)}var Rfe=function(e){var t=e.as,n=e.errors,r=e.name,a=e.message,o=e.render,i=function(h,m){if(h==null)return{};var v,g,_={},k=Object.keys(h);for(g=0;g<k.length;g++)m.indexOf(v=k[g])>=0||(_[v]=h[v]);return _}(e,["as","errors","name","message","render"]),s=Rs(),c=Nt(n||s.formState.errors,r);if(!c)return null;var l=c.message,u=c.types,d=Object.assign({},i,{children:l||a});return Te.isValidElement(t)?Te.cloneElement(t,d):o?o({message:l||a,messages:u}):Te.createElement(t||Te.Fragment,d)};const R_=Su(async()=>(await Promise.resolve().then(()=>CZe)).SelectWithValidation),Lfe=e=>{const{value:t,setValue:n,readOnly:r,placeholder:a,maxLength:o,customProps:i,...s}=e;return b(qb,{value:t||"",placeholder:a,disabled:r,onChange:u=>{const d=u.target.value;n(d)},maxLength:o,...i,...s})},Ffe=e=>{const{value:t,noLabel:n,setValue:r,readOnly:a,placeholder:o,customProps:i,type:s="text",...c}=e;return b(a8,{containerClassName:"w-full",type:s,value:t||"",labelSrOnly:n,placeholder:o,disabled:a,onChange:d=>{const h=d.target.value;r(h)},...c,...i})};function jfe({value:e,setValue:t,...n}){return b(a8,{type:"number",labelSrOnly:n.noLabel,containerClassName:"w-full",className:"bg-default border-default disabled:bg-emphasis focus:ring-brand-default dark:focus:border-emphasis focus:border-subtle block w-full rounded-md text-sm disabled:hover:cursor-not-allowed",value:e,onChange:r=>{t(r.target.value)},...n})}const Bfe=({listValues:e,setValue:t,value:n,...r})=>{if(!e)return null;const a=e.map(i=>({label:i.title,value:i.value})),o=a.filter(i=>n==null?void 0:n.includes(i.value));return b(R_,{"aria-label":"multi-select-dropdown",className:"mb-2",onChange:i=>{t(i==null?void 0:i.map(s=>s.value))},value:o,isMulti:!0,isDisabled:r.readOnly,options:a,...r})};function Vfe({listValues:e,setValue:t,value:n,...r}){if(!e)return null;const a=e.map(i=>({label:i.title,value:i.value})),o=a.find(i=>i.value===n);return b(R_,{"aria-label":"select-dropdown",className:"data-testid-select mb-2",onChange:i=>{i&&t(i.value)},isDisabled:r.readOnly,value:o,options:a,...r})}function zfe({config:e,type:t,label:n,onClick:r,readonly:a}){if(t==="delRule"||t=="delGroup")return b("button",{className:"ml-5",children:b(Mt,{name:"trash",className:"text-subtle m-0 h-4 w-4",onClick:r})});let o="";return t==="addRule"?(n=e!=null&&e.operators.__calReporting?"Add Filter":"Add rule",o="add-rule"):t=="addGroup"&&(n="Add rule group",o="add-rule-group"),b(Sn,{StartIcon:"plus","data-testid":o,type:"button",color:"secondary",disabled:a,onClick:r,children:n})}function Hfe({children:e}){return e instanceof Array?b(vt,{children:e.map((t,n)=>t?b("div",{className:"mb-2",children:t},n):null)}):null}function Ufe({not:e,setNot:t,config:n,conjunctionOptions:r,setConjunction:a,disabled:o}){if(!n||!r)return null;const i=Object.keys(r).length,s=o,{forceShowConj:c}=n.settings,l=c||i>1&&!s,u=[{label:"All",value:"all"},{label:"Any",value:"any"},{label:"None",value:"none"}];return l?(()=>{const{checked:h}=r.AND,{checked:m}=r.OR,v=e;let g=h?"all":m?"any":"all";v&&(g=g=="any"?"none":"all");const _=u.find(x=>x.value===g),k=n.operators.__calReporting?"Query where":"Rule group when";return ue("div",{className:"flex items-center text-sm",children:[b("span",{children:k}),b(R_,{className:"flex px-2",defaultValue:_,options:u,onChange:x=>{x&&(x.value==="all"?(a("AND"),t(!1)):x.value==="any"?(a("OR"),t(!1)):x.value==="none"&&(a("OR"),t(!0)))}}),b("span",{children:"match"})]})})():null}const J1={TextWidget:Ffe,TextAreaWidget:Lfe,SelectWidget:Vfe,NumberWidget:jfe,MultiSelectWidget:Bfe,FieldSelect:function(t){const{items:n,setField:r,selectedKey:a}=t,o=n.map(s=>({...s,value:s.key})),i=o.find(s=>s.value===a);return b(R_,{className:"data-testid-field-select mb-2",menuPosition:"fixed",onChange:s=>{s&&r(s.value)},defaultValue:i,options:o})},Button:zfe,ButtonGroup:Hfe,Conjs:Ufe,Provider:({children:e})=>e},Gfe={boolean:e=>typeof e=="boolean",multiselect:e=>e instanceof Array&&e.every(t=>typeof t=="string"),objectiveWithInput:e=>typeof e=="object"&&e!==null?"value"in e:!1,select:e=>typeof e=="string",text:e=>typeof e=="string",textList:e=>e instanceof Array&&e.every(t=>typeof t=="string"),variants:e=>typeof e=="object"&&e!==null||typeof e=="string"},Wfe={text:{propsType:Qo.text,factory:e=>b(J1.TextWidget,{noLabel:!0,...e})},textarea:{propsType:Qo.textarea,factory:e=>b(J1.TextAreaWidget,{rows:3,...e})},number:{propsType:Qo.number,factory:e=>b(J1.NumberWidget,{noLabel:!0,...e})},name:{propsType:Qo.name,factory:e=>{const{variant:t="fullName"}=e,n=(o,i)=>{let s=e.value;typeof s!="object"&&(s={}),e.setValue({...s,[o]:i})};if(!e.variants)throw new Error("'variants' is required for 'name' type of field");if(t!=="firstAndLastName"&&t!=="fullName")throw new Error(`Invalid variant name '${t}' for 'name' type of field`);const r=XN(t,e.value);if(t==="fullName"){if(typeof r!="string")throw new Error("Invalid value for 'fullName' variant");const i=e.variants[t].fields[0];return b(fm,{name:"name",showAsteriskIndicator:!0,placeholder:i.placeholder,label:i.label,containerClassName:"w-full",readOnly:e.readOnly,value:r,required:i.required,type:"text",onChange:s=>{e.setValue(s.target.value)}})}const a=e.variants[t];if(typeof r!="object")throw new Error("Invalid value for 'fullName' variant");return b("div",{className:"flex space-x-4",children:a.fields.map(o=>b(fm,{className:"!mb-0",showAsteriskIndicator:!0,name:o.name,readOnly:e.readOnly,placeholder:o.placeholder,label:o.label,containerClassName:`w-full testid-${o.name}`,value:r[o.name],required:o.required,type:"text",onChange:i=>n(o.name,i.target.value)},o.name))})}},phone:{propsType:Qo.phone,factory:({setValue:e,readOnly:t,...n})=>n?b(FH,{disabled:t,onChange:r=>{e(r)},...n}):b("div",{})},email:{propsType:Qo.email,factory:e=>e?b(J1.TextWidget,{type:"email",noLabel:!0,...e}):b("div",{})},address:{propsType:Qo.address,factory:e=>b(LH,{onChange:t=>{e.setValue(t)},...e})},multiemail:{propsType:Qo.multiemail,factory:function({value:t,readOnly:n,label:r,setValue:a,...o}){const i=o.placeholder,{t:s}=At();t=t||[];const c="dark:placeholder:text-muted focus:border-emphasis border-subtle block w-full rounded-md border-default text-sm focus:ring-black disabled:bg-emphasis disabled:hover:cursor-not-allowed dark:selection:bg-green-500 disabled:dark:text-subtle bg-default";return ue(vt,{children:[t.length?ue("div",{children:[b("label",{htmlFor:"guests",className:"text-default mb-1 block text-sm font-medium",children:r}),b("ul",{children:t.map((l,u)=>b("li",{children:b(OB,{disabled:n,value:t[u],className:c,onChange:d=>{t[u]=d.target.value,a(t)},placeholder:i,label:b(vt,{}),required:!0,onClickAddon:()=>{t.splice(u,1),a(t)},addOnSuffix:n?null:b(Ta,{content:"Remove email",children:b("button",{className:"m-1",type:"button",children:b(Mt,{name:"x",width:12,className:"text-default"})})})})},u))}),!n&&b(Sn,{"data-testid":"add-another-guest",type:"button",color:"minimal",StartIcon:"user-plus",className:"my-2.5",onClick:()=>{t.push(""),a(t)},children:s("add_another")})]}):b(vt,{}),!t.length&&!n&&b(Sn,{"data-testid":"add-guests",color:"minimal",variant:"button",StartIcon:"user-plus",onClick:()=>{t.push(""),a(t)},className:"mr-auto",children:r})]})}},multiselect:{propsType:Qo.multiselect,factory:e=>{const t={...e,listValues:e.options.map(n=>({title:n.label,value:n.value}))};return b(J1.MultiSelectWidget,{...t})}},select:{propsType:Qo.select,factory:e=>{const t={...e,listValues:e.options.map(n=>({title:n.label,value:n.value}))};return b(J1.SelectWidget,{...t})}},checkbox:{propsType:Qo.checkbox,factory:({options:e,readOnly:t,setValue:n,value:r})=>(r=r||[],b("div",{children:e.map((a,o)=>ue("label",{className:"block",children:[b("input",{type:"checkbox",disabled:t,onChange:i=>{const s=r.filter(c=>c!==a.value);i.target.checked&&s.push(a.value),n(s)},className:"border-default dark:border-default hover:bg-subtle checked:hover:bg-brand-default checked:bg-brand-default dark:checked:bg-brand-default dark:bg-darkgray-100 dark:hover:bg-subtle dark:checked:hover:bg-brand-default h-4 w-4 cursor-pointer rounded ltr:mr-2 rtl:ml-2",value:a.value,checked:r.includes(a.value)}),b("span",{className:"text-emphasis me-2 ms-2 text-sm",children:a.label??""})]},o))}))},radio:{propsType:Qo.radio,factory:({setValue:e,name:t,value:n,options:r})=>b(GH,{value:n,onValueChange:a=>{e(a)},children:b(vt,{children:r.map((a,o)=>b(qH,{label:a.label,value:a.label,id:`${t}.option.${o}.radio`},`option.${o}.radio`))})})},radioInput:{propsType:Qo.radioInput,factory:function({name:t,options:n,optionsInputs:r,value:a,setValue:o,readOnly:i}){var l;w.useEffect(()=>{var u;a||o({value:(u=n[0])==null?void 0:u.value,optionValue:""})},[n,o,a]);const{t:s}=At(),c=u=>u.label?u.label.search(/^https?:\/\//)!==-1?b("a",{href:u.label,target:"_blank",children:b("span",{className:"underline",children:u.label})}):u.label:"";return ue("div",{children:[b("div",{children:b("div",{className:"mb-2",children:n.length>1?n.map((u,d)=>ue("label",{className:"mb-1 flex items-center",children:[b("input",{type:"radio",disabled:i,name:t,className:"bg-default after:bg-default border-emphasis focus:ring-brand-default hover:bg-subtle hover:after:bg-subtle dark:checked:after:bg-brand-accent flex h-4 w-4 cursor-pointer items-center justify-center text-[--cal-brand] after:h-[6px] after:w-[6px] after:rounded-full after:content-[''] after:hover:block focus:ring-2 focus:ring-offset-0 ltr:mr-2 rtl:ml-2 dark:checked:hover:text-[--cal-brand]",value:u.value,onChange:h=>{o({value:h.target.value,optionValue:""})},checked:(a==null?void 0:a.value)===u.value}),b("span",{className:"text-emphasis me-2 ms-2 text-sm",children:c(u)??""}),b("span",{children:u.value==="phone"&&b(Cb,{content:s("number_in_international_format")})})]},d)):b(vt,{children:ue(Oc,{className:"flex",children:[n[0].label,!i&&((l=r[n[0].value])!=null&&l.required)?b("span",{className:"text-default mb-1 ml-1 text-sm font-medium",children:"*"}):null,n[0].value==="phone"&&b(Cb,{content:s("number_in_international_format")})]})})})}),(()=>{const u=r[a==null?void 0:a.value];return u?b("div",{children:b(RR,{readOnly:!!i,field:{...u,name:"optionField"},value:a==null?void 0:a.optionValue,setValue:d=>{o({value:a==null?void 0:a.value,optionValue:d||""})}})}):null})()]})}},boolean:{propsType:Qo.boolean,factory:({readOnly:e,name:t,label:n,value:r,setValue:a})=>b("div",{className:"flex",children:b(Jy,{name:t,onChange:o=>{o.target.checked?a(!0):a(!1)},placeholder:"",checked:r,disabled:e,description:"",descriptionAsSafeHtml:n??""})})}},qfe=["boolean"],Zfe=({field:e,readOnly:t,className:n})=>{const{t:r}=At(),{control:a,formState:o}=Rs(),{hidden:i,placeholder:s,label:c}=Xfe(e,r);return b("div",{"data-fob-field-name":e.name,className:Fe(n,i?"hidden":""),children:b(qd,{control:a,name:`responses.${e.name}`,render:({field:{value:l,onChange:u},fieldState:{error:d}})=>ue("div",{children:[b(RR,{field:{...e,label:c,placeholder:s,hidden:i},value:l,readOnly:t,setValue:h=>{u(h)}}),b(Rfe,{name:"responses",errors:o.errors,render:({message:h})=>(h=h||"",!(h.replace(/\{([^}]+)\}.*/,"$1")===e.name)&&!d?null:(h=h.replace(/\{[^}]+\}(.*)/,"$1").trim(),i&&console.error(`Error message for hidden field:${e.name} => ${h}`),ue("div",{"data-testid":`error-message-${e.name}`,className:"mt-2 flex items-center text-sm text-red-700 ",children:[b(Mt,{name:"info",className:"h-3 w-3 ltr:mr-2 rtl:ml-2"}),b("p",{children:r(h||"invalid_input")})]})))})]})})})};function Yfe(e){throw new Error(`Don't know how to handle ${JSON.stringify(e)}`)}const K1=({field:e,children:t,readOnly:n})=>{const{t:r}=At();return ue("div",{children:[e.type!=="boolean"&&e.type!=="multiemail"&&e.label&&b("div",{className:"mb-2 flex items-center",children:ue(Oc,{className:"!mb-0 flex",children:[b("span",{children:e.label}),b("span",{className:"text-emphasis -mb-1 ml-1 text-sm font-medium leading-none",children:!n&&e.required?"*":""}),e.type==="phone"&&b(Cb,{content:r("number_in_international_format")})]})}),t]})};function Xfe(e,t){var i;let n=!1,r=!!e.hidden;if(e.type==="radioInput"){const s=e.options;if((s==null?void 0:s.length)===1){if(!e.optionsInputs)throw new Error("radioInput must have optionsInputs");e.optionsInputs[s[0].value]?n=!0:r=!0}}if(qfe.includes(e.type)&&e.labelAsSafeHtml===void 0)throw new Error(`${e.name}:${e.type} type must have labelAsSafeHtml set`);const a=n?"":e.labelAsSafeHtml||e.label||t(e.defaultLabel||""),o=e.placeholder||t(e.defaultPlaceholder||"");return(i=e.variantsConfig)!=null&&i.variants&&Object.entries(e.variantsConfig.variants).forEach(([s,c])=>{c.fields.forEach(l=>{var h,m,v,g;const u=(h=Ey[e.type])==null?void 0:h.variantsConfig,d=(g=(v=(m=u==null?void 0:u.variants)==null?void 0:m[s])==null?void 0:v.fieldsMap[l.name])==null?void 0:g.defaultLabel;l.label=l.label||t(d||"")})}),{hidden:r,placeholder:o,label:a}}const RR=({field:e,value:t,setValue:n,readOnly:r})=>{const a=e.type||"text",o=Wfe[a];if(t!==void 0&&!((s,c)=>Gfe[c](s))(t,o.propsType))throw new Error(`Value ${t} is not valid for type ${o.propsType} for field ${e.name}`);if(o.propsType==="text")return b(K1,{field:e,readOnly:r,children:b(o.factory,{placeholder:e.placeholder,name:e.name,label:e.label,readOnly:r,value:t,setValue:n})});if(o.propsType==="boolean")return b(K1,{field:e,readOnly:r,children:b(o.factory,{name:e.name,label:e.label,readOnly:r,value:t,setValue:n,placeholder:e.placeholder})});if(o.propsType==="textList")return b(K1,{field:e,readOnly:r,children:b(o.factory,{placeholder:e.placeholder,name:e.name,label:e.label,readOnly:r,value:t,setValue:n})});if(o.propsType==="select"){if(!e.options)throw new Error("Field options is not defined");return b(K1,{field:e,readOnly:r,children:b(o.factory,{readOnly:r,value:t,name:e.name,placeholder:e.placeholder,setValue:n,options:e.options.map(s=>({...s,title:s.label}))})})}if(o.propsType==="multiselect"){if(!e.options)throw new Error("Field options is not defined");return b(K1,{field:e,readOnly:r,children:b(o.factory,{placeholder:e.placeholder,name:e.name,readOnly:r,value:t,setValue:n,options:e.options.map(s=>({...s,title:s.label}))})})}if(o.propsType==="objectiveWithInput"){if(!e.options)throw new Error("Field options is not defined");if(!e.optionsInputs)throw new Error("Field optionsInputs is not defined");const s=e.options;return e.options.length?b(K1,{field:e,readOnly:r,children:b(o.factory,{placeholder:e.placeholder,readOnly:r,name:e.name,value:t,setValue:n,optionsInputs:e.optionsInputs,options:s,required:e.required})}):null}if(o.propsType==="variants"){const s=JN(e);return s?b(o.factory,{placeholder:e.placeholder,readOnly:r,name:e.name,variant:e.variant,value:t,setValue:n,variants:s.variants}):null}return Yfe(o),null},Hh=R.enum(["name","email","location","title","notes","guests","rescheduleReason","smsReminderNumber"]),Jfe=({fields:e,locations:t,rescheduleUid:n,isDynamicGroupBooking:r,bookingData:a})=>{const{t:o}=At(),{watch:i,setValue:s}=Rs(),c=i("responses.location"),l=n?"reschedule":"",u=Ot(d=>d.isInstantMeeting);return b("div",{children:e.map((d,h)=>{if(u&&d.name==="location")return null;let m=(d.editable==="system"||d.editable==="system-but-optional")&&!!n&&a!==null,v=!!d.hidden;const g=d.views;if(g&&!g.find(_=>_.id===l))return null;if(d.name===Hh.Enum.rescheduleReason){if(a===null)return null;m=!1}if(d.name===Hh.Enum.smsReminderNumber){if((c==null?void 0:c.value)==="phone")return s(`responses.${Hh.Enum.smsReminderNumber}`,c==null?void 0:c.optionValue),null;m=!1}if(d.name===Hh.Enum.guests&&(m=!1,v=r?!0:!!d.hidden),d.name===Hh.Enum.notes&&a!==null)return null;if(d.name===Hh.Enum.location&&(c==null||c.value,m=!1),d.name===Hh.Enum.location&&d.type==="radioInput"){if(!d.optionsInputs)throw new Error("radioInput must have optionsInputs");const _=d.optionsInputs,k=Dfe(t,o);k.forEach(x=>{const S=_[x.value];S&&(S.placeholder=x.inputPlaceholder)}),d.options=k.filter(x=>!!x)}if(d!=null&&d.options){const _=uue(),k={};d.options.forEach(x=>{x.value in k?k[x.value]++:k[x.value]=1}),d.options=d.options.map(x=>({...x,value:_.includes(x.value)&&k[x.value]>1?x.label:x.value}))}return b(Zfe,{className:"mb-4",field:{...d,hidden:v},readOnly:m},h)})})},Kfe=()=>ue("div",{className:"flex flex-col",children:[b(Jn,{className:"h-7 w-32"}),b(Jn,{className:"mt-2 h-7 w-full"}),b(Jn,{className:"mt-4 h-7 w-28"}),b(Jn,{className:"mt-2 h-7 w-full"}),ue("div",{className:"mt-12 flex h-7 w-full flex-row items-center gap-4",children:[b(Jn,{className:"inline h-4 w-4 rounded-full"}),b(Jn,{className:"inline h-7 w-32"})]}),ue("div",{className:"mt-2 flex h-7 w-full flex-row items-center gap-4",children:[b(Jn,{className:"inline h-4 w-4 rounded-full"}),b(Jn,{className:"inline h-7 w-28"})]}),b(Jn,{className:"mt-8 h-7 w-32"}),b(Jn,{className:"mt-2 h-7 w-full"}),b(Jn,{className:"mt-4 h-7 w-28"}),b(Jn,{className:"mt-2 h-7 w-full"}),ue("div",{className:"mt-6 flex flex-row gap-3",children:[b(Jn,{className:"ml-auto h-8 w-20"}),b(Jn,{className:"h-8 w-20"})]})]}),Qfe=({onCancel:e,eventQuery:t,rescheduleUid:n,onSubmit:r,errorRef:a,errors:o,loadingStates:i,renderConfirmNotVerifyEmailButtonCond:s,bookingForm:c,children:l,extraOptions:u,isPlatform:d=!1})=>{const h=t.data,m=Ot(E=>E.setFormValues),v=Ot(E=>E.bookingData),g=Ot(E=>E.selectedTimeslot),_=Ot(E=>E.username),k=Ot(E=>E.isInstantMeeting),[x]=w.useState(null),{t:S}=At(),M=w.useMemo(()=>{if(!(h!=null&&h.price))return!1;const E=OD(h);return(h==null?void 0:h.price)>0&&!Number.isNaN(E.price)&&E.price>0},[h]);return t.isError?b(kf,{severity:"warning",message:S("error_booking_event")}):t.isPending||!t.data?b(Kfe,{}):g?h?ue("div",{className:"flex h-full flex-col",children:[ue(Zb,{className:"flex h-full flex-col",onChange:()=>{const E=c.getValues();m(E)},form:c,handleSubmit:r,noValidate:!0,children:[b(Jfe,{isDynamicGroupBooking:!!(_&&_.indexOf("+")>-1),fields:h.bookingFields,locations:h.locations,rescheduleUid:n||void 0,bookingData:v}),(o.hasFormErrors||o.hasDataErrors)&&b("div",{"data-testid":"booking-fail",children:b(kf,{ref:a,className:"my-2",severity:"info",title:S(n?"reschedule_fail":"booking_fail"),message:ehe(o.formErrors,o.dataErrors,S,x)})}),!d&&rv&&b("div",{className:"text-subtle my-3 w-full text-xs opacity-80",children:ue(bP,{i18nKey:"signing_up_terms",children:["By proceeding, you agree to our"," ",b(ya,{className:"text-emphasis hover:underline",href:`${wu}/terms`,target:"_blank",children:b("a",{children:"Terms"})})," ","and"," ",b(ya,{className:"text-emphasis hover:underline",href:`${wu}/privacy`,target:"_blank",children:b("a",{children:"Privacy Policy"})}),"."]})}),b("div",{className:"modalsticky mt-auto flex justify-end space-x-2 rtl:space-x-reverse",children:k?b(Sn,{type:"submit",color:"primary",loading:i.creatingInstantBooking,children:S(M?"pay_and_book":"confirm")}):ue(vt,{children:[!!e&&b(Sn,{color:"minimal",type:"button",onClick:e,"data-testid":"back",children:S("back")}),b(Sn,{type:"submit",color:"primary",loading:i.creatingBooking||i.creatingRecurringBooking,"data-testid":n&&v?"confirm-reschedule-button":"confirm-book-button",children:S(n&&v?"reschedule":s?M?"pay_and_book":"confirm":"verify_email_email_button")})]})})]}),l]}):(console.warn("No event type found for event",u),b(kf,{severity:"warning",message:S("error_booking_event")})):b(Uk,{headline:S("timeslot_missing_title"),description:S("timeslot_missing_description"),Icon:"calendar",buttonText:S("timeslot_missing_cta"),buttonOnClick:e})},ehe=(e,t,n,r)=>{if(e)return e==null?void 0:e.message;const a=t;return a!=null&&a.message?ue(vt,{children:[r??""," ",n(a.message)]}):b(vt,{children:n("can_you_try_again")})},the=({date:e,timeFormat:t,timeZone:n,language:r})=>{const a=new Date(e),o=new Intl.DateTimeFormat(r,{timeZone:n,dateStyle:"full"}).format(a),i=new Intl.DateTimeFormat(r,{timeZone:n,timeStyle:"short",hour12:t===Vh.TWELVE_HOUR}).format(a).toLowerCase();return{date:o,time:i}},nhe=({date:e,duration:t,timeFormat:n,timeZone:r,language:a})=>{const o=new Date(e),i=t?new Date(new Date(e).setMinutes(o.getMinutes()+t)):o,s=new Intl.DateTimeFormat(a,{timeZone:r,dateStyle:"full"}).formatRange(o,i),c=new Intl.DateTimeFormat(a,{timeZone:r,timeStyle:"short",hour12:n===Vh.TWELVE_HOUR}).formatRange(o,i).toLowerCase();return{date:s,time:c}},LR=e=>{const t=nhe(e);return ue(vt,{children:[t.date,b("br",{}),t.time]})},rhe=e=>{const t=the(e);return ue(vt,{children:[t.date,", ",t.time]})},ahe=()=>{const[e,t]=Ot(o=>[o.username,o.eventSlug],Ua),n=Ot(o=>o.isTeamEvent),r=Ot(o=>o.org),a=Jr.viewer.public.event.useQuery({username:e??"",eventSlug:t??"",isTeamEvent:n,org:r??null},{refetchOnWindowFocus:!1,enabled:!!e&&!!t});return{data:a==null?void 0:a.data,isSuccess:a==null?void 0:a.isSuccess,isError:a==null?void 0:a.isError,isPending:a==null?void 0:a.isPending}},ohe=({children:e,onCancel:t})=>{const{data:n}=ahe();return b(FR,{child:e,eventLength:n==null?void 0:n.length,onCancel:t})},ihe=({children:e,onCancel:t})=>{const n=Ot(a=>a.eventId),{data:r}=wF(n);return b(FR,{child:e,eventLength:r==null?void 0:r.eventType.length,onCancel:t})},FR=({child:e,eventLength:t})=>{const{i18n:n,t:r}=At(),a=Ot(c=>c.selectedTimeslot),o=Ot(c=>c.selectedDuration),{timeFormat:i,timezone:s}=Si();return a?ue(vt,{children:[ue("h1",{className:"font-cal text-emphasis text-xl leading-5",children:[r("confirm_your_details")," "]}),ue("div",{className:"my-4 flex flex-wrap gap-2 rounded-md leading-none",children:[b(yf,{variant:"grayWithoutHover",startIcon:"calendar",size:"lg",children:b(rhe,{date:a,timeFormat:i,timeZone:s,language:n.language})}),(o||t)&&b(yf,{variant:"grayWithoutHover",startIcon:"clock",size:"lg",children:b("span",{children:t6(o||t,r)})})]}),e]}):null},she=({visible:e,onCancel:t,children:n})=>{const r=Vu();return b(Ju,{open:e,onOpenChange:t,children:b(Dl,{type:void 0,enableOverflow:!0,className:"[&_.modalsticky]:border-t-subtle [&_.modalsticky]:bg-default max-h-[80vh] pb-0 [&_.modalsticky]:sticky [&_.modalsticky]:bottom-0 [&_.modalsticky]:left-0 [&_.modalsticky]:right-0 [&_.modalsticky]:-mx-8 [&_.modalsticky]:border-t [&_.modalsticky]:px-8 [&_.modalsticky]:py-4",children:r?b(ihe,{onCancel:t,children:n}):b(ohe,{onCancel:t,children:n})})})},L_={variants:{visible:{opacity:1,x:0},hidden:{opacity:0,x:20}},initial:"hidden",exit:"hidden",animate:"visible",transition:{ease:"easeInOut",delay:.1}},k6={variants:{visible:{opacity:1,y:0},hidden:{opacity:0,y:20}},initial:"hidden",exit:"hidden",animate:"visible",transition:{ease:"easeInOut",delay:.1}},jR={mobile:{default:{width:"100%",minHeight:"0px",gridTemplateAreas:`
|
|
188
188
|
"meta"
|
|
189
189
|
"header"
|
|
190
190
|
"main"
|
|
@@ -201,7 +201,7 @@ error stack:
|
|
|
201
201
|
`,gridTemplateColumns:"var(--booker-meta-width) 1fr",gridTemplateRows:"70px auto"}},column_view:{default:{width:"100vw",minHeight:"100vh",height:"auto",gridTemplateAreas:`
|
|
202
202
|
"meta header header"
|
|
203
203
|
"meta main main"
|
|
204
|
-
`,gridTemplateColumns:"var(--booker-meta-width) 1fr",gridTemplateRows:"70px auto"}}},che=(e,t,n=!1)=>{const r=a=>n?"":a;return["[--booker-timeslots-width:240px] lg:[--booker-timeslots-width:280px]",e===Nn.MONTH_VIEW&&r("[--booker-meta-width:240px]"),e===Nn.MONTH_VIEW&&t==="booking"&&`[--booker-main-width:420px] ${r("lg:[--booker-meta-width:340px]")}`,e===Nn.MONTH_VIEW&&t!=="booking"&&`[--booker-main-width:480px] ${r("lg:[--booker-meta-width:280px]")}`,e!==Nn.MONTH_VIEW&&`[--booker-main-width:480px] [--booker-meta-width:340px] ${r("lg:[--booker-meta-width:424px]")}`]},lhe=(e,t)=>{var i;const n=Xee(),[r,a]=pte(),o=typeof window<"u"&&((i=window==null?void 0:window.isEmbed)==null?void 0:i.call(window));return w.useEffect(()=>{const s=jR[e][t]||jR[e].default;if(!r.current)return;const c={height:(s==null?void 0:s.height)||"auto"},l={gridTemplateAreas:s==null?void 0:s.gridTemplateAreas,width:(s==null?void 0:s.width)||"auto",gridTemplateColumns:s==null?void 0:s.gridTemplateColumns,gridTemplateRows:s==null?void 0:s.gridTemplateRows,minHeight:s==null?void 0:s.minHeight};if(n||e==="mobile"||o){const u={...l,...c};Object.keys(u).forEach(d=>{d==="height"?r.current.style.height=c.height==="100vh"&&o?"100%":c.height:r.current.style[d]=u[d]})}else Object.keys(l).forEach(u=>{r.current.style[u]=l[u]}),a(r.current,c,{duration:.5,ease:S1(.4,0,.2,1)})},[a,o,r,e,n,t]),r},F_={mobile:{desktop:0,tablet:0},[Nn.MONTH_VIEW]:{desktop:0,tablet:0},[Nn.WEEK_VIEW]:{desktop:7,tablet:4},[Nn.COLUMN_VIEW]:{desktop:6,tablet:2}},uhe=Su(()=>Promise.resolve().then(()=>N5e).then(e=>e.TimezoneSelect),{ssr:!1}),dhe=({event:e,isPending:t,isPlatform:n=!0,classNames:r})=>{const{setTimezone:a,timeFormat:o,timezone:i}=Si(),s=Ot(F=>F.selectedDuration),c=Ot(F=>F.selectedTimeslot),l=Ot(F=>F.state),u=Ot(F=>F.bookingData),d=Ot(F=>F.rescheduleUid),[h,m]=Ot(F=>[F.seatedEventData,F.setSeatedEventData],Ua),{i18n:v,t:g}=At(),_=IO(),x=Jd()?_.hideEventTypeDetails:!1,[S]=w.useMemo(()=>n?[bF]:[uhe],[n]);if(w.useEffect(()=>{var F,G;e&&(e!=null&&e.lockTimeZoneToggleOnBookingPage)&&((F=e==null?void 0:e.schedule)!=null&&F.timeZone)&&a((G=e.schedule)==null?void 0:G.timeZone)},[e,a]),x)return null;const M=(h==null?void 0:h.attendees)||(u==null?void 0:u.attendees.length),E=(h==null?void 0:h.seatsPerTimeSlot)||(e==null?void 0:e.seatsPerTimeSlot),T=M&&E&&M/E>=.5,D=M&&E&&M/E>=.83?"text-rose-600":T?"text-yellow-500":"text-bookinghighlight";return ue("div",{className:`${r==null?void 0:r.eventMetaContainer} relative z-10 p-6`,"data-testid":"event-meta",children:[t&&b(K0.div,{...k6,initial:"visible",layout:!0,children:b(Vde,{})}),!t&&!!e&&ue(K0.div,{...k6,layout:!0,transition:{...k6.transition,delay:.3},children:[b(zde,{schedulingType:e.schedulingType,users:e.users,profile:e.profile,entity:e.entity}),b(Bde,{className:`${r==null?void 0:r.eventMetaTitle} my-2`,children:e==null?void 0:e.title}),e.description&&b(Cl,{contentClassName:"mb-8 break-words max-w-full max-h-[180px] scroll-bar pr-4",children:b("div",{dangerouslySetInnerHTML:{__html:e.description}})}),ue("div",{className:"space-y-4 font-medium rtl:-mr-2",children:[d&&u&&ue(Cl,{icon:"calendar",children:[g("former_time"),b("br",{}),b("span",{className:"line-through","data-testid":"former_time_p",children:b(LR,{date:u.startTime.toString(),duration:null,timeFormat:o,timeZone:i,language:v.language})})]}),c&&b(Cl,{icon:"calendar",children:b(LR,{date:c,duration:s||e.length,timeFormat:o,timeZone:i,language:v.language})}),b(jde,{event:e}),b(Cl,{className:"cursor-pointer [&_.current-timezone:before]:focus-within:opacity-100 [&_.current-timezone:before]:hover:opacity-100",contentClassName:"relative max-w-[90%]",icon:"globe",children:l==="booking"?b(vt,{children:i}):b("span",{className:`min-w-32 current-timezone before:bg-subtle -mt-[2px] flex h-6 max-w-full items-center justify-start before:absolute before:inset-0 before:bottom-[-3px] before:left-[-30px] before:top-[-3px] before:w-[calc(100%_+_35px)] before:rounded-md before:py-3 before:opacity-0 before:transition-opacity ${e.lockTimeZoneToggleOnBookingPage?"cursor-not-allowed":""}`,children:b(S,{menuPosition:"fixed",timezoneSelectCustomClassname:r==null?void 0:r.eventMetaTimezoneSelect,classNames:{control:()=>"!min-h-0 p-0 w-full border-0 bg-transparent focus-within:ring-0",menu:()=>"!w-64 max-w-[90vw]",singleValue:()=>"text-text py-1",indicatorsContainer:()=>"ml-auto",container:()=>"max-w-full"},value:i,onChange:F=>a(F.value),isDisabled:e.lockTimeZoneToggleOnBookingPage})})}),l==="booking"&&E&&M?b(Cl,{icon:"user",className:`${D}`,children:b("div",{className:"text-bookinghighlight flex items-start text-sm",children:b("p",{children:b(NR,{showExact:!!h.showAvailableSeatsCount,totalSeats:E,bookedSeats:M||0,variant:"fraction"})})})}):null]})]})]})};function fhe(e){const{t}=At(),[n,r]=w.useState(!1);return!e.visible||process.env.NEXT_PUBLIC_BOOKER_NUMBER_OF_DAYS_TO_LOAD=="0"&&W3==0||!process.env.NEXT_PUBLIC_BOOKER_NUMBER_OF_DAYS_TO_LOAD||n&&!e.isScheduleLoading||e.isScheduleLoading||!e.dayCount?null:ue("div",{className:"bg-default border-subtle mt-6 flex w-1/2 min-w-0 items-center justify-between rounded-[32px] border p-3 text-sm leading-none shadow-sm lg:w-1/3",children:[ue("div",{className:"flex items-center gap-2 overflow-x-hidden",children:[b(Mt,{name:"info",className:"text-default h-4 w-4"}),b("p",{className:"w-full leading-none",children:t("having_trouble_finding_time")})]}),ue("button",{className:"inline-flex items-center gap-2 font-medium",onClick:a=>{a.preventDefault(),e.onButtonClick(),r(!0)},children:[t("show_more")," ",b(Mt,{name:"arrow-right",className:"h-4 w-4"})]})]})}function hhe({extraDays:e,isMobile:t,enabledLayouts:n,nextSlots:r,eventSlug:a,isMyLink:o,renderOverlay:i}){const{t:s,i18n:c}=At(),l=Jd(),[u,d]=Ot(F=>[F.layout,F.setLayout],Ua),h=Ot(F=>F.selectedDate),m=Ot(F=>F.setSelectedDate),v=Ot(F=>F.addToSelectedDate),g=u===Nn.MONTH_VIEW,_=Xe(h),k=Xe(),x=w.useMemo(()=>{const F=k.diff(_,"days");return F>3||F<-3},[k,_]),S=w.useCallback(F=>{u===F||!F||d(F)},[d,u]);if(t||!n)return null;if(g)return ue("div",{className:"flex gap-2",children:[o&&!l?b(Ta,{content:s("troubleshooter_tooltip"),side:"bottom",children:b(Sn,{color:"primary",target:"_blank",href:`${Ea}/availability/troubleshoot?eventType=${a}`,children:s("need_help")})}):i==null?void 0:i(),b(w6,{layout:u,enabledLayouts:n,onLayoutToggle:S})]});const M=_.add(u===Nn.COLUMN_VIEW?e:e-1,"days"),E=()=>_.format("MMM")===M.format("MMM"),T=()=>_.format("YYYY")===M.format("YYYY"),$=new Intl.DateTimeFormat(c.language??"en",{month:"short"});return ue("div",{className:"border-default relative z-10 flex border-b px-5 py-4 ltr:border-l rtl:border-r",children:[ue("div",{className:"flex items-center gap-5 rtl:flex-grow",children:[b(()=>ue("h3",{className:"min-w-[150px] text-base font-semibold leading-4",children:[$.format(_.toDate())," ",_.format("D"),!T()&&ue("span",{className:"text-subtle",children:[", ",_.format("YYYY")," "]}),"-"," ",!E()&&$.format(M.toDate())," ",M.format("D"),","," ",b("span",{className:"text-subtle",children:T()?_.format("YYYY"):M.format("YYYY")})]}),{}),ue(A9,{children:[b(Sn,{className:"group rtl:ml-1 rtl:rotate-180",variant:"icon",color:"minimal",StartIcon:"chevron-left","aria-label":"Previous Day",onClick:()=>v(u===Nn.COLUMN_VIEW?-r:-e)}),b(Sn,{className:"group rtl:mr-1 rtl:rotate-180",variant:"icon",color:"minimal",StartIcon:"chevron-right","aria-label":"Next Day",onClick:()=>v(u===Nn.COLUMN_VIEW?r:e)}),x&&b(Sn,{className:"capitalize ltr:ml-2 rtl:mr-2",color:"secondary",onClick:()=>m(k.format("YYYY-MM-DD")),children:s("today")})]})]}),ue("div",{className:"ml-auto flex gap-2",children:[i==null?void 0:i(),b(DR,{}),b("div",{className:"fixed top-4 ltr:right-4 rtl:left-4",children:b(w6,{layout:u,enabledLayouts:n,onLayoutToggle:S})}),b("div",{className:"pointer-events-none opacity-0","aria-hidden":!0,children:b(w6,{layout:u,enabledLayouts:n,onLayoutToggle:S})})]})]})}const phe=({onLayoutToggle:e,layout:t,enabledLayouts:n})=>{const r=Jd(),{t:a}=At(),o=w.useMemo(()=>[{value:Nn.MONTH_VIEW,label:b(Mt,{name:"calendar",width:"16",height:"16"}),tooltip:a("switch_monthly")},{value:Nn.WEEK_VIEW,label:b(Mt,{name:"grid-3x3",width:"16",height:"16"}),tooltip:a("switch_weekly")},{value:Nn.COLUMN_VIEW,label:b(Mt,{name:"columns-3",width:"16",height:"16"}),tooltip:a("switch_columnview")}].filter(i=>n==null?void 0:n.includes(i.value)),[a,n]);return r?null:b(sC,{onValueChange:e,defaultValue:t,options:o})},w6=({enabledLayouts:e,onLayoutToggle:t,layout:n})=>e.length<=1?null:b(phe,{onLayoutToggle:t,layout:n,enabledLayouts:e}),mhe=({onConnectNow:e,event:t})=>{const{t:n}=At();return ue("div",{className:" bg-default border-subtle mx-2 block items-center gap-3 rounded-xl border p-[6px] text-sm shadow-sm delay-1000 sm:flex",children:[ue("div",{className:"flex items-center gap-3 ps-1",children:[ue("div",{className:"relative",children:[b(S9,{size:"sm",className:"border-muted",organization:{slug:t.entity.orgSlug,name:t.entity.name||""},users:t.schedulingType!==Iy.ROUND_ROBIN?t.users:[]}),b("div",{className:"border-muted absolute -bottom-0.5 -right-1 h-2 w-2 rounded-full border bg-green-500"})]}),b("div",{children:n("dont_want_to_wait")})]}),b("div",{className:"mt-2 sm:mt-0",children:b(Sn,{color:"primary",onClick:()=>{e()},size:"sm",className:"w-full justify-center rounded-lg sm:w-auto",children:n("connect_now")})})]})};function BR(e=0,t,n=6){const r=t;for(;r.getDay()!==e;)r.setDate(r.getDate()-1);return{startDate:r,endDate:new Date(r.getTime()+n*24*60*60*1e3)}}function yhe({day:e,gridCellIdx:t,totalGridCells:n,selectionLength:r,startHour:a,timezone:o}){const c=(r+1)*60/n*t;return Xe(e).tz(o).startOf("day").add(c,"minutes").add(a,"hours")}function ghe(e,t){const n=[];let r=Xe(e).hour(0).minute(0).second(0).millisecond(0);n.push(r);const a=Xe(t).hour(0).minute(0).second(0).millisecond(0);for(;r.isBefore(a);)n.push(r.add(1,"day")),r=r.add(1,"day");return n.slice(0,7)}function vhe(e,t,n){const r=[];let a=Xe("1970-01-01").tz(n).hour(e);r.push(a);const o=Xe("1970-01-01").tz(n).hour(t);for(;a.isBefore(o);)r.push(a.add(1,"hour")),a=a.add(1,"hour");return r}function _he(e){e.sort((n,r)=>n.start.getTime()-r.start.getTime());const t=[];for(let n=0;n<e.length;n++)if(t.length===0)t.push(e[n]);else{const r=t[t.length-1],a=e[n];r.end.getTime()>=a.start.getTime()?r.end=a.end:t.push(a)}return t}const bhe={view:"week",startDate:BR(0,new Date).startDate,endDate:BR(0,new Date).endDate,events:[],startHour:0,endHour:23,gridCellsPerHour:4},Vs=n_(e=>({...bhe,setView:t=>e({view:t}),setStartDate:t=>e({startDate:t}),setEndDate:t=>e({endDate:t}),setEvents:t=>e({events:t}),initState:t=>{let n=t.events;t.sortEvents&&(n=t.events.sort((a,o)=>Xe(a.start).valueOf()-Xe(o.start).valueOf()));const r=_he(t.blockingDates||[]);e({...t,blockingDates:r,events:n})},setSelectedEvent:t=>e({selectedEvent:t}),handleDateChange:t=>e(n=>{const{startDate:r,endDate:a}=n;if(t==="INCREMENT"){const s=Xe(r).add(1,n.view).toDate(),c=Xe(a).add(1,n.view).toDate();return n.minDate&&s<n.minDate||n.maxDate&&c>n.maxDate?{startDate:r,endDate:a}:(n.onDateChange&&n.onDateChange(s,c),{startDate:s,endDate:c})}const o=Xe(r).subtract(1,n.view).toDate(),i=Xe(a).subtract(1,n.view).toDate();return n.onDateChange&&n.onDateChange(o,i),{startDate:o,endDate:i}})}));function khe({days:e,containerNavRef:t}){const{i18n:n}=At(),r=a=>new Intl.DateTimeFormat(n.language,{weekday:"short"}).format(a.toDate());return ue("div",{ref:t,className:"bg-default dark:bg-muted border-b-subtle rtl:border-r-default sticky top-[var(--calendar-dates-sticky-offset,0px)] z-[80] flex-none border-b border-r sm:pr-8",children:[b("div",{className:"text-subtle flex text-sm leading-6 sm:hidden","data-dayslength":e.length,children:e.map(a=>{const o=Xe().isSame(a,"day");return ue("button",{type:"button",className:"flex flex-1 flex-col items-center pb-3 pt-2",children:[a.format("dd")," ",b("span",{className:Fe("text-emphasis mt-1 flex h-8 w-8 items-center justify-center font-semibold",o&&"bg-inverted text-inverted rounded-full"),children:a.format("D")})]},a.toString())})}),ue("div",{className:"text-subtle -mr-px hidden auto-cols-fr text-sm leading-6 sm:flex ",children:[b("div",{className:"border-default col-end-1 w-14 ltr:border-l"}),e.map(a=>{const o=Xe().isSame(a,"day");return b("div",{className:Fe("flex flex-1 items-center justify-center py-3 text-xs font-medium uppercase",o&&"font-bold"),children:ue("span",{children:[r(a)," ",b("span",{className:Fe("items-center justify-center p-1",o&&"bg-brand-default text-brand rounded-full"),children:a.format("DD")})]})},a.toString())})]})]})}function whe(e,t,n){const r=e*60;return t*60+n-r}function xhe(){const e=w.useRef(null),[t,n]=w.useState(!1),[r,a]=w.useState(null),{startHour:o,endHour:i}=Vs(l=>({startHour:l.startHour||0,endHour:l.endHour||23})),{timeFormat:s,timezone:c}=Si();return w.useEffect(()=>{const l=Xe().tz(c),u=l.hour(),d=l.minute();(u>i||u<o)&&a(null);const h=whe(o,u,d);a(h),!(!e.current||t)&&setTimeout(()=>{var m;(m=e==null?void 0:e.current)==null||m.scrollIntoView({block:"center"}),n(!0)},100)},[o,i,t,c]),ue("div",{ref:e,className:"absolute top-0 z-40 flex h-px items-center justify-center text-xs","aria-hidden":"true",style:{top:`calc(${r}*var(--one-minute-height) + var(--calendar-offset-top))`,zIndex:70},children:[b("div",{className:"w-14 pr-2 text-right",children:Xe().tz(c).format(s)}),b("div",{className:"bg-inverted h-3 w-px"}),b("div",{className:"bg-inverted h-px w-screen"})]})}function Che(e){const t=yhe({day:e.day,gridCellIdx:e.gridCellIdx,totalGridCells:e.totalGridCells,selectionLength:e.selectionLength,startHour:e.startHour,timezone:e.timezone}),n=(t.hour()-e.startHour)*60+t.minute();return b(VR,{topOffsetMinutes:n,timeSlot:Xe(t).tz(e.timezone)})}function She({availableSlots:e,day:t,startHour:n}){var c;const{timezone:r}=Si(),o=Xe(t).format("YYYY-MM-DD"),i=e&&e[o],s=w.useMemo(()=>{const l=[];let u=-1,d=-1,h=!0,m=0;if(i==null||i.forEach((v,g)=>{const _=Xe(v.start).tz(r),k=(_.hour()-n)*60+_.minute();l.push({slot:v,topOffsetMinutes:k}),v.away?(u===-1&&(u=g),d=g):h=!1}),h&&u!==-1){const v=i[u],g=i[d];return m=Xe(g.end).diff(Xe(v.start),"minutes"),v.toUser==null?null:{slots:l,startEndTimeDuration:m,firstSlot:v,timezone:r}}return{slots:l,startEndTimeDuration:m}},[i,n,r]);if(s===null)return null;if(s.startEndTimeDuration){const{firstSlot:l,startEndTimeDuration:u}=s;return b(Mhe,{timeSlot:Xe(l==null?void 0:l.start).tz(s.timezone),topOffsetMinutes:(c=s.slots[0])==null?void 0:c.topOffsetMinutes,startEndTimeDuration:u,children:b(PR,{fromUser:l==null?void 0:l.fromUser,toUser:l==null?void 0:l.toUser,reason:l==null?void 0:l.reason,emoji:l==null?void 0:l.emoji,borderDashed:!1,date:o,className:"pb-0"})})}return b(vt,{children:s.slots.map((l,u)=>b(VR,{timeSlot:Xe(l.slot.start).tz(r),topOffsetMinutes:l.topOffsetMinutes},u))})}function VR({isDisabled:e,topOffsetMinutes:t,timeSlot:n}){const{timeFormat:r}=Si(),{onEmptyCellClick:a,hoverEventDuration:o}=Vs(i=>({onEmptyCellClick:i.onEmptyCellClick,hoverEventDuration:i.hoverEventDuration}),Ua);return b("div",{className:Fe("group flex w-[calc(100%-1px)] items-center justify-center",e&&"pointer-events-none",!e&&"bg-default dark:bg-muted",t&&"absolute"),"data-disabled":e,"data-slot":n.toISOString(),"data-testid":"calendar-empty-cell",style:{height:`calc(${o}*var(--one-minute-height))`,overflow:"visible",top:t?`calc(${t}*var(--one-minute-height))`:void 0},onClick:()=>{a&&a(n.toDate())},children:!e&&o!==0&&b("div",{className:Fe("opacity-4 bg-brand-default hover:bg-brand-default text-brand dark:border-emphasis absolute hidden rounded-[4px] p-[6px] text-xs font-semibold leading-5 group-hover:flex group-hover:cursor-pointer",o&&o>15&&"items-start pt-3",o&&o<15&&"items-center"),style:{height:`calc(${o}*var(--one-minute-height) - 2px)`,zIndex:80,width:"calc(100% - 2px)"},children:b("div",{className:"overflow-ellipsis leading-[0]",children:n.format(r)})})})}function Mhe({timeSlot:e,children:t,topOffsetMinutes:n,startEndTimeDuration:r}){return b("div",{className:Fe("bg-default dark:bg-muted group absolute z-[65] flex w-[calc(100%-1px)] items-center justify-center"),"data-slot":e.toISOString(),style:{top:n?`calc(${n}*var(--one-minute-height))`:void 0,overflow:"visible"},children:b("div",{className:Fe("dark:border-emphasis bg-default dark:bg-muted cursor-pointer rounded-[4px] p-[6px] text-xs font-semibold dark:text-white"),style:{height:`calc(${r}*var(--one-minute-height) - 2px)`,width:"calc(100% - 2px)"},children:t})})}const Ahe=D0("group flex h-full w-full overflow-y-auto rounded-[6px] px-[6px] text-xs font-semibold leading-5 opacity-80",{variants:{status:{ACCEPTED:"bg-subtle hover:bg-emphasis text-emphasis border-[1px] border-gray-900",PENDING:"bg-default text-emphasis border-[1px] border-dashed border-gray-900",REJECTED:"",CANCELLED:"",AWAITING_HOST:""},disabled:{true:"hover:cursor-default",false:"hover:cursor-pointer"},selected:{true:"bg-inverted text-inverted border-[1px] border-transparent",false:""},borderColor:{ACCEPTED:"border-gray-900",PENDING:"border-gray-900",REJECTED:"border-gray-900",CANCELLED:"border-gray-900",AWAITING_HOST:"",custom:""}}});function Ehe({event:e,currentlySelectedEventId:t,eventDuration:n,disabled:r,onEventClick:a}){var u,d;const o=t===e.id,{options:i}=e,s=i!=null&&i.borderColor?"custom":i==null?void 0:i.status,c=i!=null&&i.borderColor?{borderColor:i==null?void 0:i.borderColor}:{},l=a?"button":"div";return b(Ta,{content:e.title,children:ue(l,{onClick:()=>a==null?void 0:a(e),className:Fe(Ahe({status:i==null?void 0:i.status,disabled:r,selected:o,borderColor:s}),n>30&&"flex-col py-1",i==null?void 0:i.className),style:c,children:[ue("div",{className:Fe("flex w-full gap-2 overflow-hidden overflow-ellipsis whitespace-nowrap text-left leading-4",n<=30&&"items-center"),children:[b("span",{children:e.title}),n<=30&&!((u=e.options)!=null&&u.hideTime)&&ue("p",{className:"text-subtle w-full whitespace-nowrap text-left text-[10px] leading-none",children:[Xe(e.start).format("HH:mm")," - ",Xe(e.end).format("HH:mm")]})]}),n>30&&!((d=e.options)!=null&&d.hideTime)&&ue("p",{className:"text-subtle text-left text-[10px] leading-none",children:[Xe(e.start).format("HH:mm")," - ",Xe(e.end).format("HH:mm")]}),n>45&&e.description&&b("p",{className:"text-subtle text-left text-[10px] leading-none",children:e.description})]})})}function Ihe({day:e}){const{startHour:t,events:n,eventOnClick:r}=Vs(o=>({startHour:o.startHour,events:o.events,eventOnClick:o.onEventClick}),Ua),a=w.useRef(null);return b(vt,{children:n.filter(o=>{var i;return Xe(o.start).isSame(e,"day")&&!((i=o.options)!=null&&i.allDay)}).map((o,i,s)=>{var S;let c=90,l=0,u=0,d=61;const h=Xe(o.start),m=Xe(o.end),v=m.diff(h,"minutes"),_=(h.hour()-(t||0))*60+h.minute(),k=s[i+1],x=s[i-1];if(a.current?v>a.current.duration&&h.isBetween(a.current.start,a.current.end)&&(a.current={idx:i,start:h.toDate(),end:m.toDate(),duration:v}):a.current={idx:i,start:h.toDate(),end:m.toDate(),duration:v},a.current.idx!==i){if(k){const M=Xe(k.start);(M.isBetween(a.current.start,a.current.end)||M.isBetween(h.add(-5,"minutes"),h.add(5,"minutes")))&&(d=65,l="auto",u=4,c=c/2)}else if(x){const M=Xe(x.start);M.isBetween(a.current.start,a.current.end)?(d=65,l="auto",u=4):h.isBetween(M.add(5,"minutes"),M.add(-5,"minutes"))&&(d=65,u=4,c=c/2)}}return b("div",{className:"absolute inset-x-1 ","data-testid":(S=o.options)==null?void 0:S["data-test-id"],style:{marginLeft:l,zIndex:d,right:`calc(${u}% - 1px)`,width:`${c}%`,top:`calc(${_}*var(--one-minute-height))`,height:`calc(${v}*var(--one-minute-height))`},children:b(Ehe,{event:o,eventDuration:v,onEventClick:r})},`${o.id}-${h.toISOString()}`)})})}const zR=w.forwardRef(function({offsetHeight:t,gridStopsPerDay:n,children:r,zIndex:a},o){return b("ol",{ref:o,className:"scheduler-grid-row-template col-start-1 col-end-2 row-start-1 grid auto-cols-auto text-[0px] sm:pr-8",style:{marginTop:t||"var(--gridDefaultSize)",zIndex:a},"data-gridstopsperday":n,children:r})});function The(){const{startDate:e,endDate:t,handleDateChange:n}=Vs(r=>({startDate:Xe(r.startDate),endDate:Xe(r.endDate),handleDateChange:r.handleDateChange}));return ue("header",{className:"flex flex-none flex-col justify-between py-4 sm:flex-row sm:items-center",children:[ue("h1",{className:"text-emphasis text-xl font-semibold",children:[e.format("MMM DD"),"-",t.format("DD"),ue("span",{className:"text-subtle",children:[",",e.format("YYYY")]})]}),b("div",{className:"flex items-center space-x-2 rtl:space-x-reverse",children:ue(A9,{combined:!0,children:[b(Sn,{StartIcon:"chevron-left",variant:"icon",color:"secondary","aria-label":"Previous Week",onClick:()=>{n("DECREMENT")}}),b(Sn,{StartIcon:"chevron-right",variant:"icon",color:"secondary","aria-label":"Next Week",onClick:()=>{n("INCREMENT")}})]})})]})}const $he=({hours:e,numberOfGridStopsPerCell:t,containerOffsetRef:n})=>{const{timeFormat:r}=Si(),a=e[e.length-1].add(1,"hour").minute(0).format(r),o=w.useId();return ue("div",{className:" divide-default pointer-events-none relative z-[60] col-start-1 col-end-2 row-start-1 grid divide-y",style:{gridTemplateRows:`repeat(${e.length}, minmax(var(--gridDefaultSize),1fr)`},children:[b("div",{className:"row-end-1 h-[--calendar-offset-top] ",ref:n}),e.map(i=>b("div",{children:b("div",{className:"text-muted sticky left-0 z-20 -ml-14 -mt-2.5 w-14 pr-2 text-right text-xs leading-5 rtl:-mr-14",children:i.minute(0).format(r)})},`${o}-${i.get("hour")}`)),b("div",{children:b("div",{className:"text-muted sticky left-0 z-20 -ml-14 -mt-2.5 w-14 pr-2 text-right text-xs leading-5 rtl:-mr-14",children:a})},`${o}-${a}`)]})},Phe=({className:e})=>b("div",{className:Fe("fixed left-[calc(50%+calc(var(--booker-meta-width,0px)/2))] top-1/2 z-[80] h-10 w-10 -translate-x-1/2 -translate-y-1/2",e),children:ue("svg",{className:"h-10 w-10",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:[b("path",{className:"fill-default",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"}),b("path",{className:"animate-spinning fill-emphasis origin-center",d:"M10.14,1.16a11,11,0,0,0-9,8.92A1.59,1.59,0,0,0,2.46,12,1.52,1.52,0,0,0,4.11,10.7a8,8,0,0,1,6.66-6.61A1.42,1.42,0,0,0,12,2.69h0A1.57,1.57,0,0,0,10.14,1.16Z"})]})}),Ohe=({days:e})=>{const t=()=>{let r="en";if(typeof window<"u"&&typeof navigator<"u"){const a=navigator.language;r=new Intl.Locale(a).language}return["ar","he","fa","ur"].includes(r)},n=t()?"rtl":"ltr";return b("div",{className:"divide-default pointer-events-none relative z-[60] col-start-1 col-end-2 row-start-1 grid auto-cols-auto grid-rows-1 divide-x sm:pr-8",dir:n,style:{direction:n},children:e.map((r,a)=>b("div",{className:"row-span-full",style:{gridColumnStart:t()?e.length-a:a+1}},`Key_vertical_${a}`))})};function Nhe(e){var x,S;const t=w.useRef(null),n=w.useRef(null),r=w.useRef(null),a=w.useRef(null),o=Vs(M=>M.initState),{timezone:i}=Si(),s=Vs(M=>M.startDate),c=Vs(M=>M.endDate),l=Vs(M=>M.startHour||0),u=Vs(M=>M.endHour||23),d=Vs(M=>M.gridCellsPerHour||4),h=Vs(M=>M.availableTimeslots),m=Vs(M=>M.hideHeader),v=w.useMemo(()=>ghe(s,c),[s,c]),g=w.useMemo(()=>vhe(l||0,u||23,i),[l,u,i]),_=g.length*d,k=58;return w.useEffect(()=>{o(e)},[e,o]),b(Dhe,{children:ue("div",{className:Fe("scheduler-wrapper flex h-full w-full flex-col"),style:{"--one-minute-height":`calc(${k}px/60)`,"--gridDefaultSize":`${k}px`},children:[m!==!0&&b(The,{}),e.isPending&&b(Phe,{}),b("div",{ref:t,className:"bg-default dark:bg-muted relative isolate flex h-full flex-auto flex-col",children:ue("div",{style:{width:"165%"},className:"flex h-full max-w-full flex-none flex-col sm:max-w-none md:max-w-full",children:[b(khe,{containerNavRef:n,days:v}),ue("div",{className:"relative flex flex-auto",children:[b(xhe,{}),b("div",{className:"bg-default dark:bg-muted ring-muted border-default sticky left-0 z-10 w-14 flex-none border-l border-r ring-1"}),ue("div",{className:"grid flex-auto grid-cols-1 grid-rows-1 [--disabled-gradient-background:#F8F9FB] [--disabled-gradient-foreground:#E6E7EB] dark:[--disabled-gradient-background:#262626] dark:[--disabled-gradient-foreground:#393939]",style:{backgroundColor:"var(--disabled-gradient-background)",background:"repeating-linear-gradient(-45deg, var(--disabled-gradient-background), var(--disabled-gradient-background) 2.5px, var(--disabled-gradient-foreground) 2.5px, var(--disabled-gradient-foreground) 5px)"},children:[b($he,{hours:g,numberOfGridStopsPerCell:d,containerOffsetRef:r}),b(Ohe,{days:v}),b(zR,{offsetHeight:(x=r.current)==null?void 0:x.offsetHeight,gridStopsPerDay:_,children:v.map((M,E)=>b("li",{className:"relative",style:{gridColumnStart:E+1},children:b(Ihe,{day:M})},M.toISOString()))}),b(zR,{ref:a,offsetHeight:(S=r.current)==null?void 0:S.offsetHeight,gridStopsPerDay:_,children:b(vt,{children:[...Array(v.length)].map((M,E)=>b("li",{className:"relative",style:{gridRow:`1 / span ${_}`},children:h?b(She,{day:v[E],startHour:l,availableSlots:h},v[E].toISOString()):b(vt,{children:[...Array(_)].map((T,$)=>{const D=`${E}-${$}`;return b(Che,{day:v[E],gridCellIdx:$,totalGridCells:_,selectionLength:u-l,startHour:l,timezone:i},D)})})},E))})})]})]})]})})]})})}const Dhe=({children:e})=>ue(vt,{children:[ue("div",{className:"flex h-full flex-col items-center justify-center sm:hidden",children:[b("h1",{className:"text-2xl font-bold",children:"Mobile not supported yet "}),b("p",{className:"text-subtle",children:"Please use a desktop browser to view this page"})]}),b("div",{className:"hidden h-full sm:block",children:e})]}),Rhe=({extraDays:e,schedule:t,isLoading:n,event:r})=>{var v;const a=Ot(g=>g.selectedDate),o=Ot(g=>g.setSelectedTimeslot),i=Ot(g=>g.selectedDuration),s=cf(g=>g.overlayBusyDates),c=pl("overlayCalendar")==="true"||ti.getItem("overlayCalendarSwitchDefault"),l=i||((v=r==null?void 0:r.data)==null?void 0:v.length)||30,u=w.useMemo(()=>{const g={};if(!t||!t.slots)return g;for(const _ in t.slots)g[_]=t.slots[_].map(k=>{const{time:x,...S}=k;return{start:Xe(x).toDate(),end:Xe(x).add(l,"minutes").toDate(),...S}});return g},[t,l]),d=a?Xe(a).toDate():Xe().toDate(),h=Xe(d).add(e-1,"day").toDate();w.useEffect(()=>{},[c]);const m=w.useMemo(()=>!s||!c?[]:s.map((g,_)=>({id:_,start:Xe(g.start).toDate(),end:Xe(g.end).toDate(),title:"Busy",options:{status:"ACCEPTED"}})),[s,c]);return b("div",{className:"h-full [--calendar-dates-sticky-offset:66px]",children:b(Nhe,{isPending:n,availableTimeslots:u,startHour:0,endHour:23,events:m,startDate:d,endDate:h,onEmptyCellClick:g=>o(g.toISOString()),gridCellsPerHour:60/l,hoverEventDuration:l,hideHeader:!0})})};function HR(e,t){const[n,r]=w.useState(()=>{const l=ti.getItem(e);return l?new Set(JSON.parse(l)):new Set(t)});return w.useEffect(()=>{ti.setItem(e,JSON.stringify(Array.from(n)))},[e,n]),{set:n,addValue:l=>{r(u=>new Set(u).add(l))},removeById:l=>{r(u=>{const d=new Set(u);return d.forEach(h=>{h.externalId===l&&d.delete(h)}),d})},toggleValue:l=>{r(u=>{const d=new Set(u);let h=!1;return d.forEach(m=>{m.externalId===l.externalId&&(h=!0,d.delete(m))}),h||d.add(l),d})},hasItem:l=>Array.from(n).some(u=>u.externalId===l.externalId),clearSet:()=>{r(()=>new Set),ti.removeItem(e)}}}const Lhe=({connectedCalendars:e,overlayBusyDates:t,onToggleCalendar:n})=>{const{set:r,toggleValue:a,hasItem:o}=HR("toggledConnectedCalendars",[]),[i,s]=w.useState(!1),[c,l]=cf(g=>[g.continueWithProviderModal,g.setContinueWithProviderModal],Ua),[u,d]=cf(g=>[g.calendarSettingsOverlayModal,g.setCalendarSettingsOverlayModal],Ua),h=cf(g=>g.setOverlayBusyDates),{timezone:m}=Si();return w.useEffect(()=>{if(t){const g=Xe(),k=(g.tz(m).utcOffset()-g.utcOffset())/60,x=t.map(S=>({...S,start:Xe(S.start).add(k,"hours").toDate(),end:Xe(S.end).add(k,"hours").toDate()}));h(x)}},[t]),w.useEffect(()=>{e&&r.size===0&&!i&&(e.forEach(g=>{var _;(_=g.calendars)==null||_.forEach(k=>{const x={credentialId:g.credentialId,externalId:k.externalId};k.primary&&a(x)})}),s(!0))},[o,r,i]),{isOpenOverlayContinueModal:c,isOpenOverlaySettingsModal:u,handleCloseContinueModal:g=>l(g),handleCloseSettingsModal:g=>d(g),handleToggleConnectedCalendar:(g,_)=>{a({credentialId:_,externalId:g}),h([]),n()},checkIsCalendarToggled:(g,_)=>o({credentialId:_,externalId:g})}};function Fhe(e){const{t}=At();return b(vt,{children:b(Ju,{open:e.open,onOpenChange:e.onClose,children:ue(Dl,{type:"creation",title:t("overlay_my_calendar"),description:t("overlay_my_calendar_toc"),children:[b("div",{className:"flex flex-col gap-2",children:b(Sn,{"data-testid":"overlay-calendar-continue-button",onClick:()=>{e.onContinue()},className:"gap w-full items-center justify-center font-semibold",StartIcon:"calendar-search",children:t("continue_with",{appName:xu})})}),b(qk,{children:b(vt,{})})]})})})}const jhe=()=>b(bH,{children:ue("div",{className:"border-subtle mt-3 space-y-4 rounded-xl border px-4 py-4 ",children:[b(Jn,{className:"h-4 w-full"}),b(Jn,{className:"h-4 w-full"}),b(Jn,{className:"h-4 w-full"}),b(Jn,{className:"h-4 w-full"})]})});function Bhe({connectedCalendars:e,isLoading:t,open:n,onClose:r,onClickNoCalendar:a,onToggleConnectedCalendar:o,checkIsCalendarToggled:i}){const{t:s}=At();return b(vt,{children:b(Ju,{open:n,onOpenChange:r,children:ue(Dl,{enableOverflow:!0,type:"creation",title:"Calendar Settings",className:"pb-4",description:s("view_overlay_calendar_events"),children:[b("div",{className:"no-scrollbar max-h-full overflow-y-scroll ",children:t?b(jhe,{}):b(vt,{children:e.length===0?b(Uk,{Icon:"calendar",headline:s("no_calendar_installed"),description:s("no_calendar_installed_description"),buttonText:s("add_a_calendar"),buttonOnClick:a}):b(vt,{children:e.map(c=>ue(w.Fragment,{children:[c.error&&!c.calendars&&b(kf,{severity:"error",title:c.error.message}),(c==null?void 0:c.error)===void 0&&c.calendars&&ue(IH,{className:"flex-col rounded-md",children:[ue("div",{className:"flex w-full flex-1 items-center space-x-3 pb-4 rtl:space-x-reverse",children:[c.integration.logo&&b("img",{className:Fe("h-10 w-10",c.integration.logo.includes("-dark")&&"dark:invert"),src:c.integration.logo,alt:c.integration.title}),ue("div",{className:"flex-grow truncate pl-2",children:[b(TH,{component:"h3",className:"space-x-2 rtl:space-x-reverse",children:b(ya,{href:`/apps/${c.integration.slug}`,children:c.integration.name||c.integration.title})}),b($H,{component:"p",children:c.primary.email})]})]}),b("div",{className:"border-subtle w-full border-t pt-4",children:b("ul",{className:"space-y-4",children:c.calendars.map((l,u)=>{const d=l.integrationTitle??`calendar-switch-${u}`;return ue("li",{className:"flex gap-3",children:[b(up,{id:d,checked:i(l.externalId,c.credentialId),onCheckedChange:()=>{o(l.externalId,c.credentialId)}}),b("label",{htmlFor:d,children:l.name})]},d)})})})]})]},c.credentialId))})})}),b("div",{className:"mt-4 flex gap-2 self-end",children:b(Rl,{children:s("done")})})]})})})}function Vhe({enabled:e,hasSession:t,onStateChange:n}){const{t:r}=At(),a=cf(c=>c.setContinueWithProviderModal),o=cf(c=>c.setCalendarSettingsOverlayModal),i=Ot(c=>c.layout),s=e;return w.useEffect(()=>{!t&&s&&(n(!1),a(!0))},[t,s,a,n]),ue("div",{className:Fe("hidden gap-2",i==="week_view"||i==="column_view"?"xl:flex":"md:flex"),children:[ue("div",{className:"flex items-center gap-2 pr-2",children:[b(up,{"data-testid":"overlay-calendar-switch",checked:s,id:"overlayCalendar",onCheckedChange:c=>{t?n(c):a(c)}}),b("label",{htmlFor:"overlayCalendar",className:"text-emphasis text-sm font-medium leading-none hover:cursor-pointer",children:r("overlay_my_calendar")})]}),t&&b(Sn,{size:"base","data-testid":"overlay-calendar-settings-button",variant:"icon",color:"secondary",StartIcon:"settings",onClick:()=>{o(!0)}})]})}const zhe=({connectedCalendars:e,overlayBusyDates:t,onToggleCalendar:n,isOverlayCalendarEnabled:r,loadingConnectedCalendar:a,handleClickNoCalendar:o,handleSwitchStateChange:i,handleClickContinue:s,hasSession:c})=>{const{handleCloseContinueModal:l,handleCloseSettingsModal:u,isOpenOverlayContinueModal:d,isOpenOverlaySettingsModal:h,handleToggleConnectedCalendar:m,checkIsCalendarToggled:v}=Lhe({connectedCalendars:e,overlayBusyDates:t,onToggleCalendar:n});return ue(vt,{children:[b(Vhe,{enabled:r,hasSession:c,onStateChange:i}),b(Fhe,{open:d,onClose:l,onContinue:s}),b(Bhe,{connectedCalendars:e,open:h,onClose:u,isLoading:a,onToggleConnectedCalendar:m,onClickNoCalendar:()=>{o()},checkIsCalendarToggled:v})]})},j_=e=>{const t="/o";return e.returnValue=t,t},Hhe=({bookingId:e,onGoBack:t,expiryTime:n,instantVideoMeetingUrl:r})=>{const{t:a}=At(),[o,i]=w.useState(u()),[s,c]=w.useState(!1),l=ga.useRouter();function u(){const h=Xe(),v=Xe(n).diff(h);return Math.max(v,0)}w.useEffect(()=>{if(!n)return;const h=setInterval(()=>{i(u()),c(n&&new Date(n)<new Date)},1e3);return()=>{clearInterval(h)}},[n]);const d=h=>{const m=Xe.duration(h),v=m.seconds();return`${m.minutes()}m ${v}s`};return w.useEffect(()=>{if(!n||s||r){window.removeEventListener("beforeunload",j_);return}return window.addEventListener("beforeunload",j_),()=>{window.removeEventListener("beforeunload",j_)}},[n,s,r]),w.useEffect(()=>{r&&(window.removeEventListener("beforeunload",j_),l.push(r))},[r]),b(Ju,{open:!!e&&!!n,children:b(Dl,{enableOverflow:!0,className:"py-8",children:b("div",{children:s?ue("div",{children:[b("p",{className:"font-medium",children:a("please_book_a_time_sometime_later")}),b(Sn,{className:"mt-4",onClick:()=>{t()},color:"primary",children:a("go_back")})]}):ue("div",{className:"text-center",children:[b("p",{className:"font-medium",children:a("connecting_you_to_someone")}),b("p",{className:"font-medium",children:a("please_do_not_close_this_tab")}),b("p",{className:"mt-2 font-medium",children:a("please_schedule_future_call",{seconds:d(o)})}),b("div",{className:"mt-4 h-[414px]",children:b("iframe",{className:"mx-auto h-full w-[276px] rounded-lg",src:"https://cal.games/"})})]})})})})},UR={calendar:"[grid-area:calendar]",main:"[grid-area:main]",meta:"[grid-area:meta]",timeslots:"[grid-area:timeslots]",header:"[grid-area:header]"},Q1=w.forwardRef(function({children:t,area:n,visible:r,className:a,...o},i){const s=Ot(l=>l.layout);let c;return typeof n=="string"?c=UR[n]:c=UR[n[s]||n.default],!r&&typeof r<"u"?null:b(K0.div,{ref:i,className:Fe(c,a),layout:!0,...o,children:t})}),GR=({children:e,title:t})=>b("div",{className:"mx-auto w-full max-w-2xl",children:ue("div",{className:"border-subtle bg-default dark:bg-muted overflow-hidden rounded-lg border p-10",children:[b("h2",{className:"font-cal mb-4 text-3xl",children:t}),e]})}),Uhe=()=>{const{t:e}=At();return b(GR,{title:`😴 ${e("user_away")}`,children:b("p",{className:"max-w-[50ch]",children:e("user_away_description")})})},Ghe=()=>{const{t:e}=At();return b(GR,{title:e("404_page_not_found"),children:b("p",{className:"max-w-[50ch]",children:e("booker_event_not_found")})})},Whe=()=>Promise.resolve().then(()=>pYe).then(e=>e.default),qhe=Su(()=>Promise.resolve().then(()=>mYe)),Zhe=Su(()=>Promise.resolve().then(()=>W6e).then(e=>e.UnpublishedEntity)),WR=Su(()=>Promise.resolve().then(()=>yYe).then(e=>e.DatePicker),{ssr:!1}),Yhe=({username:e,eventSlug:t,hideBranding:n=!1,entity:r,isInstantMeeting:a=!1,onGoBackInstantMeeting:o,onConnectNowInstantMeeting:i,onOverlayClickNoCalendar:s,onClickOverlayContinue:c,onOverlaySwitchStateChange:l,sessionUsername:u,rescheduleUid:d,hasSession:h,extraOptions:m,bookings:v,verifyEmail:g,slots:_,calendars:k,bookerForm:x,event:S,bookerLayout:M,schedule:E,verifyCode:T,isPlatform:$,orgBannerUrl:D,customClassNames:F})=>{var ba,$a,ir,aa,Lr,xn,oa,fa,ta,gr,Pa,Hr,Kn;At();const[G,z]=Ot(Er=>[Er.state,Er.setState],Ua),Z=Ot(Er=>Er.selectedDate),{shouldShowFormInDialog:H,hasDarkBackground:j,extraDays:Y,columnViewExtraDays:K,isMobile:Q,layout:he,hideEventTypeDetails:ne,isEmbed:le,bookerLayouts:ae}=M,[ve,Oe]=Ot(Er=>[Er.seatedEventData,Er.setSeatedEventData],Ua),{selectedTimeslot:pe,setSelectedTimeslot:te}=_,[Ee,Re]=Ot(Er=>[Er.dayCount,Er.setDayCount],Ua),Ge=e6((ba=E==null?void 0:E.data)==null?void 0:ba.slots).filter(Er=>Xe(Z).diff(Er,"day")<=0),Ue=7,at=Ge.length<Y?(Y-Ge.length+1)*Ue:Ge.length===Y?Ue:0,ct=Ge.slice(0,Y+1);Ge.length!==0&&(K.current=Math.abs(Xe(Z).diff(ct[ct.length-2],"day"))+at);const et=Math.abs(Xe(Z).diff(ct[ct.length-1],"day"))+at,wt=lhe(he,G),lt=w.useRef(null),re=Q?"div":Mte,{bookerFormErrorRef:be,key:we,formEmail:Ze,bookingForm:Ve,errors:Se}=x,{handleBookEvent:Ie,errors:yt,loadingStates:qe,expiryTime:mt,instantVideoMeetingUrl:$t}=v,{isEmailVerificationModalVisible:Be,setEmailVerificationModalVisible:tt,handleVerifyEmail:Et,renderConfirmNotVerifyEmailButtonCond:Mn}=g,{overlayBusyDates:Dn,isOverlayCalendarEnabled:Qn,connectedCalendars:yr,loadingConnectedCalendar:Pr,onToggleCalendar:Bn}=k;w.useEffect(()=>S.isPending?z("loading"):z(Z?pe?"booking":"selecting_time":"selecting_date"),[S,Z,pe,z]);const Qr=w.useMemo(()=>G==="booking"?b(Qfe,{onCancel:()=>{te(null),ve.bookingUid&&Oe({...ve,bookingUid:void 0,attendees:void 0})},onSubmit:Mn?Ie:Et,errorRef:be,errors:{...Se,...yt},loadingStates:qe,renderConfirmNotVerifyEmailButtonCond:Mn,bookingForm:Ve,eventQuery:S,extraOptions:m,rescheduleUid:d,isPlatform:$,children:ue(vt,{children:[T?b(vue,{isOpenDialog:Be,setIsOpenDialog:tt,email:Ze,isUserSessionRequiredToVerify:!1,verifyCodeWithSessionNotRequired:T.verifyCodeWithSessionNotRequired,verifyCodeWithSessionRequired:T.verifyCodeWithSessionRequired,error:T.error,resetErrors:T.resetErrors,isPending:T.isPending,setIsPending:T.setIsPending}):b(vt,{}),!$&&b(Hhe,{expiryTime:mt,bookingId:parseInt(pl("bookingId")||"0"),instantVideoMeetingUrl:$t,onGoBack:()=>{o()}})]})},we):b(vt,{}),[be,$t,G,Ve,yt,S,mt,m,Ze,Se,Ie,Et,Be,we,qe,o,Mn,d,ve,tt,Oe,te,T==null?void 0:T.error,T==null?void 0:T.isPending,T==null?void 0:T.resetErrors,T==null?void 0:T.setIsPending,T==null?void 0:T.verifyCodeWithSessionNotRequired,T==null?void 0:T.verifyCodeWithSessionRequired,$]);return r.considerUnpublished&&!d?b(Zhe,{...r}):S.isSuccess&&!S.data?b(Ghe,{}):G==="loading"?null:ue(vt,{children:[S.data&&!$?b(Nte,{eventType:S.data}):b(vt,{}),G!=="booking"&&(($a=S.data)==null?void 0:$a.isInstantEvent)&&b("div",{className:"animate-fade-in-up fixed bottom-2 z-40 my-2 opacity-0",style:{animationDelay:"1s"},children:b(mhe,{event:S.data,onConnectNow:()=>{i()}})}),ue("div",{className:Fe("main","text-default flex min-h-full w-full flex-col items-center",he===Nn.MONTH_VIEW?"overflow-visible":"overflow-clip"),children:[b("div",{ref:wt,className:Fe(...che(he,G,ne),"bg-default dark:bg-muted grid max-w-full items-start dark:[color-scheme:dark] sm:transition-[width] sm:duration-300 sm:motion-reduce:transition-none md:flex-row",(he===Nn.MONTH_VIEW||le)&&"border-subtle rounded-md",!le&&"sm:transition-[width] sm:duration-300",le&&he===Nn.MONTH_VIEW&&"border-booker sm:border-booker-width",!le&&he===Nn.MONTH_VIEW&&"border-subtle",`${F==null?void 0:F.bookerContainer}`),children:ue(LT,{children:[!a&&b(Q1,{area:"header",className:Fe(he===Nn.MONTH_VIEW&&"fixed top-4 z-10 ltr:right-4 rtl:left-4",(he===Nn.COLUMN_VIEW||he===Nn.WEEK_VIEW)&&"bg-default dark:bg-muted sticky top-0 z-10"),children:$?b(vt,{}):b(hhe,{isMyLink:e===u,eventSlug:t,enabledLayouts:ae.enabledLayouts,extraDays:he===Nn.COLUMN_VIEW?K.current:Y,isMobile:Q,nextSlots:et,renderOverlay:()=>le?b(vt,{}):b(vt,{children:b(zhe,{isOverlayCalendarEnabled:Qn,connectedCalendars:yr,loadingConnectedCalendar:Pr,overlayBusyDates:Dn,onToggleCalendar:Bn,hasSession:h,handleClickContinue:c,handleSwitchStateChange:l,handleClickNoCalendar:()=>{s()}})})})}),b(re,{className:Fe("relative z-10 flex [grid-area:meta]",he!==Nn.MONTH_VIEW&&!le&&"sm:min-h-screen"),children:ue(Q1,{area:"meta",className:"max-w-screen flex w-full flex-col md:w-[var(--booker-meta-width)]",children:[!ne&&D&&!$&&b("img",{loading:"eager",className:"-mb-9 h-28 max-h-28 rounded-tl-md sm:max-h-24",alt:"org banner",src:D}),b(dhe,{classNames:{eventMetaContainer:(ir=F==null?void 0:F.eventMetaCustomClassname)==null?void 0:ir.eventMetaContainer,eventMetaTitle:(aa=F==null?void 0:F.eventMetaCustomClassname)==null?void 0:aa.eventMetaTitle,eventMetaTimezoneSelect:(Lr=F==null?void 0:F.eventMetaCustomClassname)==null?void 0:Lr.eventMetaTimezoneSelect},event:S.data,isPending:S.isPending,isPlatform:$}),he!==Nn.MONTH_VIEW&&!(he==="mobile"&&G==="booking")&&b("div",{className:"mt-auto px-5 py-3 ",children:b(WR,{event:S,schedule:E})})]})},"meta"),b(Q1,{area:"main",className:"sticky top-0 ml-[-1px] h-full p-6 md:w-[var(--booker-main-width)] md:border-l",...L_,visible:G==="booking"&&!H,children:Qr},"book-event-form"),b(Q1,{area:"main",visible:G!=="booking"&&he===Nn.MONTH_VIEW,...L_,initial:"visible",className:"md:border-subtle ml-[-1px] h-full flex-shrink px-5 py-3 md:border-l lg:w-[var(--booker-main-width)]",children:b(WR,{classNames:{datePickerContainer:(xn=F==null?void 0:F.datePickerCustomClassname)==null?void 0:xn.datePickerContainer,datePickerTitle:(oa=F==null?void 0:F.datePickerCustomClassname)==null?void 0:oa.datePickerTitle,datePickerDays:(fa=F==null?void 0:F.datePickerCustomClassname)==null?void 0:fa.datePickerDays,datePickerDate:(ta=F==null?void 0:F.datePickerCustomClassname)==null?void 0:ta.datePickerDate,datePickerDatesActive:(gr=F==null?void 0:F.datePickerCustomClassname)==null?void 0:gr.datePickerDatesActive,datePickerToggle:(Pa=F==null?void 0:F.datePickerCustomClassname)==null?void 0:Pa.datePickerToggle},event:S,schedule:E})},"datepicker"),b(Q1,{area:"main",visible:he===Nn.WEEK_VIEW,className:"border-subtle sticky top-0 ml-[-1px] h-full md:border-l",...L_,children:b(Rhe,{extraDays:Y,schedule:E.data,isLoading:E.isPending,event:S})},"large-calendar"),b(Q1,{area:{default:"main",month_view:"timeslots"},visible:he!==Nn.WEEK_VIEW&&G==="selecting_time"||he===Nn.COLUMN_VIEW,className:Fe("border-subtle rtl:border-default flex h-full w-full flex-col overflow-x-auto px-5 py-3 pb-0 rtl:border-r ltr:md:border-l",he===Nn.MONTH_VIEW&&"h-full overflow-hidden md:w-[var(--booker-timeslots-width)]",he!==Nn.MONTH_VIEW&&"sticky top-0"),ref:lt,...L_,children:b(Ofe,{customClassnames:F==null?void 0:F.availableTimeSlotsCustomClassname,extraDays:Y,limitHeight:he===Nn.MONTH_VIEW,schedule:E==null?void 0:E.data,isLoading:E.isPending,seatsPerTimeSlot:(Hr=S.data)==null?void 0:Hr.seatsPerTimeSlot,showAvailableSeatsCount:(Kn=S.data)==null?void 0:Kn.seatsShowAvailabilityCount,event:S})},"timeslots")]})}),b(fhe,{visible:G!=="booking"&&he===Nn.MONTH_VIEW&&!Q,dayCount:Ee,isScheduleLoading:E.isLoading,onButtonClick:()=>{Re(null)}}),!n&&!$&&b(K0.span,{className:Fe("-z-10 mb-6 mt-auto pt-6 [&_img]:h-[15px]",j?"dark":"",he===Nn.MONTH_VIEW?"block":"hidden"),children:b(qhe,{logoOnly:!0})},"logo")]}),b(she,{onCancel:()=>te(null),visible:G==="booking"&&H,children:Qr})]})},Xhe=e=>e.isAway?b(Uhe,{}):b(Zee,{strict:!0,features:Whe,children:b(Yhe,{...e})}),x6=e=>{const[t,n]=w.useState(!1);return w.useEffect(()=>{const r=window.matchMedia(e);r.matches!==t&&n(r.matches);const a=()=>n(r.matches);return window.addEventListener("resize",a),()=>window.removeEventListener("resize",a)},[t,e]),t},C6=e=>Ty.find(t=>t===e),Jhe=e=>{var k;const[t,n]=Ot(x=>[x.layout,x.setLayout],Ua),r=Jd(),a=x6("(max-width: 768px)"),o=x6("(max-width: 1024px)"),i=IO(),s=r?a?"mobile":C6(i.layout)||t:t,c=o?F_[s].tablet:F_[s].desktop,l=zae(),u=r&&l!=="inline",d=w.useRef(o?F_[s].tablet:F_[s].desktop),h=((k=e==null?void 0:e.profile)==null?void 0:k.bookerLayouts)||fle,m=r&&C6(i.layout)||h.defaultLayout;w.useEffect(()=>{a&&s!=="mobile"?n("mobile"):!a&&s==="mobile"&&n(m)},[a,n,s,m]),w.useEffect(()=>{var S;const x=pl("layout");if(!a&&!r&&C6(x)&&((S=h==null?void 0:h.enabledLayouts)!=null&&S.length)&&x!==t){const M=h.enabledLayouts.find(E=>E===x);M&&n(M)}},[h,n,t,r,a]);const g={mobile:!r,month_view:!1,week_view:!0,column_view:!0}[s],_=r?i.hideEventTypeDetails:!1;return{shouldShowFormInDialog:g,hasDarkBackground:u,extraDays:c,columnViewExtraDays:d,isMobile:a,isEmbed:r,isTablet:o,layout:s,defaultLayout:m,hideEventTypeDetails:_,bookerLayouts:h}};var qR=function(e,t,n){if(e&&"reportValidity"in e){var r=Nt(n,t);e.setCustomValidity(r&&r.message||""),e.reportValidity()}},ZR=function(e,t){var n=function(a){var o=t.fields[a];o&&o.ref&&"reportValidity"in o.ref?qR(o.ref,a,e):o.refs&&o.refs.forEach(function(i){return qR(i,a,e)})};for(var r in t.fields)n(r)},Khe=function(e,t){t.shouldUseNativeValidation&&ZR(e,t);var n={};for(var r in e){var a=Nt(t.fields,r);Vr(n,r,Object.assign(e[r],{ref:a&&a.ref}))}return n},Qhe=function(e,t){for(var n={};e.length;){var r=e[0],a=r.code,o=r.message,i=r.path.join(".");if(!n[i])if("unionErrors"in r){var s=r.unionErrors[0].errors[0];n[i]={message:s.message,type:s.code}}else n[i]={message:o,type:a};if("unionErrors"in r&&r.unionErrors.forEach(function(u){return u.errors.forEach(function(d){return e.push(d)})}),t){var c=n[i].types,l=c&&c[r.code];n[i]=q$(i,t,n,a,l?[].concat(l,r.message):r.message)}e.shift()}return n},epe=function(e,t,n){return n===void 0&&(n={}),function(r,a,o){try{return Promise.resolve(function(i,s){try{var c=Promise.resolve(e[n.mode==="sync"?"parse":"parseAsync"](r,t)).then(function(l){return o.shouldUseNativeValidation&&ZR({},o),{errors:{},values:n.rawValues?r:l}})}catch(l){return s(l)}return c&&c.then?c.then(void 0,s):c}(0,function(i){return{values:{},errors:i.isEmpty?{}:Khe(Qhe(i.errors,!o.shouldUseNativeValidation&&o.criteriaMode==="all"),o)}}))}catch(i){return Promise.reject(i)}}};const tpe=R.record(lle),npe=({bookingFields:e,view:t})=>{const n=Wx.unwrap().partial().and(tpe);return YR({schema:n,bookingFields:e,isPartialSchema:!0,view:t})};function rpe({bookingFields:e,view:t}){const n=Wx.and(R.record(R.any()));return YR({schema:n,bookingFields:e,isPartialSchema:!1,view:t})}function YR({schema:e,bookingFields:t,isPartialSchema:n,view:r}){const a=R.preprocess(o=>{const i=R.record(R.any()).nullable().parse(o)||{},s={};return t?(t.forEach(c=>{const l=i[c.name];if(l===void 0)return;const u=c.views;if(!(r==="ALL_VIEWS"?!0:u?u.find(m=>m.id===r):!0))return;const h=nD[c.type];if(h){s[c.name]=h.preprocess({response:l,isPartialSchema:n,field:c});return}if(c.type==="boolean")s[c.name]=l==="true"||l===!0;else if(c.type==="multiemail"||c.type==="checkbox"||c.type==="multiselect")s[c.name]=l instanceof Array?l:[l];else if(c.type==="radioInput"&&typeof l=="string"){let m={optionValue:"",value:""};try{m=JSON.parse(l)}catch{}s[c.name]=m}else s[c.name]=l}),{...i,...s}):i},e.superRefine(async(o,i)=>{var s;if(t)for(const c of t){const l=o[c.name],u=R.string(),d=n?R.string():R.string().refine(xle),h=n?R.string():R.string().refine(async M=>{const{isValidPhoneNumber:E}=await Promise.resolve().then(()=>cse);return E(M)}),m=M=>`{${c.name}}${M}`,v=c.views,g=r==="ALL_VIEWS"?!0:v?v.find(M=>M.id===r):!0;let _=c.hidden;const k=((s=c.options)==null?void 0:s.length)??0;c.hideWhenJustOneOption&&(_=_||k<=1);const x=_?!1:g?c.required:!1;if((n||!x)&&l===void 0)continue;if(x&&!n&&!l){i.addIssue({code:R.ZodIssueCode.custom,message:m("error_required_field")});return}if(c.type==="email"){d.safeParse(l).success||i.addIssue({code:R.ZodIssueCode.custom,message:m("email_validation_error")});continue}const S=nD[c.type];if(S){S.superRefine({response:l,ctx:i,m,field:c,isPartialSchema:n});continue}if(c.type==="multiemail"){const M=d.array().safeParse(l);if(x&&(!l||l.length===0)){i.addIssue({code:R.ZodIssueCode.custom,message:m("error_required_field")});continue}if(!M.success){if(c.name==="guests"&&l.every(T=>T==="")){o[c.name]=[];continue}i.addIssue({code:R.ZodIssueCode.custom,message:m("email_validation_error")});continue}const E=M.data;E.sort().some((T,$)=>{if(T===E[$+1])return i.addIssue({code:R.ZodIssueCode.custom,message:m("duplicate_email")}),!0});continue}if(c.type==="checkbox"||c.type==="multiselect"){u.array().safeParse(l).success||i.addIssue({code:R.ZodIssueCode.custom,message:m("Invalid array of strings")});continue}if(c.type==="phone"){(await h.safeParseAsync(l)).success||i.addIssue({code:R.ZodIssueCode.custom,message:m("invalid_number")});continue}if(c.type==="boolean"){R.boolean().safeParse(l).success||i.addIssue({code:R.ZodIssueCode.custom,message:m("Invalid Boolean")});continue}if(c.type==="radioInput"){if(c.optionsInputs){const M=l==null?void 0:l.optionValue,E=c.optionsInputs[l==null?void 0:l.value],T=E==null?void 0:E.type;if((x||l!=null&&l.value)&&(E!=null&&E.required)&&!M){i.addIssue({code:R.ZodIssueCode.custom,message:m("error_required_field")});return}M&&T==="phone"&&((await h.safeParseAsync(M)).success||i.addIssue({code:R.ZodIssueCode.custom,message:m("invalid_number")}))}continue}if(["address","text","select","number","radio","textarea"].includes(c.type)){u.safeParse(l).success||i.addIssue({code:R.ZodIssueCode.custom,message:m("Invalid string")});continue}i.addIssue({code:R.ZodIssueCode.custom,message:`Can't parse unknown booking field type: ${c.type}`})}}));return n?a.catch(function(o){return console.error("Failed to preprocess query params, prefilling will be skipped",o==null?void 0:o.error),{}}):a}function ape({eventType:e,rescheduleUid:t,isRescheduling:n,email:r,name:a,username:o,hasSession:i,extraOptions:s,prefillFormParams:c}){const[l,u]=w.useState({}),d=Ot(v=>v.bookingData),h=Ot(v=>v.formValues);w.useEffect(()=>{(async function(){if(Object.keys(h).length){u(h);return}if(!(e!=null&&e.bookingFields))return{};const g=await npe({bookingFields:e.bookingFields,view:t?"reschedule":"booking"}).parseAsync({...s,name:c.name,guests:c.guests}),_={email:t&&d&&d.attendees.length>0?d==null?void 0:d.attendees[0].email:g.email?g.email:r??"",name:t&&d&&d.attendees.length>0?d==null?void 0:d.attendees[0].name:g.name?g.name:a??o??""};if(!n){const S={responses:{}},M=e.bookingFields.reduce((E,T)=>({...E,[T.name]:g[T.name]||void 0}),{});S.responses={...M,name:_.name,email:_.email},u(S)}if(!t&&!d)return{};const k={responses:{}},x=e.bookingFields.reduce((S,M)=>({...S,[M.name]:d==null?void 0:d.responses[M.name]}),{});k.responses={...x,name:_.name,email:_.email},u(k)})()},[e==null?void 0:e.bookingFields,h,n,d,t,r,a,o,c]);const m=`${Object.keys(l).length}_${i?1:0}`;return{initialValues:l,key:m}}const ope=({event:e,sessionEmail:t,sessionName:n,sessionUsername:r,hasSession:a,extraOptions:o,prefillFormParams:i})=>{const s=Ot(M=>M.rescheduleUid),c=Ot(M=>M.bookingData),{t:l}=At(),u=w.useRef(null),d=R.object({responses:e?rpe({bookingFields:e.bookingFields,view:s?"reschedule":"booking"}):R.object({})}).passthrough(),h=!!s&&!!c,{initialValues:m,key:v}=ape({eventType:e,rescheduleUid:s,isRescheduling:h,email:t,name:n,username:r,hasSession:a,extraOptions:o,prefillFormParams:i}),g=U5({defaultValues:m,resolver:epe(d,{},{mode:"async"})});w.useEffect(()=>{g.reset(m)},[v]);const _=g.watch("responses.email"),k=g.watch("responses.name"),x=()=>{if(g.clearErrors(),!e){g.setError("globalError",{message:l("error_booking_event")});return}},S={hasFormErrors:!!g.formState.errors.globalError,formErrors:g.formState.errors.globalError};return{bookingForm:g,bookerFormErrorRef:u,key:v,formEmail:_,formName:k,beforeVerifyEmail:x,formErrors:S,errors:S}};let XR=null;const ipe=()=>{function e(n){XR=n}function t(){return XR}return[t(),e]},S6=dJ,M6=fJ,JR=(e,t)=>/^#?([0-9A-F]{3}|[0-9A-F]{4}|[0-9A-F]{6}|[0-9A-F]{8})$/i.test(e.replace("##","#"))?e:t;function A6(e){const t=e.replace("##","#"),n=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t);if(!n)throw new Error("Invalid Hex colour");const[,r,a,o]=n;return{r:parseInt(r,16),g:parseInt(a,16),b:parseInt(o,16)}}function KR(e,t,n){const r=a=>`0${a.toString(16)}`.slice(-2);return`#${r(e)}${r(t)}${r(n)}`}function spe(e,t){const n=A6(`#${e}`);if(!n)return"";const r=Math.round(n.r+(255-n.r)*t),a=Math.round(n.g+(255-n.g)*t),o=Math.round(n.b+(255-n.b)*t);return KR(r,a,o)}function cpe(e,t){const n=A6(e);if(!n)return"";const r=Math.round(n.r*t),a=Math.round(n.g*t),o=Math.round(n.b*t);return KR(r,a,o)}function QR(e,t){return e?(e=e.replace("#",""),e.length===3&&(e=e.split("").map(function(n){return n+n}).join("")),e):t?M6:S6}const eL=e=>{const t={500:`#${e}`.replace("##","#")},n={50:.95,100:.9,200:.75,300:.6,400:.3,600:.9,700:.75,800:.6,900:.49};return[50,100,200,300,400].forEach(r=>{t[r]=spe(e,n[r])}),[600,700,800,900].forEach(r=>{t[r]=cpe(e,n[r])}),t};function B_(e){const{r:t,g:n,b:r}=A6(e);return(.2126*t+.7152*n+.0722*r)/255<.5?"#FFFFFF":"#000000"}const lpe=({lightVal:e=S6,darkVal:t=M6})=>{e=Bae().brandColor||e,e=QR(e,!1),t=QR(t,!0);const r=eL(JR(e,S6)),a=eL(JR(t,M6));return{light:{"cal-brand":r[500],"cal-brand-emphasis":r[400],"cal-brand-subtle":r[200],"cal-brand-text":B_(r[500]),"cal-brand-accent":B_(r[500])},dark:{"cal-brand":a[500],"cal-brand-emphasis":a[600],"cal-brand-subtle":a[800],"cal-brand-text":B_(a[500]),"cal-brand-accent":B_(a[500])}}},upe=w.createContext(void 0),dpe={setTheme:e=>{},themes:[]},fpe=()=>{var e;return(e=w.useContext(upe))!==null&&e!==void 0?e:dpe};function tL(e,t=!1){const{resolvedTheme:n,setTheme:r,forcedTheme:a,theme:o}=fpe(),i=Fae();if(w.useEffect(()=>{if(t||e===void 0)return;const s=i?i==="auto"?"system":i:e;!s||s===o||r(s)},[e,r,i]),t)return{resolvedTheme:n,forcedTheme:a,activeTheme:o}}function hpe(){const e=tL(null,!0);if(!e)throw new Error("useTheme must have a return value here");return e}const ppe="get-available-slots",mpe=({enabled:e,...t})=>Zi({queryKey:[ppe,t.startTime,t.endTime,t.eventTypeId,t.eventTypeSlug],queryFn:()=>Xt.get("/slots/available",{params:t}).then(r=>{if(r.data.status===Yr)return r.data.data;throw new Error(r.data.error.message)}),enabled:e}),ype="get-calendars-busy-times",gpe=({onError:e,enabled:t,...n})=>{var a;return Zi({queryKey:[ype,((a=n==null?void 0:n.calendarsToLoad)==null?void 0:a.toString())??"",n.dateFrom??"",n.dateTo??"",n.loggedInUsersTz],queryFn:()=>Xt.get("/ee/calendars/busy-times",{params:n}).then(o=>{if(o.data.status===Yr)return o.data;throw e==null||e(),new Error(o.data.error.message)}),enabled:t})},vpe="get-connected-calendars",nL=e=>Zi({queryKey:[vpe],queryFn:()=>Xt.get("/ee/calendars").then(n=>{var r;if(n.data.status===Yr)return(r=n.data)==null?void 0:r.data;throw new Error(n.data.error.message)}),enabled:(e==null?void 0:e.enabled)??!0}),_pe=({onSuccess:e,onError:t}={onSuccess:()=>{},onError:()=>{}})=>ll({mutationFn:r=>Xt.post("/ee/bookings",r).then(a=>{if(a.data.status===Yr)return a.data;throw new Error(a.data.error.message)}),onSuccess:r=>{r.status===Yr?e==null||e(r):t==null||t(r)},onError:r=>{t==null||t(r)}}),bpe=({onSuccess:e,onError:t}={onSuccess:()=>{},onError:()=>{}})=>ll({mutationFn:r=>Xt.post("/ee/bookings/instant",r).then(a=>{if(a.data.status===Yr)return a.data;throw new Error(a.data.error.message)}),onSuccess:r=>{r.status===Yr?e==null||e(r):t==null||t(r)},onError:r=>{t==null||t(r)}}),kpe=({onSuccess:e,onError:t}={onSuccess:()=>{},onError:()=>{}})=>ll({mutationFn:r=>Xt.post("/ee/bookings/recurring",r).then(a=>a.data),onSuccess:r=>{r.status===Yr?e==null||e(r):t==null||t(r)},onError:r=>{t==null||t(r)}}),wpe="user-booking",xpe=(e={onSuccess:()=>{},onError:()=>{},uid:""})=>{const t=`/${vc.bookings}/${e.uid}/reschedule`;return Zi({queryKey:[wpe,e.uid],queryFn:()=>Xt.get(t).then(r=>{var o,i;if(r.data.status===Yr)return(o=e.onSuccess)==null||o.call(e,r.data.data),r.data.data;const a=new Error(r.data.error.message);throw(i=e.onError)==null||i.call(e,a),a}).catch(r=>{var a;(a=e.onError)==null||a.call(e,r)}),enabled:!!(e!=null&&e.uid)})},Cpe=({bookingForm:e,event:t,metadata:n,hashedLink:r,handleBooking:a,handleInstantBooking:o,handleRecBooking:i})=>{const s=Ot(M=>M.setFormValues),c=Ot(M=>M.selectedTimeslot),l=Ot(M=>M.selectedDuration),{timezone:u}=Si(),d=Ot(M=>M.rescheduleUid),{t:h,i18n:m}=At(),v=Ot(M=>M.username),g=Ot(M=>M.recurringEventCount),_=Ot(M=>M.bookingData),k=Ot(M=>M.seatedEventData),x=Ot(M=>M.isInstantMeeting);return()=>{var E,T,$,D;const M=e.getValues();if(c){if(s({}),e.clearErrors(),!(t!=null&&t.data)){e.setError("globalError",{message:h("error_booking_event")});return}const F=t.data.isDynamic?l||t.data.length:l&&((T=(E=t.data.metadata)==null?void 0:E.multipleDuration)!=null&&T.includes(l))?l:t.data.length,G={values:M,duration:F,event:t.data,date:c,timeZone:u,language:m.language,rescheduleUid:d||void 0,bookingUid:_&&_.uid||(k==null?void 0:k.bookingUid)||void 0,username:v||"",metadata:n,hashedLink:r};x?o(h6(G)):(D=($=t.data)==null?void 0:$.recurringEvent)!=null&&D.freq&&g&&!d?i($de(G,g)):a(h6(G)),s({}),e.clearErrors()}}},Spe="get-public-event",Mpe=e=>{const[t,n]=Ot(i=>[i.username,i.eventSlug],Ua),r=Ot(i=>i.isTeamEvent),a=Ot(i=>i.org);return Zi({queryKey:[Spe,t??e.username,n??e.eventSlug],queryFn:()=>Xt.get("/events/public",{params:{username:t??e.username,eventSlug:n??e.eventSlug,isTeamEvent:r,org:a??null}}).then(i=>{if(i.data.status===Yr)return i.data.data;throw new Error(i.data.error.message)})})},Ape=({onSuccess:e,onError:t}={onSuccess:()=>{},onError:()=>{}})=>ll({mutationFn:r=>Xt.delete("/slots/selected-slot",{params:r}).then(a=>{if(a.data.status===Yr)return a.data;throw new Error(a.data.error.message)}),onSuccess:r=>{r.status===Yr?e==null||e(r):t==null||t(r)},onError:r=>{t==null||t(r)}}),Epe=({onSuccess:e,onError:t}={onSuccess:()=>{},onError:()=>{}})=>ll({mutationFn:r=>Xt.post("/slots/reserve",r).then(a=>{if(a.data.status===Yr)return a.data;throw new Error(a.data.error.message)}),onSuccess:r=>{r.status===Yr?e==null||e(r):t==null||t(r)},onError:r=>{t==null||t(r)}}),Ipe=e=>{var d;const t=Ot(h=>h.selectedDuration),[n,r]=Ot(h=>[h.selectedTimeslot,h.setSelectedTimeslot],Ua),[a,o]=ipe(),i=Epe({onSuccess:h=>{o(h.data)}}),s=Ape(),c=()=>{e!=null&&e.data&&s.mutate({uid:a??void 0})},l=()=>{var h,m;(h=e==null?void 0:e.data)!=null&&h.id&&n&&(t||(m=e==null?void 0:e.data)!=null&&m.length)&&i.mutate({slotUtcStartDate:Xe(n).utc().format(),eventTypeId:e.data.id,slotUtcEndDate:Xe(n).utc().add(t||e.data.length,"minutes").format()})},u=Ot(h=>h.selectedTimeslot);return w.useEffect(()=>{l();const h=setInterval(()=>{l()},parseInt(lJ)*60*1e3-2e3);return()=>{c(),clearInterval(h)}},[(d=e==null?void 0:e.data)==null?void 0:d.id,u]),{selectedTimeslot:n,setSelectedTimeslot:r,setSlotReservationId:o,slotReservationId:a,handleReserveSlot:l,handleRemoveSlot:c}},Tpe=e=>{var Ue,at,ct,et,wt,lt,re,be,we,Ze,Ve;const[t,n]=Ot(Se=>[Se.state,Se.setState],Ua),r=Ot(Se=>Se.setSelectedDate),a=Ot(Se=>Se.setBookingData),o=Ot(Se=>Se.setSelectedTimeslot);xpe({uid:e.rescheduleUid??e.bookingUid??"",onSuccess:Se=>{a(Se)}}),w.useEffect(()=>()=>{n("loading"),r(null),o(null)},[]);const i=Mpe({username:e.username,eventSlug:e.eventSlug}),s=Jhe(i.data);Cle({...e,eventId:(Ue=i.data)==null?void 0:Ue.id,rescheduleUid:e.rescheduleUid??null,bookingUid:e.bookingUid??null,layout:s.defaultLayout,org:(at=i.data)==null?void 0:at.entity.orgSlug});const[c]=Ot(Se=>[Se.dayCount,Se.setDayCount],Ua),l=Ot(Se=>Se.selectedDate),u=Ot(Se=>Se.month),d=Ot(Se=>Se.eventSlug),h=Ot(Se=>Se.selectedDuration),{data:m}=l3(),v=!!m,g=w.useMemo(()=>({name:e.name??null,guests:e.guests??[]}),[e.name,e.guests]),_=Xe(l).format("YYYY-MM-DD"),k=s.layout===Nn.WEEK_VIEW&&!!s.extraDays&&Xe(_).month()!==Xe(_).add(s.extraDays,"day").month()||s.layout===Nn.COLUMN_VIEW&&Xe(_).month()!==Xe(_).add(s.columnViewExtraDays.current,"day").month(),x=(s.layout!==Nn.WEEK_VIEW&&t==="selecting_time"||s.layout===Nn.COLUMN_VIEW)&&Xe(_).add(1,"month").month()!==Xe(_).add(s.columnViewExtraDays.current,"day").month()?2:void 0,{timezone:S}=Si(),[M,E]=Vle({month:u,monthCount:x,dayCount:c,prefetchNextMonth:k,selectedDate:l}),T=mpe({usernameList:pue(e.username??""),eventTypeId:((ct=i==null?void 0:i.data)==null?void 0:ct.id)??0,startTime:M,endTime:E,timeZone:(et=m==null?void 0:m.data)==null?void 0:et.timeZone,duration:h??void 0,rescheduleUid:e.rescheduleUid,enabled:!!e.username&&!!u&&!!S&&(!!d||!!((wt=i==null?void 0:i.data)!=null&&wt.id)||((lt=i==null?void 0:i.data)==null?void 0:lt.id)===0)}),$=ope({event:i.data,sessionEmail:(re=m==null?void 0:m.data)==null?void 0:re.email,sessionUsername:(be=m==null?void 0:m.data)==null?void 0:be.username,sessionName:(we=m==null?void 0:m.data)==null?void 0:we.username,hasSession:v,extraOptions:{},prefillFormParams:g}),{mutate:D,isPending:F,error:G,isError:z}=_pe({onSuccess:Se=>{var Ie;T.refetch(),(Ie=e.onCreateBookingSuccess)==null||Ie.call(e,Se)},onError:e.onCreateBookingError}),{mutate:Z,isPending:H,error:j,isError:Y}=kpe({onSuccess:Se=>{var Ie;T.refetch(),(Ie=e.onCreateRecurringBookingSuccess)==null||Ie.call(e,Se)},onError:e.onCreateRecurringBookingError}),{mutate:K,isPending:Q,error:he,isError:ne}=bpe({onSuccess:Se=>{var Ie;T.refetch(),(Ie=e.onCreateInstantBookingSuccess)==null||Ie.call(e,Se)},onError:e.onCreateInstantBookingError}),le=Ipe(i),[ae]=cf(Se=>[Se.calendarSettingsOverlayModal,Se.setCalendarSettingsOverlayModal],Ua),{data:ve,isPending:Oe}=nL({enabled:!!ae}),pe=ve,{set:te,clearSet:Ee}=HR("toggledConnectedCalendars",[]),{data:Re}=gpe({loggedInUsersTz:((Ze=m==null?void 0:m.data)==null?void 0:Ze.timeZone)||"Europe/London",dateFrom:l,dateTo:l,calendarsToLoad:Array.from(te).map(Se=>({credentialId:Se.credentialId,externalId:Se.externalId})),onError:()=>{Ee()},enabled:!!(v&&te.size>0&&(localStorage==null?void 0:localStorage.getItem("overlayCalendarSwitchDefault"))==="true")}),Ge=Cpe({event:i,bookingForm:$.bookingForm,hashedLink:e.hashedLink,metadata:{},handleBooking:D,handleInstantBooking:K,handleRecBooking:Z});return b(N0,{children:b(Xhe,{customClassNames:e.customClassNames,eventSlug:e.eventSlug,username:e.username,entity:((Ve=i==null?void 0:i.data)==null?void 0:Ve.entity)??{considerUnpublished:!1,orgSlug:void 0,teamSlug:void 0,name:void 0},rescheduleUid:e.rescheduleUid??null,bookingUid:e.bookingUid??null,isRedirect:!1,fromUserNameRedirected:"",hasSession:v,onGoBackInstantMeeting:function(){throw new Error("Function not implemented.")},onConnectNowInstantMeeting:function(){throw new Error("Function not implemented.")},onOverlayClickNoCalendar:function(){throw new Error("Function not implemented.")},onClickOverlayContinue:function(){throw new Error("Function not implemented.")},onOverlaySwitchStateChange:function(Se){throw new Error("Function not implemented.")},extraOptions:{},bookings:{handleBookEvent:()=>{Ge()},expiryTime:void 0,bookingForm:$.bookingForm,bookerFormErrorRef:$.bookerFormErrorRef,errors:{hasDataErrors:z||Y||ne,dataErrors:G||j||he},loadingStates:{creatingBooking:F,creatingRecurringBooking:H,creatingInstantBooking:Q},instantVideoMeetingUrl:void 0},slots:le,calendars:{overlayBusyDates:Re==null?void 0:Re.data,isOverlayCalendarEnabled:!1,connectedCalendars:(pe==null?void 0:pe.connectedCalendars)||[],loadingConnectedCalendar:Oe,onToggleCalendar:()=>{}},verifyEmail:{isEmailVerificationModalVisible:!1,setEmailVerificationModalVisible:()=>{},setVerifiedEmail:()=>{},handleVerifyEmail:()=>{},renderConfirmNotVerifyEmailButtonCond:!0},bookerForm:$,event:i,schedule:T,bookerLayout:s,verifyCode:void 0,isPlatform:!0})})};let $pe={data:""},Ppe=e=>typeof window=="object"?((e?e.querySelector("#_goober"):window._goober)||Object.assign((e||document.head).appendChild(document.createElement("style")),{innerHTML:" ",id:"_goober"})).firstChild:e||$pe,Ope=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,Npe=/\/\*[^]*?\*\/| +/g,rL=/\n+/g,lf=(e,t)=>{let n="",r="",a="";for(let o in e){let i=e[o];o[0]=="@"?o[1]=="i"?n=o+" "+i+";":r+=o[1]=="f"?lf(i,o):o+"{"+lf(i,o[1]=="k"?"":t)+"}":typeof i=="object"?r+=lf(i,t?t.replace(/([^,])+/g,s=>o.replace(/(^:.*)|([^,])+/g,c=>/&/.test(c)?c.replace(/&/g,s):s?s+" "+c:c)):o):i!=null&&(o=/^--/.test(o)?o:o.replace(/[A-Z]/g,"-$&").toLowerCase(),a+=lf.p?lf.p(o,i):o+":"+i+";")}return n+(t&&a?t+"{"+a+"}":a)+r},Dy={},aL=e=>{if(typeof e=="object"){let t="";for(let n in e)t+=n+aL(e[n]);return t}return e},Dpe=(e,t,n,r,a)=>{let o=aL(e),i=Dy[o]||(Dy[o]=(s=>{let c=0,l=11;for(;c<s.length;)l=101*l+s.charCodeAt(c++)>>>0;return"go"+l})(o));if(!Dy[i]){let s=o!==e?e:(c=>{let l,u,d=[{}];for(;l=Ope.exec(c.replace(Npe,""));)l[4]?d.shift():l[3]?(u=l[3].replace(rL," ").trim(),d.unshift(d[0][u]=d[0][u]||{})):d[0][l[1]]=l[2].replace(rL," ").trim();return d[0]})(e);Dy[i]=lf(a?{["@keyframes "+i]:s}:s,n?"":"."+i)}return((s,c,l)=>{c.data.indexOf(s)==-1&&(c.data=l?s+c.data:c.data+s)})(Dy[i],t,r),i},Rpe=(e,t,n)=>e.reduce((r,a,o)=>{let i=t[o];if(i&&i.call){let s=i(n),c=s&&s.props&&s.props.className||/^go/.test(s)&&s;i=c?"."+c:s&&typeof s=="object"?s.props?"":lf(s,""):s===!1?"":s}return r+a+(i??"")},"");function V_(e){let t=this||{},n=e.call?e(t.p):e;return Dpe(n.unshift?n.raw?Rpe(n,[].slice.call(arguments,1),t.p):n.reduce((r,a)=>Object.assign(r,a&&a.call?a(t.p):a),{}):n,Ppe(t.target),t.g,t.o,t.k)}let oL,E6,I6;V_.bind({g:1});let Ru=V_.bind({k:1});function Lpe(e,t,n,r){lf.p=t,oL=e,E6=n,I6=r}function uf(e,t){let n=this||{};return function(){let r=arguments;function a(o,i){let s=Object.assign({},o),c=s.className||a.className;n.p=Object.assign({theme:E6&&E6()},s),n.o=/ *go\d+/.test(c),s.className=V_.apply(n,r)+(c?" "+c:""),t&&(s.ref=i);let l=e;return e[0]&&(l=s.as||e,delete s.as),I6&&l[0]&&I6(s),oL(l,s)}return t?t(a):a}}var Fpe=e=>typeof e=="function",z_=(e,t)=>Fpe(e)?e(t):e,jpe=(()=>{let e=0;return()=>(++e).toString()})(),Bpe=e=>t=>{t&&setTimeout(()=>{let n=t.getBoundingClientRect();e(n)})},iL=(()=>{let e;return()=>{if(e===void 0&&typeof window<"u"){let t=matchMedia("(prefers-reduced-motion: reduce)");e=!t||t.matches}return e}})(),Vpe=20,H_=new Map,sL=e=>{if(H_.has(e))return;let t=setTimeout(()=>{H_.delete(e),Uh({type:4,toastId:e})},1e3);H_.set(e,t)},zpe=e=>{let t=H_.get(e);t&&clearTimeout(t)},T6=(e,t)=>{switch(t.type){case 0:return{...e,toasts:[t.toast,...e.toasts].slice(0,Vpe)};case 1:return t.toast.id&&zpe(t.toast.id),{...e,toasts:e.toasts.map(o=>o.id===t.toast.id?{...o,...t.toast}:o)};case 2:let{toast:n}=t;return e.toasts.find(o=>o.id===n.id)?T6(e,{type:1,toast:n}):T6(e,{type:0,toast:n});case 3:let{toastId:r}=t;return r?sL(r):e.toasts.forEach(o=>{sL(o.id)}),{...e,toasts:e.toasts.map(o=>o.id===r||r===void 0?{...o,visible:!1}:o)};case 4:return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(o=>o.id!==t.toastId)};case 5:return{...e,pausedAt:t.time};case 6:let a=t.time-(e.pausedAt||0);return{...e,pausedAt:void 0,toasts:e.toasts.map(o=>({...o,pauseDuration:o.pauseDuration+a}))}}},U_=[],G_={toasts:[],pausedAt:void 0},Uh=e=>{G_=T6(G_,e),U_.forEach(t=>{t(G_)})},Hpe={blank:4e3,error:4e3,success:2e3,loading:1/0,custom:4e3},Upe=(e={})=>{let[t,n]=w.useState(G_);w.useEffect(()=>(U_.push(n),()=>{let a=U_.indexOf(n);a>-1&&U_.splice(a,1)}),[t]);let r=t.toasts.map(a=>{var o,i;return{...e,...e[a.type],...a,duration:a.duration||((o=e[a.type])==null?void 0:o.duration)||(e==null?void 0:e.duration)||Hpe[a.type],style:{...e.style,...(i=e[a.type])==null?void 0:i.style,...a.style}}});return{...t,toasts:r}},Gpe=(e,t="blank",n)=>({createdAt:Date.now(),visible:!0,type:t,ariaProps:{role:"status","aria-live":"polite"},message:e,pauseDuration:0,...n,id:(n==null?void 0:n.id)||jpe()}),Ry=e=>(t,n)=>{let r=Gpe(t,e,n);return Uh({type:2,toast:r}),r.id},as=(e,t)=>Ry("blank")(e,t);as.error=Ry("error"),as.success=Ry("success"),as.loading=Ry("loading"),as.custom=Ry("custom"),as.dismiss=e=>{Uh({type:3,toastId:e})},as.remove=e=>Uh({type:4,toastId:e}),as.promise=(e,t,n)=>{let r=as.loading(t.loading,{...n,...n==null?void 0:n.loading});return e.then(a=>(as.success(z_(t.success,a),{id:r,...n,...n==null?void 0:n.success}),a)).catch(a=>{as.error(z_(t.error,a),{id:r,...n,...n==null?void 0:n.error})}),e};var Wpe=e=>{let{toasts:t,pausedAt:n}=Upe(e);w.useEffect(()=>{if(n)return;let a=Date.now(),o=t.map(i=>{if(i.duration===1/0)return;let s=(i.duration||0)+i.pauseDuration-(a-i.createdAt);if(s<0){i.visible&&as.dismiss(i.id);return}return setTimeout(()=>as.dismiss(i.id),s)});return()=>{o.forEach(i=>i&&clearTimeout(i))}},[t,n]);let r=w.useMemo(()=>({startPause:()=>{Uh({type:5,time:Date.now()})},endPause:()=>{n&&Uh({type:6,time:Date.now()})},updateHeight:(a,o)=>Uh({type:1,toast:{id:a,height:o}}),calculateOffset:(a,o)=>{let{reverseOrder:i=!1,gutter:s=8,defaultPosition:c}=o||{},l=t.filter(h=>(h.position||c)===(a.position||c)&&h.height),u=l.findIndex(h=>h.id===a.id),d=l.filter((h,m)=>m<u&&h.visible).length;return l.filter(h=>h.visible).slice(...i?[d+1]:[0,d]).reduce((h,m)=>h+(m.height||0)+s,0)}}),[t,n]);return{toasts:t,handlers:r}},qpe=Ru`
|
|
204
|
+
`,gridTemplateColumns:"var(--booker-meta-width) 1fr",gridTemplateRows:"70px auto"}}},che=(e,t,n=!1)=>{const r=a=>n?"":a;return["[--booker-timeslots-width:240px] lg:[--booker-timeslots-width:280px]",e===Nn.MONTH_VIEW&&r("[--booker-meta-width:240px]"),e===Nn.MONTH_VIEW&&t==="booking"&&`[--booker-main-width:420px] ${r("lg:[--booker-meta-width:340px]")}`,e===Nn.MONTH_VIEW&&t!=="booking"&&`[--booker-main-width:480px] ${r("lg:[--booker-meta-width:280px]")}`,e!==Nn.MONTH_VIEW&&`[--booker-main-width:480px] [--booker-meta-width:340px] ${r("lg:[--booker-meta-width:424px]")}`]},lhe=(e,t)=>{var i;const n=Xee(),[r,a]=pte(),o=typeof window<"u"&&((i=window==null?void 0:window.isEmbed)==null?void 0:i.call(window));return w.useEffect(()=>{const s=jR[e][t]||jR[e].default;if(!r.current)return;const c={height:(s==null?void 0:s.height)||"auto"},l={gridTemplateAreas:s==null?void 0:s.gridTemplateAreas,width:(s==null?void 0:s.width)||"auto",gridTemplateColumns:s==null?void 0:s.gridTemplateColumns,gridTemplateRows:s==null?void 0:s.gridTemplateRows,minHeight:s==null?void 0:s.minHeight};if(n||e==="mobile"||o){const u={...l,...c};Object.keys(u).forEach(d=>{d==="height"?r.current.style.height=c.height==="100vh"&&o?"100%":c.height:r.current.style[d]=u[d]})}else Object.keys(l).forEach(u=>{r.current.style[u]=l[u]}),a(r.current,c,{duration:.5,ease:S1(.4,0,.2,1)})},[a,o,r,e,n,t]),r},F_={mobile:{desktop:0,tablet:0},[Nn.MONTH_VIEW]:{desktop:0,tablet:0},[Nn.WEEK_VIEW]:{desktop:7,tablet:4},[Nn.COLUMN_VIEW]:{desktop:6,tablet:2}},uhe=Su(()=>Promise.resolve().then(()=>N5e).then(e=>e.TimezoneSelect),{ssr:!1}),dhe=({event:e,isPending:t,isPlatform:n=!0,classNames:r})=>{const{setTimezone:a,timeFormat:o,timezone:i}=Si(),s=Ot(F=>F.selectedDuration),c=Ot(F=>F.selectedTimeslot),l=Ot(F=>F.state),u=Ot(F=>F.bookingData),d=Ot(F=>F.rescheduleUid),[h,m]=Ot(F=>[F.seatedEventData,F.setSeatedEventData],Ua),{i18n:v,t:g}=At(),_=IO(),x=Jd()?_.hideEventTypeDetails:!1,[S]=w.useMemo(()=>n?[bF]:[uhe],[n]);if(w.useEffect(()=>{var F,G;e&&(e!=null&&e.lockTimeZoneToggleOnBookingPage)&&((F=e==null?void 0:e.schedule)!=null&&F.timeZone)&&a((G=e.schedule)==null?void 0:G.timeZone)},[e,a]),x)return null;const M=(h==null?void 0:h.attendees)||(u==null?void 0:u.attendees.length),E=(h==null?void 0:h.seatsPerTimeSlot)||(e==null?void 0:e.seatsPerTimeSlot),T=M&&E&&M/E>=.5,D=M&&E&&M/E>=.83?"text-rose-600":T?"text-yellow-500":"text-bookinghighlight";return ue("div",{className:`${r==null?void 0:r.eventMetaContainer} relative z-10 p-6`,"data-testid":"event-meta",children:[t&&b(K0.div,{...k6,initial:"visible",layout:!0,children:b(Vde,{})}),!t&&!!e&&ue(K0.div,{...k6,layout:!0,transition:{...k6.transition,delay:.3},children:[b(zde,{schedulingType:e.schedulingType,users:e.users,profile:e.profile,entity:e.entity}),b(Bde,{className:`${r==null?void 0:r.eventMetaTitle} my-2`,children:e==null?void 0:e.title}),e.description&&b(Cl,{contentClassName:"mb-8 break-words max-w-full max-h-[180px] scroll-bar pr-4",children:b("div",{dangerouslySetInnerHTML:{__html:e.description}})}),ue("div",{className:"space-y-4 font-medium rtl:-mr-2",children:[d&&u&&ue(Cl,{icon:"calendar",children:[g("former_time"),b("br",{}),b("span",{className:"line-through","data-testid":"former_time_p",children:b(LR,{date:u.startTime.toString(),duration:null,timeFormat:o,timeZone:i,language:v.language})})]}),c&&b(Cl,{icon:"calendar",children:b(LR,{date:c,duration:s||e.length,timeFormat:o,timeZone:i,language:v.language})}),b(jde,{event:e}),b(Cl,{className:"cursor-pointer [&_.current-timezone:before]:focus-within:opacity-100 [&_.current-timezone:before]:hover:opacity-100",contentClassName:"relative max-w-[90%]",icon:"globe",children:l==="booking"?b(vt,{children:i}):b("span",{className:`min-w-32 current-timezone before:bg-subtle -mt-[2px] flex h-6 max-w-full items-center justify-start before:absolute before:inset-0 before:bottom-[-3px] before:left-[-30px] before:top-[-3px] before:w-[calc(100%_+_35px)] before:rounded-md before:py-3 before:opacity-0 before:transition-opacity ${e.lockTimeZoneToggleOnBookingPage?"cursor-not-allowed":""}`,children:b(S,{menuPosition:"fixed",timezoneSelectCustomClassname:r==null?void 0:r.eventMetaTimezoneSelect,classNames:{control:()=>"!min-h-0 p-0 w-full border-0 bg-transparent focus-within:ring-0",menu:()=>"!w-64 max-w-[90vw]",singleValue:()=>"text-text py-1",indicatorsContainer:()=>"ml-auto",container:()=>"max-w-full"},value:i,onChange:F=>a(F.value),isDisabled:e.lockTimeZoneToggleOnBookingPage})})}),l==="booking"&&E&&M?b(Cl,{icon:"user",className:`${D}`,children:b("div",{className:"text-bookinghighlight flex items-start text-sm",children:b("p",{children:b(NR,{showExact:!!h.showAvailableSeatsCount,totalSeats:E,bookedSeats:M||0,variant:"fraction"})})})}):null]})]})]})};function fhe(e){const{t}=At(),[n,r]=w.useState(!1);return!e.visible||process.env.NEXT_PUBLIC_BOOKER_NUMBER_OF_DAYS_TO_LOAD=="0"&&W3==0||!process.env.NEXT_PUBLIC_BOOKER_NUMBER_OF_DAYS_TO_LOAD||n&&!e.isScheduleLoading||e.isScheduleLoading||!e.dayCount?null:ue("div",{className:"bg-default border-subtle mt-6 flex w-1/2 min-w-0 items-center justify-between rounded-[32px] border p-3 text-sm leading-none shadow-sm lg:w-1/3",children:[ue("div",{className:"flex items-center gap-2 overflow-x-hidden",children:[b(Mt,{name:"info",className:"text-default h-4 w-4"}),b("p",{className:"w-full leading-none",children:t("having_trouble_finding_time")})]}),ue("button",{className:"inline-flex items-center gap-2 font-medium",onClick:a=>{a.preventDefault(),e.onButtonClick(),r(!0)},children:[t("show_more")," ",b(Mt,{name:"arrow-right",className:"h-4 w-4"})]})]})}function hhe({extraDays:e,isMobile:t,enabledLayouts:n,nextSlots:r,eventSlug:a,isMyLink:o,renderOverlay:i}){const{t:s,i18n:c}=At(),l=Jd(),[u,d]=Ot(F=>[F.layout,F.setLayout],Ua),h=Ot(F=>F.selectedDate),m=Ot(F=>F.setSelectedDate),v=Ot(F=>F.addToSelectedDate),g=u===Nn.MONTH_VIEW,_=Xe(h),k=Xe(),x=w.useMemo(()=>{const F=k.diff(_,"days");return F>3||F<-3},[k,_]),S=w.useCallback(F=>{u===F||!F||d(F)},[d,u]);if(t||!n)return null;if(g)return ue("div",{className:"flex gap-2",children:[o&&!l?b(Ta,{content:s("troubleshooter_tooltip"),side:"bottom",children:b(Sn,{color:"primary",target:"_blank",href:`${Ea}/availability/troubleshoot?eventType=${a}`,children:s("need_help")})}):i==null?void 0:i(),b(w6,{layout:u,enabledLayouts:n,onLayoutToggle:S})]});const M=_.add(u===Nn.COLUMN_VIEW?e:e-1,"days"),E=()=>_.format("MMM")===M.format("MMM"),T=()=>_.format("YYYY")===M.format("YYYY"),$=new Intl.DateTimeFormat(c.language??"en",{month:"short"});return ue("div",{className:"border-default relative z-10 flex border-b px-5 py-4 ltr:border-l rtl:border-r",children:[ue("div",{className:"flex items-center gap-5 rtl:flex-grow",children:[b(()=>ue("h3",{className:"min-w-[150px] text-base font-semibold leading-4",children:[$.format(_.toDate())," ",_.format("D"),!T()&&ue("span",{className:"text-subtle",children:[", ",_.format("YYYY")," "]}),"-"," ",!E()&&$.format(M.toDate())," ",M.format("D"),","," ",b("span",{className:"text-subtle",children:T()?_.format("YYYY"):M.format("YYYY")})]}),{}),ue(A9,{children:[b(Sn,{className:"group rtl:ml-1 rtl:rotate-180",variant:"icon",color:"minimal",StartIcon:"chevron-left","aria-label":"Previous Day",onClick:()=>v(u===Nn.COLUMN_VIEW?-r:-e)}),b(Sn,{className:"group rtl:mr-1 rtl:rotate-180",variant:"icon",color:"minimal",StartIcon:"chevron-right","aria-label":"Next Day",onClick:()=>v(u===Nn.COLUMN_VIEW?r:e)}),x&&b(Sn,{className:"capitalize ltr:ml-2 rtl:mr-2",color:"secondary",onClick:()=>m(k.format("YYYY-MM-DD")),children:s("today")})]})]}),ue("div",{className:"ml-auto flex gap-2",children:[i==null?void 0:i(),b(DR,{}),b("div",{className:"fixed top-4 ltr:right-4 rtl:left-4",children:b(w6,{layout:u,enabledLayouts:n,onLayoutToggle:S})}),b("div",{className:"pointer-events-none opacity-0","aria-hidden":!0,children:b(w6,{layout:u,enabledLayouts:n,onLayoutToggle:S})})]})]})}const phe=({onLayoutToggle:e,layout:t,enabledLayouts:n})=>{const r=Jd(),{t:a}=At(),o=w.useMemo(()=>[{value:Nn.MONTH_VIEW,label:b(Mt,{name:"calendar",width:"16",height:"16"}),tooltip:a("switch_monthly")},{value:Nn.WEEK_VIEW,label:b(Mt,{name:"grid-3x3",width:"16",height:"16"}),tooltip:a("switch_weekly")},{value:Nn.COLUMN_VIEW,label:b(Mt,{name:"columns-3",width:"16",height:"16"}),tooltip:a("switch_columnview")}].filter(i=>n==null?void 0:n.includes(i.value)),[a,n]);return r?null:b(sC,{onValueChange:e,defaultValue:t,options:o})},w6=({enabledLayouts:e,onLayoutToggle:t,layout:n})=>e.length<=1?null:b(phe,{onLayoutToggle:t,layout:n,enabledLayouts:e}),mhe=({onConnectNow:e,event:t})=>{const{t:n}=At();return ue("div",{className:" bg-default border-subtle mx-2 block items-center gap-3 rounded-xl border p-[6px] text-sm shadow-sm delay-1000 sm:flex",children:[ue("div",{className:"flex items-center gap-3 ps-1",children:[ue("div",{className:"relative",children:[b(S9,{size:"sm",className:"border-muted",organization:{slug:t.entity.orgSlug,name:t.entity.name||""},users:t.schedulingType!==Iy.ROUND_ROBIN?t.users:[]}),b("div",{className:"border-muted absolute -bottom-0.5 -right-1 h-2 w-2 rounded-full border bg-green-500"})]}),b("div",{children:n("dont_want_to_wait")})]}),b("div",{className:"mt-2 sm:mt-0",children:b(Sn,{color:"primary",onClick:()=>{e()},size:"sm",className:"w-full justify-center rounded-lg sm:w-auto",children:n("connect_now")})})]})};function BR(e=0,t,n=6){const r=t;for(;r.getDay()!==e;)r.setDate(r.getDate()-1);return{startDate:r,endDate:new Date(r.getTime()+n*24*60*60*1e3)}}function yhe({day:e,gridCellIdx:t,totalGridCells:n,selectionLength:r,startHour:a,timezone:o}){const c=(r+1)*60/n*t;return Xe(e).tz(o).startOf("day").add(c,"minutes").add(a,"hours")}function ghe(e,t){const n=[];let r=Xe(e).hour(0).minute(0).second(0).millisecond(0);n.push(r);const a=Xe(t).hour(0).minute(0).second(0).millisecond(0);for(;r.isBefore(a);)n.push(r.add(1,"day")),r=r.add(1,"day");return n.slice(0,7)}function vhe(e,t,n){const r=[];let a=Xe("1970-01-01").tz(n).hour(e);r.push(a);const o=Xe("1970-01-01").tz(n).hour(t);for(;a.isBefore(o);)r.push(a.add(1,"hour")),a=a.add(1,"hour");return r}function _he(e){e.sort((n,r)=>n.start.getTime()-r.start.getTime());const t=[];for(let n=0;n<e.length;n++)if(t.length===0)t.push(e[n]);else{const r=t[t.length-1],a=e[n];r.end.getTime()>=a.start.getTime()?r.end=a.end:t.push(a)}return t}const bhe={view:"week",startDate:BR(0,new Date).startDate,endDate:BR(0,new Date).endDate,events:[],startHour:0,endHour:23,gridCellsPerHour:4},Vs=n_(e=>({...bhe,setView:t=>e({view:t}),setStartDate:t=>e({startDate:t}),setEndDate:t=>e({endDate:t}),setEvents:t=>e({events:t}),initState:t=>{let n=t.events;t.sortEvents&&(n=t.events.sort((a,o)=>Xe(a.start).valueOf()-Xe(o.start).valueOf()));const r=_he(t.blockingDates||[]);e({...t,blockingDates:r,events:n})},setSelectedEvent:t=>e({selectedEvent:t}),handleDateChange:t=>e(n=>{const{startDate:r,endDate:a}=n;if(t==="INCREMENT"){const s=Xe(r).add(1,n.view).toDate(),c=Xe(a).add(1,n.view).toDate();return n.minDate&&s<n.minDate||n.maxDate&&c>n.maxDate?{startDate:r,endDate:a}:(n.onDateChange&&n.onDateChange(s,c),{startDate:s,endDate:c})}const o=Xe(r).subtract(1,n.view).toDate(),i=Xe(a).subtract(1,n.view).toDate();return n.onDateChange&&n.onDateChange(o,i),{startDate:o,endDate:i}})}));function khe({days:e,containerNavRef:t}){const{i18n:n}=At(),r=a=>new Intl.DateTimeFormat(n.language,{weekday:"short"}).format(a.toDate());return ue("div",{ref:t,className:"bg-default dark:bg-muted border-b-subtle rtl:border-r-default sticky top-[var(--calendar-dates-sticky-offset,0px)] z-[80] flex-none border-b border-r sm:pr-8",children:[b("div",{className:"text-subtle flex text-sm leading-6 sm:hidden","data-dayslength":e.length,children:e.map(a=>{const o=Xe().isSame(a,"day");return ue("button",{type:"button",className:"flex flex-1 flex-col items-center pb-3 pt-2",children:[a.format("dd")," ",b("span",{className:Fe("text-emphasis mt-1 flex h-8 w-8 items-center justify-center font-semibold",o&&"bg-inverted text-inverted rounded-full"),children:a.format("D")})]},a.toString())})}),ue("div",{className:"text-subtle -mr-px hidden auto-cols-fr text-sm leading-6 sm:flex ",children:[b("div",{className:"border-default col-end-1 w-14 ltr:border-l"}),e.map(a=>{const o=Xe().isSame(a,"day");return b("div",{className:Fe("flex flex-1 items-center justify-center py-3 text-xs font-medium uppercase",o&&"font-bold"),children:ue("span",{children:[r(a)," ",b("span",{className:Fe("items-center justify-center p-1",o&&"bg-brand-default text-brand rounded-full"),children:a.format("DD")})]})},a.toString())})]})]})}function whe(e,t,n){const r=e*60;return t*60+n-r}function xhe(){const e=w.useRef(null),[t,n]=w.useState(!1),[r,a]=w.useState(null),{startHour:o,endHour:i}=Vs(l=>({startHour:l.startHour||0,endHour:l.endHour||23})),{timeFormat:s,timezone:c}=Si();return w.useEffect(()=>{const l=Xe().tz(c),u=l.hour(),d=l.minute();(u>i||u<o)&&a(null);const h=whe(o,u,d);a(h),!(!e.current||t)&&setTimeout(()=>{var m;(m=e==null?void 0:e.current)==null||m.scrollIntoView({block:"center"}),n(!0)},100)},[o,i,t,c]),ue("div",{ref:e,className:"absolute top-0 z-40 flex h-px items-center justify-center text-xs","aria-hidden":"true",style:{top:`calc(${r}*var(--one-minute-height) + var(--calendar-offset-top))`,zIndex:70},children:[b("div",{className:"w-14 pr-2 text-right",children:Xe().tz(c).format(s)}),b("div",{className:"bg-inverted h-3 w-px"}),b("div",{className:"bg-inverted h-px w-screen"})]})}function Che(e){const t=yhe({day:e.day,gridCellIdx:e.gridCellIdx,totalGridCells:e.totalGridCells,selectionLength:e.selectionLength,startHour:e.startHour,timezone:e.timezone}),n=(t.hour()-e.startHour)*60+t.minute();return b(VR,{topOffsetMinutes:n,timeSlot:Xe(t).tz(e.timezone)})}function She({availableSlots:e,day:t,startHour:n}){var c;const{timezone:r}=Si(),o=Xe(t).format("YYYY-MM-DD"),i=e&&e[o],s=w.useMemo(()=>{const l=[];let u=-1,d=-1,h=!0,m=0;if(i==null||i.forEach((v,g)=>{const _=Xe(v.start).tz(r),k=(_.hour()-n)*60+_.minute();l.push({slot:v,topOffsetMinutes:k}),v.away?(u===-1&&(u=g),d=g):h=!1}),h&&u!==-1){const v=i[u],g=i[d];return m=Xe(g.end).diff(Xe(v.start),"minutes"),v.toUser==null?null:{slots:l,startEndTimeDuration:m,firstSlot:v,timezone:r}}return{slots:l,startEndTimeDuration:m}},[i,n,r]);if(s===null)return null;if(s.startEndTimeDuration){const{firstSlot:l,startEndTimeDuration:u}=s;return b(Mhe,{timeSlot:Xe(l==null?void 0:l.start).tz(s.timezone),topOffsetMinutes:(c=s.slots[0])==null?void 0:c.topOffsetMinutes,startEndTimeDuration:u,children:b(PR,{fromUser:l==null?void 0:l.fromUser,toUser:l==null?void 0:l.toUser,reason:l==null?void 0:l.reason,emoji:l==null?void 0:l.emoji,borderDashed:!1,date:o,className:"pb-0"})})}return b(vt,{children:s.slots.map((l,u)=>b(VR,{timeSlot:Xe(l.slot.start).tz(r),topOffsetMinutes:l.topOffsetMinutes},u))})}function VR({isDisabled:e,topOffsetMinutes:t,timeSlot:n}){const{timeFormat:r}=Si(),{onEmptyCellClick:a,hoverEventDuration:o}=Vs(i=>({onEmptyCellClick:i.onEmptyCellClick,hoverEventDuration:i.hoverEventDuration}),Ua);return b("div",{className:Fe("group flex w-[calc(100%-1px)] items-center justify-center",e&&"pointer-events-none",!e&&"bg-default dark:bg-muted",t&&"absolute"),"data-disabled":e,"data-slot":n.toISOString(),"data-testid":"calendar-empty-cell",style:{height:`calc(${o}*var(--one-minute-height))`,overflow:"visible",top:t?`calc(${t}*var(--one-minute-height))`:void 0},onClick:()=>{a&&a(n.toDate())},children:!e&&o!==0&&b("div",{className:Fe("opacity-4 bg-brand-default hover:bg-brand-default text-brand dark:border-emphasis absolute hidden rounded-[4px] p-[6px] text-xs font-semibold leading-5 group-hover:flex group-hover:cursor-pointer",o&&o>15&&"items-start pt-3",o&&o<15&&"items-center"),style:{height:`calc(${o}*var(--one-minute-height) - 2px)`,zIndex:80,width:"calc(100% - 2px)"},children:b("div",{className:"overflow-ellipsis leading-[0]",children:n.format(r)})})})}function Mhe({timeSlot:e,children:t,topOffsetMinutes:n,startEndTimeDuration:r}){return b("div",{className:Fe("bg-default dark:bg-muted group absolute z-[65] flex w-[calc(100%-1px)] items-center justify-center"),"data-slot":e.toISOString(),style:{top:n?`calc(${n}*var(--one-minute-height))`:void 0,overflow:"visible"},children:b("div",{className:Fe("dark:border-emphasis bg-default dark:bg-muted cursor-pointer rounded-[4px] p-[6px] text-xs font-semibold dark:text-white"),style:{height:`calc(${r}*var(--one-minute-height) - 2px)`,width:"calc(100% - 2px)"},children:t})})}const Ahe=D0("group flex h-full w-full overflow-y-auto rounded-[6px] px-[6px] text-xs font-semibold leading-5 opacity-80",{variants:{status:{ACCEPTED:"bg-subtle hover:bg-emphasis text-emphasis border-[1px] border-gray-900",PENDING:"bg-default text-emphasis border-[1px] border-dashed border-gray-900",REJECTED:"",CANCELLED:"",AWAITING_HOST:""},disabled:{true:"hover:cursor-default",false:"hover:cursor-pointer"},selected:{true:"bg-inverted text-inverted border-[1px] border-transparent",false:""},borderColor:{ACCEPTED:"border-gray-900",PENDING:"border-gray-900",REJECTED:"border-gray-900",CANCELLED:"border-gray-900",AWAITING_HOST:"",custom:""}}});function Ehe({event:e,currentlySelectedEventId:t,eventDuration:n,disabled:r,onEventClick:a}){var u,d;const o=t===e.id,{options:i}=e,s=i!=null&&i.borderColor?"custom":i==null?void 0:i.status,c=i!=null&&i.borderColor?{borderColor:i==null?void 0:i.borderColor}:{},l=a?"button":"div";return b(Ta,{content:e.title,children:ue(l,{onClick:()=>a==null?void 0:a(e),className:Fe(Ahe({status:i==null?void 0:i.status,disabled:r,selected:o,borderColor:s}),n>30&&"flex-col py-1",i==null?void 0:i.className),style:c,children:[ue("div",{className:Fe("flex w-full gap-2 overflow-hidden overflow-ellipsis whitespace-nowrap text-left leading-4",n<=30&&"items-center"),children:[b("span",{children:e.title}),n<=30&&!((u=e.options)!=null&&u.hideTime)&&ue("p",{className:"text-subtle w-full whitespace-nowrap text-left text-[10px] leading-none",children:[Xe(e.start).format("HH:mm")," - ",Xe(e.end).format("HH:mm")]})]}),n>30&&!((d=e.options)!=null&&d.hideTime)&&ue("p",{className:"text-subtle text-left text-[10px] leading-none",children:[Xe(e.start).format("HH:mm")," - ",Xe(e.end).format("HH:mm")]}),n>45&&e.description&&b("p",{className:"text-subtle text-left text-[10px] leading-none",children:e.description})]})})}function Ihe({day:e}){const{startHour:t,events:n,eventOnClick:r}=Vs(o=>({startHour:o.startHour,events:o.events,eventOnClick:o.onEventClick}),Ua),a=w.useRef(null);return b(vt,{children:n.filter(o=>{var i;return Xe(o.start).isSame(e,"day")&&!((i=o.options)!=null&&i.allDay)}).map((o,i,s)=>{var S;let c=90,l=0,u=0,d=61;const h=Xe(o.start),m=Xe(o.end),v=m.diff(h,"minutes"),_=(h.hour()-(t||0))*60+h.minute(),k=s[i+1],x=s[i-1];if(a.current?v>a.current.duration&&h.isBetween(a.current.start,a.current.end)&&(a.current={idx:i,start:h.toDate(),end:m.toDate(),duration:v}):a.current={idx:i,start:h.toDate(),end:m.toDate(),duration:v},a.current.idx!==i){if(k){const M=Xe(k.start);(M.isBetween(a.current.start,a.current.end)||M.isBetween(h.add(-5,"minutes"),h.add(5,"minutes")))&&(d=65,l="auto",u=4,c=c/2)}else if(x){const M=Xe(x.start);M.isBetween(a.current.start,a.current.end)?(d=65,l="auto",u=4):h.isBetween(M.add(5,"minutes"),M.add(-5,"minutes"))&&(d=65,u=4,c=c/2)}}return b("div",{className:"absolute inset-x-1 ","data-testid":(S=o.options)==null?void 0:S["data-test-id"],style:{marginLeft:l,zIndex:d,right:`calc(${u}% - 1px)`,width:`${c}%`,top:`calc(${_}*var(--one-minute-height))`,height:`calc(${v}*var(--one-minute-height))`},children:b(Ehe,{event:o,eventDuration:v,onEventClick:r})},`${o.id}-${h.toISOString()}`)})})}const zR=w.forwardRef(function({offsetHeight:t,gridStopsPerDay:n,children:r,zIndex:a},o){return b("ol",{ref:o,className:"scheduler-grid-row-template col-start-1 col-end-2 row-start-1 grid auto-cols-auto text-[0px] sm:pr-8",style:{marginTop:t||"var(--gridDefaultSize)",zIndex:a},"data-gridstopsperday":n,children:r})});function The(){const{startDate:e,endDate:t,handleDateChange:n}=Vs(r=>({startDate:Xe(r.startDate),endDate:Xe(r.endDate),handleDateChange:r.handleDateChange}));return ue("header",{className:"flex flex-none flex-col justify-between py-4 sm:flex-row sm:items-center",children:[ue("h1",{className:"text-emphasis text-xl font-semibold",children:[e.format("MMM DD"),"-",t.format("DD"),ue("span",{className:"text-subtle",children:[",",e.format("YYYY")]})]}),b("div",{className:"flex items-center space-x-2 rtl:space-x-reverse",children:ue(A9,{combined:!0,children:[b(Sn,{StartIcon:"chevron-left",variant:"icon",color:"secondary","aria-label":"Previous Week",onClick:()=>{n("DECREMENT")}}),b(Sn,{StartIcon:"chevron-right",variant:"icon",color:"secondary","aria-label":"Next Week",onClick:()=>{n("INCREMENT")}})]})})]})}const $he=({hours:e,numberOfGridStopsPerCell:t,containerOffsetRef:n})=>{const{timeFormat:r}=Si(),a=e[e.length-1].add(1,"hour").minute(0).format(r),o=w.useId();return ue("div",{className:" divide-default pointer-events-none relative z-[60] col-start-1 col-end-2 row-start-1 grid divide-y",style:{gridTemplateRows:`repeat(${e.length}, minmax(var(--gridDefaultSize),1fr)`},children:[b("div",{className:"row-end-1 h-[--calendar-offset-top] ",ref:n}),e.map(i=>b("div",{children:b("div",{className:"text-muted sticky left-0 z-20 -ml-14 -mt-2.5 w-14 pr-2 text-right text-xs leading-5 rtl:-mr-14",children:i.minute(0).format(r)})},`${o}-${i.get("hour")}`)),b("div",{children:b("div",{className:"text-muted sticky left-0 z-20 -ml-14 -mt-2.5 w-14 pr-2 text-right text-xs leading-5 rtl:-mr-14",children:a})},`${o}-${a}`)]})},Phe=({className:e})=>b("div",{className:Fe("fixed left-[calc(50%+calc(var(--booker-meta-width,0px)/2))] top-1/2 z-[80] h-10 w-10 -translate-x-1/2 -translate-y-1/2",e),children:ue("svg",{className:"h-10 w-10",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:[b("path",{className:"fill-default",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"}),b("path",{className:"animate-spinning fill-emphasis origin-center",d:"M10.14,1.16a11,11,0,0,0-9,8.92A1.59,1.59,0,0,0,2.46,12,1.52,1.52,0,0,0,4.11,10.7a8,8,0,0,1,6.66-6.61A1.42,1.42,0,0,0,12,2.69h0A1.57,1.57,0,0,0,10.14,1.16Z"})]})}),Ohe=({days:e})=>{const t=()=>{let r="en";if(typeof window<"u"&&typeof navigator<"u"){const a=navigator.language;r=new Intl.Locale(a).language}return["ar","he","fa","ur"].includes(r)},n=t()?"rtl":"ltr";return b("div",{className:"divide-default pointer-events-none relative z-[60] col-start-1 col-end-2 row-start-1 grid auto-cols-auto grid-rows-1 divide-x sm:pr-8",dir:n,style:{direction:n},children:e.map((r,a)=>b("div",{className:"row-span-full",style:{gridColumnStart:t()?e.length-a:a+1}},`Key_vertical_${a}`))})};function Nhe(e){var x,S;const t=w.useRef(null),n=w.useRef(null),r=w.useRef(null),a=w.useRef(null),o=Vs(M=>M.initState),{timezone:i}=Si(),s=Vs(M=>M.startDate),c=Vs(M=>M.endDate),l=Vs(M=>M.startHour||0),u=Vs(M=>M.endHour||23),d=Vs(M=>M.gridCellsPerHour||4),h=Vs(M=>M.availableTimeslots),m=Vs(M=>M.hideHeader),v=w.useMemo(()=>ghe(s,c),[s,c]),g=w.useMemo(()=>vhe(l||0,u||23,i),[l,u,i]),_=g.length*d,k=58;return w.useEffect(()=>{o(e)},[e,o]),b(Dhe,{children:ue("div",{className:Fe("scheduler-wrapper flex h-full w-full flex-col"),style:{"--one-minute-height":`calc(${k}px/60)`,"--gridDefaultSize":`${k}px`},children:[m!==!0&&b(The,{}),e.isPending&&b(Phe,{}),b("div",{ref:t,className:"bg-default dark:bg-muted relative isolate flex h-full flex-auto flex-col",children:ue("div",{style:{width:"165%"},className:"flex h-full max-w-full flex-none flex-col sm:max-w-none md:max-w-full",children:[b(khe,{containerNavRef:n,days:v}),ue("div",{className:"relative flex flex-auto",children:[b(xhe,{}),b("div",{className:"bg-default dark:bg-muted ring-muted border-default sticky left-0 z-10 w-14 flex-none border-l border-r ring-1"}),ue("div",{className:"grid flex-auto grid-cols-1 grid-rows-1 [--disabled-gradient-background:#F8F9FB] [--disabled-gradient-foreground:#E6E7EB] dark:[--disabled-gradient-background:#262626] dark:[--disabled-gradient-foreground:#393939]",style:{backgroundColor:"var(--disabled-gradient-background)",background:"repeating-linear-gradient(-45deg, var(--disabled-gradient-background), var(--disabled-gradient-background) 2.5px, var(--disabled-gradient-foreground) 2.5px, var(--disabled-gradient-foreground) 5px)"},children:[b($he,{hours:g,numberOfGridStopsPerCell:d,containerOffsetRef:r}),b(Ohe,{days:v}),b(zR,{offsetHeight:(x=r.current)==null?void 0:x.offsetHeight,gridStopsPerDay:_,children:v.map((M,E)=>b("li",{className:"relative",style:{gridColumnStart:E+1},children:b(Ihe,{day:M})},M.toISOString()))}),b(zR,{ref:a,offsetHeight:(S=r.current)==null?void 0:S.offsetHeight,gridStopsPerDay:_,children:b(vt,{children:[...Array(v.length)].map((M,E)=>b("li",{className:"relative",style:{gridRow:`1 / span ${_}`},children:h?b(She,{day:v[E],startHour:l,availableSlots:h},v[E].toISOString()):b(vt,{children:[...Array(_)].map((T,$)=>{const D=`${E}-${$}`;return b(Che,{day:v[E],gridCellIdx:$,totalGridCells:_,selectionLength:u-l,startHour:l,timezone:i},D)})})},E))})})]})]})]})})]})})}const Dhe=({children:e})=>ue(vt,{children:[ue("div",{className:"flex h-full flex-col items-center justify-center sm:hidden",children:[b("h1",{className:"text-2xl font-bold",children:"Mobile not supported yet "}),b("p",{className:"text-subtle",children:"Please use a desktop browser to view this page"})]}),b("div",{className:"hidden h-full sm:block",children:e})]}),Rhe=({extraDays:e,schedule:t,isLoading:n,event:r})=>{var v;const a=Ot(g=>g.selectedDate),o=Ot(g=>g.setSelectedTimeslot),i=Ot(g=>g.selectedDuration),s=cf(g=>g.overlayBusyDates),c=pl("overlayCalendar")==="true"||ti.getItem("overlayCalendarSwitchDefault"),l=i||((v=r==null?void 0:r.data)==null?void 0:v.length)||30,u=w.useMemo(()=>{const g={};if(!t||!t.slots)return g;for(const _ in t.slots)g[_]=t.slots[_].map(k=>{const{time:x,...S}=k;return{start:Xe(x).toDate(),end:Xe(x).add(l,"minutes").toDate(),...S}});return g},[t,l]),d=a?Xe(a).toDate():Xe().toDate(),h=Xe(d).add(e-1,"day").toDate();w.useEffect(()=>{},[c]);const m=w.useMemo(()=>!s||!c?[]:s.map((g,_)=>({id:_,start:Xe(g.start).toDate(),end:Xe(g.end).toDate(),title:"Busy",options:{status:"ACCEPTED"}})),[s,c]);return b("div",{className:"h-full [--calendar-dates-sticky-offset:66px]",children:b(Nhe,{isPending:n,availableTimeslots:u,startHour:0,endHour:23,events:m,startDate:d,endDate:h,onEmptyCellClick:g=>o(g.toISOString()),gridCellsPerHour:60/l,hoverEventDuration:l,hideHeader:!0})})};function HR(e,t){const[n,r]=w.useState(()=>{const l=ti.getItem(e);return l?new Set(JSON.parse(l)):new Set(t)});return w.useEffect(()=>{ti.setItem(e,JSON.stringify(Array.from(n)))},[e,n]),{set:n,addValue:l=>{r(u=>new Set(u).add(l))},removeById:l=>{r(u=>{const d=new Set(u);return d.forEach(h=>{h.externalId===l&&d.delete(h)}),d})},toggleValue:l=>{r(u=>{const d=new Set(u);let h=!1;return d.forEach(m=>{m.externalId===l.externalId&&(h=!0,d.delete(m))}),h||d.add(l),d})},hasItem:l=>Array.from(n).some(u=>u.externalId===l.externalId),clearSet:()=>{r(()=>new Set),ti.removeItem(e)}}}const Lhe=({connectedCalendars:e,overlayBusyDates:t,onToggleCalendar:n})=>{const{set:r,toggleValue:a,hasItem:o}=HR("toggledConnectedCalendars",[]),[i,s]=w.useState(!1),[c,l]=cf(g=>[g.continueWithProviderModal,g.setContinueWithProviderModal],Ua),[u,d]=cf(g=>[g.calendarSettingsOverlayModal,g.setCalendarSettingsOverlayModal],Ua),h=cf(g=>g.setOverlayBusyDates),{timezone:m}=Si();return w.useEffect(()=>{if(t){const g=Xe(),k=(g.tz(m).utcOffset()-g.utcOffset())/60,x=t.map(S=>({...S,start:Xe(S.start).add(k,"hours").toDate(),end:Xe(S.end).add(k,"hours").toDate()}));h(x)}},[t]),w.useEffect(()=>{e&&r.size===0&&!i&&(e.forEach(g=>{var _;(_=g.calendars)==null||_.forEach(k=>{const x={credentialId:g.credentialId,externalId:k.externalId};k.primary&&a(x)})}),s(!0))},[o,r,i]),{isOpenOverlayContinueModal:c,isOpenOverlaySettingsModal:u,handleCloseContinueModal:g=>l(g),handleCloseSettingsModal:g=>d(g),handleToggleConnectedCalendar:(g,_)=>{a({credentialId:_,externalId:g}),h([]),n()},checkIsCalendarToggled:(g,_)=>o({credentialId:_,externalId:g})}};function Fhe(e){const{t}=At();return b(vt,{children:b(Ju,{open:e.open,onOpenChange:e.onClose,children:ue(Dl,{type:"creation",title:t("overlay_my_calendar"),description:t("overlay_my_calendar_toc"),children:[b("div",{className:"flex flex-col gap-2",children:b(Sn,{"data-testid":"overlay-calendar-continue-button",onClick:()=>{e.onContinue()},className:"gap w-full items-center justify-center font-semibold",StartIcon:"calendar-search",children:t("continue_with",{appName:xu})})}),b(qk,{children:b(vt,{})})]})})})}const jhe=()=>b(bH,{children:ue("div",{className:"border-subtle mt-3 space-y-4 rounded-xl border px-4 py-4 ",children:[b(Jn,{className:"h-4 w-full"}),b(Jn,{className:"h-4 w-full"}),b(Jn,{className:"h-4 w-full"}),b(Jn,{className:"h-4 w-full"})]})});function Bhe({connectedCalendars:e,isLoading:t,open:n,onClose:r,onClickNoCalendar:a,onToggleConnectedCalendar:o,checkIsCalendarToggled:i}){const{t:s}=At();return b(vt,{children:b(Ju,{open:n,onOpenChange:r,children:ue(Dl,{enableOverflow:!0,type:"creation",title:"Calendar Settings",className:"pb-4",description:s("view_overlay_calendar_events"),children:[b("div",{className:"no-scrollbar max-h-full overflow-y-scroll ",children:t?b(jhe,{}):b(vt,{children:e.length===0?b(Uk,{Icon:"calendar",headline:s("no_calendar_installed"),description:s("no_calendar_installed_description"),buttonText:s("add_a_calendar"),buttonOnClick:a}):b(vt,{children:e.map(c=>ue(w.Fragment,{children:[c.error&&!c.calendars&&b(kf,{severity:"error",title:c.error.message}),(c==null?void 0:c.error)===void 0&&c.calendars&&ue(IH,{className:"flex-col rounded-md",children:[ue("div",{className:"flex w-full flex-1 items-center space-x-3 pb-4 rtl:space-x-reverse",children:[c.integration.logo&&b("img",{className:Fe("h-10 w-10",c.integration.logo.includes("-dark")&&"dark:invert"),src:c.integration.logo,alt:c.integration.title}),ue("div",{className:"flex-grow truncate pl-2",children:[b(TH,{component:"h3",className:"space-x-2 rtl:space-x-reverse",children:b(ya,{href:`/apps/${c.integration.slug}`,children:c.integration.name||c.integration.title})}),b($H,{component:"p",children:c.primary.email})]})]}),b("div",{className:"border-subtle w-full border-t pt-4",children:b("ul",{className:"space-y-4",children:c.calendars.map((l,u)=>{const d=l.integrationTitle??`calendar-switch-${u}`;return ue("li",{className:"flex gap-3",children:[b(up,{id:d,checked:i(l.externalId,c.credentialId),onCheckedChange:()=>{o(l.externalId,c.credentialId)}}),b("label",{htmlFor:d,children:l.name})]},d)})})})]})]},c.credentialId))})})}),b("div",{className:"mt-4 flex gap-2 self-end",children:b(Rl,{children:s("done")})})]})})})}function Vhe({enabled:e,hasSession:t,onStateChange:n}){const{t:r}=At(),a=cf(c=>c.setContinueWithProviderModal),o=cf(c=>c.setCalendarSettingsOverlayModal),i=Ot(c=>c.layout),s=e;return w.useEffect(()=>{!t&&s&&(n(!1),a(!0))},[t,s,a,n]),ue("div",{className:Fe("hidden gap-2",i==="week_view"||i==="column_view"?"xl:flex":"md:flex"),children:[ue("div",{className:"flex items-center gap-2 pr-2",children:[b(up,{"data-testid":"overlay-calendar-switch",checked:s,id:"overlayCalendar",onCheckedChange:c=>{t?n(c):a(c)}}),b("label",{htmlFor:"overlayCalendar",className:"text-emphasis text-sm font-medium leading-none hover:cursor-pointer",children:r("overlay_my_calendar")})]}),t&&b(Sn,{size:"base","data-testid":"overlay-calendar-settings-button",variant:"icon",color:"secondary",StartIcon:"settings",onClick:()=>{o(!0)}})]})}const zhe=({connectedCalendars:e,overlayBusyDates:t,onToggleCalendar:n,isOverlayCalendarEnabled:r,loadingConnectedCalendar:a,handleClickNoCalendar:o,handleSwitchStateChange:i,handleClickContinue:s,hasSession:c})=>{const{handleCloseContinueModal:l,handleCloseSettingsModal:u,isOpenOverlayContinueModal:d,isOpenOverlaySettingsModal:h,handleToggleConnectedCalendar:m,checkIsCalendarToggled:v}=Lhe({connectedCalendars:e,overlayBusyDates:t,onToggleCalendar:n});return ue(vt,{children:[b(Vhe,{enabled:r,hasSession:c,onStateChange:i}),b(Fhe,{open:d,onClose:l,onContinue:s}),b(Bhe,{connectedCalendars:e,open:h,onClose:u,isLoading:a,onToggleConnectedCalendar:m,onClickNoCalendar:()=>{o()},checkIsCalendarToggled:v})]})},j_=e=>{const t="/o";return e.returnValue=t,t},Hhe=({bookingId:e,onGoBack:t,expiryTime:n,instantVideoMeetingUrl:r})=>{const{t:a}=At(),[o,i]=w.useState(u()),[s,c]=w.useState(!1),l=ga.useRouter();function u(){const h=Xe(),v=Xe(n).diff(h);return Math.max(v,0)}w.useEffect(()=>{if(!n)return;const h=setInterval(()=>{i(u()),c(n&&new Date(n)<new Date)},1e3);return()=>{clearInterval(h)}},[n]);const d=h=>{const m=Xe.duration(h),v=m.seconds();return`${m.minutes()}m ${v}s`};return w.useEffect(()=>{if(!n||s||r){window.removeEventListener("beforeunload",j_);return}return window.addEventListener("beforeunload",j_),()=>{window.removeEventListener("beforeunload",j_)}},[n,s,r]),w.useEffect(()=>{r&&(window.removeEventListener("beforeunload",j_),l.push(r))},[r]),b(Ju,{open:!!e&&!!n,children:b(Dl,{enableOverflow:!0,className:"py-8",children:b("div",{children:s?ue("div",{children:[b("p",{className:"font-medium",children:a("please_book_a_time_sometime_later")}),b(Sn,{className:"mt-4",onClick:()=>{t()},color:"primary",children:a("go_back")})]}):ue("div",{className:"text-center",children:[b("p",{className:"font-medium",children:a("connecting_you_to_someone")}),b("p",{className:"font-medium",children:a("please_do_not_close_this_tab")}),b("p",{className:"mt-2 font-medium",children:a("please_schedule_future_call",{seconds:d(o)})}),b("div",{className:"mt-4 h-[414px]",children:b("iframe",{className:"mx-auto h-full w-[276px] rounded-lg",src:"https://cal.games/"})})]})})})})},UR={calendar:"[grid-area:calendar]",main:"[grid-area:main]",meta:"[grid-area:meta]",timeslots:"[grid-area:timeslots]",header:"[grid-area:header]"},Q1=w.forwardRef(function({children:t,area:n,visible:r,className:a,...o},i){const s=Ot(l=>l.layout);let c;return typeof n=="string"?c=UR[n]:c=UR[n[s]||n.default],!r&&typeof r<"u"?null:b(K0.div,{ref:i,className:Fe(c,a),layout:!0,...o,children:t})}),GR=({children:e,title:t})=>b("div",{className:"mx-auto w-full max-w-2xl",children:ue("div",{className:"border-subtle bg-default dark:bg-muted overflow-hidden rounded-lg border p-10",children:[b("h2",{className:"font-cal mb-4 text-3xl",children:t}),e]})}),Uhe=()=>{const{t:e}=At();return b(GR,{title:`😴 ${e("user_away")}`,children:b("p",{className:"max-w-[50ch]",children:e("user_away_description")})})},Ghe=()=>{const{t:e}=At();return b(GR,{title:e("404_page_not_found"),children:b("p",{className:"max-w-[50ch]",children:e("booker_event_not_found")})})},Whe=()=>Promise.resolve().then(()=>pYe).then(e=>e.default),qhe=Su(()=>Promise.resolve().then(()=>mYe)),Zhe=Su(()=>Promise.resolve().then(()=>W6e).then(e=>e.UnpublishedEntity)),WR=Su(()=>Promise.resolve().then(()=>yYe).then(e=>e.DatePicker),{ssr:!1}),Yhe=({username:e,eventSlug:t,hideBranding:n=!1,entity:r,isInstantMeeting:a=!1,onGoBackInstantMeeting:o,onConnectNowInstantMeeting:i,onOverlayClickNoCalendar:s,onClickOverlayContinue:c,onOverlaySwitchStateChange:l,sessionUsername:u,rescheduleUid:d,hasSession:h,extraOptions:m,bookings:v,verifyEmail:g,slots:_,calendars:k,bookerForm:x,event:S,bookerLayout:M,schedule:E,verifyCode:T,isPlatform:$,orgBannerUrl:D,customClassNames:F})=>{var ba,$a,ir,aa,Lr,xn,oa,fa,ta,gr,Pa,Hr,Kn;At();const[G,z]=Ot(Er=>[Er.state,Er.setState],Ua),Z=Ot(Er=>Er.selectedDate),{shouldShowFormInDialog:H,hasDarkBackground:j,extraDays:Y,columnViewExtraDays:K,isMobile:Q,layout:he,hideEventTypeDetails:ne,isEmbed:le,bookerLayouts:ae}=M,[ve,Oe]=Ot(Er=>[Er.seatedEventData,Er.setSeatedEventData],Ua),{selectedTimeslot:pe,setSelectedTimeslot:te}=_,[Ee,Re]=Ot(Er=>[Er.dayCount,Er.setDayCount],Ua),Ge=e6((ba=E==null?void 0:E.data)==null?void 0:ba.slots).filter(Er=>Xe(Z).diff(Er,"day")<=0),Ue=7,at=Ge.length<Y?(Y-Ge.length+1)*Ue:Ge.length===Y?Ue:0,ct=Ge.slice(0,Y+1);Ge.length!==0&&(K.current=Math.abs(Xe(Z).diff(ct[ct.length-2],"day"))+at);const et=Math.abs(Xe(Z).diff(ct[ct.length-1],"day"))+at,wt=lhe(he,G),lt=w.useRef(null),re=Q?"div":Mte,{bookerFormErrorRef:be,key:we,formEmail:Ze,bookingForm:Ve,errors:Se}=x,{handleBookEvent:Ie,errors:yt,loadingStates:qe,expiryTime:mt,instantVideoMeetingUrl:$t}=v,{isEmailVerificationModalVisible:Be,setEmailVerificationModalVisible:tt,handleVerifyEmail:Et,renderConfirmNotVerifyEmailButtonCond:Mn}=g,{overlayBusyDates:Dn,isOverlayCalendarEnabled:Qn,connectedCalendars:yr,loadingConnectedCalendar:Pr,onToggleCalendar:Bn}=k;w.useEffect(()=>S.isPending?z("loading"):z(Z?pe?"booking":"selecting_time":"selecting_date"),[S,Z,pe,z]);const Qr=w.useMemo(()=>G==="booking"?b(Qfe,{onCancel:()=>{te(null),ve.bookingUid&&Oe({...ve,bookingUid:void 0,attendees:void 0})},onSubmit:Mn?Ie:Et,errorRef:be,errors:{...Se,...yt},loadingStates:qe,renderConfirmNotVerifyEmailButtonCond:Mn,bookingForm:Ve,eventQuery:S,extraOptions:m,rescheduleUid:d,isPlatform:$,children:ue(vt,{children:[T?b(vue,{isOpenDialog:Be,setIsOpenDialog:tt,email:Ze,isUserSessionRequiredToVerify:!1,verifyCodeWithSessionNotRequired:T.verifyCodeWithSessionNotRequired,verifyCodeWithSessionRequired:T.verifyCodeWithSessionRequired,error:T.error,resetErrors:T.resetErrors,isPending:T.isPending,setIsPending:T.setIsPending}):b(vt,{}),!$&&b(Hhe,{expiryTime:mt,bookingId:parseInt(pl("bookingId")||"0"),instantVideoMeetingUrl:$t,onGoBack:()=>{o()}})]})},we):b(vt,{}),[be,$t,G,Ve,yt,S,mt,m,Ze,Se,Ie,Et,Be,we,qe,o,Mn,d,ve,tt,Oe,te,T==null?void 0:T.error,T==null?void 0:T.isPending,T==null?void 0:T.resetErrors,T==null?void 0:T.setIsPending,T==null?void 0:T.verifyCodeWithSessionNotRequired,T==null?void 0:T.verifyCodeWithSessionRequired,$]);return r.considerUnpublished&&!d?b(Zhe,{...r}):S.isSuccess&&!S.data?b(Ghe,{}):G==="loading"?null:ue(vt,{children:[S.data&&!$?b(Nte,{eventType:S.data}):b(vt,{}),G!=="booking"&&(($a=S.data)==null?void 0:$a.isInstantEvent)&&b("div",{className:"animate-fade-in-up fixed bottom-2 z-40 my-2 opacity-0",style:{animationDelay:"1s"},children:b(mhe,{event:S.data,onConnectNow:()=>{i()}})}),ue("div",{className:Fe("main","text-default flex min-h-full w-full flex-col items-center",he===Nn.MONTH_VIEW?"overflow-visible":"overflow-clip"),children:[b("div",{ref:wt,className:Fe(...che(he,G,ne),"bg-default dark:bg-muted grid max-w-full items-start dark:[color-scheme:dark] sm:transition-[width] sm:duration-300 sm:motion-reduce:transition-none md:flex-row",(he===Nn.MONTH_VIEW||le)&&"border-subtle rounded-md",!le&&"sm:transition-[width] sm:duration-300",le&&he===Nn.MONTH_VIEW&&"border-booker sm:border-booker-width",!le&&he===Nn.MONTH_VIEW&&"border-subtle",`${F==null?void 0:F.bookerContainer}`),children:ue(LT,{children:[!a&&b(Q1,{area:"header",className:Fe(he===Nn.MONTH_VIEW&&"fixed top-4 z-10 ltr:right-4 rtl:left-4",(he===Nn.COLUMN_VIEW||he===Nn.WEEK_VIEW)&&"bg-default dark:bg-muted sticky top-0 z-10"),children:$?b(vt,{}):b(hhe,{isMyLink:e===u,eventSlug:t,enabledLayouts:ae.enabledLayouts,extraDays:he===Nn.COLUMN_VIEW?K.current:Y,isMobile:Q,nextSlots:et,renderOverlay:()=>le?b(vt,{}):b(vt,{children:b(zhe,{isOverlayCalendarEnabled:Qn,connectedCalendars:yr,loadingConnectedCalendar:Pr,overlayBusyDates:Dn,onToggleCalendar:Bn,hasSession:h,handleClickContinue:c,handleSwitchStateChange:l,handleClickNoCalendar:()=>{s()}})})})}),b(re,{className:Fe("relative z-10 flex [grid-area:meta]",he!==Nn.MONTH_VIEW&&!le&&"sm:min-h-screen"),children:ue(Q1,{area:"meta",className:"max-w-screen flex w-full flex-col md:w-[var(--booker-meta-width)]",children:[!ne&&D&&!$&&b("img",{loading:"eager",className:"-mb-9 h-28 max-h-28 rounded-tl-md sm:max-h-24",alt:"org banner",src:D}),b(dhe,{classNames:{eventMetaContainer:(ir=F==null?void 0:F.eventMetaCustomClassnames)==null?void 0:ir.eventMetaContainer,eventMetaTitle:(aa=F==null?void 0:F.eventMetaCustomClassnames)==null?void 0:aa.eventMetaTitle,eventMetaTimezoneSelect:(Lr=F==null?void 0:F.eventMetaCustomClassnames)==null?void 0:Lr.eventMetaTimezoneSelect},event:S.data,isPending:S.isPending,isPlatform:$}),he!==Nn.MONTH_VIEW&&!(he==="mobile"&&G==="booking")&&b("div",{className:"mt-auto px-5 py-3 ",children:b(WR,{event:S,schedule:E})})]})},"meta"),b(Q1,{area:"main",className:"sticky top-0 ml-[-1px] h-full p-6 md:w-[var(--booker-main-width)] md:border-l",...L_,visible:G==="booking"&&!H,children:Qr},"book-event-form"),b(Q1,{area:"main",visible:G!=="booking"&&he===Nn.MONTH_VIEW,...L_,initial:"visible",className:"md:border-subtle ml-[-1px] h-full flex-shrink px-5 py-3 md:border-l lg:w-[var(--booker-main-width)]",children:b(WR,{classNames:{datePickerContainer:(xn=F==null?void 0:F.datePickerCustomClassnames)==null?void 0:xn.datePickerContainer,datePickerTitle:(oa=F==null?void 0:F.datePickerCustomClassnames)==null?void 0:oa.datePickerTitle,datePickerDays:(fa=F==null?void 0:F.datePickerCustomClassnames)==null?void 0:fa.datePickerDays,datePickerDate:(ta=F==null?void 0:F.datePickerCustomClassnames)==null?void 0:ta.datePickerDate,datePickerDatesActive:(gr=F==null?void 0:F.datePickerCustomClassnames)==null?void 0:gr.datePickerDatesActive,datePickerToggle:(Pa=F==null?void 0:F.datePickerCustomClassnames)==null?void 0:Pa.datePickerToggle},event:S,schedule:E})},"datepicker"),b(Q1,{area:"main",visible:he===Nn.WEEK_VIEW,className:"border-subtle sticky top-0 ml-[-1px] h-full md:border-l",...L_,children:b(Rhe,{extraDays:Y,schedule:E.data,isLoading:E.isPending,event:S})},"large-calendar"),b(Q1,{area:{default:"main",month_view:"timeslots"},visible:he!==Nn.WEEK_VIEW&&G==="selecting_time"||he===Nn.COLUMN_VIEW,className:Fe("border-subtle rtl:border-default flex h-full w-full flex-col overflow-x-auto px-5 py-3 pb-0 rtl:border-r ltr:md:border-l",he===Nn.MONTH_VIEW&&"h-full overflow-hidden md:w-[var(--booker-timeslots-width)]",he!==Nn.MONTH_VIEW&&"sticky top-0"),ref:lt,...L_,children:b(Ofe,{customClassnames:F==null?void 0:F.availableTimeSlotsCustomClassnames,extraDays:Y,limitHeight:he===Nn.MONTH_VIEW,schedule:E==null?void 0:E.data,isLoading:E.isPending,seatsPerTimeSlot:(Hr=S.data)==null?void 0:Hr.seatsPerTimeSlot,showAvailableSeatsCount:(Kn=S.data)==null?void 0:Kn.seatsShowAvailabilityCount,event:S})},"timeslots")]})}),b(fhe,{visible:G!=="booking"&&he===Nn.MONTH_VIEW&&!Q,dayCount:Ee,isScheduleLoading:E.isLoading,onButtonClick:()=>{Re(null)}}),!n&&!$&&b(K0.span,{className:Fe("-z-10 mb-6 mt-auto pt-6 [&_img]:h-[15px]",j?"dark":"",he===Nn.MONTH_VIEW?"block":"hidden"),children:b(qhe,{logoOnly:!0})},"logo")]}),b(she,{onCancel:()=>te(null),visible:G==="booking"&&H,children:Qr})]})},Xhe=e=>e.isAway?b(Uhe,{}):b(Zee,{strict:!0,features:Whe,children:b(Yhe,{...e})}),x6=e=>{const[t,n]=w.useState(!1);return w.useEffect(()=>{const r=window.matchMedia(e);r.matches!==t&&n(r.matches);const a=()=>n(r.matches);return window.addEventListener("resize",a),()=>window.removeEventListener("resize",a)},[t,e]),t},C6=e=>Ty.find(t=>t===e),Jhe=e=>{var k;const[t,n]=Ot(x=>[x.layout,x.setLayout],Ua),r=Jd(),a=x6("(max-width: 768px)"),o=x6("(max-width: 1024px)"),i=IO(),s=r?a?"mobile":C6(i.layout)||t:t,c=o?F_[s].tablet:F_[s].desktop,l=zae(),u=r&&l!=="inline",d=w.useRef(o?F_[s].tablet:F_[s].desktop),h=((k=e==null?void 0:e.profile)==null?void 0:k.bookerLayouts)||fle,m=r&&C6(i.layout)||h.defaultLayout;w.useEffect(()=>{a&&s!=="mobile"?n("mobile"):!a&&s==="mobile"&&n(m)},[a,n,s,m]),w.useEffect(()=>{var S;const x=pl("layout");if(!a&&!r&&C6(x)&&((S=h==null?void 0:h.enabledLayouts)!=null&&S.length)&&x!==t){const M=h.enabledLayouts.find(E=>E===x);M&&n(M)}},[h,n,t,r,a]);const g={mobile:!r,month_view:!1,week_view:!0,column_view:!0}[s],_=r?i.hideEventTypeDetails:!1;return{shouldShowFormInDialog:g,hasDarkBackground:u,extraDays:c,columnViewExtraDays:d,isMobile:a,isEmbed:r,isTablet:o,layout:s,defaultLayout:m,hideEventTypeDetails:_,bookerLayouts:h}};var qR=function(e,t,n){if(e&&"reportValidity"in e){var r=Nt(n,t);e.setCustomValidity(r&&r.message||""),e.reportValidity()}},ZR=function(e,t){var n=function(a){var o=t.fields[a];o&&o.ref&&"reportValidity"in o.ref?qR(o.ref,a,e):o.refs&&o.refs.forEach(function(i){return qR(i,a,e)})};for(var r in t.fields)n(r)},Khe=function(e,t){t.shouldUseNativeValidation&&ZR(e,t);var n={};for(var r in e){var a=Nt(t.fields,r);Vr(n,r,Object.assign(e[r],{ref:a&&a.ref}))}return n},Qhe=function(e,t){for(var n={};e.length;){var r=e[0],a=r.code,o=r.message,i=r.path.join(".");if(!n[i])if("unionErrors"in r){var s=r.unionErrors[0].errors[0];n[i]={message:s.message,type:s.code}}else n[i]={message:o,type:a};if("unionErrors"in r&&r.unionErrors.forEach(function(u){return u.errors.forEach(function(d){return e.push(d)})}),t){var c=n[i].types,l=c&&c[r.code];n[i]=q$(i,t,n,a,l?[].concat(l,r.message):r.message)}e.shift()}return n},epe=function(e,t,n){return n===void 0&&(n={}),function(r,a,o){try{return Promise.resolve(function(i,s){try{var c=Promise.resolve(e[n.mode==="sync"?"parse":"parseAsync"](r,t)).then(function(l){return o.shouldUseNativeValidation&&ZR({},o),{errors:{},values:n.rawValues?r:l}})}catch(l){return s(l)}return c&&c.then?c.then(void 0,s):c}(0,function(i){return{values:{},errors:i.isEmpty?{}:Khe(Qhe(i.errors,!o.shouldUseNativeValidation&&o.criteriaMode==="all"),o)}}))}catch(i){return Promise.reject(i)}}};const tpe=R.record(lle),npe=({bookingFields:e,view:t})=>{const n=Wx.unwrap().partial().and(tpe);return YR({schema:n,bookingFields:e,isPartialSchema:!0,view:t})};function rpe({bookingFields:e,view:t}){const n=Wx.and(R.record(R.any()));return YR({schema:n,bookingFields:e,isPartialSchema:!1,view:t})}function YR({schema:e,bookingFields:t,isPartialSchema:n,view:r}){const a=R.preprocess(o=>{const i=R.record(R.any()).nullable().parse(o)||{},s={};return t?(t.forEach(c=>{const l=i[c.name];if(l===void 0)return;const u=c.views;if(!(r==="ALL_VIEWS"?!0:u?u.find(m=>m.id===r):!0))return;const h=nD[c.type];if(h){s[c.name]=h.preprocess({response:l,isPartialSchema:n,field:c});return}if(c.type==="boolean")s[c.name]=l==="true"||l===!0;else if(c.type==="multiemail"||c.type==="checkbox"||c.type==="multiselect")s[c.name]=l instanceof Array?l:[l];else if(c.type==="radioInput"&&typeof l=="string"){let m={optionValue:"",value:""};try{m=JSON.parse(l)}catch{}s[c.name]=m}else s[c.name]=l}),{...i,...s}):i},e.superRefine(async(o,i)=>{var s;if(t)for(const c of t){const l=o[c.name],u=R.string(),d=n?R.string():R.string().refine(xle),h=n?R.string():R.string().refine(async M=>{const{isValidPhoneNumber:E}=await Promise.resolve().then(()=>cse);return E(M)}),m=M=>`{${c.name}}${M}`,v=c.views,g=r==="ALL_VIEWS"?!0:v?v.find(M=>M.id===r):!0;let _=c.hidden;const k=((s=c.options)==null?void 0:s.length)??0;c.hideWhenJustOneOption&&(_=_||k<=1);const x=_?!1:g?c.required:!1;if((n||!x)&&l===void 0)continue;if(x&&!n&&!l){i.addIssue({code:R.ZodIssueCode.custom,message:m("error_required_field")});return}if(c.type==="email"){d.safeParse(l).success||i.addIssue({code:R.ZodIssueCode.custom,message:m("email_validation_error")});continue}const S=nD[c.type];if(S){S.superRefine({response:l,ctx:i,m,field:c,isPartialSchema:n});continue}if(c.type==="multiemail"){const M=d.array().safeParse(l);if(x&&(!l||l.length===0)){i.addIssue({code:R.ZodIssueCode.custom,message:m("error_required_field")});continue}if(!M.success){if(c.name==="guests"&&l.every(T=>T==="")){o[c.name]=[];continue}i.addIssue({code:R.ZodIssueCode.custom,message:m("email_validation_error")});continue}const E=M.data;E.sort().some((T,$)=>{if(T===E[$+1])return i.addIssue({code:R.ZodIssueCode.custom,message:m("duplicate_email")}),!0});continue}if(c.type==="checkbox"||c.type==="multiselect"){u.array().safeParse(l).success||i.addIssue({code:R.ZodIssueCode.custom,message:m("Invalid array of strings")});continue}if(c.type==="phone"){(await h.safeParseAsync(l)).success||i.addIssue({code:R.ZodIssueCode.custom,message:m("invalid_number")});continue}if(c.type==="boolean"){R.boolean().safeParse(l).success||i.addIssue({code:R.ZodIssueCode.custom,message:m("Invalid Boolean")});continue}if(c.type==="radioInput"){if(c.optionsInputs){const M=l==null?void 0:l.optionValue,E=c.optionsInputs[l==null?void 0:l.value],T=E==null?void 0:E.type;if((x||l!=null&&l.value)&&(E!=null&&E.required)&&!M){i.addIssue({code:R.ZodIssueCode.custom,message:m("error_required_field")});return}M&&T==="phone"&&((await h.safeParseAsync(M)).success||i.addIssue({code:R.ZodIssueCode.custom,message:m("invalid_number")}))}continue}if(["address","text","select","number","radio","textarea"].includes(c.type)){u.safeParse(l).success||i.addIssue({code:R.ZodIssueCode.custom,message:m("Invalid string")});continue}i.addIssue({code:R.ZodIssueCode.custom,message:`Can't parse unknown booking field type: ${c.type}`})}}));return n?a.catch(function(o){return console.error("Failed to preprocess query params, prefilling will be skipped",o==null?void 0:o.error),{}}):a}function ape({eventType:e,rescheduleUid:t,isRescheduling:n,email:r,name:a,username:o,hasSession:i,extraOptions:s,prefillFormParams:c}){const[l,u]=w.useState({}),d=Ot(v=>v.bookingData),h=Ot(v=>v.formValues);w.useEffect(()=>{(async function(){if(Object.keys(h).length){u(h);return}if(!(e!=null&&e.bookingFields))return{};const g=await npe({bookingFields:e.bookingFields,view:t?"reschedule":"booking"}).parseAsync({...s,name:c.name,guests:c.guests}),_={email:t&&d&&d.attendees.length>0?d==null?void 0:d.attendees[0].email:g.email?g.email:r??"",name:t&&d&&d.attendees.length>0?d==null?void 0:d.attendees[0].name:g.name?g.name:a??o??""};if(!n){const S={responses:{}},M=e.bookingFields.reduce((E,T)=>({...E,[T.name]:g[T.name]||void 0}),{});S.responses={...M,name:_.name,email:_.email},u(S)}if(!t&&!d)return{};const k={responses:{}},x=e.bookingFields.reduce((S,M)=>({...S,[M.name]:d==null?void 0:d.responses[M.name]}),{});k.responses={...x,name:_.name,email:_.email},u(k)})()},[e==null?void 0:e.bookingFields,h,n,d,t,r,a,o,c]);const m=`${Object.keys(l).length}_${i?1:0}`;return{initialValues:l,key:m}}const ope=({event:e,sessionEmail:t,sessionName:n,sessionUsername:r,hasSession:a,extraOptions:o,prefillFormParams:i})=>{const s=Ot(M=>M.rescheduleUid),c=Ot(M=>M.bookingData),{t:l}=At(),u=w.useRef(null),d=R.object({responses:e?rpe({bookingFields:e.bookingFields,view:s?"reschedule":"booking"}):R.object({})}).passthrough(),h=!!s&&!!c,{initialValues:m,key:v}=ape({eventType:e,rescheduleUid:s,isRescheduling:h,email:t,name:n,username:r,hasSession:a,extraOptions:o,prefillFormParams:i}),g=U5({defaultValues:m,resolver:epe(d,{},{mode:"async"})});w.useEffect(()=>{g.reset(m)},[v]);const _=g.watch("responses.email"),k=g.watch("responses.name"),x=()=>{if(g.clearErrors(),!e){g.setError("globalError",{message:l("error_booking_event")});return}},S={hasFormErrors:!!g.formState.errors.globalError,formErrors:g.formState.errors.globalError};return{bookingForm:g,bookerFormErrorRef:u,key:v,formEmail:_,formName:k,beforeVerifyEmail:x,formErrors:S,errors:S}};let XR=null;const ipe=()=>{function e(n){XR=n}function t(){return XR}return[t(),e]},S6=dJ,M6=fJ,JR=(e,t)=>/^#?([0-9A-F]{3}|[0-9A-F]{4}|[0-9A-F]{6}|[0-9A-F]{8})$/i.test(e.replace("##","#"))?e:t;function A6(e){const t=e.replace("##","#"),n=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t);if(!n)throw new Error("Invalid Hex colour");const[,r,a,o]=n;return{r:parseInt(r,16),g:parseInt(a,16),b:parseInt(o,16)}}function KR(e,t,n){const r=a=>`0${a.toString(16)}`.slice(-2);return`#${r(e)}${r(t)}${r(n)}`}function spe(e,t){const n=A6(`#${e}`);if(!n)return"";const r=Math.round(n.r+(255-n.r)*t),a=Math.round(n.g+(255-n.g)*t),o=Math.round(n.b+(255-n.b)*t);return KR(r,a,o)}function cpe(e,t){const n=A6(e);if(!n)return"";const r=Math.round(n.r*t),a=Math.round(n.g*t),o=Math.round(n.b*t);return KR(r,a,o)}function QR(e,t){return e?(e=e.replace("#",""),e.length===3&&(e=e.split("").map(function(n){return n+n}).join("")),e):t?M6:S6}const eL=e=>{const t={500:`#${e}`.replace("##","#")},n={50:.95,100:.9,200:.75,300:.6,400:.3,600:.9,700:.75,800:.6,900:.49};return[50,100,200,300,400].forEach(r=>{t[r]=spe(e,n[r])}),[600,700,800,900].forEach(r=>{t[r]=cpe(e,n[r])}),t};function B_(e){const{r:t,g:n,b:r}=A6(e);return(.2126*t+.7152*n+.0722*r)/255<.5?"#FFFFFF":"#000000"}const lpe=({lightVal:e=S6,darkVal:t=M6})=>{e=Bae().brandColor||e,e=QR(e,!1),t=QR(t,!0);const r=eL(JR(e,S6)),a=eL(JR(t,M6));return{light:{"cal-brand":r[500],"cal-brand-emphasis":r[400],"cal-brand-subtle":r[200],"cal-brand-text":B_(r[500]),"cal-brand-accent":B_(r[500])},dark:{"cal-brand":a[500],"cal-brand-emphasis":a[600],"cal-brand-subtle":a[800],"cal-brand-text":B_(a[500]),"cal-brand-accent":B_(a[500])}}},upe=w.createContext(void 0),dpe={setTheme:e=>{},themes:[]},fpe=()=>{var e;return(e=w.useContext(upe))!==null&&e!==void 0?e:dpe};function tL(e,t=!1){const{resolvedTheme:n,setTheme:r,forcedTheme:a,theme:o}=fpe(),i=Fae();if(w.useEffect(()=>{if(t||e===void 0)return;const s=i?i==="auto"?"system":i:e;!s||s===o||r(s)},[e,r,i]),t)return{resolvedTheme:n,forcedTheme:a,activeTheme:o}}function hpe(){const e=tL(null,!0);if(!e)throw new Error("useTheme must have a return value here");return e}const ppe="get-available-slots",mpe=({enabled:e,...t})=>Zi({queryKey:[ppe,t.startTime,t.endTime,t.eventTypeId,t.eventTypeSlug],queryFn:()=>Xt.get("/slots/available",{params:t}).then(r=>{if(r.data.status===Yr)return r.data.data;throw new Error(r.data.error.message)}),enabled:e}),ype="get-calendars-busy-times",gpe=({onError:e,enabled:t,...n})=>{var a;return Zi({queryKey:[ype,((a=n==null?void 0:n.calendarsToLoad)==null?void 0:a.toString())??"",n.dateFrom??"",n.dateTo??"",n.loggedInUsersTz],queryFn:()=>Xt.get("/ee/calendars/busy-times",{params:n}).then(o=>{if(o.data.status===Yr)return o.data;throw e==null||e(),new Error(o.data.error.message)}),enabled:t})},vpe="get-connected-calendars",nL=e=>Zi({queryKey:[vpe],queryFn:()=>Xt.get("/ee/calendars").then(n=>{var r;if(n.data.status===Yr)return(r=n.data)==null?void 0:r.data;throw new Error(n.data.error.message)}),enabled:(e==null?void 0:e.enabled)??!0}),_pe=({onSuccess:e,onError:t}={onSuccess:()=>{},onError:()=>{}})=>ll({mutationFn:r=>Xt.post("/ee/bookings",r).then(a=>{if(a.data.status===Yr)return a.data;throw new Error(a.data.error.message)}),onSuccess:r=>{r.status===Yr?e==null||e(r):t==null||t(r)},onError:r=>{t==null||t(r)}}),bpe=({onSuccess:e,onError:t}={onSuccess:()=>{},onError:()=>{}})=>ll({mutationFn:r=>Xt.post("/ee/bookings/instant",r).then(a=>{if(a.data.status===Yr)return a.data;throw new Error(a.data.error.message)}),onSuccess:r=>{r.status===Yr?e==null||e(r):t==null||t(r)},onError:r=>{t==null||t(r)}}),kpe=({onSuccess:e,onError:t}={onSuccess:()=>{},onError:()=>{}})=>ll({mutationFn:r=>Xt.post("/ee/bookings/recurring",r).then(a=>a.data),onSuccess:r=>{r.status===Yr?e==null||e(r):t==null||t(r)},onError:r=>{t==null||t(r)}}),wpe="user-booking",xpe=(e={onSuccess:()=>{},onError:()=>{},uid:""})=>{const t=`/${vc.bookings}/${e.uid}/reschedule`;return Zi({queryKey:[wpe,e.uid],queryFn:()=>Xt.get(t).then(r=>{var o,i;if(r.data.status===Yr)return(o=e.onSuccess)==null||o.call(e,r.data.data),r.data.data;const a=new Error(r.data.error.message);throw(i=e.onError)==null||i.call(e,a),a}).catch(r=>{var a;(a=e.onError)==null||a.call(e,r)}),enabled:!!(e!=null&&e.uid)})},Cpe=({bookingForm:e,event:t,metadata:n,hashedLink:r,handleBooking:a,handleInstantBooking:o,handleRecBooking:i})=>{const s=Ot(M=>M.setFormValues),c=Ot(M=>M.selectedTimeslot),l=Ot(M=>M.selectedDuration),{timezone:u}=Si(),d=Ot(M=>M.rescheduleUid),{t:h,i18n:m}=At(),v=Ot(M=>M.username),g=Ot(M=>M.recurringEventCount),_=Ot(M=>M.bookingData),k=Ot(M=>M.seatedEventData),x=Ot(M=>M.isInstantMeeting);return()=>{var E,T,$,D;const M=e.getValues();if(c){if(s({}),e.clearErrors(),!(t!=null&&t.data)){e.setError("globalError",{message:h("error_booking_event")});return}const F=t.data.isDynamic?l||t.data.length:l&&((T=(E=t.data.metadata)==null?void 0:E.multipleDuration)!=null&&T.includes(l))?l:t.data.length,G={values:M,duration:F,event:t.data,date:c,timeZone:u,language:m.language,rescheduleUid:d||void 0,bookingUid:_&&_.uid||(k==null?void 0:k.bookingUid)||void 0,username:v||"",metadata:n,hashedLink:r};x?o(h6(G)):(D=($=t.data)==null?void 0:$.recurringEvent)!=null&&D.freq&&g&&!d?i($de(G,g)):a(h6(G)),s({}),e.clearErrors()}}},Spe="get-public-event",Mpe=e=>{const[t,n]=Ot(i=>[i.username,i.eventSlug],Ua),r=Ot(i=>i.isTeamEvent),a=Ot(i=>i.org);return Zi({queryKey:[Spe,t??e.username,n??e.eventSlug],queryFn:()=>Xt.get("/events/public",{params:{username:t??e.username,eventSlug:n??e.eventSlug,isTeamEvent:r,org:a??null}}).then(i=>{if(i.data.status===Yr)return i.data.data;throw new Error(i.data.error.message)})})},Ape=({onSuccess:e,onError:t}={onSuccess:()=>{},onError:()=>{}})=>ll({mutationFn:r=>Xt.delete("/slots/selected-slot",{params:r}).then(a=>{if(a.data.status===Yr)return a.data;throw new Error(a.data.error.message)}),onSuccess:r=>{r.status===Yr?e==null||e(r):t==null||t(r)},onError:r=>{t==null||t(r)}}),Epe=({onSuccess:e,onError:t}={onSuccess:()=>{},onError:()=>{}})=>ll({mutationFn:r=>Xt.post("/slots/reserve",r).then(a=>{if(a.data.status===Yr)return a.data;throw new Error(a.data.error.message)}),onSuccess:r=>{r.status===Yr?e==null||e(r):t==null||t(r)},onError:r=>{t==null||t(r)}}),Ipe=e=>{var d;const t=Ot(h=>h.selectedDuration),[n,r]=Ot(h=>[h.selectedTimeslot,h.setSelectedTimeslot],Ua),[a,o]=ipe(),i=Epe({onSuccess:h=>{o(h.data)}}),s=Ape(),c=()=>{e!=null&&e.data&&s.mutate({uid:a??void 0})},l=()=>{var h,m;(h=e==null?void 0:e.data)!=null&&h.id&&n&&(t||(m=e==null?void 0:e.data)!=null&&m.length)&&i.mutate({slotUtcStartDate:Xe(n).utc().format(),eventTypeId:e.data.id,slotUtcEndDate:Xe(n).utc().add(t||e.data.length,"minutes").format()})},u=Ot(h=>h.selectedTimeslot);return w.useEffect(()=>{l();const h=setInterval(()=>{l()},parseInt(lJ)*60*1e3-2e3);return()=>{c(),clearInterval(h)}},[(d=e==null?void 0:e.data)==null?void 0:d.id,u]),{selectedTimeslot:n,setSelectedTimeslot:r,setSlotReservationId:o,slotReservationId:a,handleReserveSlot:l,handleRemoveSlot:c}},Tpe=e=>{var Ue,at,ct,et,wt,lt,re,be,we,Ze,Ve;const[t,n]=Ot(Se=>[Se.state,Se.setState],Ua),r=Ot(Se=>Se.setSelectedDate),a=Ot(Se=>Se.setBookingData),o=Ot(Se=>Se.setSelectedTimeslot);xpe({uid:e.rescheduleUid??e.bookingUid??"",onSuccess:Se=>{a(Se)}}),w.useEffect(()=>()=>{n("loading"),r(null),o(null)},[]);const i=Mpe({username:e.username,eventSlug:e.eventSlug}),s=Jhe(i.data);Cle({...e,eventId:(Ue=i.data)==null?void 0:Ue.id,rescheduleUid:e.rescheduleUid??null,bookingUid:e.bookingUid??null,layout:s.defaultLayout,org:(at=i.data)==null?void 0:at.entity.orgSlug});const[c]=Ot(Se=>[Se.dayCount,Se.setDayCount],Ua),l=Ot(Se=>Se.selectedDate),u=Ot(Se=>Se.month),d=Ot(Se=>Se.eventSlug),h=Ot(Se=>Se.selectedDuration),{data:m}=l3(),v=!!m,g=w.useMemo(()=>({name:e.name??null,guests:e.guests??[]}),[e.name,e.guests]),_=Xe(l).format("YYYY-MM-DD"),k=s.layout===Nn.WEEK_VIEW&&!!s.extraDays&&Xe(_).month()!==Xe(_).add(s.extraDays,"day").month()||s.layout===Nn.COLUMN_VIEW&&Xe(_).month()!==Xe(_).add(s.columnViewExtraDays.current,"day").month(),x=(s.layout!==Nn.WEEK_VIEW&&t==="selecting_time"||s.layout===Nn.COLUMN_VIEW)&&Xe(_).add(1,"month").month()!==Xe(_).add(s.columnViewExtraDays.current,"day").month()?2:void 0,{timezone:S}=Si(),[M,E]=Vle({month:u,monthCount:x,dayCount:c,prefetchNextMonth:k,selectedDate:l}),T=mpe({usernameList:pue(e.username??""),eventTypeId:((ct=i==null?void 0:i.data)==null?void 0:ct.id)??0,startTime:M,endTime:E,timeZone:(et=m==null?void 0:m.data)==null?void 0:et.timeZone,duration:h??void 0,rescheduleUid:e.rescheduleUid,enabled:!!e.username&&!!u&&!!S&&(!!d||!!((wt=i==null?void 0:i.data)!=null&&wt.id)||((lt=i==null?void 0:i.data)==null?void 0:lt.id)===0)}),$=ope({event:i.data,sessionEmail:(re=m==null?void 0:m.data)==null?void 0:re.email,sessionUsername:(be=m==null?void 0:m.data)==null?void 0:be.username,sessionName:(we=m==null?void 0:m.data)==null?void 0:we.username,hasSession:v,extraOptions:{},prefillFormParams:g}),{mutate:D,isPending:F,error:G,isError:z}=_pe({onSuccess:Se=>{var Ie;T.refetch(),(Ie=e.onCreateBookingSuccess)==null||Ie.call(e,Se)},onError:e.onCreateBookingError}),{mutate:Z,isPending:H,error:j,isError:Y}=kpe({onSuccess:Se=>{var Ie;T.refetch(),(Ie=e.onCreateRecurringBookingSuccess)==null||Ie.call(e,Se)},onError:e.onCreateRecurringBookingError}),{mutate:K,isPending:Q,error:he,isError:ne}=bpe({onSuccess:Se=>{var Ie;T.refetch(),(Ie=e.onCreateInstantBookingSuccess)==null||Ie.call(e,Se)},onError:e.onCreateInstantBookingError}),le=Ipe(i),[ae]=cf(Se=>[Se.calendarSettingsOverlayModal,Se.setCalendarSettingsOverlayModal],Ua),{data:ve,isPending:Oe}=nL({enabled:!!ae}),pe=ve,{set:te,clearSet:Ee}=HR("toggledConnectedCalendars",[]),{data:Re}=gpe({loggedInUsersTz:((Ze=m==null?void 0:m.data)==null?void 0:Ze.timeZone)||"Europe/London",dateFrom:l,dateTo:l,calendarsToLoad:Array.from(te).map(Se=>({credentialId:Se.credentialId,externalId:Se.externalId})),onError:()=>{Ee()},enabled:!!(v&&te.size>0&&(localStorage==null?void 0:localStorage.getItem("overlayCalendarSwitchDefault"))==="true")}),Ge=Cpe({event:i,bookingForm:$.bookingForm,hashedLink:e.hashedLink,metadata:{},handleBooking:D,handleInstantBooking:K,handleRecBooking:Z});return b(N0,{children:b(Xhe,{customClassNames:e.customClassNames,eventSlug:e.eventSlug,username:e.username,entity:((Ve=i==null?void 0:i.data)==null?void 0:Ve.entity)??{considerUnpublished:!1,orgSlug:void 0,teamSlug:void 0,name:void 0},rescheduleUid:e.rescheduleUid??null,bookingUid:e.bookingUid??null,isRedirect:!1,fromUserNameRedirected:"",hasSession:v,onGoBackInstantMeeting:function(){throw new Error("Function not implemented.")},onConnectNowInstantMeeting:function(){throw new Error("Function not implemented.")},onOverlayClickNoCalendar:function(){throw new Error("Function not implemented.")},onClickOverlayContinue:function(){throw new Error("Function not implemented.")},onOverlaySwitchStateChange:function(Se){throw new Error("Function not implemented.")},extraOptions:{},bookings:{handleBookEvent:()=>{Ge()},expiryTime:void 0,bookingForm:$.bookingForm,bookerFormErrorRef:$.bookerFormErrorRef,errors:{hasDataErrors:z||Y||ne,dataErrors:G||j||he},loadingStates:{creatingBooking:F,creatingRecurringBooking:H,creatingInstantBooking:Q},instantVideoMeetingUrl:void 0},slots:le,calendars:{overlayBusyDates:Re==null?void 0:Re.data,isOverlayCalendarEnabled:!1,connectedCalendars:(pe==null?void 0:pe.connectedCalendars)||[],loadingConnectedCalendar:Oe,onToggleCalendar:()=>{}},verifyEmail:{isEmailVerificationModalVisible:!1,setEmailVerificationModalVisible:()=>{},setVerifiedEmail:()=>{},handleVerifyEmail:()=>{},renderConfirmNotVerifyEmailButtonCond:!0},bookerForm:$,event:i,schedule:T,bookerLayout:s,verifyCode:void 0,isPlatform:!0})})};let $pe={data:""},Ppe=e=>typeof window=="object"?((e?e.querySelector("#_goober"):window._goober)||Object.assign((e||document.head).appendChild(document.createElement("style")),{innerHTML:" ",id:"_goober"})).firstChild:e||$pe,Ope=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,Npe=/\/\*[^]*?\*\/| +/g,rL=/\n+/g,lf=(e,t)=>{let n="",r="",a="";for(let o in e){let i=e[o];o[0]=="@"?o[1]=="i"?n=o+" "+i+";":r+=o[1]=="f"?lf(i,o):o+"{"+lf(i,o[1]=="k"?"":t)+"}":typeof i=="object"?r+=lf(i,t?t.replace(/([^,])+/g,s=>o.replace(/(^:.*)|([^,])+/g,c=>/&/.test(c)?c.replace(/&/g,s):s?s+" "+c:c)):o):i!=null&&(o=/^--/.test(o)?o:o.replace(/[A-Z]/g,"-$&").toLowerCase(),a+=lf.p?lf.p(o,i):o+":"+i+";")}return n+(t&&a?t+"{"+a+"}":a)+r},Dy={},aL=e=>{if(typeof e=="object"){let t="";for(let n in e)t+=n+aL(e[n]);return t}return e},Dpe=(e,t,n,r,a)=>{let o=aL(e),i=Dy[o]||(Dy[o]=(s=>{let c=0,l=11;for(;c<s.length;)l=101*l+s.charCodeAt(c++)>>>0;return"go"+l})(o));if(!Dy[i]){let s=o!==e?e:(c=>{let l,u,d=[{}];for(;l=Ope.exec(c.replace(Npe,""));)l[4]?d.shift():l[3]?(u=l[3].replace(rL," ").trim(),d.unshift(d[0][u]=d[0][u]||{})):d[0][l[1]]=l[2].replace(rL," ").trim();return d[0]})(e);Dy[i]=lf(a?{["@keyframes "+i]:s}:s,n?"":"."+i)}return((s,c,l)=>{c.data.indexOf(s)==-1&&(c.data=l?s+c.data:c.data+s)})(Dy[i],t,r),i},Rpe=(e,t,n)=>e.reduce((r,a,o)=>{let i=t[o];if(i&&i.call){let s=i(n),c=s&&s.props&&s.props.className||/^go/.test(s)&&s;i=c?"."+c:s&&typeof s=="object"?s.props?"":lf(s,""):s===!1?"":s}return r+a+(i??"")},"");function V_(e){let t=this||{},n=e.call?e(t.p):e;return Dpe(n.unshift?n.raw?Rpe(n,[].slice.call(arguments,1),t.p):n.reduce((r,a)=>Object.assign(r,a&&a.call?a(t.p):a),{}):n,Ppe(t.target),t.g,t.o,t.k)}let oL,E6,I6;V_.bind({g:1});let Ru=V_.bind({k:1});function Lpe(e,t,n,r){lf.p=t,oL=e,E6=n,I6=r}function uf(e,t){let n=this||{};return function(){let r=arguments;function a(o,i){let s=Object.assign({},o),c=s.className||a.className;n.p=Object.assign({theme:E6&&E6()},s),n.o=/ *go\d+/.test(c),s.className=V_.apply(n,r)+(c?" "+c:""),t&&(s.ref=i);let l=e;return e[0]&&(l=s.as||e,delete s.as),I6&&l[0]&&I6(s),oL(l,s)}return t?t(a):a}}var Fpe=e=>typeof e=="function",z_=(e,t)=>Fpe(e)?e(t):e,jpe=(()=>{let e=0;return()=>(++e).toString()})(),Bpe=e=>t=>{t&&setTimeout(()=>{let n=t.getBoundingClientRect();e(n)})},iL=(()=>{let e;return()=>{if(e===void 0&&typeof window<"u"){let t=matchMedia("(prefers-reduced-motion: reduce)");e=!t||t.matches}return e}})(),Vpe=20,H_=new Map,sL=e=>{if(H_.has(e))return;let t=setTimeout(()=>{H_.delete(e),Uh({type:4,toastId:e})},1e3);H_.set(e,t)},zpe=e=>{let t=H_.get(e);t&&clearTimeout(t)},T6=(e,t)=>{switch(t.type){case 0:return{...e,toasts:[t.toast,...e.toasts].slice(0,Vpe)};case 1:return t.toast.id&&zpe(t.toast.id),{...e,toasts:e.toasts.map(o=>o.id===t.toast.id?{...o,...t.toast}:o)};case 2:let{toast:n}=t;return e.toasts.find(o=>o.id===n.id)?T6(e,{type:1,toast:n}):T6(e,{type:0,toast:n});case 3:let{toastId:r}=t;return r?sL(r):e.toasts.forEach(o=>{sL(o.id)}),{...e,toasts:e.toasts.map(o=>o.id===r||r===void 0?{...o,visible:!1}:o)};case 4:return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(o=>o.id!==t.toastId)};case 5:return{...e,pausedAt:t.time};case 6:let a=t.time-(e.pausedAt||0);return{...e,pausedAt:void 0,toasts:e.toasts.map(o=>({...o,pauseDuration:o.pauseDuration+a}))}}},U_=[],G_={toasts:[],pausedAt:void 0},Uh=e=>{G_=T6(G_,e),U_.forEach(t=>{t(G_)})},Hpe={blank:4e3,error:4e3,success:2e3,loading:1/0,custom:4e3},Upe=(e={})=>{let[t,n]=w.useState(G_);w.useEffect(()=>(U_.push(n),()=>{let a=U_.indexOf(n);a>-1&&U_.splice(a,1)}),[t]);let r=t.toasts.map(a=>{var o,i;return{...e,...e[a.type],...a,duration:a.duration||((o=e[a.type])==null?void 0:o.duration)||(e==null?void 0:e.duration)||Hpe[a.type],style:{...e.style,...(i=e[a.type])==null?void 0:i.style,...a.style}}});return{...t,toasts:r}},Gpe=(e,t="blank",n)=>({createdAt:Date.now(),visible:!0,type:t,ariaProps:{role:"status","aria-live":"polite"},message:e,pauseDuration:0,...n,id:(n==null?void 0:n.id)||jpe()}),Ry=e=>(t,n)=>{let r=Gpe(t,e,n);return Uh({type:2,toast:r}),r.id},as=(e,t)=>Ry("blank")(e,t);as.error=Ry("error"),as.success=Ry("success"),as.loading=Ry("loading"),as.custom=Ry("custom"),as.dismiss=e=>{Uh({type:3,toastId:e})},as.remove=e=>Uh({type:4,toastId:e}),as.promise=(e,t,n)=>{let r=as.loading(t.loading,{...n,...n==null?void 0:n.loading});return e.then(a=>(as.success(z_(t.success,a),{id:r,...n,...n==null?void 0:n.success}),a)).catch(a=>{as.error(z_(t.error,a),{id:r,...n,...n==null?void 0:n.error})}),e};var Wpe=e=>{let{toasts:t,pausedAt:n}=Upe(e);w.useEffect(()=>{if(n)return;let a=Date.now(),o=t.map(i=>{if(i.duration===1/0)return;let s=(i.duration||0)+i.pauseDuration-(a-i.createdAt);if(s<0){i.visible&&as.dismiss(i.id);return}return setTimeout(()=>as.dismiss(i.id),s)});return()=>{o.forEach(i=>i&&clearTimeout(i))}},[t,n]);let r=w.useMemo(()=>({startPause:()=>{Uh({type:5,time:Date.now()})},endPause:()=>{n&&Uh({type:6,time:Date.now()})},updateHeight:(a,o)=>Uh({type:1,toast:{id:a,height:o}}),calculateOffset:(a,o)=>{let{reverseOrder:i=!1,gutter:s=8,defaultPosition:c}=o||{},l=t.filter(h=>(h.position||c)===(a.position||c)&&h.height),u=l.findIndex(h=>h.id===a.id),d=l.filter((h,m)=>m<u&&h.visible).length;return l.filter(h=>h.visible).slice(...i?[d+1]:[0,d]).reduce((h,m)=>h+(m.height||0)+s,0)}}),[t,n]);return{toasts:t,handlers:r}},qpe=Ru`
|
|
205
205
|
from {
|
|
206
206
|
transform: scale(0) rotate(45deg);
|
|
207
207
|
opacity: 0;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { aP as L, aQ as V, aR as D, aS as M, aT as Q, aU as Z, aV as _, aW as j, aX as re, aY as ie, aZ as oe, a_ as ae } from "./index-
|
|
1
|
+
import { aP as L, aQ as V, aR as D, aS as M, aT as Q, aU as Z, aV as _, aW as j, aX as re, aY as ie, aZ as oe, a_ as ae } from "./index-RvYZ-ROA.js";
|
|
2
2
|
function b(t, e, n, s = { passive: !0 }) {
|
|
3
3
|
return t.addEventListener(e, n, s), () => t.removeEventListener(e, n);
|
|
4
4
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ag as o, W as s, A as t, c as r, B as n, h as i, j as l, K as d, C as p, k as u, ae as m, ad as g, X as c, a7 as C, a8 as D, a9 as T, aa as I, ab as S, ac as h, u as w, v as x, J as k, w as B, x as b, y as A, M as E, z as F, G as L, E as M, l as f, Z as G, R as v, F as U, aj as H, a1 as R, H as y, am as O, I as z, m as P, O as V, n as W, L as j, _ as q, $ as J, a0 as K, V as N, ah as Q, ai as X, ak as Y, S as Z, a5 as _, r as $, a2 as aa, a3 as ea, a4 as oa, N as sa, o as ta, q as ra, T as na, b as ia, s as la, a6 as da, Q as pa, e as ua, U as ma, d as ga, Y as ca, t as Ca, af as Da, al as Ta } from "./index-
|
|
2
|
-
import { U as Sa } from "./UnpublishedEntity-
|
|
3
|
-
import { C as wa } from "./Card-
|
|
1
|
+
import { ag as o, W as s, A as t, c as r, B as n, h as i, j as l, K as d, C as p, k as u, ae as m, ad as g, X as c, a7 as C, a8 as D, a9 as T, aa as I, ab as S, ac as h, u as w, v as x, J as k, w as B, x as b, y as A, M as E, z as F, G as L, E as M, l as f, Z as G, R as v, F as U, aj as H, a1 as R, H as y, am as O, I as z, m as P, O as V, n as W, L as j, _ as q, $ as J, a0 as K, V as N, ah as Q, ai as X, ak as Y, S as Z, a5 as _, r as $, a2 as aa, a3 as ea, a4 as oa, N as sa, o as ta, q as ra, T as na, b as ia, s as la, a6 as da, Q as pa, e as ua, U as ma, d as ga, Y as ca, t as Ca, af as Da, al as Ta } from "./index-RvYZ-ROA.js";
|
|
2
|
+
import { U as Sa } from "./UnpublishedEntity-xCb8jM6g.js";
|
|
3
|
+
import { C as wa } from "./Card-zRo4OuhG.js";
|
|
4
4
|
export {
|
|
5
5
|
o as AddressInput,
|
|
6
6
|
s as Alert,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { D as a, P as o, f as s, g as t, g as m, i as C, p as n, a as p } from "./index-
|
|
2
|
-
import { i } from "./isSupportedCountry-
|
|
1
|
+
import { D as a, P as o, f as s, g as t, g as m, i as C, p as n, a as p } from "./index-RvYZ-ROA.js";
|
|
2
|
+
import { i } from "./isSupportedCountry-PzuVRP6F.js";
|
|
3
3
|
export {
|
|
4
4
|
a as DIGITS,
|
|
5
5
|
o as ParseError,
|
|
@@ -41043,7 +41043,7 @@ const a3 = ({
|
|
|
41043
41043
|
currency: t
|
|
41044
41044
|
}).format(_rt(e, t))}`;
|
|
41045
41045
|
}
|
|
41046
|
-
}, wrt = vs(() => import("./AlbyPriceComponent-
|
|
41046
|
+
}, wrt = vs(() => import("./AlbyPriceComponent-pvsGnCwS.js").then((e) => e.AlbyPriceComponent), {
|
|
41047
41047
|
ssr: !1
|
|
41048
41048
|
}), xrt = ({
|
|
41049
41049
|
price: e,
|
|
@@ -42367,20 +42367,20 @@ const PL = ({
|
|
|
42367
42367
|
i18n: o
|
|
42368
42368
|
} = He(), [i] = Ze((u) => [u.layout], pr), s = i === $t.COLUMN_VIEW, c = i === $t.MONTH_VIEW, l = de().isSame(e, "day");
|
|
42369
42369
|
return /* @__PURE__ */ U("header", {
|
|
42370
|
-
className: ce("dark:bg-muted dark:before:bg-muted mb-3 flex w-full flex-row items-center font-medium", "bg-default before:bg-default", r == null ? void 0 : r.
|
|
42370
|
+
className: ce("dark:bg-muted dark:before:bg-muted mb-3 flex w-full flex-row items-center font-medium", "bg-default before:bg-default", r == null ? void 0 : r.availableTimeSlotsHeaderContainer),
|
|
42371
42371
|
children: [/* @__PURE__ */ U("span", {
|
|
42372
42372
|
className: ce(s && "w-full text-center", s ? "text-subtle text-xs uppercase" : "text-emphasis font-semibold"),
|
|
42373
42373
|
children: [/* @__PURE__ */ b("span", {
|
|
42374
|
-
className: ce(l && !(r != null && r.
|
|
42374
|
+
className: ce(l && !(r != null && r.availableTimeSlotsTitle) && "!text-default", r == null ? void 0 : r.availableTimeSlotsTitle),
|
|
42375
42375
|
children: f5(o.language, Number(e.format("d")), "short")
|
|
42376
42376
|
}), /* @__PURE__ */ U("span", {
|
|
42377
|
-
className: ce(s && l && "bg-brand-default text-brand ml-2", "inline-flex items-center justify-center rounded-3xl px-1 pt-0.5 font-medium", c ? `text-default text-sm ${r == null ? void 0 : r.
|
|
42377
|
+
className: ce(s && l && "bg-brand-default text-brand ml-2", "inline-flex items-center justify-center rounded-3xl px-1 pt-0.5 font-medium", c ? `text-default text-sm ${r == null ? void 0 : r.availableTimeSlotsTitle}` : `text-xs ${r == null ? void 0 : r.availableTimeSlotsTitle}`),
|
|
42378
42378
|
children: [e.format("DD"), n && `, ${n}`]
|
|
42379
42379
|
})]
|
|
42380
42380
|
}), t && /* @__PURE__ */ b("div", {
|
|
42381
42381
|
className: "ml-auto rtl:mr-auto",
|
|
42382
42382
|
children: /* @__PURE__ */ b(NL, {
|
|
42383
|
-
customClassname: r == null ? void 0 : r.
|
|
42383
|
+
customClassname: r == null ? void 0 : r.availableTimeSlotsTimeFormatToggle
|
|
42384
42384
|
})
|
|
42385
42385
|
})]
|
|
42386
42386
|
});
|
|
@@ -42409,8 +42409,9 @@ const PL = ({
|
|
|
42409
42409
|
className: "mb-3 h-8"
|
|
42410
42410
|
}) : C.length > 0 && C.map((M) => /* @__PURE__ */ b(vat, {
|
|
42411
42411
|
customClassnames: {
|
|
42412
|
-
|
|
42413
|
-
|
|
42412
|
+
availableTimeSlotsHeaderContainer: s == null ? void 0 : s.availableTimeSlotsHeaderContainer,
|
|
42413
|
+
availableTimeSlotsTitle: s == null ? void 0 : s.availableTimeSlotsTitle,
|
|
42414
|
+
availableTimeSlotsTimeFormatToggle: s == null ? void 0 : s.availableTimeSlotsTimeFormatToggle
|
|
42414
42415
|
},
|
|
42415
42416
|
date: de(M.date),
|
|
42416
42417
|
showTimeFormatToggle: !y,
|
|
@@ -42467,7 +42468,7 @@ var xat = function(e) {
|
|
|
42467
42468
|
var l = c.message, u = c.types, h = Object.assign({}, i, { children: l || a });
|
|
42468
42469
|
return ne.isValidElement(t) ? ne.cloneElement(t, h) : o ? o({ message: l || a, messages: u }) : ne.createElement(t || ne.Fragment, h);
|
|
42469
42470
|
};
|
|
42470
|
-
const Sy = vs(async () => (await import("./index-
|
|
42471
|
+
const Sy = vs(async () => (await import("./index-0NLe4Yyc.js")).SelectWithValidation), Cat = (e) => {
|
|
42471
42472
|
const {
|
|
42472
42473
|
value: t,
|
|
42473
42474
|
setValue: n,
|
|
@@ -43851,7 +43852,7 @@ const RL = ({
|
|
|
43851
43852
|
desktop: 6,
|
|
43852
43853
|
tablet: 2
|
|
43853
43854
|
}
|
|
43854
|
-
}, eot = vs(() => import("./index-
|
|
43855
|
+
}, eot = vs(() => import("./index-HLaWGAF2.js").then((e) => e.TimezoneSelect), {
|
|
43855
43856
|
ssr: !1
|
|
43856
43857
|
}), tot = ({
|
|
43857
43858
|
event: e,
|
|
@@ -45366,7 +45367,7 @@ const Oot = ({
|
|
|
45366
45367
|
children: e("booker_event_not_found")
|
|
45367
45368
|
})
|
|
45368
45369
|
});
|
|
45369
|
-
}, Dot = () => import("./framer-features-
|
|
45370
|
+
}, Dot = () => import("./framer-features-AEF3NKfo.js").then((e) => e.default), Lot = vs(() => import("./PoweredBy-l6TxbHkw.js")), Fot = vs(() => import("./index-J7apBMlg.js").then((e) => e.UnpublishedEntity)), GA = vs(() => import("./DatePicker-cCCY0o_q.js").then((e) => e.DatePicker), {
|
|
45370
45371
|
ssr: !1
|
|
45371
45372
|
}), Vot = ({
|
|
45372
45373
|
username: e,
|
|
@@ -45559,9 +45560,9 @@ const Oot = ({
|
|
|
45559
45560
|
src: E
|
|
45560
45561
|
}), /* @__PURE__ */ b(tot, {
|
|
45561
45562
|
classNames: {
|
|
45562
|
-
eventMetaContainer: (Ms = O == null ? void 0 : O.
|
|
45563
|
-
eventMetaTitle: ($c = O == null ? void 0 : O.
|
|
45564
|
-
eventMetaTimezoneSelect: (Da = O == null ? void 0 : O.
|
|
45563
|
+
eventMetaContainer: (Ms = O == null ? void 0 : O.eventMetaCustomClassnames) == null ? void 0 : Ms.eventMetaContainer,
|
|
45564
|
+
eventMetaTitle: ($c = O == null ? void 0 : O.eventMetaCustomClassnames) == null ? void 0 : $c.eventMetaTitle,
|
|
45565
|
+
eventMetaTimezoneSelect: (Da = O == null ? void 0 : O.eventMetaCustomClassnames) == null ? void 0 : Da.eventMetaTimezoneSelect
|
|
45565
45566
|
},
|
|
45566
45567
|
event: C.data,
|
|
45567
45568
|
isPending: C.isPending,
|
|
@@ -45588,12 +45589,12 @@ const Oot = ({
|
|
|
45588
45589
|
className: "md:border-subtle ml-[-1px] h-full flex-shrink px-5 py-3 md:border-l lg:w-[var(--booker-main-width)]",
|
|
45589
45590
|
children: /* @__PURE__ */ b(GA, {
|
|
45590
45591
|
classNames: {
|
|
45591
|
-
datePickerContainer: (Ci = O == null ? void 0 : O.
|
|
45592
|
-
datePickerTitle: (As = O == null ? void 0 : O.
|
|
45593
|
-
datePickerDays: (Sc = O == null ? void 0 : O.
|
|
45594
|
-
datePickerDate: (ql = O == null ? void 0 : O.
|
|
45595
|
-
datePickerDatesActive: (Ic = O == null ? void 0 : O.
|
|
45596
|
-
datePickerToggle: (Tc = O == null ? void 0 : O.
|
|
45592
|
+
datePickerContainer: (Ci = O == null ? void 0 : O.datePickerCustomClassnames) == null ? void 0 : Ci.datePickerContainer,
|
|
45593
|
+
datePickerTitle: (As = O == null ? void 0 : O.datePickerCustomClassnames) == null ? void 0 : As.datePickerTitle,
|
|
45594
|
+
datePickerDays: (Sc = O == null ? void 0 : O.datePickerCustomClassnames) == null ? void 0 : Sc.datePickerDays,
|
|
45595
|
+
datePickerDate: (ql = O == null ? void 0 : O.datePickerCustomClassnames) == null ? void 0 : ql.datePickerDate,
|
|
45596
|
+
datePickerDatesActive: (Ic = O == null ? void 0 : O.datePickerCustomClassnames) == null ? void 0 : Ic.datePickerDatesActive,
|
|
45597
|
+
datePickerToggle: (Tc = O == null ? void 0 : O.datePickerCustomClassnames) == null ? void 0 : Tc.datePickerToggle
|
|
45597
45598
|
},
|
|
45598
45599
|
event: C,
|
|
45599
45600
|
schedule: A
|
|
@@ -45619,7 +45620,7 @@ const Oot = ({
|
|
|
45619
45620
|
ref: Je,
|
|
45620
45621
|
...qf,
|
|
45621
45622
|
children: /* @__PURE__ */ b(bat, {
|
|
45622
|
-
customClassnames: O == null ? void 0 : O.
|
|
45623
|
+
customClassnames: O == null ? void 0 : O.availableTimeSlotsCustomClassnames,
|
|
45623
45624
|
extraDays: V,
|
|
45624
45625
|
limitHeight: W === $t.MONTH_VIEW,
|
|
45625
45626
|
schedule: A == null ? void 0 : A.data,
|
|
@@ -45825,7 +45826,7 @@ function BL({
|
|
|
45825
45826
|
if (t)
|
|
45826
45827
|
for (const c of t) {
|
|
45827
45828
|
const l = o[c.name], u = I.string(), h = n ? I.string() : I.string().refine(ttt), p = n ? I.string() : I.string().refine(async (M) => {
|
|
45828
|
-
const { isValidPhoneNumber: A } = await import("./index-
|
|
45829
|
+
const { isValidPhoneNumber: A } = await import("./index-LugnGhAc.js");
|
|
45829
45830
|
return A(M);
|
|
45830
45831
|
}), y = (M) => `{${c.name}}${M}`, v = c.views, g = r === "ALL_VIEWS" ? !0 : v ? v.find((M) => M.id === r) : !0;
|
|
45831
45832
|
let _ = c.hidden;
|
|
@@ -52613,7 +52614,7 @@ function $bt() {
|
|
|
52613
52614
|
children: n("invite_team_notifcation_badge")
|
|
52614
52615
|
});
|
|
52615
52616
|
}
|
|
52616
|
-
const Sbt = vs(() => import("./index-
|
|
52617
|
+
const Sbt = vs(() => import("./index-rvhB8hBr.js").then((e) => e.Tips), {
|
|
52617
52618
|
ssr: !1
|
|
52618
52619
|
}), Ibt = de("September 1 2021").toISOString(), Tbt = (e) => !e.completedOnboarding && !e.organizationId && de(e.createdDate).isAfter(Ibt);
|
|
52619
52620
|
function Ebt(e = !1) {
|
|
@@ -66763,7 +66764,7 @@ const q7t = (e) => {
|
|
|
66763
66764
|
})]
|
|
66764
66765
|
})]
|
|
66765
66766
|
});
|
|
66766
|
-
}, Z7t = vs(() => import("./AddressInput-
|
|
66767
|
+
}, Z7t = vs(() => import("./AddressInput-2mgl0lyR.js")), Y7t = Z7t, X7t = vs(() => import("./PhoneInput-OwM4ptIW.js")), J7t = X7t, EB = "Radio", [K7t, OB] = Ir(EB), [Q7t, eCt] = K7t(EB), tCt = /* @__PURE__ */ Ee((e, t) => {
|
|
66767
66768
|
const { __scopeRadio: n, name: r, checked: a = !1, required: o, disabled: i, value: s = "on", onCheck: c, ...l } = e, [u, h] = Ce(null), p = dn(
|
|
66768
66769
|
t,
|
|
66769
66770
|
(g) => h(g)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { memo as j, useState as T } from "react";
|
|
2
|
-
import { an as k, aG as g, aq as t, aH as U, aI as N, aJ as C, au as b, ar as n, aC as v } from "./index-
|
|
3
|
-
import { C as A } from "./Card-
|
|
2
|
+
import { an as k, aG as g, aq as t, aH as U, aI as N, aJ as C, au as b, ar as n, aC as v } from "./index-RvYZ-ROA.js";
|
|
3
|
+
import { C as A } from "./Card-zRo4OuhG.js";
|
|
4
4
|
const I = [{
|
|
5
5
|
id: 13,
|
|
6
6
|
thumbnailUrl: "https://img.youtube.com/vi/ihE8OYTdklg/0.jpg",
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Customizable UI components to integrate scheduling into your product.",
|
|
6
6
|
"authors": "Cal.com, Inc.",
|
|
7
|
-
"version": "1.0.
|
|
7
|
+
"version": "1.0.17",
|
|
8
8
|
"scripts": {
|
|
9
9
|
"dev": "yarn vite build --watch & npx tailwindcss -i ./globals.css -o ./globals.min.css --postcss --minify --watch",
|
|
10
10
|
"build": "yarn vite build && npx tailwindcss -i ./globals.css -o ./globals.min.css --postcss --minify",
|
package/dist/index-84ezy2f4.js
DELETED