1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9845],{41981:function(e,n,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/applicant/viewing",function(){return t(55805)}])},4212:function(e,n,t){"use strict";t.d(n,{Z:function(){return T}});var i=t(14251),r=t(52875),a=t(44747),s=t(32692),o=t(85893),l=t(67294),u=t(45697),c=t.n(u),d=t(20648),f=t(38504),p=t(21911),h=t(42800),v=t(591),m=t(26664);function x(){var e=(0,s.Z)([""]);return x=function(){return e},e}function g(){var e=(0,s.Z)(["\n max-height: ",";\n overflow: hidden;\n"]);return g=function(){return e},e}function Z(){var e=(0,s.Z)(["\n padding: 4px;\n cursor: pointer;\n display: inline-block;\n"]);return Z=function(){return e},e}function y(){var e=(0,s.Z)(["\n display: none;\n"]);return y=function(){return e},e}var w=(0,d.ZP)(f.Z).withConfig({componentId:"sc-118cfe5c-0"})(x()),b=(0,d.ZP)(f.Z).withConfig({componentId:"sc-118cfe5c-1"})(g(),(function(e){return e.maxHeight})),C=(0,d.ZP)(f.Z).withConfig({componentId:"sc-118cfe5c-2"})(Z()),j=d.ZP.input.withConfig({componentId:"sc-118cfe5c-3"})(y());function E(e){var n=e.style.overflow,t=(0,m.Z)();n&&"visible"!==n||(e.style.overflow="hidden");var i=e.scrollHeight;t&&(i-=2);var r=e.clientWidth<e.scrollWidth||e.clientHeight<i;return e.style.overflow=n,r}var S=function(e){var n=e.filterKey,t=e.filter,s=e.filterState,u=e.handleFilterChange,c=e.hideIcon,d=e.maxHeight,f=(0,a.Z)(e,["filterKey","filter","filterState","handleFilterChange","hideIcon","maxHeight"]),m=(0,l.useState)(!1),x=m[0],g=m[1],Z=(0,l.useState)(!1),y=Z[0],S=Z[1],T=(0,l.useState)(null),_=T[0],I=T[1],D=(0,l.useCallback)((function(e){e&&(I(e),S(E(e)))}),[d,x]);(0,l.useEffect)((function(){var e=function(){_&&S(E(_))};return e(),window.addEventListener("resize",e),window.addEventListener("scroll",e),function(){window.removeEventListener("resize",e),window.removeEventListener("scroll",e)}}),[_,d,x]);var A;return(0,o.jsxs)(w,(0,r.Z)((0,i.Z)({},f),{children:[(0,o.jsx)(p.Z,{mb:"12px",children:t.name}),(0,o.jsx)(b,{ref:D,maxHeight:x||d,children:(A=t.items,A.map((function(e){var t=s.items.map((function(e){return e.value})).includes(e.value);return(0,o.jsxs)(C,{htmlFor:e.value,onClick:function(){return u((0,i.Z)({name:n},e))},children:[(0,o.jsx)(j,{type:"checkbox",name:e.value,value:t}),(0,o.jsx)(h.Z,{border:!t,type:t?"tertiaryContainer":"surface2",iconLeft:!c&&t?"close":null,children:e.label})]},e.value)})))}),d&&(x||y)&&(0,o.jsx)(v.Z,{collapseText:"Show Less",expandText:"Show More",onClick:function(){g((function(e){return!e}))},isExpanded:x,ml:"auto"})]}))};S.propTypes={filterKey:c().string,filter:c().object,filterState:c().object,handleFilterChange:c().func,hideIcon:c().bool,maxHeight:c().string.isRequired};var T=S},277:function(e,n,t){"use strict";var i=t(67294);n.Z=function(e){var n=(0,i.useRef)();return(0,i.useEffect)((function(){n.current=e}),[e]),n.current}},2815:function(e,n,t){"use strict";var i=t(34727),r=t(75815),a=t(18352),s=t(67573),o=t(90132),l=t(14251),u=t(48270),c=t(97582),d=t(85893),f=t(67294),p=t(45697),h=t(36135);n.Z=function(e){var n;return n=function(n){(0,o.Z)(s,n);var t=(0,u.Z)(s);function s(){return(0,r.Z)(this,s),t.apply(this,arguments)}return(0,a.Z)(s,[{key:"render",value:function(){return this.props.statusCode?(0,d.jsx)(h.default,(0,l.Z)({},this.props)):(0,d.jsx)(e,(0,l.Z)({},this.props))}}],[{key:"getInitialProps",value:function(n){return(0,i.Z)((function(){var t,i;return(0,c.__generator)(this,(function(r){switch(r.label){case 0:return e.getInitialProps?[4,e.getInitialProps(n)]:[3,2];case 1:return i=r.sent(),[3,3];case 2:i=null,r.label=3;case 3:return(t=i||{}).statusCode&&n.res&&(n.res.statusCode=t.statusCode),[2,t]}}))}))()}}]),s}(f.Component),(0,s.Z)(n,"propTypes",{statusCode:p.number}),n}},36135:function(e,n,t){"use strict";t.r(n);var i=t(34727),r=t(97582),a=t(85893),s=(t(67294),t(45697)),o=t(24844),l=t(31838),u=t(97892),c=t(98771),d=t(74852),f=t(52077),p=t(38504),h=t(14373);function v(e){var n=e.statusCode,t=e.title,i=e.message,r=(0,o.Kw)((function(e){return e.me.data})),s=t||(n>=500?"Uh oh! Something's wrong.":401===n?"You need an account to view this page!":403===n?"Sorry, access denied!":"Sorry, page not found!"),u=function(){return(0,a.jsxs)(p.Z,{py:"40px",px:["20px","20px","40px"],children:[(0,a.jsx)(d.Z,{tag:"h1",size:["xxxl","xxxxl"],align:"center",mb:"20px",lineHeight:1.5,children:s}),i?(0,a.jsx)(d.Z,{align:"center",lineHeight:1.5,children:i}):(0,a.jsxs)(d.Z,{align:"center",lineHeight:1.5,children:["If this isn't right, please contact support at"," ",(0,a.jsx)(h.Z,{external:!0,href:"mailto:".concat(l.Z.support.email),children:l.Z.support.email}),"."]}),(0,a.jsx)(p.Z,{display:"flex",justifyContent:"center",children:(0,a.jsx)(f.Z,{href:"/",minWidth:"200px",mt:"40px",children:"Home"})})]})};return(0,a.jsx)(a.Fragment,{children:r?(0,a.jsx)(c.Z,{children:(0,a.jsx)(u,{})}):(0,a.jsx)(u,{})})}v.getInitialProps=function(){var e=(0,i.Z)((function(e){return(0,r.__generator)(this,(function(n){switch(n.label){case 0:return[4,(0,u.ZP)(e)];case 1:return n.sent(),[2,{statusCode:e.res?e.res.statusCode:e.err?e.err.statusCode:null}]}}))}));return function(n){return e.apply(this,arguments)}}(),v.propTypes={statusCode:s.number,title:s.string,message:s.string},n.default=v},55805:function(e,n,t){"use strict";t.r(n),t.d(n,{default:function(){return ne}});var i=t(34727),r=t(67573),a=t(14251),s=t(52875),o=t(32692),l=t(97582),u=t
1(85893),c=t(67294),d=t(24844),f=t(20648),p=t(74865),h=t.n(p),v=t(22920),m=t(27484),x=t.n(m),g=t(97892),Z=t(99664),y=t(28644),w=t(277),b=t(2815),C=t(5601),j=t(34423),E=t(44747),S=t(69779),T=t(45697),_=t.n(T),I=t(38504),D=t(42800),A=t(21911),O=t(9953),Y=t(40944),L=t(86813);function M(){var e=(0,o.Z)(["\n height: 100%;\n width: 100%;\n"]);return M=function(){return e},e}function P(){var e=(0,o.Z)(["\n max-height: ",";\n width: 100%;\n overflow: auto;\n overflow-x: none;\n\n position: relative;\n"]);return P=function(){return e},e}function F(){var e=(0,o.Z)(["\n width: 100%;\n display: flex;\n flex-direction: column;\n background-color: ",";\n border-radius: ",";\n margin-bottom: 12px;\n padding: 8px;\n"]);return F=function(){return e},e}var H=(0,f.ZP)(I.Z).withConfig({componentId:"sc-ca318668-0"})(M()),N=(0,f.ZP)(I.Z).withConfig({componentId:"sc-ca318668-1"})(P(),(function(e){return e.calendarHeight||"100%"})),k=(0,f.ZP)(I.Z).withConfig({componentId:"sc-ca318668-2"})(F(),(function(e){return e.theme.colors.surface1}),(function(e){return e.theme.borderRadius})),R=function(e){var n=e.viewings,t=e.calendarHeight,i=e.applicantView,o=e.cancelByViewing,l=(0,E.Z)(e,["viewings","calendarHeight","applicantView","cancelByViewing"]),c=n&&n.reduce((function(e,n){return(0,s.Z)((0,a.Z)({},e),(0,r.Z)({},x()(n.startTime||n.requestedStartTime).format("YYYY-MM-DD"),(0,S.Z)(e[x()(n.startTime||n.requestedStartTime).format("YYYY-MM-DD")]||[]).concat([n])))}),{}),d=c&&Object.keys(c).sort().map((function(e){return{value:e,label:x()(e).format("dddd Do Of MMMM")}})),f=function(e){if(!(null===e||void 0===e?void 0:e.attending))return!1;if(o)return"CANCELLED"===e.status;var n=e.attending.find((function(e){return!["CANCELLED","ABANDONED"].includes(e.status)})),t=e.attending.filter((function(e){return["CANCELLED","ABANDONED"].includes(e.status)})).sort((function(e,n){return new Date(n.cancelledAt).getTime()-new Date(e.cancelledAt).getTime()}))[0];return!("CANCELLED"!==e.status&&(n||!t))};return(0,u.jsx)(H,(0,s.Z)((0,a.Z)({},l),{children:(0,u.jsx)(N,{calendarHeight:t,children:(null===d||void 0===d?void 0:d.length)?d.map((function(e){return(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(O.Z,{text:e.label,textLeft:!0},e.value),c[e.value].map((function(e){return(0,u.jsxs)(k,{as:e.requestedStartTime?"div":"a",decoration:"none",color:"inherit",href:i?e.requestedStartTime?"":"/applicant/viewing/".concat(e._id):e.viewingSlot?"/viewings/".concat(e._id):"/viewing-slot/".concat(e._id),children:[(0,u.jsxs)(I.Z,{width:"100%",display:"flex",justifyContent:"space-between",children:[(0,u.jsxs)(I.Z,{display:"flex",alignItems:"center",children:[(0,u.jsx)(D.Z,{mb:"8px",type:f(e)?"failLight":e.viewingSlot?"primaryContainer":"surfaceVariant",children:f(e)?"Cancelled":(0,u.jsxs)(u.Fragment,{children:["".concat(x()((null===e||void 0===e?void 0:e.startTime)||e.requestedStartTime).format("h:mma[-]")).concat(x()((null===e||void 0===e?void 0:e.endTime)||e.requestedEndTime).format("h:mma"))," ",!e.viewingSlot&&!e.requestedStartTime&&"Time Range Placeholder",e.requestedStartTime&&"(Request ".concat("DECLINED"===e.status?"Declined":"Pending",")")]})}),e.viewingSlot&&!e.requestedStartTime&&(0,u.jsxs)(I.Z,{display:"flex",alignItems:"center",mb:"8px",children:[(0,u.jsx)(Y.Z,{name:"person",type:"outlined",size:"16px",mx:"8px"}),(0,u.jsx)(A.Z,{type:"label-small-bold",children:"".concat(e.groupsBooked,"/").concat(e.groupsAllowed)})]})]}),!e.requestedStartTime&&(0,u.jsx)(Y.Z,{name:"remove_red_eye",type:"outlined",color:"#323232"})]}),(0,u.jsxs)(A.Z,{type:"caption",children:[e.listing.property.address.short,", ",e.listing.property.address.suburb,","," ",e.listing.property.address.territory]})]},e._id)}))]})})):(0,u.jsx)(L.Z,{type:"tip",children:"There are no viewings for the selected filter"})})}))};R.propTypes={viewings:_().array,calendarHeight:_().string,applicantView:_().bool};var W=R,V=t(34130),q=t(4212),G=t(13466);function K(){var e=(0,o.Z)(["\n margin: auto;\n"]);return K=function(){return e},e}function B(){var e=(0,o.Z)(["\n display: grid;\n grid-template-columns: 420px 420px;\n gap: 20px;\n\n @media (max-width: ",") {\n display: flex;\n flex-direction: column;\n }\n"]);return B=function(){return e},e}function z(){var e=(0,o.Z)(["\n width: 100%;\n display: flex;\n flex-direction: column;\n background-color: ",";\n border-radius: ",";\n padding: 8px;\n"]);return z=function(){return e},e}var X={name:"date",items:[{label:"Specific Day",value:"SPECIFIC_DAY",isExclusive:!0},{label:"Last 7 Days",value:"LAST_7_DAYS",isExclusive:!0},{label:"This Week",value:"THIS_WEEK",isExclusive:!0},{label:"Tomorrow",value:"TOMORROW",isExclusive:!0},{label:"Today",value:"TODAY",isExclusive:!0},{label:"Last 30 days",value:"LAST_30_DAYS",isExclusive:!0},{label:"Upcoming 30 days",value:"UPCOMING_30_DAYS",isExclusive:!0},{label:"All past",value:"ALL_PAST",isExclusive:!0},{label:"Cancelled",value:"CANCELLED",isExclusive:!0},{label:"All Viewings",value:"ALL_VIEWINGS",isExclusive:!0}]},U=(0,f.ZP)(I.Z).withConfig({componentId:"sc-5b4ad7ce-0"})(K()),J=(0,f.ZP)(I.Z).withConfig({componentId:"sc-5b4ad7ce-1"})(B(),(function(e){return e.theme.breakpoints.md})),Q=(0,f.ZP)(I.Z).withConfig({componentId:"sc-5b4ad7ce-2"})(z(),(function(e){return e.theme.colors.surface1}),(function(e){return e.theme.borderRadius})),$=function(e,n){var t=n.type,i=n.payload;switch(t){case"FILTER_SELECT":var o=(0,a.Z)({},e),l=(0,a.Z)({},i),u=void 0;"TOMORROW"===i.value&&(u=x()(new Date).startOf("day").add(1,"day").toISOString()),["TODAY","SPECIFIC_DAY"].includes(i.value)&&(u=x()(new Date).startOf("day").toISOString(),l={name:"MY",label:"Today",value:"TODAY",isExclusive:!0});var c=!!e.filters[i.name].items.find((function(e){return e.value===i.value})),d=e.filters[i.name].items.filter((function(e){return!e.isExclusive&&e.value!==i.value})),f=i.isExclusive?c?[]:[(0,a.Z)({},l)]:c?d:d.concat((0,a.Z)({},l));return(0,s.Z)((0,a.Z)({},o),{isFiltersDirty:!0,filters:(0,s.Z)((0,a.Z)({},o.filters),(0,r.Z)({},l.name,(0,s.Z)((0,a.Z)({},[l.name]),{items:f}))),date:u});case"DATE_CHANGE":var p=[{name:"MY",label:"Specific Day",value:"SPECIFIC_DAY"}];return x()(i).isSame(x()(),"day")&&(p=[{name:"MY",label:"Today",value:"TODAY"}]),x()(i).isSame(x()().add(1,"day"),"day")&&(p=[{name:"MY",label:"Tomorrow",value:"TOMORROW"}
1]),(0,s.Z)((0,a.Z)({},e),{isFiltersDirty:!0,filters:(0,s.Z)((0,a.Z)({},e.filters),{MY:(0,s.Z)((0,a.Z)({},[i.name]),{items:p})}),date:x()(i).startOf("day").toISOString()});default:throw new Error("Action type '".concat(t,"' is not recognized in this reducer."))}};function ee(){var e=(0,d.Kw)((function(e){return e.viewings.byMe.data.data})),n=(0,d.Kw)((function(e){return e.me.data})),t=(0,d.Kw)((function(e){return e.waitlistedGroups.byMe.data})),r=(0,d.WX)((function(e){return e.waitlistedGroups.byMe.fetchMyWaitlistedGroups})),a=(0,d.WX)((function(e){return e.viewings.byMe.fetchMyViewings})),s={filters:{MY:{name:"MY",items:[{label:"All Viewings",value:"ALL_VIEWINGS"}]}},isFiltersDirty:!1,date:x()(new Date).startOf("day").toISOString()},o=(0,c.useReducer)($,s),p=o[0],m=o[1],g=(0,c.useState)(!0),Z=g[0],b=g[1],E=p.filters,S=p.isFiltersDirty,T=p.date,_=(0,w.Z)(S);function O(){return L.apply(this,arguments)}function L(){return(L=(0,i.Z)((function(){var e,n;return(0,l.__generator)(this,(function(t){switch(t.label){case 0:h().start(),e=Object.keys(E).reduce((function(e,n){return e[n]=E[n].items.map((function(e){return e.value})),e}),{}),t.label=1;case 1:return t.trys.push([1,3,4,5]),[4,a({query:{filters:e,date:T}})];case 2:return t.sent(),[3,5];case 3:return n=t.sent(),v.Am.error(n.message),[3,5];case 4:return h().done(),[7];case 5:return[2]}}
1))}))).apply(this,arguments)}return(0,c.useEffect)((function(){null!=_&&S&&O()}),[E]),(0,c.useEffect)((function(){O(),r()}),[]),(0,u.jsx)(f.f6,{theme:y.Z,children:(0,u.jsx)(C.Z,{children:(0,u.jsxs)(U,{children:[(0,u.jsx)(A.Z,{type:"large-headline",mb:"8px",children:"Your Viewings"}),(0,u.jsxs)(J,{children:[(0,u.jsx)(j.Z,{type:"calendar",indicatorType:"MY_VIEWINGS",indicatorContext:n.id,value:E.MY.items.filter((function(e){return["TODAY","SPECIFIC_DAY","TOMORROW"].includes(e.value)})).length>0?T:null,onChangeValue:function(e){m({type:"DATE_CHANGE",payload:e})},m:"auto",width:"100%"}),(0,u.jsxs)(I.Z,{children:[(0,u.jsx)(q.Z,{mb:"16px",filterKey:"MY",filter:X,filterState:E.MY,handleFilterChange:function(e){m({type:"FILTER_SELECT",payload:e})},hideIcon:!0}),(0,u.jsxs)(I.Z,{children:[E.MY.items.filter((function(e){return["TODAY","SPECIFIC_DAY","TOMORROW"].includes(e.value)})).length>0?(0,u.jsx)(V.Z,{calendarHeight:"400px",applicantView:!0,date:T,times:e}):(0,u.jsx)(W,{calendarHeight:"400px",applicantView:!0,viewings:e}),t.count>0&&(0,u.jsxs)(I.Z,{my:"16px",children:[(0,u.jsx)(I.Z,{width:"100%",display:"flex",justifyContent:"flex-end",mb:"16px",children:(0,u.jsxs)(G.Z,{color:"warning",as:"button",onClick:function(){b(!Z)},iconRight:Z?"arrow_upward":"arrow_downward",children:["(",t.count,") Waitlist"]})}),(0,u.jsx)(I.Z,{maxHeight:"400px",overflow:"auto",display:"flex",flexDirection:"column",flexGap:"12px",children:Z&&t&&t.data.map((function(e){return(0,u.jsxs)(Q,{as:"a",decoration:"none",color:"inherit",href:"/applicant/viewing/waitlist/".concat(e._id),children:[(0,u.jsxs)(I.Z,{width:"100%",display:"flex",justifyContent:"space-between",children:[(0,u.jsx)(D.Z,{mb:"8px",type:"warningLight",children:"Waitlist"}),(0,u.jsx)(Y.Z,{name:"remove_red_eye",type:"outlined",color:"#323232"})]}),(0,u.jsxs)(A.Z,{type:"caption",children:[e.waitlistedFor.property.address.short,","," ",e.waitlistedFor.property.address.suburb,","," ",e.waitlistedFor.property.address.territory]})]},e._id)}))})]})]})]})]})]})})})}ee.propTypes={},ee.getInitialProps=function(){var e=(0,i.Z)((function(e){var n,t,i;return(0,l.__generator)(this,(function(r){switch(r.label){case 0:return[4,(0,g.ZP)(e,{requiresAuth:!0})];case 1:return r.sent(),i=e.store.getState().me,(null===(n=i.agency)||void 0===n||null===(t=n.enabledFeatures)||void 0===t?void 0:t.viewingBookings)?[2,(0,Z.Z)("/viewings",e)]:i.agency?[2,(0,Z.Z)("/agency/dashboard",e)]:[2,{}]}}))}));return function(n){return e.apply(this,arguments)}}();var ne=(0,b.Z)(ee)}},function(e){e.O(0,[8153,1517,4032,5601,8124,9774,2888,179],(function(){return n=41981,e(e.s=n);var n}));var n=e.O();_N_E=n}]);
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.