1import{d as Z,u as J,r as $,k as M,q as Y,o as i,c as d,b as e,t as n,e as s,x as y,n as u,v as b,Z as E,z as p,_ as R,F as A,I as G,W as _,aD as K,bD as ee,G as te,H as se,M as N,ay as le}from"./vendor-lxhXACKn.js";import{u as ne,a as oe,b as ae,l as L,_ as ie}from"./formkit.theme-uoC4MDOU.js";import"./globalBasic-DCViCoV8.js";const de={key:0,class:"w-full m-auto text-center mb-4"},re={class:"text-2xl font-bold text-text-brand mb-1"},ce={class:"text-text-light text-sm"},ue={class:"flex w-1/2 h-8 mt-1 gap-4 items-center"},me={class:"font-bold text-sm ml-4"},be={class:"flex justify-between p-3 !w-28 items-center btn-plus-minus"},pe=["disabled"],ve={class:"text-sm font-bold"},_e=["disabled"],fe={class:"m-4 max-h-[320px] overflow-y-auto !z-9999"},he=["onClick"],xe={class:"w-5/12 font-bold flex justify-between"},ye={class:"text-text-primary"},ge={class:"flex items-center m-2"},we=["onClick"],Ce={class:"w-3/4 items-center"},Ae={class:"text-xs font-bold text-text-primary"},ke={class:"w-3/4 text-text-primary flex items-center m-4 justify-end"},Le=["onClick"],Oe={class:"ml-3 mr-3 text-sm font-bold"},Ee=["onClick"],Re={key:0,class:"flex items-center text-text-primary justify-between"},Ge={class:"w-3/4 items-center"},Be={class:"text-xs font-bold text-text-primary"},Se={class:"w-3/4 flex items-center m-4 justify-end"},Ue=["onClick"],De={class:"ml-3 mr-3 text-sm font-bold rounded-md"},Ie=["onClick"],Pe={key:1},Te={class:"w-3/5 flex-col justify-evenly m-auto font-bold"},$e={class:"mb-6"},Me={class:"w-full"},Ne={class:"w-1/2 flex flex-wrap items-center"},ze=["onUpdate:modelValue","aria-label"],Ve={value:null,disabled:""},je=["value"],We={key:1,class:"w-full flex flex-col gap-2 p-4 !z-9999"},He={key:0,class:"text-sm text-red-500 px-4"},Fe=["disabled"],qe=["disabled"],Qe={key:2,class:"sticky left-0 bottom-4 w-full flex gap-2 p-4 pb-0 !z-9999"},Xe=["disabled"],Ze=["disabled"],Je=Z({__name:"RoomGuestDialog",props:{type:{default:"dialog"}},setup(z){const r=z,{t:c}=J(),{emit:V}=le();ne();const f=oe(),m=ae(),l=$([]),k=$(""),v=M(()=>{var a;const t=(a=m==null?void 0:m.settings)==null?void 0:a.maxBookableRoomsPerReservation;return t==null||t===-1?1/0:t}),j=t=>{var w;const a=((w=m==null?void 0:m.settings)==null?void 0:w.maxRoomSize)??5;t.numberOfAdults<a&&(t.numberOfAdults++,t.applyGuests())},W=t=>{t.numberOfAdults>1&&t.numberOfAdults--,t.applyGuests()},H=t=>{t.children.push(null),t.applyGuests()},F=t=>t.children.some(a=>!a||a<1),g=M(()=>l.value.some(t=>F(t))),q=t=>{t.children.splice(-1,1),t.applyGuests()},B=()=>{V("close")},S=async()=>{if(k.value="",g.value){k.value=c("WBEPLUS.NOCHILDAGE");return}if(f.reservation.rooms=l.value,f.reservation.rooms.forEach(t=>{t.applyGuests()}),f.validateReservation(),f.selectNextRoomAfterRoomsUpdate(),f.errors.length){B(),await N(),setTimeout(()=>{var t;(t=document.getElementById("main-content"))==null||t.scrollIntoView({behavior:"smooth",block:"start"})},300);return}B(),await N(),setTimeout(()=>{var t;(t=document.getElementById("main-content"))==null||t.scrollIntoView({behavior:"smooth",block:"start"})},300)},Q=()=>{var t;l.value.push(new L({numberOfAdults:((t=l.value[0])==null?void 0:t.numberOfAdults)??2}))},X=()=>{l.value.length>1&&l.value.pop()};return Y(()=>{f.reservation.rooms.forEach(t=>{let a=new L(t);a.applyGuests(),l.value.push(a)})}),(t,a)=>{var w,U,D,I;return i(),d("div",{class:u([[{"!w-[25rem] shadow-box-shadow2 !z-100 overflow-y-auto pt-4":(r==null?void 0:r.type)==="tooltip","mt-8":(r==null?void 0:r.type)==="dialog"},((I=(D=(U=(w=s(m))==null?void 0:w.settings)==null?void 0:U.styles)==null?void 0:D.radius)==null?void 0:I.value)??"radius-small"],"relative bg-surface-primary !z-9999 w-full rounded-md"])},[(r==null?void 0:r.type)!="tooltip"?(i(),d("div",de,[e("p",re,n(s(c)("WBEPLUS.TRAVEL_DATA")),1),e("p",ce,n(s(c)("WBEPLUS.GUEST_QUESTION")),1)])):y("",!0),e("div",ue,[e("p",me,n(t.$t("WBEPLUS.ROOMS")),1),e("div",be,[e("button",{"aria-label":"remove room in room and guest dialog",class:u(["!bg-white",{"cursor-not-allowed":l.value.length<=1}]),disabled:l.value.length<=1,onClick:X}
1,[e("span",null,[b(s(p),{icon:s(E),class:"fa-minus room-stepper-btn text-sm"},null,8,["icon"])])],10,pe),e("span",ve,n(l.value.length),1),e("div",{class:u({"cursor-not-allowed":l.value.length>=v.value})},[e("button",{"aria-label":"add room in room and guest dialog",onClick:Q,disabled:l.value.length>=v.value,class:u({"opacity-50 pointer-events-none !bg-transparent":l.value.length>=v.value})},[e("span",null,[b(s(p),{icon:s(R),class:"fa-plus text-sm"},null,8,["icon"])])],10,_e)],2)])]),e("div",fe,[(i(!0),d(A,null,G(l.value,(o,O)=>(i(),d("div",{key:O,class:"p-3 pt-0 mb-5 pb-0 bg-surface-md border border-primary-border rounded-md"},[e("div",{class:"flex items-center justify-between",onClick:h=>o.roomConfigClosed=!o.roomConfigClosed},[e("div",xe,[e("p",ye,n(s(c)("GLOBAL.ROOMS_PLURAL"))+" "+n(O+1),1)]),e("div",ge,[l.value.length>1?(i(),d(A,{key:0},[e("button",{class:"btn-icon",onClick:_(h=>l.value.splice(O,1),["prevent"])},[b(s(p),{icon:s(K)},null,8,["icon"])],8,we),a[2]||(a[2]=e("span",{class:"text-text-primary p-1"},"|",-1))],64)):y("",!0),e("button",{class:u(["btn-icon minimizer",o.roomConfigClosed?"":"minimizer-open"])}
1,[b(s(p),{icon:s(ee)},null,8,["icon"])],2)])],8,he),o.roomConfigClosed?y("",!0):(i(),d(A,{key:0},[e("div",{class:u(["flex items-center justify-between",{"border-b":!s(m).settings.adultsOnly}])},[e("div",Ce,[e("p",Ae,n(s(c)("GLOBAL.ADULTS_PLURAL")),1)]),e("div",ke,[e("button",{onClick:_(h=>W(o),["prevent"]),class:"btn-plus-minus"},[b(s(p),{icon:s(E),class:"text-sm"},null,8,["icon"])],8,Le),e("p",Oe,n(o.numberOfAdults),1),e("button",{onClick:_(h=>j(o),["prevent"]),class:"btn-plus-minus"},[b(s(p),{icon:s(R),class:"text-sm"},null,8,["icon"])],8,Ee)])],2),s(m).settings.adultsOnly?y("",!0):(i(),d("div",Re,[e("div",Ge,[e("p",Be,n(s(c)("GLOBAL.CHILDREN_PLURAL")),1)]),e("div",Se,[e("button",{onClick:_(h=>q(o),["prevent"]),class:"btn-plus-minus"},[b(s(p),{icon:s(E),class:"text-sm"},null,8,["icon"])],8,Ue),e("p",De,n(o.children.length),1),e("button",{onClick:_(h=>H(o),["prevent"]),class:"btn-plus-minus"},[b(s(p),{icon:s(R),class:"text-sm"},null,8,["icon"])],8,Ie)])])),o.children.length?(i(),d("div",Pe,[(i(!0),d(A,null,G(o.children,(h,x)=>{var P,T;return i(),d("div",{key:x,class:"border mb-4 text-text-primary flex bg-surface-secondary w-full p-3 text-sm"},[e("div",Te,[e("p",$e,n(`${x+1}.`)+" "+n(s(c)("GLOBAL.CHILDREN_PLURAL")),1),e("p",Me,n(s(c)("WBEPLUS.NOCHILDAGE")),1)]),e("div",Ne,[te(e("select",{"onUpdate:modelValue":C=>o.children[x]=C,"aria-label":s(c)("CONTACT.AGE"),style:{height:"36px"},class:u(["w-full rounded-md pl-2 mb-2 border",!o.children[x]||o.children[x]<1?"border-red-500":"border-primary-border"])},[e("option",Ve,n(s(c)("CONTACT.AGE")),1),(i(!0),d(A,null,G(((T=(P=s(m))==null?void 0:P.settings)==null?void 0:T.oldestPossibleChild)??17,C=>(i(),d("option",{key:C,value:C},n(C),9,je))),128))],10,ze),[[se,o.children[x]]])])])}),128))])):y("",!0)],64))]))),128))]),(r==null?void 0:r.type)!="tooltip"?(i(),d("div",We,[k.value?(i(),d("p",He,n(k.value),1)):y("",!0),e("button",{class:u(["btn-outline
1!rounded-md font-bold",{"opacity-50 cursor-not-allowed":l.value.length>=v.value}]),"aria-label":"add room in room and guest dialog",disabled:l.value.length>=v.value,onClick:a[0]||(a[0]=o=>l.value.push(new(s(L))({numberOfAdults:l.value[0].numberOfAdults})))},[e("span",null,n(t.$t("WBEPLUS.ADDROOM")),1)],10,Fe),e("button",{class:u(["relative btn-primary font-bold w-full",{"opacity-50 cursor-not-allowed pointer-events-none":g.value}]),onClick:_(S,["prevent"]),disabled:g.value,"aria-label":"save room in room and guest dialog (tooltip)"},[e("span",null,n(s(c)("GLOBAL.SAVE")),1)],10,qe)])):(i(),d("div",Qe,[e("button",{class:u(["relative btn-outline font-bold w-full",{"opacity-50 cursor-not-allowed":l.value.length>=v.value}]),disabled:l.value.length>=v.value,"aria-label":"add room in room and guest dialog (tooltip)",onClick:a[1]||(a[1]=o=>l.value.push(new(s(L))({numberOfAdults:l.value[0].numberOfAdults})))},[e("span",null,n(t.$t("WBEPLUS.ADDROOM")),1)],10,Xe),e("button",{class:u(["relative btn-primary font-bold w-full",{"opacity-50 cursor-not-allowed pointer-events-none":g.value}]),onClick:_(S,["prevent"]),disabled:g.value,"aria-label":"save room in room and guest dialog (tooltip)"},[e("span",null,n(s(c)("GLOBAL.SAVE")),1)],10,Ze)]))],2)}}}),tt=ie(Je,[["__scopeId","data-v-3f71732e"]]);export{tt as default};
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.