1"use strict";(globalThis.webpackChunk_triplake_member_portal=globalThis.webpackChunk_triplake_member_portal||[]).push([[18460],{71410:(e,r,t)=>{t.d(r,{w:()=>F,D:()=>I});var s=t(81034),o=t(46724),n=t(95764),a=t(19065),i=t(76781),l=t(47778),c=t(24286);const u=e=>{let r=e.formControl,t=e.formId,s=e.onError,o=e.onUnmount,n=e.onFormSubmit;const a=(0,l.useFormState)({control:r}),u=a.errors,d=a.isSubmitted,f=a.isSubmitting,m=(0,c.usePrevious)(d),p=(0,c.usePrevious)(JSON.stringify(u))!==JSON.stringify(u);return(0,i.useEffect)(()=>{s(d?u:{},t)},[u,p,t,d,s]),(0,i.useEffect)(()=>{m&&!f&&n()},[f,m,n]),(0,i.useEffect)(()=>o(t),[t,o]),null};var d=t(10864),f=t(34613),m=t(14146);const p=e=>{let r=e.errorPayload;const t=(0,f.v)();return(0,m.jsx)(d.bZ,{type:d.NK.ERROR,children:t(r)})};var S,g=t(95250),E=t(99500);const h=t(99025).default.div(S||(S=(0,E.Z)(["\n scroll-margin-top: 2.4rem;\n & > * {\n align-items: start;\n }\n"])));var v=t(79693);const b=(0,v.defineDynamicMessages)({genericSuccess:{id:"ApiSuccess.loyalty.{requestType}",defaultMessage:"{requestType}"}}),A=e=>{let r=e.successPayload,t=e.forwardRef;const s=(0,v.useIntl)();return(0,m.jsx)(d.bZ,{type:d.NK.SUCCESS,forwardRef:t,children:(e=>{let r=e.customMessage,t=e.requestId;return r||s.formatDynamicMessage(b.genericSuccess,{requestType:t})})(r)})},Z=e=>{let r=e.apiErrorList,t=e.formErrorList,s=e.apiSuccessList,o=e.scrollTrigger;const n=(0,i.useRef)(null),a=r.length||s.length,l=(0,c.usePrevious)(a),u=()=>{n.current&&n.current.scrollIntoView({behavior:"smooth"})};return(0,i.useEffect)(()=>{a&&!l&&n.current&&u()},[a,l]),(0,i.useEffect)(()=>{u()},[o]),t.length>0?(0,m.jsx)(h,{ref:n,children:(0,m.jsx)(g.H,{formErrorList:t})}):s.length>0?(0,m.jsx)(h,{ref:n,children:s.map(e=>(0,m.jsx)(A,{successPayload:e},e.requestId))}):r.length>0?(0,m.jsx)(h,{ref:n,children:r.map(e=>(0,m.jsx)(p,{errorPayload:e},e.requestId))}):null};var T=t(31118);const C={registerForm:()=>{},unregisterForm:()=>{},clearAllFormErrors:()=>{},clearFormErrors:()=>{},onApiSuccess:()=>{},clearApiSuccess:()=>{},onApiError:()=>{},clearApiError:()=>{},clearAllApiErrors:()=>{},clearAllSuccessAlerts:()=>{}};var j=t(28400),y=t(24289),U=t(52108);const k=e=>{const r=e.map(e=>U.lowerCase(e.field)).filter(e=>"root"!==e),t="Form validation failed for ".concat(r.join(", "));return t.length>100?"Form validation failed for ".concat(r.length," fields"):t},I=(0,i.createContext)(C),F=e=>{let r=e.children;const t=(0,i.useState)({}),l=(0,a.Z)(t,2),c=l[0],d=l[1],f=(0,i.useState)({}),p=(0,a.Z)(f,2),S=p[0],g=p[1],E=(0,i.useState)({}),h=(0,a.Z)(E,2),v=h[0],b=h[1],A=(0,i.useState)({}),C=(0,a.Z)(A,2),U=C[0],F=C[1],N=(0,i.useState)(0),P=(0,a.Z)(N,2),x=P[0],L=P[1],R=Object.values(v),q=Object.values(U),O=(0,T.t)(S);((e,r)=>{const t=(0,y.I0)();(0,i.useEffect)(()=>{e&&0!==e.length&&t((0,j.t)({errorMessage:k(e),errorName:"Form validation error"}))},[r])})(O,x);const _=(0,i.useCallback)((e,r)=>{d(t=>e&&!t[r]?(0,n.Z)((0,n.Z)({},t),{},{[r]:e}):t)},[]),w=(0,i.useCallback)(e=>{g(r=>{r[e];return(0,s.Z)(r,[e].map(o.Z))})},[]),M=(0,i.useCallback)(e=>{d(r=>{r[e];return(0,s.Z)(r,[e].map(o.Z))}),w(e)},[w]),D=(0,i.useCallback)((e,r)=>{g(t=>(0,n.Z)((0,n.Z)({},t),{},{[r]:e}))},[]),Q=(0,i.useCallback)(()=>{g({})},[]),K=(0,i.useCallback)(e=>{F(r=>(0,n.Z)((0,n.Z)({},r),{},{[e.requestId]:e})),b(r=>{const t=e.requestId;r[t];return(0,s.Z)(r,[t].map(o.Z))})},[]),G=(0,i.useCallback)(e=>{F(r=>{r[e];return(0,s.Z)(r,[e].map(o.Z))})},[]),H=(0,i.useCallback)(e=>{b(r=>(0,n.Z)((0,n.Z)({},r),{},{[e.requestId]:e})),F(r=>{const t=e.requestId;r[t];return(0,s.Z)(r,[t].map(o.Z))})},[]),J=(0,i.useCallback)(e=>{b(r=>{r[e];return(0,s.Z)(r,[e].map(o.Z))})},[]),V=(0,i.useCallback)(()=>{b({})},[]),z=(0,i.useCallback)(()=>{F({})},[]),B=(0,i.useCallback)(()=>{L(Math.random())},[]),W=(0,i.useMemo)(()=>({registerForm:_,unregisterForm:M,clearAllFormErrors:Q,clearFormErrors:w,onApiSuccess:K,clearApiSuccess:G,onApiError:H,clearApiError:J,clearAllApiErrors:V,clearAllSuccessAlerts:z}),[_,M,Q,w,K,G,H,J,V,z]),X=Object.entries(c).map(e=>{let r=(0,a.Z)(e,2),t=r[0],s=r[1];return(0,m.jsx)(u,{formId:t,formControl:s,onError:D,onUnmount:w,onFormSubmit:B},t)});return(0,m.jsxs)(I.Provider,{value:W,children:[(0,m.jsx)(Z,{formErrorList:O,apiErrorList:R,apiSuccessList:q,scrollTrigger:x}),X,r]})}},80970:(e,r,t)=>{t.d(r,{M:()=>Z});var s=t(95764),o=t(19065),n=t(83400),a=t(76781),i=t(24289),l=t(32813),c=t(49155),u=t(47217),d=t(25466);const f=(e,r)=>e.map(e=>(0,i.v9)(e)).includes(r),m=e=>f(e,d.REQUEST_STATUS.PENDING);var p=t(71410),S=t(99288),g=t(73137),E=t(58388),h=t(37202),v=t(95682),b=t(64485),A=t(14
1146);const Z=(e,r)=>e=>t=>{Object.assign({},((0,n.Z)(t),t));const Z=(0,i.I0)(),T=(0,S.e)(),C=T.isInitialized,j=T.isAuthenticated,y=T.login,U=(0,i.v9)(g.jE),k=(0,a.useState)(!1),I=(0,o.Z)(k,2),F=I[0],N=I[1],P=(0,a.useRef)(!1),x=[(0,h.y)("intlApi",["getTranslations"]),(0,h.y)("configApi",["getLanguage","getConfig","getDictionaries","getCheckinAirports"]),(0,h.y)("userApi",["getUserProfile","getUserInfo"]),...r.getLoadingStatus||[]],L=[...x,(0,h.y)("configApi",["getHeader","getFooter"])],R=r.getSubmitStatus||[],q=m(L),O=m(R),_=f(x,d.REQUEST_STATUS.FAILURE);if((0,a.useEffect)(()=>{Z((0,E.A)({isPrivate:!!r.isPrivate,isAuthenticated:j}))},[Z,j]),_&&U)throw new Error("One of the requests required for page to load has failed.");(0,a.useEffect)(()=>{if((!r.isPrivate||j)&&null!==r&&void 0!==r&&r.actionOnLoad)for(const e of r.actionOnLoad)Z(e)},[Z,j]),(0,a.useEffect)(()=>{q||F||((0,v.lM)(),N(!0))},[q,F]),(0,a.useEffect)(()=>{r.isPrivate&&!j&&C&&!P.current&&(P.current=!0,y({redirectUri:(0,u.m)()}))},[y,j,C]);return r.isPrivate&&!j?(0,A.jsx)(c.c,{}
1):(0,A.jsxs)(p.w,{children:[(0,A.jsx)(l.LoadingMask,(0,s.Z)({isFullScreen:!0,isVisible:O||q||!F,CustomSpinner:(0,b.c)()},r.pageLoader)),F?(0,A.jsx)(e,{onSubmit:()=>{if(null!==r&&void 0!==r&&r.actionOnSubmit)for(const e of null===r||void 0===r?void 0:r.actionOnSubmit)Z(e)}}):null]})}},87262:(e,r,t)=>{t.r(r),t.d(r,{default:()=>i});var s=t(36027),o=t(80970),n=t(76781),a=t(99728);const i=(0,o.M)(s.r.home,{isPrivate:!0})(()=>{const e=(0,a.s0)();return(0,n.useEffect)(()=>{e(s.r.user.dashboard)},[]),null})},37202:(e,r,t)=>{t.d(r,{y:()=>n});var s=t(25466),o=t(96739);const n=(e,r)=>t=>{const n=t[e],a=new Set,i=[],l=[];for(const e of r)"string"===typeof e?i.push(e):"object"===typeof e&&"endpointName"in e&&"cacheKey"in e&&l.push(e);if(null!==n&&void 0!==n&&n.queries&&i.length>0&&Object.values(n.queries).forEach(e=>{"endpointName"in e&&"status"in e&&i.includes(e.endpointName)&&a.add(e.status)}),null!==n&&void 0!==n&&n.mutations&&l.length>0)for(const e of l){var c;const r=e.endpointName,t=e.cacheKey,s=null===(c=n.mutations)||void 0===c?void 0:c[t];s&&"endpointName"in s&&"status"in s&&s.endpointName===r&&a.add(s.status)}return a.has(o.oZ.pending)?s.REQUEST_STATUS.PENDING:a.has(o.oZ.rejected)?s.REQUEST_STATUS.FAILURE:a.has(o.oZ.fulfilled)?s.REQUEST_STATUS.SUCCESS:s.REQUEST_STATUS.NONE}}}]); 2//# sourceMappingURL=HomePage_08bc30495b5e12f6d240.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.