1"use strict";(self.__LOADABLE_LOADED_CHUNKS__=self.__LOADABLE_LOADED_CHUNKS__||[]).push([[9190],{34018:(e,i,n)=>{n.r(i),n.d(i,{BookingTimeForm:()=>S,default:()=>C});var a=n(83738),o=n(18489),t=n(72791),s=n(55269),r=n(41418),l=n.n(r),m=n(88014),d=n(53176),c=(n(73665),n(32311)),g=n(59930),u=n(38975),h=n(54817),k=n(59493);const b="BookingTimeForm_root__F4jWP",p="BookingTimeForm_bookingBreakdownTitle__5LZ66",_="BookingTimeForm_totalDivider__qCSMl",T="BookingTimeForm_bookingDates__4C6mV",F="BookingTimeForm_priceBreakdownContainer__f1zZ8",v="BookingTimeForm_submitButton__+EAec",B="BookingTimeForm_fieldSeats__BumJ+";var N=n(763),j=n(47047),x=n(94294),D=n(80184);const E=["rootClassName","className","price","dayCountAvailableForBooking","marketplaceName","seatsEnabled","isPriceVariationsInUse","priceVariants","priceVariantFieldComponent","preselectedPriceVariant","isPublishedListing","listingCategoryColour"],P=e=>i=>{const{form:n,seatsEnabled:a}=e;n.batch((()=>{n.change("bookingStartDate",null),n.change("bookingStartTime",null),n.change("bookingEndTime",null),a&&n.change("seats",1)}))},S=e=>{var i;const n=(0,m.YB)(),{rootClassName:r,className:S,price:C,dayCountAvailableForBooking:L,marketplaceName:I,seatsEnabled:V,isPriceVariationsInUse:f,priceVariants:Z=[],priceVariantFieldComponent:y,preselectedPriceVariant:w,isPublishedListing:A,listingCategoryColour:O}=e,H=(0,a.Z)(e,E),[M,U]=(0,t.useState)([1]),W=Z.length>1&&w?{initialValues:{priceVariantName:null===w||void 0===w?void 0:w.name}}:1===Z.length?{initialValues:{priceVariantName:null===Z||void 0===Z||null===(i=Z[0])||void 0===i?void 0:i.name}}:{},K=l()(r||b,S);return(0,D.jsx)(s.l0,(0,o.Z)((0,o.Z)((0,o.Z)({},W),H),{},{unitPrice:C,render:i=>{const{endDatePlaceholder:a,startDatePlaceholder:t,form:s,pristine:r,handleSubmit:l,listingId:b,values:E,monthlyTimeSlots:S,timeSlotsForDate:w,onFetchTimeSlots:H,timeZone:W,lineItems:q,fetchLineItemsInProgress:z,fetchLineItemsError:J,payoutDetailsWarning:Y,isOwnListing:G,finePrintComponent:Q}=i,R=null!==E&&void 0!==E&&E.bookingStartTime?E.bookingStartTime:null,X=null!==E&&void 0!==E&&E.bookingEndTime?E.bookingEndTime:null,$=R?(0,d.Ft)(R):null,ee=X?(0,d.Ft)(X):null,ie=(null===E||void 0===E?void 0:E.priceVariantName)||null,ne=$&&ee?{startDate:$,endDate:ee}:null,ae=ne&&q&&!z&&!J,oe=(e=>i=>{const{listingId:n,isOwnListing:a,fetchLineItemsInProgress:t,onFetchTransactionLineItems:s,seatsEnabled:r}=e,{bookingStartTime:l,bookingEndTime:m,seats:c,priceVariantName:g}=i.values,u=l?(0,d.Ft)(l):null,h=m?(0,d.Ft)(m):null,k=l<m,b=r&&c>0?{seats:parseInt(c,10)}:{},p=g?{priceVariantName:g}:{};l&&m&&k&&!t&&s({orderData:(0,o.Z)((0,o.Z)({bookingStart:u,bookingEnd:h},b),p),listingId:n,isOwnListing:a})})(e),te=f&&!A;return(0,D.jsxs)(g.l0,{onSubmit:l,className:K,enforcePagePreloadFor:"CheckoutPage",children:[y?(0,D.jsx)(y,{priceVariants:Z,priceVariantName:ie,onPriceVariantChange:P(i),disabled:!A}):null,S&&W?(0,D.jsx)(h.Z,{seatsEnabled:V,setSeatsOptions:U,startDateInputProps:{label:n.formatMessage({id:"BookingTimeForm.bookingStartTitle"}),placeholderText:t},endDateInputProps:{label:n.formatMessage({id:"BookingTimeForm.bookingEndTitle"}),placeholderText:a},className:T,listingId:b,onFetchTimeSlots:H,monthlyTimeSlots:S,timeSlotsForDate:w,values:E,intl:n,form:s,pristine:r,disabled:f&&!ie,timeZone:W,dayCountAvailableForBooking:L,handleFetchLineItems:oe}):null,V?(0,D.jsxs)(g.Wy,{name:"seats",id:"seats",disabled:!R,showLabelAsDisabled:!R,label:n.formatMessage({id:"BookingTimeForm.seatsTitle"}),className:B,onChange:e=>{oe({values:{priceVariantName:ie,bookingStartDate:$,bookingStartTime:R,bookingEndDate:ee,bookingEndTime:X,seats:e}})},children:[(0,D.jsx)("option",{disabled:!0,value:"",children:n.formatMessage({id:"BookingTimeForm.seatsPlaceholder"})}),M.map((e=>(0,D.jsx)("option",{value:e,children:e},e)))]}):null,ae?(0,D.jsxs)("div",{className:F,children:[(0,D.jsx)(g.H6,{as:"h3",className:p,children:(0,D.jsx)(m._H,{id:"BookingTimeForm.priceBreakdownTitle"})}),(0,D.jsx)("hr",{className:_}),(0,D.jsx)(u.Z,{breakdownData:ne,lineItems:q,timeZone:W,currency:C.currency,marketplaceName:I,processName:c.j5})]}):null,(0,D.jsx)(k.Z,{error:J}),(0,D.jsx)("div",{className:v,children:(0,N.isNil)(O)?(0,D.jsx)(j.Z,{variant:"rounded",animation:"wave",children:(0,D.jsx)(x.Z,{})}):(0,D.jsx)(g.KM,{type:"submit",inProgress:z,disabled:te,style:{background:O||""},children:(0,D.jsx)(m._H,{id:"BookingTimeForm.requestToBook"})})}),(0,D.jsx)(Q,{payoutDetailsWarning:Y,isOwnListing:G})]})}}))},C=S},59493:(e,i,n)=>{n.d(i,{Z:()=>r});n(72791);var a=n(88014),o=n(35074);const t="FetchLineItemsError_error__F-ziP h4";var s=n(80184);const r=e=>{const{error:i}=e,n=!!i;return n&&(0,o.Cn)(i)?(0,s.jsx)("span",{className:t,children:(0,s.jsx)(a._H,{id:"FetchLineItemsError.providerCommissionBiggerThanMinPrice"})}):n?(0,s.jsx)("span",{className:t,children:(0,s.jsx)(a._H,{id:"FetchLineItemsError.unknownError"})}):null}}}]); 2//# sourceMappingURL=BookingTimeForm.592362a5.chunk.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.