(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[405],{87314:function(e,t,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/",function(){return n(7232)}])},62621:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return NotFound}});var r=n(52322),o=n(97729),i=n.n(o),a=n(65992),l=n(96792),s=n(78675),c=n(62197),d=n(44981),u=n(9814),g=n(96577),h=n.n(g);let m=(0,a.ZP)("div")(()=>({minHeight:"95vh",backgroundColor:p.palette.background.default,margin:"0px auto",display:"flex",justifyContent:"center"})),f=(0,a.ZP)("div")(()=>({display:"flex",flexDirection:"column",justifyContent:"center"})),p=(0,d.Sl)("pink","pink",!1),b=(0,a.ZP)("div")(()=>({textAlign:"center",display:"flex",flexDirection:"row",justifyContent:"center"}));function NotFound(){return(0,r.jsxs)(l.Z,{theme:p,children:[(0,r.jsxs)(i(),{children:[(0,r.jsx)("title",{children:"Destination not found"}),(0,r.jsx)("link",{type:"image/jpg",rel:"shortcut icon",href:"https://www.paxflow.io/wp-content/uploads/2021/07/PaxFlow-favicon-100x100.png"})]}),(0,r.jsxs)(s.Z,{maxWidth:"lg",children:[(0,r.jsx)(m,{children:(0,r.jsxs)(f,{children:[(0,r.jsxs)(b,{children:[(0,r.jsx)(c.Z,{fontWeight:"bold",fontSize:"130px",color:"rgba(255,81,82,1)",children:"4"}),(0,r.jsx)(h(),{src:"https://static.paxflow.io/paxflow-icon.png",width:192,height:192,alt:"0",style:{maxWidth:"100%",height:"auto"}}),(0,r.jsx)(c.Z,{fontWeight:"bold",fontSize:"130px",color:"rgba(194,21,211,1)",children:"4"})]}),(0,r.jsx)(c.Z,{variant:"h4",component:"h1",my:3,fontWeight:"bolder",textAlign:"center",children:"You seem to have the wrong destination!"}),(0,r.jsx)(c.Z,{variant:"h5",component:"h2",my:3,fontWeight:"bolder",textAlign:"center",children:"Try asking around for directions."})]})}),(0,r.jsx)(u.$_,{label:"Powered by PaxFlow",type:"normal"})]})]})}},76916:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return ServerError}});var r=n(52322),o=n(97729),i=n.n(o),a=n(65992),l=n(96792),s=n(78675),c=n(62197),d=n(44981),u=n(9814),g=n(96577),h=n.n(g);let m=(0,a.ZP)("div")(e=>{let{theme:t}=e;return{minHeight:"95vh",backgroundColor:t.palette.background.default,margin:"0px auto",display:"flex",justifyContent:"center"}}),f=(0,a.ZP)("div")(()=>({display:"flex",flexDirection:"column",justifyContent:"center"})),p=(0,d.Sl)("pink","pink",!1),b=(0,a.ZP)("div")(()=>({textAlign:"center",display:"flex",flexDirection:"row",justifyContent:"center"}));function ServerError(){return(0,r.jsxs)(l.Z,{theme:p,children:[(0,r.jsxs)(i(),{children:[(0,r.jsx)("title",{children:"Server Error"}),(0,r.jsx)("link",{type:"image/jpg",rel:"shortcut icon",href:"https://www.paxflow.io/wp-content/uploads/2021/07/PaxFlow-favicon-100x100.png"})]}),(0,r.jsxs)(s.Z,{maxWidth:"lg",children:[(0,r.jsx)(m,{children:(0,r.jsxs)(f,{children:[(0,r.jsxs)(b,{children:[(0,r.jsx)(c.Z,{fontWeight:"bold",fontSize:"130px",color:"rgba(255,81,82,1)",children:"5"}),(0,r.jsx)(h(),{src:"https://static.paxflow.io/paxflow-icon.png",width:192,height:192,alt:"0",style:{maxWidth:"100%",height:"auto"}}),(0,r.jsx)(c.Z,{fontWeight:"bold",fontSize:"130px",color:"rgba(194,21,211,1)",children:"0"})]}),(0,r.jsx)(c.Z,{variant:"h4",component:"h1",my:3,fontWeight:"bolder",textAlign:"center",children:"Oops! Something went wrong on our end."}),(0,r.jsx)(c.Z,{variant:"h5",component:"h2",my:3,fontWeight:"bolder",textAlign:"center",children:"We're working on fixing it. Please try again later."})]})}),(0,r.jsx)(u.$_,{label:"Powered by PaxFlow",type:"normal"})]})]})}},7232:function(e,t,n){"use strict";n.r(t),n.d(t,{__N_SSP:function(){return eo},default:function(){return pages}});var r=n(52322),o=n(70689),i=n.n(o),a=n(9814),l=n(63397),s=n(5632),c=n.n(s),d=n(2784),u=n(65992),g=n(79906),h=n(41075),m=n(62197),f=n(96792),p=n(31461),b=n(7896),x=n(40489),j=n(69075),k=n(28165),v=n(47591),y=n(7342),w=n(47746),Z=n(43853),P=n(69222),C=n(15672);function getLinearProgressUtilityClass(e){return(0,C.Z)("MuiLinearProgress",e)}(0,P.Z)("MuiLinearProgress",["root","colorPrimary","colorSecondary","determinate","indeterminate","buffer","query","dashed","dashedColorPrimary","dashedColorSecondary","bar","barColorPrimary","barColorSecondary","bar1Indeterminate","bar1Determinate","bar1Buffer","bar2Indeterminate","bar2Buffer"]);let S=["className","color","value","valueBuffer","variant"],_=e=>e,B,F,L,N,E,W,$=(0,k.F4)(B||(B=_`
  0% {
    left: -35%;
    right: 100%;
  }

  60% {
    left: 100%;
    right: -90%;
  }

  100% {
    left: 100%;
    right: -90%;
  }
`)),I=(0,k.F4)(F||(F=_`
  0% {
    left: -200%;
    right: 100%;
  }

  60% {
    left: 107%;
    right: -8%;
  }

  100% {
    left: 107%;
    right: -8%;
  }
`)),O=(0,k.F4)(L||(L=_`
  0% {
    opacity: 1;
    background-position: 0 -23px;
  }

  60% {
    opacity: 0;
    background-position: 0 -23px;
  }

  100% {
    opacity: 1;
    background-position: -200px -23px;
  }
`)),useUtilityClasses=e=>{let{classes:t,variant:n,color:r}=e,o={root:["root",`color${(0,y.Z)(r)}`,n],dashed:["dashed",`dashedColor${(0,y.Z)(r)}`],bar1:["bar",`barColor${(0,y.Z)(r)}`,("indeterminate"===n||"query"===n)&&"bar1Indeterminate","determinate"===n&&"bar1Determinate","buffer"===n&&"bar1Buffer"],bar2:["bar","buffer"!==n&&`barColor${(0,y.Z)(r)}`,"buffer"===n&&`color${(0,y.Z)(r)}`,("indeterminate"===n||"query"===n)&&"bar2Indeterminate","buffer"===n&&"bar2Buffer"]};return(0,j.Z)(o,getLinearProgressUtilityClass,t)},getColorShade=(e,t)=>"inherit"===t?"currentColor":e.vars?e.vars.palette.LinearProgress[`${t}Bg`]:"light"===e.palette.mode?(0,v.$n)(e.palette[t].main,.62):(0,v._j)(e.palette[t].main,.5),A=(0,u.ZP)("span",{name:"MuiLinearProgress",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,t[`color${(0,y.Z)(n.color)}`],t[n.variant]]}})(({ownerState:e,theme:t})=>(0,b.Z)({position:"relative",overflow:"hidden",display:"block",height:4,zIndex:0,"@media print":{colorAdjust:"exact"},backgroundColor:getColorShade(t,e.color)},"inherit"===e.color&&"buffer"!==e.variant&&{backgroundColor:"none","&::before":{content:'""',position:"absolute",left:0,top:0,right:0,bottom:0,backgroundColor:"currentColor",opacity:.3}},"buffer"===e.variant&&{backgroundColor:"transparent"},"query"===e.variant&&{transform:"rotate(180deg)"})),D=(0,u.ZP)("span",{name:"MuiLinearProgress",slot:"Dashed",overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.dashed,t[`dashedColor${(0,y.Z)(n.color)}`]]}})(({ownerState:e,theme:t})=>{let n=getColorShade(t,e.color);return(0,b.Z)({position:"absolute",marginTop:0,height:"100%",width:"100%"},"inherit"===e.color&&{opacity:.3},{backgroundImage:`radial-gradient(${n} 0%, ${n} 16%, transparent 42%)`,backgroundSize:"10px 10px",backgroundPosition:"0 -23px"})},(0,k.iv)(N||(N=_`
    animation: ${0} 3s infinite linear;
  `),O)),q=(0,u.ZP)("span",{name:"MuiLinearProgress",slot:"Bar1",overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.bar,t[`barColor${(0,y.Z)(n.color)}`],("indeterminate"===n.variant||"query"===n.variant)&&t.bar1Indeterminate,"determinate"===n.variant&&t.bar1Determinate,"buffer"===n.variant&&t.bar1Buffer]}})(({ownerState:e,theme:t})=>(0,b.Z)({width:"100%",position:"absolute",left:0,bottom:0,top:0,transition:"transform 0.2s linear",transformOrigin:"left",backgroundColor:"inherit"===e.color?"currentColor":(t.vars||t).palette[e.color].main},"determinate"===e.variant&&{transition:"transform .4s linear"},"buffer"===e.variant&&{zIndex:1,transition:"transform .4s linear"}),({ownerState:e})=>("indeterminate"===e.variant||"query"===e.variant)&&(0,k.iv)(E||(E=_`
      width: auto;
      animation: ${0} 2.1s cubic-bezier(0.65, 0.815, 0.735, 0.395) infinite;
    `),$)),H=(0,u.ZP)("span",{name:"MuiLinearProgress",slot:"Bar2",overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.bar,t[`barColor${(0,y.Z)(n.color)}`],("indeterminate"===n.variant||"query"===n.variant)&&t.bar2Indeterminate,"buffer"===n.variant&&t.bar2Buffer]}})(({ownerState:e,theme:t})=>(0,b.Z)({width:"100%",position:"absolute",left:0,bottom:0,top:0,transition:"transform 0.2s linear",transformOrigin:"left"},"buffer"!==e.variant&&{backgroundColor:"inherit"===e.color?"currentColor":(t.vars||t).palette[e.color].main},"inherit"===e.color&&{opacity:.3},"buffer"===e.variant&&{backgroundColor:getColorShade(t,e.color),transition:"transform .4s linear"}),({ownerState:e})=>("indeterminate"===e.variant||"query"===e.variant)&&(0,k.iv)(W||(W=_`
      width: auto;
      animation: ${0} 2.1s cubic-bezier(0.165, 0.84, 0.44, 1) 1.15s infinite;
    `),I)),R=d.forwardRef(function(e,t){let n=(0,Z.Z)({props:e,name:"MuiLinearProgress"}),{className:o,color:i="primary",value:a,valueBuffer:l,variant:s="indeterminate"}=n,c=(0,p.Z)(n,S),d=(0,b.Z)({},n,{color:i,variant:s}),u=useUtilityClasses(d),g=(0,w.Z)(),h={},m={bar1:{},bar2:{}};if(("determinate"===s||"buffer"===s)&&void 0!==a){h["aria-valuenow"]=Math.round(a),h["aria-valuemin"]=0,h["aria-valuemax"]=100;let e=a-100;"rtl"===g.direction&&(e=-e),m.bar1.transform=`translateX(${e}%)`}if("buffer"===s&&void 0!==l){let e=(l||0)-100;"rtl"===g.direction&&(e=-e),m.bar2.transform=`translateX(${e}%)`}return(0,r.jsxs)(A,(0,b.Z)({className:(0,x.Z)(u.root,o),ownerState:d,role:"progressbar"},h,{ref:t},c,{children:["buffer"===s?(0,r.jsx)(D,{className:u.dashed,ownerState:d}):null,(0,r.jsx)(q,{className:u.bar1,ownerState:d,style:m.bar1}),"determinate"===s?null:(0,r.jsx)(H,{className:u.bar2,ownerState:d,style:m.bar2})]}))});var z=n(78675),T=n(44981),M=n(97729),V=n.n(M),X=n(3255),U=n(62621),G=n(76916),J=n(87599),Y=n(40357),K=n(98614),Q=n(60118),ee=n(34406);let ResError=class ResError extends Error{};let et=(0,u.ZP)("div")(e=>{let{theme:t,height:n}=e;return{minHeight:"".concat(n,"vh"),backgroundColor:t.palette.background.default,margin:"0px auto",display:"flex"}}),en=(0,u.ZP)("a")(()=>({textDecorationColor:"#b1adad",fontSize:"16px",color:"#b1adad",fontWeight:600,cursor:"pointer",wordBreak:"break-all"})),er=(0,u.ZP)(g.Z)(e=>{let{theme:t}=e;return{backgroundColor:t.palette.grey[200]}});async function fetchVerifyBooking(e,t){return fetch("/api/verifyBooking",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({bookingReference:e,emailOrName:t})}).then(e=>e.json())}async function fetchIsOtaBooking(e,t){try{let n=await fetch("".concat("https://paxflow-backend-n7ps7imnrq-ew.a.run.app","/api/client/bookings/get-public-info?companyId=").concat(t,"&bookingRef=").concat(e));if(!n.ok){if(404===n.status)throw new T.VL("Booking not found",404);if(429===n.status)throw new T.VL("Too many requests",429);throw new T.VL("Error fetching booking details",500)}let r=await n.json();return{isBookingOta:!r.data.paxPortalLoginUseEmailAddress,status:n.status}}catch(e){if(e instanceof T.VL)return{error:e.message,status:e.status,isBookingOta:!1};return{error:"An unknown error occurred when fetching booking details",isBookingOta:!1}}}let validate=(e,t)=>{let n={};return e.bookingNumber||(n.bookingNumber="".concat(t("login.please_type_booking_reference"))),e.email||(n.email="".concat(t("login.please_type_email_address_or_name"))),n},validateBookingNumber=(e,t,n)=>(e?t.setErrors({}):t.setFieldError("bookingNumber",n("login.please_type_booking_reference")),{}),validateEmail=(e,t,n)=>(e?t.setErrors({}):t.setFieldError("email",n("login.please_type_email_address_or_name")),{}),FormLogin=e=>{let{companyId:t,formik:n,initialLoading:o,t:i,theme:l,bookingCodeHint:s,searchBooking:c,isBookingFound:d,setIsBookingFound:u,isOtaBooking:g,logo:f}=e;return(0,r.jsxs)("form",{onSubmit:n.handleSubmit,children:[(0,r.jsxs)(h.ZP,{item:!0,children:[(0,r.jsx)(m.Z,{variant:"h4",component:"h1",my:5,mt:f?5:15,fontWeight:"bolder",textAlign:"center",children:i("login.manage_booking")}),o?(0,r.jsx)(er,{height:"100%",width:"40%"}):(0,r.jsxs)(m.Z,{my:2,fontWeight:"bolder",children:[i("login.booking_reference"),":"]})]}),(0,r.jsx)(h.ZP,{item:!0,sx:{[l.breakpoints.down("sm")]:{maxWidth:350}},children:(0,r.jsx)(a.SB,{initialLoading:o,setIsBookingFound:u,validateBookingNumber:validateBookingNumber,formik:n,t:i,bookingCodeHint:s})}),d&&(0,r.jsxs)(h.ZP,{item:!0,sx:{[l.breakpoints.down("sm")]:{maxWidth:350}},children:[(0,r.jsx)(h.ZP,{item:!0,children:o?(0,r.jsx)(er,{height:"100%",width:"50%"}):(0,r.jsxs)(m.Z,{my:2,fontWeight:"bolder",children:[i(g?"login.input_field_name":"login.input_field_email_or_name"),":"]})}),(0,r.jsx)(h.ZP,{item:!0,children:(0,r.jsx)(a.F6,{initialLoading:o,validateEmail:validateEmail,formik:n,t:i})})]}),(0,r.jsx)(h.ZP,{item:!0,my:o?1:5,children:(0,r.jsx)(a.XA,{initialLoading:o,isBookingFound:d,formik:n,t:i,color:l.paxflow.green})}),(0,r.jsx)(h.ZP,{item:!0,my:o?1:5,children:(0,r.jsx)(a.cH,{companyId:t,initialLoading:o,isBookingFound:d,formik:n,t:i,color:l.paxflow.green,searchBooking:c})})]})};var eo=!0,pages=e=>{let{locale:t}=e,[n,o]=(0,d.useState)(t),{t:s}=(0,K.$G)("translation",{lng:n}),[u,g]=(0,d.useState)(""),[p,b]=(0,d.useState)(!1),[x,j]=(0,d.useState)(!1),[k,v]=(0,d.useState)(!1),[y,w]=(0,d.useState)(!1),[Z,P]=(0,d.useState)(!0),{enqueueSnackbar:C}=(0,Y.Ds)(),onLoginFormSubmit=async e=>{b(!0);let t=await fetchVerifyBooking(e.bookingNumber,e.email);if(t.error)(0,Q.j)("loginFailed status code: ".concat(t.statusCode,", company ").concat(E)),b(!1),[500,502].includes(t.statusCode)?C("".concat(s("login.fetch_booking"),"."),{variant:"error"}):S.setFieldError("email",k?"".concat(s("login.booking_reference_doesnt_match_name"),"."):"".concat(s("login.booking_reference_doesnt_match_email_address_or_name"),"."));else{var n;(0,Q.j)("loginSuccess, company: ".concat(E)),c().push((n=t.internalBookingId,"/booking?id=".concat(n)))}},searchBooking=async(e,t)=>{b(!0);let n=await fetchIsOtaBooking(e,t);switch(n.status){case 200:v(n.isBookingOta),w(!0);break;case 404:default:S.setFieldError("bookingNumber",s("login.booking_not_found"));break;case 429:S.setFieldError("bookingNumber",s("login.too_many_requests"))}b(!1)},S=(0,l.TA)({initialValues:{bookingNumber:"",email:""},validate:e=>validate(e,s),onSubmit:onLoginFormSubmit}),publicCompanyDataFetcher=async()=>{var e;let t=null!==(e=ee.env.NEXT_PUBLIC_PAXPORTAL_DOMAIN)&&void 0!==e?e:u;if(!t)throw Error("".concat(s("login.domain_specified_error")));let n=await fetch("".concat("https://paxflow-backend-n7ps7imnrq-ew.a.run.app","/api/client/companies/public/").concat(t));if(!n.ok){let e=new ResError("".concat(s("login.fetch_data_error"),"."));throw e.info=await n.json(),e.status=n.status,e}return n.json()},{data:B,error:F}=(0,X.ZP)(u?"login":null,publicCompanyDataFetcher);if((0,d.useEffect)(()=>{let{errors:e,values:t,setFieldError:n}=S,{bookingNumber:r,email:o}=t;e.bookingNumber&&n("bookingNumber",r?k?"".concat(s("login.booking_reference_doesnt_match_email_address_or_name"),"."):"".concat(s("login.booking_reference_doesnt_match_name"),"."):"".concat(s("login.please_type_booking_reference"),".")),e.email&&n("email",o?k?s("name_doesnt_match"):s("login.email_or_name_dont_match"):k?s("login.please_type_name"):s("login.please_type_email_address_or_name"))},[n,s]),(0,d.useEffect)(()=>{j(!0);let e=window.location.hostname;g(e)},[]),(0,d.useEffect)(()=>{(null==B?void 0:B.data)&&x&&P(!1)},[B,x]),F)return 404===F.status?(0,r.jsx)(U.default,{}):500===F.status?(0,r.jsx)(G.default,{}):(0,r.jsx)(i(),{statusCode:F.status});let{id:L,logo:N,companyName:E,email:W,phone:$,secondaryColor:I,mainColor:O,bookingCodeHint:A,favicon:D,paxportalCustomTheme:q,paxportalActive:H}=(null==B?void 0:B.data)||{},M=(0,T.Sl)(O,I,q);return(0,r.jsxs)(f.Z,{theme:M,children:[(0,r.jsxs)(V(),{children:[(0,r.jsx)("title",{children:"".concat(E," - Customer Portal")}),(0,r.jsx)("link",{type:"image/jpg",rel:"shortcut icon",href:D})]}),(0,r.jsx)(J.default,{}),p&&(0,r.jsx)(R,{variant:"indeterminate"}),(0,r.jsx)("div",{style:{position:"fixed",top:0,right:0,padding:"30px"},children:(0,r.jsx)(a.HL,{selectedLanguage:n,setSelectedLanguage:o})}),(0,r.jsxs)(z.Z,{maxWidth:"lg",children:[(0,r.jsx)(et,{height:"95",children:(0,r.jsxs)(h.ZP,{container:!0,direction:"column",justifyContent:"center",alignItems:"center",spacing:M.spacing(2),children:[(0,r.jsx)(h.ZP,{item:!0,mt:3,children:Z?(0,r.jsx)(er,{variant:"circular",height:"100%",width:"100%",sx:{[M.breakpoints.down("md")]:{minHeight:200,minWidth:200,maxHeight:420,maxWidth:420},[M.breakpoints.up("md")]:{minHeight:400,minWidth:400,maxHeight:420,maxWidth:420}}}):(0,r.jsx)(a.Dc,{url:N||E,type:N?"logo":"name"})}),H&&(0,r.jsx)("div",{children:(0,r.jsx)(h.ZP,{item:!0,children:(0,r.jsx)(h.ZP,{container:!0,direction:"column",children:(0,r.jsx)(FormLogin,{companyId:L,formik:S,initialLoading:Z,t:s,theme:M,bookingCodeHint:A,searchBooking:searchBooking,isBookingFound:y,setIsBookingFound:w,isOtaBooking:k,logo:N})})})}),(0,r.jsx)(h.ZP,{item:!0,children:Z?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(er,{height:"30px",width:400}),(0,r.jsx)(er,{height:"30px",width:400})]}):(0,r.jsxs)(m.Z,{my:5,color:"#b1adad",width:400,margin:"auto",children:[H?(0,r.jsxs)(r.Fragment,{children:[s("login.info_email")," "]}):(0,r.jsxs)(r.Fragment,{children:[s("login.info_inactive_contact")," ",(0,r.jsx)("b",{children:E})," ",s("login.info_inactive_contact_email")," "]}),W&&(0,r.jsx)(en,{href:"mailto: ".concat(W),children:W}),$&&(0,r.jsxs)(r.Fragment,{children:[" ".concat(s("login.info_phone")," "),(0,r.jsx)(en,{href:"tel:".concat($),children:(null==$?void 0:$.includes("+"))?$:"+"+$})]}),"."]})})]})}),(0,r.jsx)(a.$_,{label:s("login.footer_caption"),type:"normal"})]})]})}},87599:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return Plausible}});var r=n(52322),o=n(45847),i=n.n(o);function Plausible(){return(0,r.jsx)(i(),{defer:!0,"data-domain":"paxportal.io",src:"https://plausible.io/js/plausible.js"})}},70689:function(e,t,n){e.exports=n(78941)},45847:function(e,t,n){e.exports=n(22898)}},function(e){e.O(0,[688,341,267,774,888,179],function(){return e(e.s=87314)}),_N_E=e.O()}]);