(this.webpackJsonp=this.webpackJsonp||[]).push([[0],[,function(e,t,r){"use strict";var n=r(110);r.d(t,"a",(function(){return n.a}));var a=r(80);r.d(t,"d",(function(){return a.a}));var o=r(211);r.d(t,"b",(function(){return o.a}));var i=r(212);r.d(t,"c",(function(){return i.a}))},,,function(e,t,r){"use strict";var n=r(0),a=r.n(n),o=r(2),i=r(33),l=r(1);t.a={Screen:function(e){return a.a.createElement(o.a,{style:{minWidth:l.d.minPageWidth,minHeight:e.forceScrollbar?"101%":void 0,backgroundColor:l.a.pageBackground,paddingVertical:e.paddingVertical||l.d.doubleBaseMargin,paddingHorizontal:e.paddingHorizontal||l.d.doubleBaseMargin}},e.children)},Icon:function(e){return a.a.createElement(i.a,{source:e.source,style:{width:e.size?e.size:l.d.icons.medium,height:e.size?e.size:l.d.icons.medium,tintColor:e.tintColor,resizeMode:"contain"}})},FlexSpacer:function(e){return a.a.createElement(o.a,{style:{flex:e.flex?e.flex:1}})},SpacerSmall:function(){return a.a.createElement(o.a,{style:{width:l.d.smallMargin,height:l.d.smallMargin}})},Spacer:function(){return a.a.createElement(o.a,{style:{width:l.d.baseMargin,height:l.d.baseMargin}})},SpacerDouble:function(){return a.a.createElement(o.a,{style:{width:l.d.doubleBaseMargin,height:l.d.doubleBaseMargin}})},SpacerTriple:function(){return a.a.createElement(o.a,{style:{width:l.d.tripleBaseMargin,height:l.d.tripleBaseMargin}})},SpacerQuad:function(){return a.a.createElement(o.a,{style:{width:l.d.quadBaseMargin,height:l.d.quadBaseMargin}})},SpacerSix:function(){return a.a.createElement(o.a,{style:{width:l.d.sixBaseMargin,height:l.d.sixBaseMargin}})},SpacerEight:function(){return a.a.createElement(o.a,{style:{width:l.d.eightBaseMargin,height:l.d.eightBaseMargin}})},HorizontalLine:function(e){var t=e.color,r=void 0===t?l.a.lightGrey:t;return a.a.createElement(o.a,{style:{width:"100%",borderWidth:1,borderColor:r}})}}},,,,function(e,t,r){"use strict";r.d(t,"a",(function(){return i})),r.d(t,"b",(function(){return l.a})),r.d(t,"c",(function(){return u})),r.d(t,"d",(function(){return f}));var n=r(12),a=r.n(n);function o(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}var i=function(e){for(var t=1;t2&&void 0!==arguments[2]?arguments[2]:o(e,t),n=a(e.toFixed(r));return i(t)+n+l(t)}function s(e,t){var r="";return r=Math.abs(e)>=1e7?(e/1e6).toFixed(0)+"M":Math.abs(e)>=1e6?(e/1e6).toFixed(1)+"M":Math.abs(e)>=1e4?(e/1e3).toFixed(0)+"k":Math.abs(e)>=1e3?(e/1e3).toFixed(1)+"k":""+e.toFixed(0),i(t)+r+l(t)}r.d(t,"a",(function(){return n})),r.d(t,"c",(function(){return c})),r.d(t,"b",(function(){return s})),function(e){e.Number="Number",e.Dollars="Dollars",e.Percent="Percent",e.Temperature="Temperature"}(n||(n={}))},,,function(e,t,r){"use strict";var n=r(223);r.d(t,"Label",(function(){return n.a}));var a=r(471);r.d(t,"ConnectedLabel",(function(){return a.a}));var o=r(472);r.o(o,"ConnectedValueLabel")&&r.d(t,"ConnectedValueLabel",(function(){return o.ConnectedValueLabel})),r.o(o,"LABEL_THEME_COMPONENT_CAPTION")&&r.d(t,"LABEL_THEME_COMPONENT_CAPTION",(function(){return o.LABEL_THEME_COMPONENT_CAPTION})),r.o(o,"LABEL_THEME_LIGHT")&&r.d(t,"LABEL_THEME_LIGHT",(function(){return o.LABEL_THEME_LIGHT})),r.o(o,"LABEL_THEME_SUBHEADING")&&r.d(t,"LABEL_THEME_SUBHEADING",(function(){return o.LABEL_THEME_SUBHEADING})),r.o(o,"LABEL_THEME_TITLE")&&r.d(t,"LABEL_THEME_TITLE",(function(){return o.LABEL_THEME_TITLE})),r.o(o,"LABEL_THEME_TITLE_BOLD")&&r.d(t,"LABEL_THEME_TITLE_BOLD",(function(){return o.LABEL_THEME_TITLE_BOLD})),r.o(o,"kvsComponentSelector")&&r.d(t,"kvsComponentSelector",(function(){return o.kvsComponentSelector}));var i=r(156);r.d(t,"LABEL_THEME_COMPONENT_CAPTION",(function(){return i.a})),r.d(t,"LABEL_THEME_LIGHT",(function(){return i.c})),r.d(t,"LABEL_THEME_SUBHEADING",(function(){return i.d})),r.d(t,"LABEL_THEME_TITLE",(function(){return i.e})),r.d(t,"LABEL_THEME_TITLE_BOLD",(function(){return i.f}))},function(e,t,r){"use strict";var n=r(455);r.d(t,"Button",(function(){return n.a}));var a=r(456);r.o(a,"BUTTON_THEME_ACCEPT")&&r.d(t,"BUTTON_THEME_ACCEPT",(function(){return a.BUTTON_THEME_ACCEPT})),r.o(a,"BUTTON_THEME_CANCEL")&&r.d(t,"BUTTON_THEME_CANCEL",(function(){return a.BUTTON_THEME_CANCEL})),r.o(a,"BUTTON_THEME_CLEAR_WITH_RED_TEXT")&&r.d(t,"BUTTON_THEME_CLEAR_WITH_RED_TEXT",(function(){return a.BUTTON_THEME_CLEAR_WITH_RED_TEXT})),r.o(a,"BUTTON_THEME_FIXED_BLUE")&&r.d(t,"BUTTON_THEME_FIXED_BLUE",(function(){return a.BUTTON_THEME_FIXED_BLUE})),r.o(a,"BUTTON_THEME_FIXED_RED")&&r.d(t,"BUTTON_THEME_FIXED_RED",(function(){return a.BUTTON_THEME_FIXED_RED})),r.o(a,"BUTTON_THEME_GLOBAL_ERROR")&&r.d(t,"BUTTON_THEME_GLOBAL_ERROR",(function(){return a.BUTTON_THEME_GLOBAL_ERROR})),r.o(a,"BUTTON_THEME_GLOBAL_MESSAGE")&&r.d(t,"BUTTON_THEME_GLOBAL_MESSAGE",(function(){return a.BUTTON_THEME_GLOBAL_MESSAGE})),r.o(a,"BUTTON_THEME_LARGE_BLUE")&&r.d(t,"BUTTON_THEME_LARGE_BLUE",(function(){return a.BUTTON_THEME_LARGE_BLUE})),r.o(a,"BUTTON_THEME_LARGE_GREEN")&&r.d(t,"BUTTON_THEME_LARGE_GREEN",(function(){return a.BUTTON_THEME_LARGE_GREEN})),r.o(a,"BUTTON_THEME_LARGE_GREY")&&r.d(t,"BUTTON_THEME_LARGE_GREY",(function(){return a.BUTTON_THEME_LARGE_GREY})),r.o(a,"ERROR_BUTTON_THEME")&&r.d(t,"ERROR_BUTTON_THEME",(function(){return a.ERROR_BUTTON_THEME})),r.o(a,"SOLID_BUTTON_THEME")&&r.d(t,"SOLID_BUTTON_THEME",(function(){return a.SOLID_BUTTON_THEME}));var o=r(213);r.d(t,"BUTTON_THEME_ACCEPT",(function(){return o.a})),r.d(t,"BUTTON_THEME_CANCEL",(function(){return o.b})),r.d(t,"BUTTON_THEME_CLEAR_WITH_RED_TEXT",(function(){return o.c})),r.d(t,"BUTTON_THEME_FIXED_BLUE",(function(){return o.d})),r.d(t,"BUTTON_THEME_FIXED_RED",(function(){return o.e})),r.d(t,"BUTTON_THEME_GLOBAL_ERROR",(function(){return o.f})),r.d(t,"BUTTON_THEME_GLOBAL_MESSAGE",(function(){return o.g})),r.d(t,"BUTTON_THEME_LARGE_BLUE",(function(){return o.h})),r.d(t,"BUTTON_THEME_LARGE_GREEN",(function(){return o.i})),r.d(t,"BUTTON_THEME_LARGE_GREY",(function(){return o.j})),r.d(t,"ERROR_BUTTON_THEME",(function(){return o.k})),r.d(t,"SOLID_BUTTON_THEME",(function(){return o.l}))},,,,function(e,t,r){"use strict";var n=r(207);r.d(t,"default",(function(){return n.default}))},function(e,t,r){"use strict";r.d(t,"a",(function(){return n})),r.d(t,"g",(function(){return i})),r.d(t,"f",(function(){return l})),r.d(t,"c",(function(){return c})),r.d(t,"b",(function(){return s})),r.d(t,"e",(function(){return f})),r.d(t,"d",(function(){return h}));var n,a=r(9),o=r.n(a);r(671);!function(e){e.Day="day",e.Week="week",e.Month="month",e.Quarter="quarter",e.Year="year"}(n||(n={}));function i(e){return o.a.tz(e,"YYYY-MM-DDTHH:mm",!1,o()().tz()||"Australia/Melbourne")}function l(e){return o.a.utc(e).tz(o()().tz()||"Australia/Melbourne")}function c(e,t){if(void 0===e)return"...";var r=l(e),a=l(t),o=d(r,n.Day),i=d(a,n.Day);return 0===s(o,i)?r.format("h:mm a z"):0===o.diff(i,n.Year)?r.format("D MMM, h:mm a z"):r.format("D MMM YYYY, h:mm a z")}function s(e,t){return Math.floor(t.diff(e,n.Day,!0))}function u(e,t){switch(t){case n.Day:return 0===e.hour()&&0===e.minute()&&0===e.second()&&0===e.millisecond();case n.Week:return u(e,n.Day)&&1===e.day();case n.Month:return u(e,n.Day)&&1===e.date();case n.Quarter:var r=e.month();return u(e,n.Month)&&(0===r||3===r||6===r||9===r);case n.Year:return u(e,n.Day)&&1===e.dayOfYear()}return console.log("isStartOfInterval is missing case",t),!1}function d(e,t){switch(t){case n.Day:return e.clone().startOf(n.Day);case n.Week:return e.clone().startOf(n.Day).day(1);case n.Month:return e.clone().startOf(n.Month);case n.Quarter:var r=d(e,n.Month);return r=r.month(r.month()-r.month()%3);case n.Year:return e.clone().startOf(n.Year)}return console.log("getStartOfInterval is missing case",t),e}function p(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;switch(t){case n.Quarter:return e.clone().add(3*r,n.Month)}return e.clone().add(r,t)}function f(e,t){return u(e,t)?function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;return p(e,t,-r)}(e,t):d(e,t)}function h(e,t){return u(e,t)?p(e,t):p(d(e,t),t)}},,function(e,t,r){"use strict";var n=r(482);r.d(t,"Group",(function(){return n.a}));r(483),r(228)},,,function(e,t,r){"use strict";var n=r(13);r.d(t,"b",(function(){return n.b})),r.d(t,"a",(function(){return n.a}))},function(e,t,r){"use strict";r.d(t,"a",(function(){return c})),r.d(t,"h",(function(){return u})),r.d(t,"i",(function(){return d}));var n=r(12),a=r.n(n),o=r(64),i=r(59),l=r(55);function c(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"timestart",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"carparkname",n=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],o={$match:a()({},t,{$gte:new Date(e.start.toISOString()),$lt:new Date(e.end.toISOString())})};return e.carParks&&e.carParks.length>0?o.$match[r]={$in:e.carParks}:o.$match[r]=n?null:{$ne:null},o}r.d(t,"b",(function(){return l.a})),r.d(t,"c",(function(){return l.b})),r.d(t,"d",(function(){return l.c})),r.d(t,"e",(function(){return l.d})),r.d(t,"f",(function(){return l.f})),r.d(t,"g",(function(){return l.g}));var s=function(e){return o.e.includes(e)},u=function(e,t){return s(e)?t.filter((function(t){return t.state===e})).map((function(e){return e.name})):e!==i.a&&e!==i.b?[e]:void 0},d=function(e,t){if(s(e))return[e];if(e!==i.a&&e!==i.b){var r=t.find((function(t){return t.name===e}));return r?[r.state]:void 0}}},function(e,t,r){"use strict";var n=r(459);r.d(t,"Reducers",(function(){return n.a}));var a=r(215);r.d(t,"Actions",(function(){return a.a}));r(460)},,function(e,t,r){"use strict";r(216);var n=r(469);r.d(t,"ConnectedValueLabel",(function(){return n.a}));var a=r(470);r.o(a,"LABEL_THEME_TITLE")&&r.d(t,"LABEL_THEME_TITLE",(function(){return a.LABEL_THEME_TITLE})),r.o(a,"Label")&&r.d(t,"Label",(function(){return a.Label})),r.o(a,"VALUE_LABEL_THEME_HUGE_GREEN_CENTERED")&&r.d(t,"VALUE_LABEL_THEME_HUGE_GREEN_CENTERED",(function(){return a.VALUE_LABEL_THEME_HUGE_GREEN_CENTERED})),r.o(a,"VALUE_LABEL_THEME_HUGE_GREY_CENTERED")&&r.d(t,"VALUE_LABEL_THEME_HUGE_GREY_CENTERED",(function(){return a.VALUE_LABEL_THEME_HUGE_GREY_CENTERED})),r.o(a,"VALUE_LABEL_THEME_HUGE_ORANGE_CENTERED")&&r.d(t,"VALUE_LABEL_THEME_HUGE_ORANGE_CENTERED",(function(){return a.VALUE_LABEL_THEME_HUGE_ORANGE_CENTERED})),r.o(a,"VALUE_LABEL_THEME_HUGE_RED_CENTERED")&&r.d(t,"VALUE_LABEL_THEME_HUGE_RED_CENTERED",(function(){return a.VALUE_LABEL_THEME_HUGE_RED_CENTERED})),r.o(a,"VALUE_LABEL_THEME_LARGE")&&r.d(t,"VALUE_LABEL_THEME_LARGE",(function(){return a.VALUE_LABEL_THEME_LARGE})),r.o(a,"VALUE_LABEL_THEME_MEDIUM_CENTERED")&&r.d(t,"VALUE_LABEL_THEME_MEDIUM_CENTERED",(function(){return a.VALUE_LABEL_THEME_MEDIUM_CENTERED})),r.o(a,"VALUE_LABEL_THEME_ORANGE_CENTERED")&&r.d(t,"VALUE_LABEL_THEME_ORANGE_CENTERED",(function(){return a.VALUE_LABEL_THEME_ORANGE_CENTERED})),r.o(a,"kvsComponentSelector")&&r.d(t,"kvsComponentSelector",(function(){return a.kvsComponentSelector}));var o=r(147);r.d(t,"VALUE_LABEL_THEME_HUGE_GREEN_CENTERED",(function(){return o.b})),r.d(t,"VALUE_LABEL_THEME_HUGE_GREY_CENTERED",(function(){return o.c})),r.d(t,"VALUE_LABEL_THEME_HUGE_ORANGE_CENTERED",(function(){return o.d})),r.d(t,"VALUE_LABEL_THEME_HUGE_RED_CENTERED",(function(){return o.e})),r.d(t,"VALUE_LABEL_THEME_LARGE",(function(){return o.f})),r.d(t,"VALUE_LABEL_THEME_MEDIUM_CENTERED",(function(){return o.g})),r.d(t,"VALUE_LABEL_THEME_ORANGE_CENTERED",(function(){return o.h}))},function(e,t,r){"use strict";r.d(t,"c",(function(){return d})),r.d(t,"a",(function(){return l})),r.d(t,"b",(function(){return n}));var n,a=r(12),o=r.n(a),i=r(19),l={setFontsLoading:Object(i.createAction)("app/SET_FONTS_LOADING",(function(e){return function(t){return e(t)}})),setBusy:Object(i.createAction)("app/SET_BUSY",(function(e){return function(t){return e(t)}})),setGlobalMessage:Object(i.createAction)("app/SET_GLOBAL_MESSAGE",(function(e){return function(t){return e(t)}})),setError:Object(i.createAction)("app/SET_ERROR",(function(e){return function(t){return e(t)}}))};function c(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function s(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:u,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case Object(i.getType)(l.setFontsLoading):return s({},e,{fontsLoading:t.payload});case Object(i.getType)(l.setBusy):return s({},e,{busy:e.busy+(t.payload?1:-1)});case Object(i.getType)(l.setGlobalMessage):return s({},e,{globalMessage:t.payload?s({type:n.Info},t.payload):void 0});case Object(i.getType)(l.setError):return s({},e,{globalMessage:t.payload?s({type:n.Error},t.payload):void 0});default:return e}}},,,,function(e,t,r){"use strict";r.d(t,"a",(function(){return a}));var n=r(19),a={resetPassword:Object(n.createAsyncAction)("userAdmin/RESET_PASSWORD_REQUEST","userAdmin/RESET_PASSWORD_SUCCESS","userAdmin/RESET_PASSWORD_FAILURE")(),createUser:Object(n.createAsyncAction)("userAdmin/CREATE_USER_REQUEST","userAdmin/CREATE_USER_SUCCESS","userAdmin/CREATE_USER_FAILURE")(),updateUser:Object(n.createAsyncAction)("userAdmin/UPDATE_USER_REQUEST","userAdmin/UPDATE_USER_SUCCESS","userAdmin/UPDATE_USER_FAILURE")(),deleteUser:Object(n.createAsyncAction)("userAdmin/DELETE_USER_REQUEST","userAdmin/DELETE_USER_SUCCESS","userAdmin/DELETE_USER_FAILURE")(),getUsers:Object(n.createAsyncAction)("userAdmin/GET_USERS_REQUEST","userAdmin/GET_USERS_SUCCESS","userAdmin/GET_USERS_FAILURE")(),editUser:Object(n.createStandardAction)("userAdmin/EDIT_USER")()}},,function(e,t,r){"use strict";r.d(t,"c",(function(){return u})),r.d(t,"a",(function(){return i})),r.d(t,"e",(function(){return d.b})),r.d(t,"d",(function(){return d.a})),r.d(t,"b",(function(){return E}));var n=r(12),a=r.n(n),o=r(19),i={setFirebaseLoading:Object(o.createStandardAction)("user/SET_FIREBASE_LOADING")(),setLoggedOut:Object(o.createStandardAction)("user/SET_LOGGED_OUT")(),signUp:Object(o.createAsyncAction)("user/SIGNUP_REQUEST","user/SIGNUP_SUCCESS","user/SIGNUP_FAILURE")(),login:Object(o.createAsyncAction)("user/LOGIN_REQUEST","user/LOGIN_SUCCESS","user/LOGIN_FAILURE")(),federatedLogin:Object(o.createAsyncAction)("user/FEDERATED_LOGIN_REQUEST","user/FEDERATED_LOGIN_SUCCESS","user/FEDERATED_LOGIN_FAILURE")(),checkPermissions:Object(o.createAsyncAction)("user/CHECK_PERMISSIONS_REQUEST","user/CHECK_PERMISSIONS_SUCCESS","user/CHECK_PERMISSIONS_FAILURE")(),setError:Object(o.createStandardAction)("user/SET_ERROR")()};function l(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function c(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:s,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case Object(o.getType)(i.setFirebaseLoading):return c({},e,{firebaseLoading:t.payload});case Object(o.getType)(i.setLoggedOut):return c({},e,{userDetails:void 0});case Object(o.getType)(i.signUp.request):case Object(o.getType)(i.login.request):case Object(o.getType)(i.federatedLogin.request):return c({},e,{updating:!0});case Object(o.getType)(i.signUp.success):case Object(o.getType)(i.login.success):case Object(o.getType)(i.federatedLogin.success):return c({},e,{updating:!1});case Object(o.getType)(i.signUp.failure):case Object(o.getType)(i.login.failure):case Object(o.getType)(i.federatedLogin.failure):return c({},e,{updating:!1,error:t.payload});case Object(o.getType)(i.checkPermissions.request):return c({},e,{updating:!0});case Object(o.getType)(i.checkPermissions.success):return c({},e,{updating:!1,userDetails:t.payload,error:void 0});case Object(o.getType)(i.checkPermissions.failure):return c({},e,{updating:!1,error:t.payload});case Object(o.getType)(i.setError):return c({},e,{error:t.payload});default:return e}},d=r(60),p=r(17),f=r.n(p),h=r(63),m=r.n(h),y=r(93),g=r(75),b=r(77),A=r(114),E=[Object(b.b)(i.signUp.request,(function(e){return m.a.auth().createUserWithEmailAndPassword(e.email,e.password).then((function(e){return i.signUp.success()})).catch((function(e){return i.signUp.failure(Object(d.c)(d.a.BadCredentials,e.message))}))})),Object(b.b)(i.login.request,(function(e){return m.a.auth().signInWithEmailAndPassword(e.email,e.password).then((function(e){return i.login.success()})).catch((function(e){return i.login.failure(Object(d.c)(d.a.BadCredentials,e.message))}))})),Object(b.b)(i.federatedLogin.request,(function(){var e=new m.a.auth.GoogleAuthProvider;return m.a.auth().signInWithPopup(e).then((function(e){return i.federatedLogin.success()})).catch((function(e){return i.federatedLogin.failure(Object(d.c)(d.a.BadCredentials,e.message))}))})),Object(b.b)(i.checkPermissions.request,(function(){return y.QueryService.checkPermission().then((function(e){return i.checkPermissions.success(function(e,t){if(e){var r=t&&t.role?t.role:d.b.viewer;return{displayName:e.displayName||e.email||"Unknown user",role:r}}return{displayName:"Unknown User",role:d.b.inactive}}(m.a.auth().currentUser,e))})).catch((function(e){var t,r;return f.a.async((function(n){for(;;)switch(n.prev=n.next){case 0:if(t=m.a.auth().currentUser,!(r=t&&!t.emailVerified)){n.next=5;break}return n.next=5,f.a.awrap(null==t?void 0:t.sendEmailVerification().catch((function(e){})));case 5:return n.next=7,f.a.awrap(m.a.auth().signOut());case 7:return n.abrupt("return",i.checkPermissions.failure(Object(d.c)(r?d.a.EmailUnverified:d.a.NoPermission,e.message,t&&t.email?t.email:void 0)));case 8:case"end":return n.stop()}}),null,null,null,Promise)}))})),Object(b.a)(i.setLoggedOut,(function(){return g.Actions.setMenuItem(A.b)}))]},function(e,t,r){"use strict";r.d(t,"b",(function(){return S})),r.d(t,"a",(function(){return k}));var n=r(107),a=r(741),o=r(219),i=r(285),l=r(57),c=r.n(l),s=r(742),u=r(39),d=r(75),p=r(64),f=r(45),h=r(101),m=r(36),y=r(111),g=r(197),b=r(18),A=Object(n.c)({global:u.c,menu:d.Reducers,timeZone:p.c,user:f.c,userAdmin:h.Reducers,data:y.DataReducers,kdsData:m.Reducers,kvsComponent:b.KVSComponentReducers}),E=s.a.apply(void 0,c()(f.b).concat(c()(h.Epics),c()(g.b))),v={key:"root",storage:o.a,whitelist:[]},S=function(e){var t=[],r=Object(a.a)();t.push(r);var o=[];o.push(n.a.apply(void 0,t));var i=n.d,l=Object(n.e)(e,i.apply(void 0,o));return r.run(E),l}(Object(i.a)(v,A)),k=Object(i.b)(S)},,function(e,t,r){"use strict";r.d(t,"b",(function(){return a})),r.d(t,"a",(function(){return n}));var n,a=0;!function(e){e.Line="Line graph",e.LayeredLine="Layered line graph",e.LayeredArea="Layered area graph",e.StackedLine="Stacked line graph",e.StackedLinePercentage="Stacked line percentage graph",e.StackedArea="Stacked area graph",e.StackedAreaPercentage="Stacked area percentage graph"}(n||(n={}))},function(e,t,r){"use strict";r.d(t,"a",(function(){return a})),r.d(t,"b",(function(){return o}));var n=r(32);function a(e,t){return e.format("YYYY-MM-DD")+" to "+t.format("YYYY-MM-DD")}function o(e,t,r){if(void 0===r)return!1;var a=Object(n.d)((function(t){return e(t).dataStampData[r]}));return void 0===t||a!==t.dataStamp}},,,,,function(e,t,r){"use strict";r.d(t,"b",(function(){return b})),r.d(t,"a",(function(){return g}));var n=r(6),a=r.n(n),o=r(27),i=r.n(o),l=r(0),c=r.n(l),s=r(106),u=r.n(s),d=r(66),p=r(2),f=r(5),h=r(24),m=r(4),y=r(1),g={titleStyle:[y.b.grey.bodyL.bold,{alignSelf:"center"}],messageStyle:[y.b.grey.bodyM.regular,{alignSelf:"center"}],dialogContainerStyle:{alignSelf:"center",borderWidth:1,borderColor:y.a.grey,backgroundColor:y.a.white,borderRadius:5,padding:10,paddingHorizontal:20,minWidth:250},modalStyle:{backgroundColor:"rgba(192, 192, 192, 0.75)"}};function b(e){var t=e.buttons,r=void 0===t?[]:t,n=e.theme,o=void 0===n?g:n,s=Object(l.useState)(e.show),y=i()(s,2),b=y[0],A=y[1];Object(l.useEffect)((function(){return A(e.show)}));return c.a.createElement(u.a,{animationType:"fade",transparent:!0,supportedOrientations:["landscape"],visible:b,ariaHideApp:!1,onRequestClose:void 0},c.a.createElement(d.a,{onPress:function(){A(!1),e.onClose&&e.onClose()}},c.a.createElement(p.a,{style:[{flex:1},o.modalStyle]})),c.a.createElement(p.a,{style:{position:"absolute",height:"100%",width:"100%",flex:1,justifyContent:"space-around"},pointerEvents:"box-none"},c.a.createElement(p.a,{style:o.dialogContainerStyle},c.a.createElement(f.a,{style:o.titleStyle},e.title),c.a.createElement(m.a.Spacer,null),e.message&&c.a.createElement(f.a,{style:o.messageStyle},e.message),e.children&&c.a.createElement(c.a.Fragment,null,e.children),c.a.createElement(m.a.SpacerDouble,null),c.a.createElement(p.a,{style:{flexDirection:"row",alignItems:"center",justifyContent:"center"}},r.map((function(e,t){return c.a.createElement(c.a.Fragment,null,c.a.createElement(h.Button,a()({key:t},e)),t!==r.length-1&&c.a.createElement(m.a.Spacer,null))}))),c.a.createElement(m.a.Spacer,null))))}var A=b;t.c=A},function(e,t,r){"use strict";r.d(t,"c",(function(){return l})),r.d(t,"a",(function(){return c})),r.d(t,"h",(function(){return s})),r.d(t,"e",(function(){return u})),r.d(t,"b",(function(){return d})),r.d(t,"g",(function(){return p})),r.d(t,"d",(function(){return f})),r.d(t,"f",(function(){return h}));var n=r(12),a=r.n(n);function o(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function i(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:"date",r={$match:a()({},t,{$gte:new Date(e.start.toISOString()),$lt:new Date(e.end.toISOString())})};return r}function c(e){return{$match:a()({},e.field,{$in:e.values})}}function s(e){return e?{$match:a()({},e.filterKey,{$in:e.values})}:{$match:{}}}function u(e){return e?{$match:a()({},e.filterKey,{$in:e.values})}:{$match:{}}}function d(e){var t={};e.firstOutputs&&e.firstOutputs.forEach((function(e){t[e]={$first:"$"+e}})),e.sumOutputs&&e.sumOutputs.forEach((function(e){t[e]={$sum:"$"+e}})),e.addCount&&(t[e.addCount]={$sum:1});var r=e.fields.map((function(e){return{$toString:"$"+e}}));return{$group:i({_id:1==r.length?r[0]:{$concat:r}},t)}}function p(e){return{$sort:a()({},e.field,e.ascendingOrder?1:-1)}}function f(e){return{$limit:e.limit}}function h(e){var t={};return e.outputs&&e.outputs.forEach((function(e){t[e]=!0})),e.projectOutputs&&e.projectOutputs.forEach((function(e){t[e.to]="$"+e.from})),{$project:i({_id:!1},t)}}},,,function(e,t,r){"use strict";r(234);var n=r(512);r.d(t,"ConnectedDataTable",(function(){return n.a}));var a=r(205);r.o(a,"DATA_TABLE_THEME_DEFAULT")&&r.d(t,"DATA_TABLE_THEME_DEFAULT",(function(){return a.DATA_TABLE_THEME_DEFAULT})),r.o(a,"DATA_TABLE_THEME_DOUBLE_ROWS")&&r.d(t,"DATA_TABLE_THEME_DOUBLE_ROWS",(function(){return a.DATA_TABLE_THEME_DOUBLE_ROWS}));var o=r(157);r.d(t,"DATA_TABLE_THEME_DEFAULT",(function(){return o.a})),r.d(t,"DATA_TABLE_THEME_DOUBLE_ROWS",(function(){return o.b}))},function(e,t,r){"use strict";r.d(t,"a",(function(){return n})),r.d(t,"b",(function(){return a})),r.d(t,"c",(function(){return o}));var n="All "+r(13).b.strings.car_parks,a="All states",o=[{name:"Sydney",state:"NSW",latitude:-33.8688,longitude:151.2093},{name:"Melbourne",state:"VIC",latitude:-37.8136,longitude:144.9631},{name:"Brisbane",state:"QLD",latitude:-27.4698,longitude:153.0251},{name:"Perth",state:"WA",latitude:-31.9505,longitude:115.8605},{name:"Adelaide",state:"SA",latitude:-34.9285,longitude:138.6007}]},function(e,t,r){"use strict";var n,a;function o(e,t,r){return{code:e,message:t,email:r}}r.d(t,"b",(function(){return n})),r.d(t,"a",(function(){return a})),r.d(t,"c",(function(){return o})),function(e){e.administrator="administrator",e.editor="editor",e.viewer="viewer",e.updateRequired="update required",e.inactive="inactive"}(n||(n={})),function(e){e.BadCredentials="Bad Credentials",e.EmailUnverified="Email Unverified",e.NoPermission="No Permission"}(a||(a={}))},,,,function(e,t,r){"use strict";r.d(t,"c",(function(){return d})),r.d(t,"a",(function(){return i})),r.d(t,"d",(function(){return f})),r.d(t,"b",(function(){return s})),r.d(t,"e",(function(){return m})),r.d(t,"f",(function(){return y})),r.d(t,"g",(function(){return g}));var n=r(12),a=r.n(n),o=r(19),i={setTimeZoneState:Object(o.createStandardAction)("timeZone/SET_TIME_ZONE_STATE")()};function l(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function c(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:u,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case Object(o.getType)(i.setTimeZoneState):return c({},e,{timeZoneState:t.payload});default:return e}},p=r(162),f={timeZoneState:Object(p.createSelector)((function(e){return e.timeZone}),(function(e){return e.timeZoneState}))};!function(e){e.ACT="ACT",e.NSW="NSW",e.NT="NT",e.QLD="QLD",e.SA="SA",e.TAS="TAS",e.VIC="VIC",e.WA="WA"}(s||(s={}));var h,m=Object.keys(s);function y(e){return"Australia/"+function(e){switch(e){case s.ACT:return h.Canberra;case s.NSW:return h.Sydney;case s.NT:return h.Darwin;case s.QLD:return h.Brisbane;case s.SA:return h.Adelaide;case s.TAS:return h.Hobart;case s.VIC:return h.Melbourne;case s.WA:return h.Perth}return"Unknown"}(e)}function g(e){switch(e){case"Australian Capital Territory":return s.ACT;case"New South Wales":return s.NSW;case"Northern Territory":return s.NT;case"Queensland":return s.QLD;case"South Australia":return s.SA;case"Tasmania":return s.TAS;case"Victoria":return s.VIC;case"Western Australia":return s.WA}return"Unknown"}!function(e){e.Canberra="Canberra",e.Sydney="Sydney",e.Darwin="Darwin",e.Brisbane="Brisbane",e.Adelaide="Adelaide",e.Hobart="Hobart",e.Melbourne="Melbourne",e.Perth="Perth"}(h||(h={}))},,,function(e,t,r){"use strict";r.d(t,"c",(function(){return a})),r.d(t,"a",(function(){return o})),r.d(t,"b",(function(){return i}));var n=r(125);function a(e,t){return e.replace("rgb","rgba").replace(")",", "+t+")")}function o(e){return n.e(n.a).domain([0,Math.max(e,1)])}function i(e,t){return n.e(n.b).domain([t,e])}},,,,,function(e,t,r){"use strict";var n=r(513);r.d(t,"PickerBox",(function(){return n.a}));var a=r(478);r.o(a,"PICKER_BOX_THEME_SLIM")&&r.d(t,"PICKER_BOX_THEME_SLIM",(function(){return a.PICKER_BOX_THEME_SLIM}));var o=r(225);r.d(t,"PICKER_BOX_THEME_SLIM",(function(){return o.b}))},function(e,t,r){"use strict";r.d(t,"e",(function(){return n})),r.d(t,"a",(function(){return a})),r.d(t,"b",(function(){return o})),r.d(t,"d",(function(){return i})),r.d(t,"h",(function(){return l})),r.d(t,"g",(function(){return c})),r.d(t,"c",(function(){return s})),r.d(t,"f",(function(){return u})),r.d(t,"i",(function(){return d}));var n={};r.r(n),r.d(n,"publicHolidays",(function(){return f})),r.d(n,"schoolHolidays",(function(){return h}));var a={};r.r(a),r.d(a,"newRequest",(function(){return A}));var o={};r.r(o),r.d(o,"newRequest",(function(){return v})),r.d(o,"createProjection",(function(){return S}));var i={};r.r(i),r.d(i,"getTopGroups",(function(){return R})),r.d(i,"newRequest",(function(){return C}));var l={};r.r(l),r.d(l,"newRequest",(function(){return P}));var c={};r.r(c),r.d(c,"newRequest",(function(){return w}));var s={};r.r(s),r.d(s,"newRequest",(function(){return I}));var u={};r.r(u),r.d(u,"newRequest",(function(){return L}));var d={};r.r(d),r.d(d,"newRequestPipeline",(function(){return H}));var p=r(55);function f(e,t){return{database:e,collection:"public_holidays",operation:"aggregate",query:{pipeline:m(t)}}}function h(e,t){return{database:e,collection:"school_holidays",operation:"aggregate",query:{pipeline:y(t)}}}function m(e){return[g(e),{$group:{_id:{$concat:[{$dateToString:{date:"$date"}},{$trim:{input:"$holiday_name"}}]},date:{$first:"$date"},name:{$first:"$holiday_name"},states:{$push:"$region_code"}}},{$group:{_id:"$date",description:{$push:{name:{$trim:{input:"$name"}},states:b("$states")}}}},{$project:{_id:!1,date:"$_id",description:{$reduce:{input:"$description",initialValue:"",in:{$concat:["$$value",{$concat:["$$this.name"," ","$$this.states"]},{$cond:[{$eq:["$$this",{$arrayElemAt:["$description",-1]}]},"",", "]}]}}}}},{$sort:{date:1}}]}function y(e){return[g(e),{$group:{_id:"$date",states:{$push:"$region_code"}}},{$project:{_id:!1,date:"$_id",description:{$concat:["School holiday ",b("$states")]}}},{$sort:{date:1}}]}function g(e){var t=p.c(e);return e.states&&(t.$match.region_code={$in:e.states}),t}function b(e){return{$cond:[{$eq:[{$size:e},8]},"(ALL)",{$reduce:{input:e,initialValue:"(",in:{$concat:["$$value","$$this",{$cond:[{$eq:["$$this",{$arrayElemAt:[e,-1]}]},")",", "]}]}}}]}}function A(e,t){return{database:e,collection:t.collectionKey,operation:"aggregate",query:{pipeline:E(t)}}}function E(e){return[p.c(e),{$project:{_id:!1,date:"$"+(e.dateKey||"date"),description:"$"+(e.descriptionKey||"description")}},{$sort:{date:1}}]}function v(e,t){return{database:e,collection:t.collectionKey,operation:"aggregate",query:{options:{allowDiskUse:!0},pipeline:k(t)}}}function S(e){var t={_id:!1,date:e.dateKey},r=e.multiValueKeys,n=void 0===r?[]:r,a=e.multiCountKeys,o=void 0===a?[]:a;if(n.length>0||o.length>0){if(n.length>0){if(o.length>0&&o.length!=n.length)throw new Error("Mismatched length of multiCountKeys and multiValueKeys");n.forEach((function(e){t[e]="$"+e}))}if(o.length>0){if(n.length>0&&n.length!=o.length)throw new Error("Mismatched length of multiCountKeys and multiValueKeys");o.forEach((function(e){t[e]="$"+e}))}}else t.value=e.valueKey?e.valueKey:1,t.count=e.countKey?e.countKey:1;return e.extraKeys&&e.extraKeys.length>0&&e.extraKeys.forEach((function(e){t[e]="$"+e})),t}function k(e){var t=[{$project:S(e)}];return e.filter&&t.unshift(p.a(e.filter)),t}var T=r(9),O=r.n(T);function R(e,t){var r=null!=t?t:{},n=r.count,a=r.group,o=void 0===a?"group":a,i=r.start,l=r.end,c=[];null==e||e.forEach((function(e){if(function(e,t,r){var n=O()(e.date);return!(null==n||!n.isValid())&&(null!=t&&null!=r?n.isSameOrAfter(t,"days")&&n.isSameOrBefore(r,"days"):null!=t?n.isSameOrAfter(t,"days"):null==r||n.isSameOrBefore(r,"days"))}(e,i,l)){var t=e[o];if(t){var r=c.find((function(e){return e.group===t}));r?r.value+=e.value:c.push({group:t,value:e.value})}}})),c.sort((function(e,t){return e.value0?{$match:B({},t.$match,{category:{$in:e.categories}})}:t}function L(e,t){return{database:e,collection:t.collectionKey,operation:"aggregate",query:{options:{allowDiskUse:!0},pipeline:F(t)}}}function F(e){return[p.c(e,e.dateKey),p.h(e.stringFilter),p.e(e.numberFilter),{$project:{_id:!1,date:"$"+(e.dateKey||"date"),value:"$value",latitude:"$latitude",longitude:"$longitude"}},{$sort:{date:1}}]}var W=r(160);function H(e){return{database:e.database||W.a.defaultDatabase||"NO_DATABASE_DEFINED",collection:e.collection,operation:"aggregate",query:{options:{allowDiskUse:!0},pipeline:e.pipeline}}}},,function(e,t,r){"use strict";var n=r(316);r.d(t,"Reducers",(function(){return n.a}));var a=r(136);r.d(t,"Actions",(function(){return a.a}));r(317)},function(e,t,r){"use strict";var n=r(457);r.d(t,"CheckBox",(function(){return n.a}));var a=r(458);r.o(a,"CHECK_BOX_THEME_NO_BORDER")&&r.d(t,"CHECK_BOX_THEME_NO_BORDER",(function(){return a.CHECK_BOX_THEME_NO_BORDER})),r.o(a,"CHECK_BOX_THEME_RADIO")&&r.d(t,"CHECK_BOX_THEME_RADIO",(function(){return a.CHECK_BOX_THEME_RADIO}));var o=r(214);r.d(t,"CHECK_BOX_THEME_NO_BORDER",(function(){return o.b})),r.d(t,"CHECK_BOX_THEME_RADIO",(function(){return o.c}))},function(e,t,r){"use strict";r.d(t,"a",(function(){return c})),r.d(t,"b",(function(){return s}));var n=r(19),a=r(554),o=r(277),i=r(278),l=r(286);function c(e,t){return function(r,i){return r.pipe(Object(a.a)(Object(n.isActionOf)(e)),Object(o.a)((function(e){return t(e.payload,i)})))}}function s(e,t){return function(r,o){return r.pipe(Object(a.a)(Object(n.isActionOf)(e)),Object(i.a)((function(e){return Object(l.a)(t(e.payload,o))})))}}},,,function(e,t,r){"use strict";var n=r(52),a=r(84),o=r(142),i=a.a.get("window"),l=i.width,c=i.height,s="android"===n.a.OS,u="ios"===n.a.OS,d="web"===n.a.OS,p=a.a.get("screen"),f=Math.min(p.width,p.height,420)/360;function h(e){return Math.round(e*f)}var m={isAndroid:s,isIos:u,isWeb:d,screenWidth:l,screenHeight:c,screenScale:f,statusBarHeight:"android"===n.a.OS?o.a.statusBarHeight:0,tinyMargin:2.5,smallMargin:5,baseMargin:10,doubleBaseMargin:20,tripleBaseMargin:30,quadBaseMargin:40,sixBaseMargin:60,eightBaseMargin:80,icons:{tiny:h(15),small:h(20),mediumSmall:h(24),medium:h(28),large:h(36),huge:h(48),massive:h(96)},minPageWidth:700,maxDialogWidth:Math.min(.75*l,500),borderRadius:5,infoButtonSize:14,infoButtonPadding:5,invalidOpacity:.5,timing:{componentDebounce:200,componentThrottle:400}};t.a=m},function(e,t,r){"use strict";r.d(t,"e",(function(){return _.d})),r.d(t,"d",(function(){return n})),r.d(t,"c",(function(){return a})),r.d(t,"f",(function(){return o})),r.d(t,"h",(function(){return i})),r.d(t,"j",(function(){return l})),r.d(t,"k",(function(){return c})),r.d(t,"i",(function(){return s})),r.d(t,"b",(function(){return u})),r.d(t,"a",(function(){return d})),r.d(t,"l",(function(){return p})),r.d(t,"n",(function(){return f})),r.d(t,"g",(function(){return h})),r.d(t,"m",(function(){return m}));var n={};r.r(n),r.d(n,"newRequest",(function(){return g}));var a={};r.r(a),r.d(a,"newRequest",(function(){return v}));var o={};r.r(o),r.d(o,"byBookingCount",(function(){return k})),r.d(o,"byValue",(function(){return T}));var i={};r.r(i),r.d(i,"Category",(function(){return C})),r.d(i,"newRequest",(function(){return D}));var l={};r.r(l),r.d(l,"newRequest",(function(){return V}));var c={};r.r(c),r.d(c,"newRequest",(function(){return I}));var s={};r.r(s),r.d(s,"newRequest",(function(){return F}));var u={};r.r(u),r.d(u,"newRequest",(function(){return H}));var d={};r.r(d),r.d(d,"newRequest",(function(){return Q}));var p={};r.r(p),r.d(p,"newRequest",(function(){return z}));var f={};r.r(f),r.d(f,"newRequest",(function(){return K}));var h={};r.r(h),r.d(h,"newPromoCampaignStatRequest",(function(){return X}));var m={};r.r(m),r.d(m,"newRequest",(function(){return q}));var y=r(34);function g(e){return{database:y.b.dataService.database,collection:"bookings",operation:"aggregate",query:{options:{allowDiskUse:!0},pipeline:b(e)}}}function b(e){return[A(e),{$sort:{datetime:-1}},{$limit:e.limit||1e3},{$project:{_id:!1,datetime:!0,pseudoId:"$pseudoid",carPark:"$carparkname",product:!0,city:"$geocity",value:"$valueaud"}}]}function A(e){var t={$match:{datetime:{$gte:new Date(e.timeStart),$lt:new Date(e.timeEnd)},product:{$ne:null},geocity:{$ne:null}}};return e.carParks&&e.carParks.length>0&&(t.$match.carparkname={$in:e.carParks}),t}var E=r(35);function v(e){return{database:y.b.dataService.database,collection:"bookings_summary_daily",operation:"aggregate",query:{options:{allowDiskUse:!0},pipeline:S(e)}}}function S(e){return[E.a(e,"timestart","carparkname",!1),{$facet:{values:[{$group:{_id:"$carparkname",count:{$sum:"$totalbookings"}}},{$project:{_id:!1,k:"$_id",v:"$count"}}]}},{$replaceRoot:{newRoot:{$arrayToObject:"$values"}}}]}function k(e){return{database:y.b.dataService.database,collection:"daily_products_by_booking_count",operation:"aggregate",query:{pipeline:O(e)}}}function T(e){return{database:y.b.dataService.database,collection:"daily_products_by_booking_value",operation:"aggregate",query:{pipeline:O(e)}}}function O(e){var t=[{$facet:{products:[R(e),{$group:{_id:"$product",count:{$sum:"$count"}}},{$sort:{count:-1}},{$project:{_id:!1,name:"$_id"}}]}},{$project:{products:{$map:{input:"$products",in:"$$this.name"}}}}];return e.limit&&t[0].$facet.products.splice(3,0,{$limit:e.limit}),t}function R(e){var t={$match:{product:{$ne:null},date:{$gte:new Date(e.timeStart),$lt:new Date(e.timeEnd)}}};return e.carParks&&e.carParks.length>0&&(t.$match.carparkname={$in:e.carParks}),t}var C,U=r(130);function D(e){return{database:y.b.dataService.database,collection:e.bookingSource===U.BookingSource.App?"bookings_summary_daily":"bookings_web_summary_daily",operation:"aggregate",query:{options:{allowDiskUse:!0},pipeline:P(e)}}}function P(e){return[E.a(e),w(e),{$sort:{timeStart:1}}]}function w(e){var t=e.category&&e.category===C.UserType?"$valuesbyusertype":"$valuesbyproduct";return{$project:{_id:!1,carParkName:e.carParks&&1===e.carParks.length?e.carParks[0]:null,timeStart:"$timestart",timeEnd:"$timeend",totalValue:"$totalvalue",valuesByCategory:t}}}!function(e){e[e.Product=0]="Product",e[e.UserType=1]="UserType"}(C||(C={}));var M=r(57),x=r.n(M);function V(e){return{database:y.b.dataService.database,collection:e.bookingSource===U.BookingSource.App?"car_park_sales_daily_forecast":"web_bookings_daily_forecast",operation:"aggregate",query:{options:{allowDiskUse:!0},pipeline:j(e)}}}function j(e){return[B(e)].concat(x()(function(e){return[{$group:{_id:{$concat:[{$toString:{$year:"$timestamp"}},{$toString:{$month:"$timestamp"}},{$toString:{$dayOfMonth:"$timestamp"}}]},carparkname:e.carParks&&1===e.carParks.length?{$first:"$carParkName"}:{$first:null},timestamp:{$first:"$timestamp"},p10:{$sum:"$p10"},p50:{$sum:"$p50"},p90:{$sum:"$p90"}}}]}(e)),[{$sort:{timestamp:1}},{$project:{_id:!1,carParkName:"$carparkname",timeStart:{$dateToString:{date:"$timestamp"}},timeEnd:{$dateToString:{date:{$add:["$timestamp",864e5]}}},valueAudP10:"$p10",valueAudP50:"$p50",valueAudP90:"$p90"}}])}function B(e){var t={$match:{timestamp:{$gte:new Date(e.timeStart),$lt:new Date(e.timeEnd)}}};if(e.carParks&&e.carParks.length>0){var r=e.carParks.map((function(e){return e.toLowerCase()}));t.$match.carParkName={$in:r}}return t}function I(e){return{database:y.b.dataService.database,collection:"car_park_sales_daily_forecast",operation:"aggregate",query:{options:{allowDiskUse:!0},pipeline:L(e)}}}function N(e){return{$match:{carParkName:{$in:e.carParks.map((function(e){return e.toLowerCase()}))},timestamp:{$gte:new Date(e.timeStart),$lt:new Date(e.timeEnd)}}}}function J(e){var t={$project:{_id:!1,predictions:{$arrayToObject:"$predictions"}}};return"carPark"===e?t.$project.carParkName="$_id":(t.$project.timeStart={$dateToString:{date:"$timestamp"}},t.$project.timeEnd={$dateToString:{date:{$add:["$timestamp",864e5]}}}),t}function L(e){var t,r={$sort:{}};return"date"===e.grouping?r.$sort.timeStart=1:r.$sort.carParkName=1,[N(e)].concat(x()([{$group:{_id:{$concat:["$carParkName",{$dateToString:{date:"$timestamp"}}]},carparkname:{$first:"$carParkName"},timestamp:{$first:"$timestamp"},p10:{$first:"$p10"},p50:{$first:"$p50"},p90:{$first:"$p90"}}},{$group:{_id:"carPark"===(t=e.grouping)?"$carparkname":{$dateToString:{date:"$timestamp"}},timestamp:{$first:"$timestamp"},predictions:{$push:{k:"carPark"===t?{$dateToString:{date:"$timestamp"}}:"$carparkname",v:{valueAudP10:"$p10",valueAudP50:"$p50",valueAudP90:"$p90"}}}}}]),[J(e.grouping),r])}function F(e){return{database:y.b.dataService.database,collection:"bookings_summary_daily",operation:"aggregate",query:{options:{allowDiskUse:!0},pipeline:W(e)}}}function W(e){return[E.a(e,"timestart","carparkname",!1),{$facet:{values:[{$group:{_id:"$carparkname",value:{$sum:"$totalvalue"}}},{$project:{_id:!1,k:"$_id",v:{$floor:"$value"}}}]}},{$replaceRoot:{newRoot:{$arrayToObject:"$values"}}}]}function H(e){return{database:y.b.dataService.database,collection:"bookings",operation:"aggregate",query:{options:{allowDiskUse:!0},pipeline:Z(e)}}}function Z(e){return[E.a(e,"datetime","carparkname",!1),{$group:{_id:"$usertype",totalValue:{$sum:"$valueaud"},totalCount:{$sum:1}}},{$project:{_id:!1,userType:"$_id",average:{$divide:["$totalValue","$totalCount"]}}}]}function Q(e){return{database:y.b.dataService.database,collection:"bookings_screen_transactions_per_user",operation:"aggregate",query:{options:{allowDiskUse:!0},pipeline:G(e)}}}function G(e){return[E.d(e),{$group:{_id:"$category",transactionCount:{$sum:"$count"}}},{$group:{_id:null,userCount:{$sum:1},transactionCount:{$sum:"$transactionCount"}}},{$project:{_id:!1,value:{$divide:["$transactionCount","$userCount"]}}}]}function z(e){return{database:y.b.dataService.database,collection:"summary_screen_active_users",operation:"aggregate",query:{options:{allowDiskUse:!0},pipeline:Y(e)}}}function Y(e){return[E.d(e,"datetime"),E.c({fields:["category"],firstOutputs:["category"]}),E.c({fields:[],addCount:"value"})]}function K(){return{database:y.b.dataService.database,collection:"summary_screen_all_time_users",operation:"aggregate",query:{options:{allowDiskUse:!0},pipeline:[E.g({field:"date"}),E.e({limit:1}),E.f({outputs:["value"]})]}}}function X(){return{database:y.b.dataService.database,collection:"promo_campaigns_stats",operation:"aggregate",query:{options:{allowDiskUse:!0},pipeline:[]}}}function q(){return{database:y.b.dataService.database,collection:"summary_screen_all_time_apple_apy",operation:"aggregate",query:{options:{allowDiskUse:!0},pipeline:[E.g({field:"date"}),E.e({limit:1}),E.f({outputs:["value"]})]}}}var _=r(73)},,function(e,t,r){"use strict";r.d(t,"d",(function(){return L})),r.d(t,"e",(function(){return D})),r.d(t,"c",(function(){return x})),r.d(t,"a",(function(){return V})),r.d(t,"b",(function(){return j}));var n=r(12),a=r.n(n),o=r(10),i=r.n(o),l=r(11),c=r.n(l),s=r(15),u=r.n(s),d=r(7),p=r.n(d),f=r(14),h=r.n(f),m=r(0),y=r.n(m),g=r(5),b=r(25),A=r(79),E=r(2),v=r(66),S=r(155),k=r(1),T=r(4),O=r(33),R=r(30),C=r(26);function U(e){var t=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=p()(e);if(t){var a=p()(this).constructor;r=Reflect.construct(n,arguments,a)}else r=n.apply(this,arguments);return u()(this,r)}}var D,P=function(e){h()(r,e);var t=U(r);function r(){return i()(this,r),t.apply(this,arguments)}return c()(r,[{key:"render",value:function(){var e=this.props,t=e.onPrevPress,r=e.onNextPress;return m.createElement(E.a,{style:w.container},m.createElement(R.a,{onPress:t},m.createElement(O.a,{source:k.c.arrowLeft,style:w.arrow})),m.createElement(R.a,{onPress:r},m.createElement(O.a,{source:k.c.arrowRight,style:w.arrow})))}}]),r}(m.PureComponent),w=C.a.create({container:{flexDirection:"row",alignItems:"center"},arrow:{width:k.d.icons.small,height:k.d.icons.small,margin:-k.d.tinyMargin,tintColor:k.a.highlight}});function M(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}!function(e){e[e.Horizontal=0]="Horizontal",e[e.Vertical=1]="Vertical"}(D||(D={}));var x={legendOrientation:D.Vertical,minWidth:100,alignItems:"flex-start",backgroundColor:k.a.controlBackground,borderColor:k.a.border,borderWidth:1,borderRadius:k.d.borderRadius,font:k.b.grey.bodyS.thin},V=function(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:{},r="/debug/pprof/",n=g.parse(r,!0),a=i()({method:"GET"},t),o={},l={};if(e&&e.apiKey){var c="function"===typeof e.apiKey?e.apiKey("X-API-Key"):e.apiKey;o["X-API-Key"]=c}return n.query=i()({},n.query,l,t.query),delete n.search,a.headers=i()({},o,t.headers),{url:g.format(n),options:a}},debugPprofProfileGet:function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(null===t||void 0===t)throw new k("profile","Required parameter profile was null or undefined when calling debugPprofProfileGet.");var n="/debug/pprof/{profile}".replace("{profile}",encodeURIComponent(String(t))),a=g.parse(n,!0),o=i()({method:"GET"},r),l={},c={};if(e&&e.apiKey){var s="function"===typeof e.apiKey?e.apiKey("X-API-Key"):e.apiKey;l["X-API-Key"]=s}return a.query=i()({},a.query,c,r.query),delete a.search,o.headers=i()({},l,r.headers),{url:g.format(a),options:o}}}},O=function(e){return{debugPprofGet:function(t){var r=T(e).debugPprofGet(t);return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return fetch(e+r.url,r.options).then((function(e){if(e.status>=200&&e.status<300)return e;throw e}))}},debugPprofProfileGet:function(t,r){var n=T(e).debugPprofProfileGet(t,r);return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return fetch(e+n.url,n.options).then((function(e){if(e.status>=200&&e.status<300)return e;throw e}))}}}},R=(function(e){p()(r,e);var t=b(r);function r(){return y()(this,r),t.apply(this,arguments)}a()(r,[{key:"debugPprofGet",value:function(e){return O(this.configuration).debugPprofGet(e)(this.basePath)}},{key:"debugPprofProfileGet",value:function(e,t){return O(this.configuration).debugPprofProfileGet(e,t)(this.basePath)}}])}(S),function(e){return{adminAllocatePack:function(t,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(null===t||void 0===t)throw new k("userId","Required parameter userId was null or undefined when calling adminAllocatePack.");if(null===r||void 0===r)throw new k("body","Required parameter body was null or undefined when calling adminAllocatePack.");var a="/packs/admin/user/{userId}/pack".replace("{userId}",encodeURIComponent(String(t))),o=g.parse(a,!0),l=i()({method:"POST"},n),c={},s={};if(e&&e.apiKey){var u="function"===typeof e.apiKey?e.apiKey("Authorization"):e.apiKey;c.Authorization=u}c["Content-Type"]="application/json",o.query=i()({},o.query,s,n.query),delete o.search,l.headers=i()({},c,n.headers);var d=!0;return l.body=d?JSON.stringify(r||{}):r||"",{url:g.format(o),options:l}},adminAllocatePackCode:function(t,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(null===t||void 0===t)throw new k("userId","Required parameter userId was null or undefined when calling adminAllocatePackCode.");if(null===r||void 0===r)throw new k("packId","Required parameter packId was null or undefined when calling adminAllocatePackCode.");var a="/packs/admin/user/{userId}/pack/{packId}/code".replace("{userId}",encodeURIComponent(String(t))).replace("{packId}",encodeURIComponent(String(r))),o=g.parse(a,!0),l=i()({method:"POST"},n),c={},s={};if(e&&e.apiKey){var u="function"===typeof e.apiKey?e.apiKey("Authorization"):e.apiKey;c.Authorization=u}return o.query=i()({},o.query,s,n.query),delete o.search,l.headers=i()({},c,n.headers),{url:g.format(o),options:l}},adminDeleteUserPack:function(t,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(null===t||void 0===t)throw new k("userId","Required parameter userId was null or undefined when calling adminDeleteUserPack.");if(null===r||void 0===r)throw new k("packId","Required parameter packId was null or undefined when calling adminDeleteUserPack.");var a="/packs/admin/user/{userId}/packs/{packId}".replace("{userId}",encodeURIComponent(String(t))).replace("{packId}",encodeURIComponent(String(r))),o=g.parse(a,!0),l=i()({method:"DELETE"},n),c={},s={};if(e&&e.apiKey){var u="function"===typeof e.apiKey?e.apiKey("Authorization"):e.apiKey;c.Authorization=u}return o.query=i()({},o.query,s,n.query),delete o.search,l.headers=i()({},c,n.headers),{url:g.format(o),options:l}},adminFixInvalidPass:function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(null===t||void 0===t)throw new k("body","Required parameter body was null or undefined when calling adminFixInvalidPass.");var n="/packs/admin/fix-invalid-pass",a=g.parse(n,!0),o=i()({method:"POST"},r),l={},c={};if(e&&e.apiKey){var s="function"===typeof e.apiKey?e.apiKey("Authorization"):e.apiKey;l.Authorization=s}l["Content-Type"]="application/json",a.query=i()({},a.query,c,r.query),delete a.search,o.headers=i()({},l,r.headers);var u=!0;return o.body=u?JSON.stringify(t||{}):t||"",{url:g.format(a),options:o}},adminGetProducts:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r="/packs/admin/products",n=g.parse(r,!0),a=i()({method:"GET"},t),o={},l={};if(e&&e.apiKey){var c="function"===typeof e.apiKey?e.apiKey("Authorization"):e.apiKey;o.Authorization=c}return n.query=i()({},n.query,l,t.query),delete n.search,a.headers=i()({},o,t.headers),{url:g.format(n),options:a}},adminGetUserPacks:function(t,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(null===t||void 0===t)throw new k("userId","Required parameter userId was null or undefined when calling adminGetUserPacks.");var a="/packs/admin/user/{userId}/packs".replace("{userId}",encodeURIComponent(String(t))),o=g.parse(a,!0),l=i()({method:"GET"},n),c={},s={};if(e&&e.apiKey){var u="function"===typeof e.apiKey?e.apiKey("Authorization"):e.apiKey;c.Authorization=u}return void 0!==r&&(s.type=r),o.query=i()({},o.query,s,n.query),delete o.search,l.headers=i()({},c,n.headers),{url:g.format(o),options:l}},adminUpdateProducts:function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(null===t||void 0===t)throw new k("body","Required parameter body was null or undefined when calling adminUpdateProducts.");var n="/packs/admin/products",a=g.parse(n,!0),o=i()({method:"PUT"},r),l={},c={};if(e&&e.apiKey){var s="function"===typeof e.apiKey?e.apiKey("Authorization"):e.apiKey;l.Authorization=s}l["Content-Type"]="application/json",a.query=i()({},a.query,c,r.query),delete a.search,o.headers=i()({},l,r.headers);var u=!0;return o.body=u?JSON.stringify(t||{}):t||"",{url:g.format(a),options:o}},amendBooking:function(t,r,n){var a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};if(null===t||void 0===t)throw new k("Authorization","Required parameter Authorization was null or undefined when calling amendBooking.");if(null===r||void 0===r)throw new k("bookingNo","Required parameter bookingNo was null or undefined when calling amendBooking.");if(null===n||void 0===n)throw new k("body","Required parameter body was null or undefined when calling amendBooking.");var o="/packs/booking/{bookingNo}/amend".replace("{bookingNo}",encodeURIComponent(String(r))),l=g.parse(o,!0),c=i()({method:"POST"},a),s={},u={};if(e&&e.apiKey){var d="function"===typeof e.apiKey?e.apiKey("X-API-Key"):e.apiKey;s["X-API-Key"]=d}void 0!==t&&null!==t&&(s.Authorization=String(t)),s["Content-Type"]="application/json",l.query=i()({},l.query,u,a.query),delete l.search,c.headers=i()({},s,a.headers);var p=!0;return c.body=p?JSON.stringify(n||{}):n||"",{url:g.format(l),options:c}},amendBookingCode:function(t,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(null===t||void 0===t)throw new k("Authorization","Required parameter Authorization was null or undefined when calling amendBookingCode.");if(null===r||void 0===r)throw new k("bookingNo","Required parameter bookingNo was null or undefined when calling amendBookingCode.");var a="/packs/booking/{bookingNo}/amendment-code".replace("{bookingNo}",encodeURIComponent(String(r))),o=g.parse(a,!0),l=i()({method:"GET"},n),c={},s={};if(e&&e.apiKey){var u="function"===typeof e.apiKey?e.apiKey("X-API-Key"):e.apiKey;c["X-API-Key"]=u}return void 0!==t&&null!==t&&(c.Authorization=String(t)),o.query=i()({},o.query,s,n.query),delete o.search,l.headers=i()({},c,n.headers),{url:g.format(o),options:l}},bookingInfo:function(t,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(null===t||void 0===t)throw new k("Authorization","Required parameter Authorization was null or undefined when calling bookingInfo.");if(null===r||void 0===r)throw new k("bookingNo","Required parameter bookingNo was null or undefined when calling bookingInfo.");var a="/packs/booking/{bookingNo}".replace("{bookingNo}",encodeURIComponent(String(r))),o=g.parse(a,!0),l=i()({method:"GET"},n),c={},s={};if(e&&e.apiKey){var u="function"===typeof e.apiKey?e.apiKey("X-API-Key"):e.apiKey;c["X-API-Key"]=u}return void 0!==t&&null!==t&&(c.Authorization=String(t)),o.query=i()({},o.query,s,n.query),delete o.search,l.headers=i()({},c,n.headers),{url:g.format(o),options:l}},cancelBooking:function(t,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(null===t||void 0===t)throw new k("Authorization","Required parameter Authorization was null or undefined when calling cancelBooking.");if(null===r||void 0===r)throw new k("bookingNo","Required parameter bookingNo was null or undefined when calling cancelBooking.");var a="/packs/booking/{bookingNo}/cancel".replace("{bookingNo}",encodeURIComponent(String(r))),o=g.parse(a,!0),l=i()({method:"POST"},n),c={},s={};if(e&&e.apiKey){var u="function"===typeof e.apiKey?e.apiKey("X-API-Key"):e.apiKey;c["X-API-Key"]=u}return void 0!==t&&null!==t&&(c.Authorization=String(t)),o.query=i()({},o.query,s,n.query),delete o.search,l.headers=i()({},c,n.headers),{url:g.format(o),options:l}},emailInvoice:function(t,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(null===t||void 0===t)throw new k("Authorization","Required parameter Authorization was null or undefined when calling emailInvoice.");if(null===r||void 0===r)throw new k("body","Required parameter body was null or undefined when calling emailInvoice.");var a="/packs/invoice",o=g.parse(a,!0),l=i()({method:"POST"},n),c={},s={};if(e&&e.apiKey){var u="function"===typeof e.apiKey?e.apiKey("X-API-Key"):e.apiKey;c["X-API-Key"]=u}void 0!==t&&null!==t&&(c.Authorization=String(t)),c["Content-Type"]="application/json",o.query=i()({},o.query,s,n.query),delete o.search,l.headers=i()({},c,n.headers);var d=!0;return l.body=d?JSON.stringify(r||{}):r||"",{url:g.format(o),options:l}},getActivePacks:function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(null===t||void 0===t)throw new k("Authorization","Required parameter Authorization was null or undefined when calling getActivePacks.");var n="/packs/active",a=g.parse(n,!0),o=i()({method:"GET"},r),l={},c={};if(e&&e.apiKey){var s="function"===typeof e.apiKey?e.apiKey("X-API-Key"):e.apiKey;l["X-API-Key"]=s}return void 0!==t&&null!==t&&(l.Authorization=String(t)),a.query=i()({},a.query,c,r.query),delete a.search,o.headers=i()({},l,r.headers),{url:g.format(a),options:o}},getPackCode:function(t,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(null===t||void 0===t)throw new k("Authorization","Required parameter Authorization was null or undefined when calling getPackCode.");if(null===r||void 0===r)throw new k("packId","Required parameter packId was null or undefined when calling getPackCode.");var a="/packs/code",o=g.parse(a,!0),l=i()({method:"GET"},n),c={},s={};if(e&&e.apiKey){var u="function"===typeof e.apiKey?e.apiKey("X-API-Key"):e.apiKey;c["X-API-Key"]=u}return void 0!==r&&(s.packId=r),void 0!==t&&null!==t&&(c.Authorization=String(t)),o.query=i()({},o.query,s,n.query),delete o.search,l.headers=i()({},c,n.headers),{url:g.format(o),options:l}},getPackProducts:function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(null===t||void 0===t)throw new k("sites","Required parameter sites was null or undefined when calling getPackProducts.");var n="/packs/products",a=g.parse(n,!0),o=i()({method:"GET"},r),l={},c={};if(e&&e.apiKey){var s="function"===typeof e.apiKey?e.apiKey("X-API-Key"):e.apiKey;l["X-API-Key"]=s}return t&&(c.sites=t.join(v)),a.query=i()({},a.query,c,r.query),delete a.search,o.headers=i()({},l,r.headers),{url:g.format(a),options:o}},getPacksHistory:function(t,r,n){var a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};if(null===t||void 0===t)throw new k("Authorization","Required parameter Authorization was null or undefined when calling getPacksHistory.");var o="/packs/history",l=g.parse(o,!0),c=i()({method:"GET"},a),s={},u={};if(e&&e.apiKey){var d="function"===typeof e.apiKey?e.apiKey("X-API-Key"):e.apiKey;s["X-API-Key"]=d}return void 0!==r&&(u.page=r),void 0!==n&&(u.pageSize=n),void 0!==t&&null!==t&&(s.Authorization=String(t)),l.query=i()({},l.query,u,a.query),delete l.search,c.headers=i()({},s,a.headers),{url:g.format(l),options:c}},purchasePack:function(t,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(null===t||void 0===t)throw new k("Authorization","Required parameter Authorization was null or undefined when calling purchasePack.");if(null===r||void 0===r)throw new k("body","Required parameter body was null or undefined when calling purchasePack.");var a="/packs/purchase",o=g.parse(a,!0),l=i()({method:"POST"},n),c={},s={};if(e&&e.apiKey){var u="function"===typeof e.apiKey?e.apiKey("X-API-Key"):e.apiKey;c["X-API-Key"]=u}void 0!==t&&null!==t&&(c.Authorization=String(t)),c["Content-Type"]="application/json",o.query=i()({},o.query,s,n.query),delete o.search,l.headers=i()({},c,n.headers);var d=!0;return l.body=d?JSON.stringify(r||{}):r||"",{url:g.format(o),options:l}},usePackPass:function(t,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(null===t||void 0===t)throw new k("Authorization","Required parameter Authorization was null or undefined when calling usePackPass.");if(null===r||void 0===r)throw new k("body","Required parameter body was null or undefined when calling usePackPass.");var a="/packs/usepass",o=g.parse(a,!0),l=i()({method:"POST"},n),c={},s={};if(e&&e.apiKey){var u="function"===typeof e.apiKey?e.apiKey("X-API-Key"):e.apiKey;c["X-API-Key"]=u}void 0!==t&&null!==t&&(c.Authorization=String(t)),c["Content-Type"]="application/json",o.query=i()({},o.query,s,n.query),delete o.search,l.headers=i()({},c,n.headers);var d=!0;return l.body=d?JSON.stringify(r||{}):r||"",{url:g.format(o),options:l}}}}),C=function(e){return{adminAllocatePack:function(t,r,n){var a=R(e).adminAllocatePack(t,r,n);return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return fetch(e+a.url,a.options).then((function(e){if(e.status>=200&&e.status<300)return e.json();throw e}))}},adminAllocatePackCode:function(t,r,n){var a=R(e).adminAllocatePackCode(t,r,n);return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return fetch(e+a.url,a.options).then((function(e){if(e.status>=200&&e.status<300)return e.json();throw e}))}},adminDeleteUserPack:function(t,r,n){var a=R(e).adminDeleteUserPack(t,r,n);return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return fetch(e+a.url,a.options).then((function(e){if(e.status>=200&&e.status<300)return e.json();throw e}))}},adminFixInvalidPass:function(t,r){var n=R(e).adminFixInvalidPass(t,r);return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return fetch(e+n.url,n.options).then((function(e){if(e.status>=200&&e.status<300)return e.json();throw e}))}},adminGetProducts:function(t){var r=R(e).adminGetProducts(t);return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return fetch(e+r.url,r.options).then((function(e){if(e.status>=200&&e.status<300)return e.json();throw e}))}},adminGetUserPacks:function(t,r,n){var a=R(e).adminGetUserPacks(t,r,n);return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return fetch(e+a.url,a.options).then((function(e){if(e.status>=200&&e.status<300)return e.json();throw e}))}},adminUpdateProducts:function(t,r){var n=R(e).adminUpdateProducts(t,r);return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return fetch(e+n.url,n.options).then((function(e){if(e.status>=200&&e.status<300)return e.json();throw e}))}},amendBooking:function(t,r,n,a){var o=R(e).amendBooking(t,r,n,a);return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return fetch(e+o.url,o.options).then((function(e){if(e.status>=200&&e.status<300)return e.json();throw e}))}},amendBookingCode:function(t,r,n){var a=R(e).amendBookingCode(t,r,n);return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return fetch(e+a.url,a.options).then((function(e){if(e.status>=200&&e.status<300)return e.json();throw e}))}},bookingInfo:function(t,r,n){var a=R(e).bookingInfo(t,r,n);return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return fetch(e+a.url,a.options).then((function(e){if(e.status>=200&&e.status<300)return e.json();throw e}))}},cancelBooking:function(t,r,n){var a=R(e).cancelBooking(t,r,n);return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return fetch(e+a.url,a.options).then((function(e){if(e.status>=200&&e.status<300)return e.json();throw e}))}},emailInvoice:function(t,r,n){var a=R(e).emailInvoice(t,r,n);return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return fetch(e+a.url,a.options).then((function(e){if(e.status>=200&&e.status<300)return e.json();throw e}))}},getActivePacks:function(t,r){var n=R(e).getActivePacks(t,r);return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return fetch(e+n.url,n.options).then((function(e){if(e.status>=200&&e.status<300)return e.json();throw e}))}},getPackCode:function(t,r,n){var a=R(e).getPackCode(t,r,n);return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return fetch(e+a.url,a.options).then((function(e){if(e.status>=200&&e.status<300)return e.json();throw e}))}},getPackProducts:function(t,r){var n=R(e).getPackProducts(t,r);return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return fetch(e+n.url,n.options).then((function(e){if(e.status>=200&&e.status<300)return e.json();throw e}))}},getPacksHistory:function(t,r,n,a){var o=R(e).getPacksHistory(t,r,n,a);return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return fetch(e+o.url,o.options).then((function(e){if(e.status>=200&&e.status<300)return e.json();throw e}))}},purchasePack:function(t,r,n){var a=R(e).purchasePack(t,r,n);return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return fetch(e+a.url,a.options).then((function(e){if(e.status>=200&&e.status<300)return e.json();throw e}))}},usePackPass:function(t,r,n){var a=R(e).usePackPass(t,r,n);return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return fetch(e+a.url,a.options).then((function(e){if(e.status>=200&&e.status<300)return e.json();throw e}))}}}},U=function(e){p()(r,e);var t=b(r);function r(){return y()(this,r),t.apply(this,arguments)}return a()(r,[{key:"adminAllocatePack",value:function(e,t,r){return C(this.configuration).adminAllocatePack(e,t,r)(this.basePath)}},{key:"adminAllocatePackCode",value:function(e,t,r){return C(this.configuration).adminAllocatePackCode(e,t,r)(this.basePath)}},{key:"adminDeleteUserPack",value:function(e,t,r){return C(this.configuration).adminDeleteUserPack(e,t,r)(this.basePath)}},{key:"adminFixInvalidPass",value:function(e,t){return C(this.configuration).adminFixInvalidPass(e,t)(this.basePath)}},{key:"adminGetProducts",value:function(e){return C(this.configuration).adminGetProducts(e)(this.basePath)}},{key:"adminGetUserPacks",value:function(e,t,r){return C(this.configuration).adminGetUserPacks(e,t,r)(this.basePath)}},{key:"adminUpdateProducts",value:function(e,t){return C(this.configuration).adminUpdateProducts(e,t)(this.basePath)}},{key:"amendBooking",value:function(e,t,r,n){return C(this.configuration).amendBooking(e,t,r,n)(this.basePath)}},{key:"amendBookingCode",value:function(e,t,r){return C(this.configuration).amendBookingCode(e,t,r)(this.basePath)}},{key:"bookingInfo",value:function(e,t,r){return C(this.configuration).bookingInfo(e,t,r)(this.basePath)}},{key:"cancelBooking",value:function(e,t,r){return C(this.configuration).cancelBooking(e,t,r)(this.basePath)}},{key:"emailInvoice",value:function(e,t,r){return C(this.configuration).emailInvoice(e,t,r)(this.basePath)}},{key:"getActivePacks",value:function(e,t){return C(this.configuration).getActivePacks(e,t)(this.basePath)}},{key:"getPackCode",value:function(e,t,r){return C(this.configuration).getPackCode(e,t,r)(this.basePath)}},{key:"getPackProducts",value:function(e,t){return C(this.configuration).getPackProducts(e,t)(this.basePath)}},{key:"getPacksHistory",value:function(e,t,r,n){return C(this.configuration).getPacksHistory(e,t,r,n)(this.basePath)}},{key:"purchasePack",value:function(e,t,r){return C(this.configuration).purchasePack(e,t,r)(this.basePath)}},{key:"usePackPass",value:function(e,t,r){return C(this.configuration).usePackPass(e,t,r)(this.basePath)}}]),r}(S),D=function(e){return{adminDeleteUserBan:function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(null===t||void 0===t)throw new k("userId","Required parameter userId was null or undefined when calling adminDeleteUserBan.");var n="/promo/admin/user/userban/{userId}".replace("{userId}",encodeURIComponent(String(t))),a=g.parse(n,!0),o=i()({method:"DELETE"},r),l={},c={};if(e&&e.apiKey){var s="function"===typeof e.apiKey?e.apiKey("Authorization"):e.apiKey;l.Authorization=s}return a.query=i()({},a.query,c,r.query),delete a.search,o.headers=i()({},l,r.headers),{url:g.format(a),options:o}},adminGetPaymentDetailUpdates:function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(null===t||void 0===t)throw new k("userId","Required parameter userId was null or undefined when calling adminGetPaymentDetailUpdates.");var n="/promo/admin/user/paymentdetailupdates/{userId}".replace("{userId}",encodeURIComponent(String(t))),a=g.parse(n,!0),o=i()({method:"GET"},r),l={},c={};if(e&&e.apiKey){var s="function"===typeof e.apiKey?e.apiKey("Authorization"):e.apiKey;l.Authorization=s}return a.query=i()({},a.query,c,r.query),delete a.search,o.headers=i()({},l,r.headers),{url:g.format(a),options:o}},assignCode:function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(null===t||void 0===t)throw new k("body","Required parameter body was null or undefined when calling assignCode.");var n="/promo/assigncode",a=g.parse(n,!0),o=i()({method:"POST"},r),l={},c={};if(e&&e.apiKey){var s="function"===typeof e.apiKey?e.apiKey("Authorization"):e.apiKey;l.Authorization=s}l["Content-Type"]="application/json",a.query=i()({},a.query,c,r.query),delete a.search,o.headers=i()({},l,r.headers);var u=!0;return o.body=u?JSON.stringify(t||{}):t||"",{url:g.format(a),options:o}},bookingEvent:function(t,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(null===t||void 0===t)throw new k("Authorization","Required parameter Authorization was null or undefined when calling bookingEvent.");if(null===r||void 0===r)throw new k("body","Required parameter body was null or undefined when calling bookingEvent.");var a="/promo/booking-events",o=g.parse(a,!0),l=i()({method:"POST"},n),c={},s={};if(e&&e.apiKey){var u="function"===typeof e.apiKey?e.apiKey("X-API-Key"):e.apiKey;c["X-API-Key"]=u}void 0!==t&&null!==t&&(c.Authorization=String(t)),c["Content-Type"]="application/json",o.query=i()({},o.query,s,n.query),delete o.search,l.headers=i()({},c,n.headers);var d=!0;return l.body=d?JSON.stringify(r||{}):r||"",{url:g.format(o),options:l}},createGroup:function(t,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(null===t||void 0===t)throw new k("group","Required parameter group was null or undefined when calling createGroup.");var a="/promo/creategroup/{group}".replace("{group}",encodeURIComponent(String(t))),o=g.parse(a,!0),l=i()({method:"POST"},n),c={},s={},u=new g.URLSearchParams;if(e&&e.apiKey){var d="function"===typeof e.apiKey?e.apiKey("Authorization"):e.apiKey;c.Authorization=d}return void 0!==r&&u.set("upfile",r),c["Content-Type"]="application/x-www-form-urlencoded",o.query=i()({},o.query,s,n.query),delete o.search,l.headers=i()({},c,n.headers),l.body=u.toString(),{url:g.format(o),options:l}},deleteCampaign:function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(null===t||void 0===t)throw new k("campaignId","Required parameter campaignId was null or undefined when calling deleteCampaign.");var n="/promo/campaign/{campaignId}".replace("{campaignId}",encodeURIComponent(String(t))),a=g.parse(n,!0),o=i()({method:"DELETE"},r),l={},c={};if(e&&e.apiKey){var s="function"===typeof e.apiKey?e.apiKey("Authorization"):e.apiKey;l.Authorization=s}return a.query=i()({},a.query,c,r.query),delete a.search,o.headers=i()({},l,r.headers),{url:g.format(a),options:o}},deleteCodesFile:function(t,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(null===t||void 0===t)throw new k("campaignId","Required parameter campaignId was null or undefined when calling deleteCodesFile.");if(null===r||void 0===r)throw new k("body","Required parameter body was null or undefined when calling deleteCodesFile.");var a="/promo/campaign/{campaignId}/codefile".replace("{campaignId}",encodeURIComponent(String(t))),o=g.parse(a,!0),l=i()({method:"DELETE"},n),c={},s={};if(e&&e.apiKey){var u="function"===typeof e.apiKey?e.apiKey("Authorization"):e.apiKey;c.Authorization=u}c["Content-Type"]="application/json",o.query=i()({},o.query,s,n.query),delete o.search,l.headers=i()({},c,n.headers);var d=!0;return l.body=d?JSON.stringify(r||{}):r||"",{url:g.format(o),options:l}},generateBarcode:function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(null===t||void 0===t)throw new k("Authorization","Required parameter Authorization was null or undefined when calling generateBarcode.");var n="/promo/requesteSpecialBarcode",a=g.parse(n,!0),o=i()({method:"GET"},r),l={},c={};if(e&&e.apiKey){var s="function"===typeof e.apiKey?e.apiKey("X-API-Key"):e.apiKey;l["X-API-Key"]=s}return void 0!==t&&null!==t&&(l.Authorization=String(t)),a.query=i()({},a.query,c,r.query),delete a.search,o.headers=i()({},l,r.headers),{url:g.format(a),options:o}},generateBarcodeLegacy:function(t,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(null===t||void 0===t)throw new k("Authorization","Required parameter Authorization was null or undefined when calling generateBarcodeLegacy.");if(null===r||void 0===r)throw new k("body","Required parameter body was null or undefined when calling generateBarcodeLegacy.");var a="/promo/requesteSpecialBarcode",o=g.parse(a,!0),l=i()({method:"POST"},n),c={},s={};if(e&&e.apiKey){var u="function"===typeof e.apiKey?e.apiKey("X-API-Key"):e.apiKey;c["X-API-Key"]=u}void 0!==t&&null!==t&&(c.Authorization=String(t)),c["Content-Type"]="application/json",o.query=i()({},o.query,s,n.query),delete o.search,l.headers=i()({},c,n.headers);var d=!0;return l.body=d?JSON.stringify(r||{}):r||"",{url:g.format(o),options:l}},getActiveCampaigns:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r="/promo/activecampaigns",n=g.parse(r,!0),a=i()({method:"GET"},t),o={},l={};if(e&&e.apiKey){var c="function"===typeof e.apiKey?e.apiKey("X-API-Key"):e.apiKey;o["X-API-Key"]=c}return n.query=i()({},n.query,l,t.query),delete n.search,a.headers=i()({},o,t.headers),{url:g.format(n),options:a}},getAllCampaigns:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r="/promo/allcampaigns",n=g.parse(r,!0),a=i()({method:"GET"},t),o={},l={};if(e&&e.apiKey){var c="function"===typeof e.apiKey?e.apiKey("Authorization"):e.apiKey;o.Authorization=c}return n.query=i()({},n.query,l,t.query),delete n.search,a.headers=i()({},o,t.headers),{url:g.format(n),options:a}},getCampaign:function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(null===t||void 0===t)throw new k("campaignId","Required parameter campaignId was null or undefined when calling getCampaign.");var n="/promo/campaign/{campaignId}".replace("{campaignId}",encodeURIComponent(String(t))),a=g.parse(n,!0),o=i()({method:"GET"},r),l={},c={};if(e&&e.apiKey){var s="function"===typeof e.apiKey?e.apiKey("Authorization"):e.apiKey;l.Authorization=s}return a.query=i()({},a.query,c,r.query),delete a.search,o.headers=i()({},l,r.headers),{url:g.format(a),options:o}},getCodes:function(t,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(null===t||void 0===t)throw new k("Authorization","Required parameter Authorization was null or undefined when calling getCodes.");var a="/promo/codes",o=g.parse(a,!0),l=i()({method:"GET"},n),c={},s={};if(e&&e.apiKey){var u="function"===typeof e.apiKey?e.apiKey("X-API-Key"):e.apiKey;c["X-API-Key"]=u}return void 0!==r&&(s.user_pseudo_id=r),void 0!==t&&null!==t&&(c.Authorization=String(t)),o.query=i()({},o.query,s,n.query),delete o.search,l.headers=i()({},c,n.headers),{url:g.format(o),options:l}},groupPush:function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(null===t||void 0===t)throw new k("body","Required parameter body was null or undefined when calling groupPush.");var n="/promo/grouppush",a=g.parse(n,!0),o=i()({method:"POST"},r),l={},c={};if(e&&e.apiKey){var s="function"===typeof e.apiKey?e.apiKey("Authorization"):e.apiKey;l.Authorization=s}l["Content-Type"]="application/json",a.query=i()({},a.query,c,r.query),delete a.search,o.headers=i()({},l,r.headers);var u=!0;return o.body=u?JSON.stringify(t||{}):t||"",{url:g.format(a),options:o}},removeCode:function(t,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(null===t||void 0===t)throw new k("Authorization","Required parameter Authorization was null or undefined when calling removeCode.");if(null===r||void 0===r)throw new k("body","Required parameter body was null or undefined when calling removeCode.");var a="/promo/removecode",o=g.parse(a,!0),l=i()({method:"POST"},n),c={},s={};if(e&&e.apiKey){var u="function"===typeof e.apiKey?e.apiKey("X-API-Key"):e.apiKey;c["X-API-Key"]=u}void 0!==t&&null!==t&&(c.Authorization=String(t)),c["Content-Type"]="application/json",o.query=i()({},o.query,s,n.query),delete o.search,l.headers=i()({},c,n.headers);var d=!0;return l.body=d?JSON.stringify(r||{}):r||"",{url:g.format(o),options:l}},resetCampaignSentCodes:function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(null===t||void 0===t)throw new k("campaignId","Required parameter campaignId was null or undefined when calling resetCampaignSentCodes.");var n="/promo/campaign/{campaignId}/resetsent".replace("{campaignId}",encodeURIComponent(String(t))),a=g.parse(n,!0),o=i()({method:"POST"},r),l={},c={};if(e&&e.apiKey){var s="function"===typeof e.apiKey?e.apiKey("Authorization"):e.apiKey;l.Authorization=s}return a.query=i()({},a.query,c,r.query),delete a.search,o.headers=i()({},l,r.headers),{url:g.format(a),options:o}},runCampaign:function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(null===t||void 0===t)throw new k("campaignId","Required parameter campaignId was null or undefined when calling runCampaign.");var n="/promo/campaign/{campaignId}/run".replace("{campaignId}",encodeURIComponent(String(t))),a=g.parse(n,!0),o=i()({method:"POST"},r),l={},c={};if(e&&e.apiKey){var s="function"===typeof e.apiKey?e.apiKey("Authorization"):e.apiKey;l.Authorization=s}return a.query=i()({},a.query,c,r.query),delete a.search,o.headers=i()({},l,r.headers),{url:g.format(a),options:o}},sessionReminderPush:function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(null===t||void 0===t)throw new k("body","Required parameter body was null or undefined when calling sessionReminderPush.");var n="/promo/sessionreminderpush",a=g.parse(n,!0),o=i()({method:"POST"},r),l={},c={};if(e&&e.apiKey){var s="function"===typeof e.apiKey?e.apiKey("X-API-Key"):e.apiKey;l["X-API-Key"]=s}l["Content-Type"]="application/json",a.query=i()({},a.query,c,r.query),delete a.search,o.headers=i()({},l,r.headers);var u=!0;return o.body=u?JSON.stringify(t||{}):t||"",{url:g.format(a),options:o}},setCampaign:function(t,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(null===t||void 0===t)throw new k("campaignId","Required parameter campaignId was null or undefined when calling setCampaign.");if(null===r||void 0===r)throw new k("body","Required parameter body was null or undefined when calling setCampaign.");var a="/promo/campaign/{campaignId}".replace("{campaignId}",encodeURIComponent(String(t))),o=g.parse(a,!0),l=i()({method:"POST"},n),c={},s={};if(e&&e.apiKey){var u="function"===typeof e.apiKey?e.apiKey("Authorization"):e.apiKey;c.Authorization=u}c["Content-Type"]="application/json",o.query=i()({},o.query,s,n.query),delete o.search,l.headers=i()({},c,n.headers);var d=!0;return l.body=d?JSON.stringify(r||{}):r||"",{url:g.format(o),options:l}},setUserPaymentDetails:function(t,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(null===t||void 0===t)throw new k("Authorization","Required parameter Authorization was null or undefined when calling setUserPaymentDetails.");if(null===r||void 0===r)throw new k("body","Required parameter body was null or undefined when calling setUserPaymentDetails.");var a="/promo/referral/paymentdetails",o=g.parse(a,!0),l=i()({method:"POST"},n),c={},s={};if(e&&e.apiKey){var u="function"===typeof e.apiKey?e.apiKey("X-API-Key"):e.apiKey;c["X-API-Key"]=u}void 0!==t&&null!==t&&(c.Authorization=String(t)),c["Content-Type"]="application/json",o.query=i()({},o.query,s,n.query),delete o.search,l.headers=i()({},c,n.headers);var d=!0;return l.body=d?JSON.stringify(r||{}):r||"",{url:g.format(o),options:l}},uploadCodesFile:function(t,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(null===t||void 0===t)throw new k("campaignId","Required parameter campaignId was null or undefined when calling uploadCodesFile.");var a="/promo/campaign/{campaignId}/codefile".replace("{campaignId}",encodeURIComponent(String(t))),o=g.parse(a,!0),l=i()({method:"POST"},n),c={},s={},u=new g.URLSearchParams;if(e&&e.apiKey){var d="function"===typeof e.apiKey?e.apiKey("Authorization"):e.apiKey;c.Authorization=d}return void 0!==r&&u.set("upfile",r),c["Content-Type"]="application/x-www-form-urlencoded",o.query=i()({},o.query,s,n.query),delete o.search,l.headers=i()({},c,n.headers),l.body=u.toString(),{url:g.format(o),options:l}},validateReferralCode:function(t,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(null===t||void 0===t)throw new k("Authorization","Required parameter Authorization was null or undefined when calling validateReferralCode.");if(null===r||void 0===r)throw new k("code","Required parameter code was null or undefined when calling validateReferralCode.");var a="/promo/referral/validatecode/{code}".replace("{code}",encodeURIComponent(String(r))),o=g.parse(a,!0),l=i()({method:"POST"},n),c={},s={};if(e&&e.apiKey){var u="function"===typeof e.apiKey?e.apiKey("X-API-Key"):e.apiKey;c["X-API-Key"]=u}return void 0!==t&&null!==t&&(c.Authorization=String(t)),o.query=i()({},o.query,s,n.query),delete o.search,l.headers=i()({},c,n.headers),{url:g.format(o),options:l}},validateReferralPayment:function(t,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(null===t||void 0===t)throw new k("Authorization","Required parameter Authorization was null or undefined when calling validateReferralPayment.");if(null===r||void 0===r)throw new k("body","Required parameter body was null or undefined when calling validateReferralPayment.");var a="/promo/referral/validatepayment",o=g.parse(a,!0),l=i()({method:"POST"},n),c={},s={};if(e&&e.apiKey){var u="function"===typeof e.apiKey?e.apiKey("X-API-Key"):e.apiKey;c["X-API-Key"]=u}void 0!==t&&null!==t&&(c.Authorization=String(t)),c["Content-Type"]="application/json",o.query=i()({},o.query,s,n.query),delete o.search,l.headers=i()({},c,n.headers);var d=!0;return l.body=d?JSON.stringify(r||{}):r||"",{url:g.format(o),options:l}}}},P=function(e){return{adminDeleteUserBan:function(t,r){var n=D(e).adminDeleteUserBan(t,r);return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return fetch(e+n.url,n.options).then((function(e){if(e.status>=200&&e.status<300)return e.json();throw e}))}},adminGetPaymentDetailUpdates:function(t,r){var n=D(e).adminGetPaymentDetailUpdates(t,r);return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return fetch(e+n.url,n.options).then((function(e){if(e.status>=200&&e.status<300)return e.json();throw e}))}},assignCode:function(t,r){var n=D(e).assignCode(t,r);return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return fetch(e+n.url,n.options).then((function(e){if(e.status>=200&&e.status<300)return e.json();throw e}))}},bookingEvent:function(t,r,n){var a=D(e).bookingEvent(t,r,n);return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return fetch(e+a.url,a.options).then((function(e){if(e.status>=200&&e.status<300)return e.json();throw e}))}},createGroup:function(t,r,n){var a=D(e).createGroup(t,r,n);return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return fetch(e+a.url,a.options).then((function(e){if(e.status>=200&&e.status<300)return e.json();throw e}))}},deleteCampaign:function(t,r){var n=D(e).deleteCampaign(t,r);return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return fetch(e+n.url,n.options).then((function(e){if(e.status>=200&&e.status<300)return e.json();throw e}))}},deleteCodesFile:function(t,r,n){var a=D(e).deleteCodesFile(t,r,n);return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return fetch(e+a.url,a.options).then((function(e){if(e.status>=200&&e.status<300)return e.json();throw e}))}},generateBarcode:function(t,r){var n=D(e).generateBarcode(t,r);return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return fetch(e+n.url,n.options).then((function(e){if(e.status>=200&&e.status<300)return e.json();throw e}))}},generateBarcodeLegacy:function(t,r,n){var a=D(e).generateBarcodeLegacy(t,r,n);return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return fetch(e+a.url,a.options).then((function(e){if(e.status>=200&&e.status<300)return e.json();throw e}))}},getActiveCampaigns:function(t){var r=D(e).getActiveCampaigns(t);return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return fetch(e+r.url,r.options).then((function(e){if(e.status>=200&&e.status<300)return e.json();throw e}))}},getAllCampaigns:function(t){var r=D(e).getAllCampaigns(t);return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return fetch(e+r.url,r.options).then((function(e){if(e.status>=200&&e.status<300)return e.json();throw e}))}},getCampaign:function(t,r){var n=D(e).getCampaign(t,r);return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return fetch(e+n.url,n.options).then((function(e){if(e.status>=200&&e.status<300)return e.json();throw e}))}},getCodes:function(t,r,n){var a=D(e).getCodes(t,r,n);return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return fetch(e+a.url,a.options).then((function(e){if(e.status>=200&&e.status<300)return e.json();throw e}))}},groupPush:function(t,r){var n=D(e).groupPush(t,r);return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return fetch(e+n.url,n.options).then((function(e){if(e.status>=200&&e.status<300)return e.json();throw e}))}},removeCode:function(t,r,n){var a=D(e).removeCode(t,r,n);return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return fetch(e+a.url,a.options).then((function(e){if(e.status>=200&&e.status<300)return e.json();throw e}))}},resetCampaignSentCodes:function(t,r){var n=D(e).resetCampaignSentCodes(t,r);return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return fetch(e+n.url,n.options).then((function(e){if(e.status>=200&&e.status<300)return e.json();throw e}))}},runCampaign:function(t,r){var n=D(e).runCampaign(t,r);return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return fetch(e+n.url,n.options).then((function(e){if(e.status>=200&&e.status<300)return e.json();throw e}))}},sessionReminderPush:function(t,r){var n=D(e).sessionReminderPush(t,r);return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return fetch(e+n.url,n.options).then((function(e){if(e.status>=200&&e.status<300)return e.json();throw e}))}},setCampaign:function(t,r,n){var a=D(e).setCampaign(t,r,n);return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return fetch(e+a.url,a.options).then((function(e){if(e.status>=200&&e.status<300)return e.json();throw e}))}},setUserPaymentDetails:function(t,r,n){var a=D(e).setUserPaymentDetails(t,r,n);return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return fetch(e+a.url,a.options).then((function(e){if(e.status>=200&&e.status<300)return e.json();throw e}))}},uploadCodesFile:function(t,r,n){var a=D(e).uploadCodesFile(t,r,n);return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return fetch(e+a.url,a.options).then((function(e){if(e.status>=200&&e.status<300)return e.json();throw e}))}},validateReferralCode:function(t,r,n){var a=D(e).validateReferralCode(t,r,n);return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return fetch(e+a.url,a.options).then((function(e){if(e.status>=200&&e.status<300)return e.json();throw e}))}},validateReferralPayment:function(t,r,n){var a=D(e).validateReferralPayment(t,r,n);return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return fetch(e+a.url,a.options).then((function(e){if(e.status>=200&&e.status<300)return e.json();throw e}))}}}},w=function(e){p()(r,e);var t=b(r);function r(){return y()(this,r),t.apply(this,arguments)}return a()(r,[{key:"adminDeleteUserBan",value:function(e,t){return P(this.configuration).adminDeleteUserBan(e,t)(this.basePath)}},{key:"adminGetPaymentDetailUpdates",value:function(e,t){return P(this.configuration).adminGetPaymentDetailUpdates(e,t)(this.basePath)}},{key:"assignCode",value:function(e,t){return P(this.configuration).assignCode(e,t)(this.basePath)}},{key:"bookingEvent",value:function(e,t,r){return P(this.configuration).bookingEvent(e,t,r)(this.basePath)}},{key:"createGroup",value:function(e,t,r){return P(this.configuration).createGroup(e,t,r)(this.basePath)}},{key:"deleteCampaign",value:function(e,t){return P(this.configuration).deleteCampaign(e,t)(this.basePath)}},{key:"deleteCodesFile",value:function(e,t,r){return P(this.configuration).deleteCodesFile(e,t,r)(this.basePath)}},{key:"generateBarcode",value:function(e,t){return P(this.configuration).generateBarcode(e,t)(this.basePath)}},{key:"generateBarcodeLegacy",value:function(e,t,r){return P(this.configuration).generateBarcodeLegacy(e,t,r)(this.basePath)}},{key:"getActiveCampaigns",value:function(e){return P(this.configuration).getActiveCampaigns(e)(this.basePath)}},{key:"getAllCampaigns",value:function(e){return P(this.configuration).getAllCampaigns(e)(this.basePath)}},{key:"getCampaign",value:function(e,t){return P(this.configuration).getCampaign(e,t)(this.basePath)}},{key:"getCodes",value:function(e,t,r){return P(this.configuration).getCodes(e,t,r)(this.basePath)}},{key:"groupPush",value:function(e,t){return P(this.configuration).groupPush(e,t)(this.basePath)}},{key:"removeCode",value:function(e,t,r){return P(this.configuration).removeCode(e,t,r)(this.basePath)}},{key:"resetCampaignSentCodes",value:function(e,t){return P(this.configuration).resetCampaignSentCodes(e,t)(this.basePath)}},{key:"runCampaign",value:function(e,t){return P(this.configuration).runCampaign(e,t)(this.basePath)}},{key:"sessionReminderPush",value:function(e,t){return P(this.configuration).sessionReminderPush(e,t)(this.basePath)}},{key:"setCampaign",value:function(e,t,r){return P(this.configuration).setCampaign(e,t,r)(this.basePath)}},{key:"setUserPaymentDetails",value:function(e,t,r){return P(this.configuration).setUserPaymentDetails(e,t,r)(this.basePath)}},{key:"uploadCodesFile",value:function(e,t,r){return P(this.configuration).uploadCodesFile(e,t,r)(this.basePath)}},{key:"validateReferralCode",value:function(e,t,r){return P(this.configuration).validateReferralCode(e,t,r)(this.basePath)}},{key:"validateReferralPayment",value:function(e,t,r){return P(this.configuration).validateReferralPayment(e,t,r)(this.basePath)}}]),r}(S),M=function(e){return{getDevices:function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(null===t||void 0===t)throw new k("Authorization","Required parameter Authorization was null or undefined when calling getDevices.");var n="/push/devices",a=g.parse(n,!0),o=i()({method:"GET"},r),l={},c={};if(e&&e.apiKey){var s="function"===typeof e.apiKey?e.apiKey("X-API-Key"):e.apiKey;l["X-API-Key"]=s}return void 0!==t&&null!==t&&(l.Authorization=String(t)),a.query=i()({},a.query,c,r.query),delete a.search,o.headers=i()({},l,r.headers),{url:g.format(a),options:o}},getSettings:function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(null===t||void 0===t)throw new k("Authorization","Required parameter Authorization was null or undefined when calling getSettings.");var n="/push/settings",a=g.parse(n,!0),o=i()({method:"GET"},r),l={},c={};if(e&&e.apiKey){var s="function"===typeof e.apiKey?e.apiKey("X-API-Key"):e.apiKey;l["X-API-Key"]=s}return void 0!==t&&null!==t&&(l.Authorization=String(t)),a.query=i()({},a.query,c,r.query),delete a.search,o.headers=i()({},l,r.headers),{url:g.format(a),options:o}},healthcheck:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r="/healthcheck",n=g.parse(r,!0),a=i()({method:"GET"},t),o={},l={};return void 0!==e&&(l.verbose=e),n.query=i()({},n.query,l,t.query),delete n.search,a.headers=i()({},o,t.headers),{url:g.format(n),options:a}},registerDevice:function(t,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(null===t||void 0===t)throw new k("Authorization","Required parameter Authorization was null or undefined when calling registerDevice.");var a="/push/devices",o=g.parse(a,!0),l=i()({method:"POST"},n),c={},s={};if(e&&e.apiKey){var u="function"===typeof e.apiKey?e.apiKey("X-API-Key"):e.apiKey;c["X-API-Key"]=u}void 0!==t&&null!==t&&(c.Authorization=String(t)),c["Content-Type"]="application/json",o.query=i()({},o.query,s,n.query),delete o.search,l.headers=i()({},c,n.headers);var d=!0;return l.body=d?JSON.stringify(r||{}):r||"",{url:g.format(o),options:l}},setSettings:function(t,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(null===t||void 0===t)throw new k("Authorization","Required parameter Authorization was null or undefined when calling setSettings.");if(null===r||void 0===r)throw new k("body","Required parameter body was null or undefined when calling setSettings.");var a="/push/settings",o=g.parse(a,!0),l=i()({method:"POST"},n),c={},s={};if(e&&e.apiKey){var u="function"===typeof e.apiKey?e.apiKey("X-API-Key"):e.apiKey;c["X-API-Key"]=u}void 0!==t&&null!==t&&(c.Authorization=String(t)),c["Content-Type"]="application/json",o.query=i()({},o.query,s,n.query),delete o.search,l.headers=i()({},c,n.headers);var d=!0;return l.body=d?JSON.stringify(r||{}):r||"",{url:g.format(o),options:l}},unregisterDevice:function(t,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(null===t||void 0===t)throw new k("Authorization","Required parameter Authorization was null or undefined when calling unregisterDevice.");var a="/push/devices",o=g.parse(a,!0),l=i()({method:"DELETE"},n),c={},s={};if(e&&e.apiKey){var u="function"===typeof e.apiKey?e.apiKey("X-API-Key"):e.apiKey;c["X-API-Key"]=u}void 0!==t&&null!==t&&(c.Authorization=String(t)),c["Content-Type"]="application/json",o.query=i()({},o.query,s,n.query),delete o.search,l.headers=i()({},c,n.headers);var d=!0;return l.body=d?JSON.stringify(r||{}):r||"",{url:g.format(o),options:l}}}},x=function(e){return{getDevices:function(t,r){var n=M(e).getDevices(t,r);return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return fetch(e+n.url,n.options).then((function(e){if(e.status>=200&&e.status<300)return e.json();throw e}))}},getSettings:function(t,r){var n=M(e).getSettings(t,r);return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return fetch(e+n.url,n.options).then((function(e){if(e.status>=200&&e.status<300)return e.json();throw e}))}},healthcheck:function(t,r){var n=M(e).healthcheck(t,r);return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return fetch(e+n.url,n.options).then((function(e){if(e.status>=200&&e.status<300)return e.json();throw e}))}},registerDevice:function(t,r,n){var a=M(e).registerDevice(t,r,n);return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return fetch(e+a.url,a.options).then((function(e){if(e.status>=200&&e.status<300)return e.json();throw e}))}},setSettings:function(t,r,n){var a=M(e).setSettings(t,r,n);return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return fetch(e+a.url,a.options).then((function(e){if(e.status>=200&&e.status<300)return e.json();throw e}))}},unregisterDevice:function(t,r,n){var a=M(e).unregisterDevice(t,r,n);return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return fetch(e+a.url,a.options).then((function(e){if(e.status>=200&&e.status<300)return e.json();throw e}))}}}},V=(function(e){p()(r,e);var t=b(r);function r(){return y()(this,r),t.apply(this,arguments)}a()(r,[{key:"getDevices",value:function(e,t){return x(this.configuration).getDevices(e,t)(this.basePath)}},{key:"getSettings",value:function(e,t){return x(this.configuration).getSettings(e,t)(this.basePath)}},{key:"healthcheck",value:function(e,t){return x(this.configuration).healthcheck(e,t)(this.basePath)}},{key:"registerDevice",value:function(e,t,r){return x(this.configuration).registerDevice(e,t,r)(this.basePath)}},{key:"setSettings",value:function(e,t,r){return x(this.configuration).setSettings(e,t,r)(this.basePath)}},{key:"unregisterDevice",value:function(e,t,r){return x(this.configuration).unregisterDevice(e,t,r)(this.basePath)}}])}(S),function(e){return{refundRequest:function(t,r,n,a){var o=function(e){return{refundRequest:function(t,r,n){var a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};if(null===t||void 0===t)throw new k("Authorization","Required parameter Authorization was null or undefined when calling refundRequest.");if(null===r||void 0===r)throw new k("bookingNo","Required parameter bookingNo was null or undefined when calling refundRequest.");if(null===n||void 0===n)throw new k("email","Required parameter email was null or undefined when calling refundRequest.");var o="/user/support/booking/{bookingNo}/refund".replace("{bookingNo}",encodeURIComponent(String(r))),l=g.parse(o,!0),c=i()({method:"POST"},a),s={},u={},d=new g.URLSearchParams;if(e&&e.apiKey){var p="function"===typeof e.apiKey?e.apiKey("X-API-Key"):e.apiKey;s["X-API-Key"]=p}return void 0!==t&&null!==t&&(s.Authorization=String(t)),void 0!==n&&d.set("email",n),s["Content-Type"]="application/x-www-form-urlencoded",l.query=i()({},l.query,u,a.query),delete l.search,c.headers=i()({},s,a.headers),c.body=d.toString(),{url:g.format(l),options:c}}}}(e).refundRequest(t,r,n,a);return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return fetch(e+o.url,o.options).then((function(e){if(e.status>=200&&e.status<300)return e.json();throw e}))}}}}),j=(function(e){p()(r,e);var t=b(r);function r(){return y()(this,r),t.apply(this,arguments)}a()(r,[{key:"refundRequest",value:function(e,t,r,n){return V(this.configuration).refundRequest(e,t,r,n)(this.basePath)}}])}(S),function(e){return{deleteUserAccount:function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(null===t||void 0===t)throw new k("Authorization","Required parameter Authorization was null or undefined when calling deleteUserAccount.");var n="/user/account",a=g.parse(n,!0),o=i()({method:"DELETE"},r),l={},c={};if(e&&e.apiKey){var s="function"===typeof e.apiKey?e.apiKey("X-API-Key"):e.apiKey;l["X-API-Key"]=s}return void 0!==t&&null!==t&&(l.Authorization=String(t)),a.query=i()({},a.query,c,r.query),delete a.search,o.headers=i()({},l,r.headers),{url:g.format(a),options:o}},deleteUserAccountData:function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(null===t||void 0===t)throw new k("userName","Required parameter userName was null or undefined when calling deleteUserAccountData.");var n="/user/account/{userName}".replace("{userName}",encodeURIComponent(String(t))),a=g.parse(n,!0),o=i()({method:"DELETE"},r),l={},c={};if(e&&e.apiKey){var s="function"===typeof e.apiKey?e.apiKey("Authorization"):e.apiKey;l.Authorization=s}return a.query=i()({},a.query,c,r.query),delete a.search,o.headers=i()({},l,r.headers),{url:g.format(a),options:o}}}}),B=function(e){return{deleteUserAccount:function(t,r){var n=j(e).deleteUserAccount(t,r);return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return fetch(e+n.url,n.options).then((function(e){if(e.status>=200&&e.status<300)return e.json();throw e}))}},deleteUserAccountData:function(t,r){var n=j(e).deleteUserAccountData(t,r);return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return fetch(e+n.url,n.options).then((function(e){if(e.status>=200&&e.status<300)return e.json();throw e}))}}}},I=function(e){p()(r,e);var t=b(r);function r(){return y()(this,r),t.apply(this,arguments)}return a()(r,[{key:"deleteUserAccount",value:function(e,t){return B(this.configuration).deleteUserAccount(e,t)(this.basePath)}},{key:"deleteUserAccountData",value:function(e,t){return B(this.configuration).deleteUserAccountData(e,t)(this.basePath)}}]),r}(S)},,function(e,t,r){"use strict";r.d(t,"b",(function(){return o})),r.d(t,"a",(function(){return i})),r.d(t,"c",(function(){return l})),r.d(t,"d",(function(){return c}));var n=r(8),a=r(13),o="",i=a.b.strings.Bookings,l="VIC",c=n.c.logo},,function(e,t,r){"use strict";r.d(t,"b",(function(){return B}));var n=r(12),a=r.n(n),o=r(10),i=r.n(o),l=r(11),c=r.n(l),s=r(15),u=r.n(s),d=r(7),p=r.n(d),f=r(14),h=r.n(f),m=r(0),y=r.n(m),g=r(2),b=r(5),A=r(95),E=r(33),v=r(30),S=r(4),k=r(1),T=r(76),O=r(24),R=r(32),C=r(45),U=[{role:C.e.administrator,text:"Administrator",secondaryText:"Access all the features of Command including user management"},{role:C.e.editor,text:"Editor",secondaryText:"View access to all the features of Command and limited ability to make amendments"},{role:C.e.viewer,text:"Viewer",secondaryText:"View access to all the features of Command"},{role:C.e.inactive,text:"Inactive",secondaryText:"No access permissions"}],D=r(75),P=r(101),w=r(122);function M(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function x(e){for(var t=1;tt-c&&(u.x=t-c-i),u.y+l>r-c&&(u.y=r-c-l)),y.a.createElement(g.a,{style:R({position:"absolute",top:u.y,left:u.x,maxWidth:t-2*c,maxHeight:r-2*c,paddingHorizontal:v.d.smallMargin,backgroundColor:v.a.pageBackground,borderRadius:v.d.smallMargin,borderWidth:1,borderColor:v.a.border},S.c,{opacity:n?0:1,overflow:"hidden"}),onLayout:n?this.onLayout:void 0},a&&a(e))}},{key:"renderOuterView",value:function(e,t){var r=this.props.renderParentOverlay,n=this.state,a=n.pendingPopupData,o=n.popupData;return y.a.createElement(g.a,{style:{width:"100%",height:"100%"},pointerEvents:"none"},o&&r&&r(o),a&&this.renderPopupLabel(a,e,t,!0),o&&this.renderPopupLabel(o,e,t,!1))}},{key:"render",value:function(){var e=this.props,t=e.isModal,r=e.updateOnTouchMove,n=this.state,a=n.pendingPopupData,o=n.popupData,i=n.parentWidth,l=n.parentHeight,c=E.a.get("window"),s=c.width,u=c.height;return y.a.createElement(k.a,{style:{width:"100%",height:"100%",position:"absolute",zIndex:1},onTouchGrant:this.onTouchGrantOrMove,onTouchMove:r?this.onTouchGrantOrMove:void 0,onTouchRelease:this.onTouchRelease,onLayout:this.onParentLayout,onMouseEnter:this.onMouseEnter,onMouseLeave:this.onMouseLeave},t&&y.a.createElement(A.a,{animationType:"none",transparent:!0,supportedOrientations:["landscape"],visible:!!a||!!o,ariaHideApp:!1},this.renderOuterView(s,u)),!t&&(a||o)&&this.renderOuterView(i,l))}}]),r}(m.PureComponent);U.defaultProps={isModal:!1,updateOnTouchMove:!0}},function(e,t,r){"use strict";r(235);var n=r(497);r.d(t,"ConnectedPieChart",(function(){return n.a}));r(204)},function(e,t,r){"use strict";r.d(t,"b",(function(){return M}));var n=r(10),a=r.n(n),o=r(11),i=r.n(o),l=r(15),c=r.n(l),s=r(7),u=r.n(s),d=r(14),p=r.n(d),f=r(0),h=r.n(f),m=r(2),y=r(5),g=r(33),b=r(30),A=r(4),E=r(89),v=r(1),S=r(24),k=r(32),T=r(75),O=r(45),R=r(101),C=r(116);function U(e){var t=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=u()(e);if(t){var a=u()(this).constructor;r=Reflect.construct(n,arguments,a)}else r=n.apply(this,arguments);return c()(this,r)}}var D=[{flex:1},{flex:1.5},{flex:.5},{flex:.5,alignItems:"flex-end"}],P=v.d.tripleBaseMargin,w=function(e){p()(r,e);var t=U(r);function r(e){var n;return a()(this,r),(n=t.call(this,e)).onAddUser=function(){n.props.dispatch(R.Actions.editUser(void 0)),n.props.dispatch(T.Actions.setMenuItem(C.b))},n.onEditUser=function(e){n.props.dispatch(R.Actions.editUser(e)),n.props.dispatch(T.Actions.setMenuItem(C.b))},n.onDeleteUser=function(e){n.props.dispatch(R.Actions.updateUser.request({uid:e,role:O.e.inactive}))},n.renderUserListSeparator=function(){return h.a.createElement(m.a,{style:{width:"100%",height:1,backgroundColor:v.a.border}})},n.renderUserListHeader=function(){return h.a.createElement(m.a,null,h.a.createElement(m.a,{style:{height:P,backgroundColor:v.a.pageBackground,flexDirection:"row",alignItems:"center"}},h.a.createElement(m.a,{style:D[0]},h.a.createElement(y.a,{style:v.b.black.bodyS.regular},"Name")),h.a.createElement(m.a,{style:D[1]},h.a.createElement(y.a,{style:v.b.black.bodyS.regular},"Email")),h.a.createElement(m.a,{style:D[2]},h.a.createElement(y.a,{style:v.b.black.bodyS.regular},"Role")),h.a.createElement(m.a,{style:D[3]},h.a.createElement(y.a,{style:v.b.black.bodyS.regular},"Actions"))),n.renderUserListSeparator())},n.renderUserListItem=function(e){var t=n.props.userAdmin.updatingUsers;return h.a.createElement(m.a,{key:e.uid},h.a.createElement(m.a,{style:{flexDirection:"row",height:P,alignItems:"center"}},h.a.createElement(m.a,{style:D[0]},h.a.createElement(y.a,{style:v.b.black.bodyXS.thin},(e.firstName||"")+(void 0!==e.firstName&&void 0!==e.surname?" ":"")+(e.surname||""))),h.a.createElement(m.a,{style:D[1]},h.a.createElement(y.a,{style:v.b.black.bodyXS.thin},e.email||"Google user")),h.a.createElement(m.a,{style:D[2]},h.a.createElement(y.a,{style:v.b.black.bodyXS.thin},e.role)),h.a.createElement(m.a,{style:[D[3],{flexDirection:"row",alignItems:"center",justifyContent:"flex-end"}]},h.a.createElement(b.a,{onPress:function(){return n.onEditUser(e.uid)},disabled:t},h.a.createElement(g.a,{source:v.c.edit,style:{width:v.d.icons.small,height:v.d.icons.small,tintColor:v.a.highlight}})),e.role!=O.e.inactive&&h.a.createElement(A.a.Spacer,null),e.role!=O.e.inactive&&h.a.createElement(b.a,{onPress:function(){return n.onDeleteUser(e.uid)},disabled:t},h.a.createElement(g.a,{source:v.c.trash,style:{width:v.d.icons.small,height:v.d.icons.small,tintColor:v.a.red}})))),n.renderUserListSeparator())},n.state={fetchedUsers:!1},n}return i()(r,[{key:"componentDidMount",value:function(){this.props.userAdmin.updatingUsers||(this.setState({fetchedUsers:!0}),this.props.dispatch(R.Actions.getUsers.request()))}},{key:"componentDidUpdate",value:function(e){var t=this.props.userAdmin.updatingUsers;e.userAdmin.updatingUsers&&!t&&(this.state.fetchedUsers||(this.setState({fetchedUsers:!0}),this.props.dispatch(R.Actions.getUsers.request())))}},{key:"render",value:function(){var e=this,t=this.props.userAdmin,r=t.users,n=t.updatingUsers;return h.a.createElement(A.a.Screen,{forceScrollbar:!0,paddingVertical:v.d.quadBaseMargin,paddingHorizontal:v.d.eightBaseMargin},h.a.createElement(m.a,{style:{flexDirection:"row",alignItems:"center",justifyContent:"space-between"}},h.a.createElement(y.a,{style:v.b.black.bodyL.bold},"Active Users"),h.a.createElement(S.Button,{text:"Add new user",onPress:this.onAddUser,disabled:n,theme:S.BUTTON_THEME_FIXED_RED})),h.a.createElement(A.a.SpacerDouble,null),this.renderUserListHeader(),h.a.createElement(m.a,null,void 0!==r&&h.a.createElement(m.a,{style:{opacity:void 0===r||n?v.d.invalidOpacity:void 0}},r.map((function(t){return e.renderUserListItem(t)}))),n&&h.a.createElement(E.a,{style:{width:"100%",height:"100%",minHeight:3*P,maxHeight:20*P,position:"absolute",backgroundColor:void 0===r?v.a.loadingBackground:void 0},activityIndicatorColor:v.a.black})),h.a.createElement(A.a.SpacerDouble,null))}}]),r}(h.a.Component);w.title="Settings";t.a=Object(k.b)((function(e){return{userAdmin:e.userAdmin}}))(w);var M=w.title},,,,,,,,function(e,t,r){"use strict";r.d(t,"BookingSource",(function(){return n}));var n;r(202);!function(e){e[e.App=0]="App",e[e.Web=1]="Web"}(n||(n={}))},,,,function(e,t,r){"use strict";r(230);var n=r(500);r.d(t,"ConnectedBarChart",(function(){return n.a}));r(203),r(231)},,function(e,t,r){"use strict";r.d(t,"a",(function(){return a}));var n=r(19),a={setHasChanges:Object(n.createStandardAction)("menu/SET_HAS_CHANGES")(),setMenuItem:Object(n.createStandardAction)("menu/SET_MENU_ITEM")(),openMenu:Object(n.createAction)("menu/OPEN_MENU"),closeMenu:Object(n.createAction)("menu/CLOSE_MENU"),toggleMenu:Object(n.createAction)("menu/TOGGLE_MENU")}},function(e,t,r){"use strict";r.d(t,"a",(function(){return a}));var n=r(19),a={setCarparkList:Object(n.createAction)("SET_CARPARK_LIST",(function(e){return function(t){return e(t)}})),setSchoolHolidays:Object(n.createAction)("SET_SCHOOL_HOLIDAYS",(function(e){return function(t){return e(t)}})),setPublicHolidays:Object(n.createAction)("SET_PUBLIC_HOLIDAYS",(function(e){return function(t){return e(t)}})),setAppVersions:Object(n.createAction)("SET_APP_VERSIONS",(function(e){return function(t){return e(t)}})),setLastImported:Object(n.createAction)("SET_LAST_IMPORTED",(function(e){return function(t){return e(t)}}))}},function(e,t,r){"use strict";var n=r(232);r.d(t,"StarRating",(function(){return n.a}));var a=r(501);r.d(t,"ConnectedStarRating",(function(){return a.a}));var o=r(206);r.o(o,"STAR_RATING_THEME_DEFAULT")&&r.d(t,"STAR_RATING_THEME_DEFAULT",(function(){return o.STAR_RATING_THEME_DEFAULT}));var i=r(158);r.d(t,"STAR_RATING_THEME_DEFAULT",(function(){return i.a}))},,,,,,,,,function(e,t,r){"use strict";r.d(t,"i",(function(){return s})),r.d(t,"a",(function(){return u})),r.d(t,"g",(function(){return d})),r.d(t,"f",(function(){return p})),r.d(t,"h",(function(){return f})),r.d(t,"b",(function(){return h})),r.d(t,"d",(function(){return m})),r.d(t,"e",(function(){return y})),r.d(t,"c",(function(){return g}));var n=r(12),a=r.n(n),o=r(1),i=r(109);function l(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function c(e){for(var t=1;t0&&void 0!==arguments[0]&&arguments[0];return e?f.b.promoPushService.prod:f.b.promoPushService.staging}},{key:"getApi",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],r=e.getAPIConfig(t),n=r.apiKey,a=r.apiBaseUrl;return new p.b({apiKey:n},a)}},{key:"authenticate",value:function(){var e;return i.a.async((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=m.a.auth().currentUser){t.next=3;break}throw new Error("You are not currently logged in");case 3:return t.abrupt("return",e.getIdToken());case 4:case"end":return t.stop()}}),null,null,null,Promise)}},{key:"getAllCampaigns",value:function(t){return e.authenticate().then((function(r){return e.getApi(t).getAllCampaigns({headers:{Authorization:r}}).then((function(e){return e.campaigns||[]}))}))}},{key:"convertBeforeSet",value:function(e){return g({},e)}},{key:"convertAfterSet",value:function(e,t){return g({},e,{campaignType:e.campaignType,codeFiles:t})}},{key:"setCampaign",value:function(t,r){return e.authenticate().then((function(n){return e.getApi(r).setCampaign(t.campaignId,e.convertBeforeSet(t),{headers:{Authorization:n}}).then((function(r){return e.convertAfterSet(r,t.codeFiles)}))}))}},{key:"uploadCodeFile",value:function(t){var r=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=new FormData;n.append("file",t.file);var a=e.getAPIConfig(r),o=a.apiKey,i=a.apiBaseUrl,l=i+"/promo/campaign/"+t.campaignId+"/codefile";return e.authenticate().then((function(e){return fetch(l,{method:"POST",headers:{Authorization:String(e),"X-API-Key":String(o)},body:n})})).then((function(e){return e.json().then((function(t){return{success:200===e.status,message:t.message}}))}))}},{key:"deleteCodeFile",value:function(t,r){return e.authenticate().then((function(n){return e.getApi(r).deleteCodesFile(t.campaignId,{fileName:t.file},{headers:{Authorization:n}})}))}},{key:"getCampaign",value:function(t){return e.authenticate().then((function(r){return e.getApi().getCampaign(t,{headers:{Authorization:r}})}))}},{key:"adminDeleteUserBan",value:function(t,r){return e.authenticate().then((function(n){return e.getApi(r).adminDeleteUserBan(t,{headers:{Authorization:n}})}))}},{key:"adminGetPaymentDetailUpdates",value:function(t,r){return e.authenticate().then((function(n){return e.getApi(r).adminGetPaymentDetailUpdates(t,{headers:{Authorization:n}})}))}}]),e}()},function(e,t,r){"use strict";var n=r(12),a=r.n(n),o=r(211);function i(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}t.a=function(e){for(var t=1;t1&&void 0!==r[1]?r[1]:{},n.abrupt("return",fetch(e,t).then((function(t){return t.ok&&200===t.status?t.json().catch((function(r){console.log("Warning: fetch "+e+" status "+t.status+" but decoding json failed with",r)})):t.json().catch((function(e){throw new Error("Request failed with status "+t.status)})).then((function(e){throw new Error(void 0!==e&&void 0!==e.message?e.message:"Request failed with status "+t.status)}))})));case 2:case"end":return n.stop()}}),null,null,null,Promise)}function y(e,t,r,n){var o,i,l,c,s=arguments;return a.a.async((function(a){for(;;)switch(a.prev=a.next){case 0:return o=s.length>4&&void 0!==s[4]?s[4]:"GET",i={headers:{Authorization:n,"Content-Type":"application/json"},method:o,mode:"cors"},l=e+"/"+t,"POST"===o&&(i.body=JSON.stringify(r)),"GET"===o&&void 0!==r&&(c=Object.keys(r).filter((function(e){return null!==r[e]&&void 0!==r[e]})).map((function(e){return encodeURIComponent(e)+"="+encodeURIComponent(r[e].toString())})).join("&"),l+="?"+c),a.abrupt("return",m(l,i));case 6:case"end":return a.stop()}}),null,null,null,Promise)}function g(e,t,r,n){var o;return a.a.async((function(a){for(;;)switch(a.prev=a.next){case 0:return o={headers:h({Authorization:"Bearer "+n},t),method:"POST",mode:"cors",body:r},a.abrupt("return",m(e,o));case 2:case"end":return a.stop()}}),null,null,null,Promise)}var b=r(73),A=r(517),E=r(55),v=function(){function e(){i()(this,e)}return c()(e,null,[{key:"init",value:function(e,t){this.apiBaseUrl=e,this.defaultDatabase=t}},{key:"dailyValue",value:function(e){var t,r,n,o,i=arguments;return a.a.async((function(a){for(;;)switch(a.prev=a.next){case 0:return t=i.length>1&&void 0!==i[1]?i[1]:"$date",r=i.length>2&&void 0!==i[2]?i[2]:"$value",n=i.length>3&&void 0!==i[3]?i[3]:"$count",o=i.length>4?i[4]:void 0,a.abrupt("return",this.postQuery(b.b.newRequest(null!=o?o:this.defaultDatabase,{collectionKey:e,dateKey:t,valueKey:r||void 0,countKey:n||void 0})).then((function(e){return e||[]})));case 5:case"end":return a.stop()}}),null,this,null,Promise)}},{key:"dailyValueFromParams",value:function(e,t){return a.a.async((function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",this.postQuery(b.b.newRequest(null!=t?t:this.defaultDatabase,e)).then((function(e){return e||[]})));case 1:case"end":return r.stop()}}),null,this,null,Promise)}},{key:"dailyMultiValue",value:function(e,t){var r,n,o,i,l=arguments;return a.a.async((function(a){for(;;)switch(a.prev=a.next){case 0:return r=l.length>2&&void 0!==l[2]?l[2]:[],n=l.length>3&&void 0!==l[3]?l[3]:[],o=l.length>4&&void 0!==l[4]?l[4]:"$date",i=l.length>5?l[5]:void 0,a.abrupt("return",this.postQuery(b.b.newRequest(null!=i?i:this.defaultDatabase,{collectionKey:e,dateKey:o,multiValueKeys:t,multiCountKeys:r,extraKeys:n})).then((function(e){return t.map((function(t,n){var a=r[n];return(e||[]).map((function(e){return{date:e.date,value:t?e[t]:1,count:a?e[a]:1}}))}))})));case 5:case"end":return a.stop()}}),null,this,null,Promise)}},{key:"groupedDailyValue",value:function(e){var t,r,n,o,i,l=arguments;return a.a.async((function(a){for(;;)switch(a.prev=a.next){case 0:return t=l.length>1&&void 0!==l[1]?l[1]:"$date",r=l.length>2&&void 0!==l[2]?l[2]:"$value",n=l.length>3&&void 0!==l[3]?l[3]:"$count",o=l.length>4&&void 0!==l[4]?l[4]:"$category",i=l.length>5?l[5]:void 0,a.abrupt("return",this.postQuery(b.d.newRequest(null!=i?i:this.defaultDatabase,{collectionKey:e,dateKey:t,valueKey:r||void 0,countKey:n||void 0,groupKey:o})).then((function(e){return e||[]})));case 6:case"end":return a.stop()}}),null,this,null,Promise)}},{key:"dailyMultiValueToGroupedDailyValue",value:function(e,t,r){var n,o,i,l,c,s=arguments;return a.a.async((function(a){for(;;)switch(a.prev=a.next){case 0:return n=s.length>3&&void 0!==s[3]?s[3]:[],o=s.length>4&&void 0!==s[4]?s[4]:[],i=s.length>5?s[5]:void 0,l=s.length>6&&void 0!==s[6]?s[6]:"$date",c=s.length>7?s[7]:void 0,a.abrupt("return",this.postQuery(b.b.newRequest(null!=c?c:this.defaultDatabase,{collectionKey:e,dateKey:l,multiValueKeys:r,multiCountKeys:n,extraKeys:o,filter:i})).then((function(e){return t.map((function(t,a){var i=r[a],l=n[a];return(e||[]).map((function(e){var r={date:e.date,group:t,value:i?e[i]:1,count:l?e[l]:1};return o.length>0&&o.forEach((function(t){r[t]=e[t]})),r}))})).reduce((function(e,t){return e.concat(t)}))})));case 6:case"end":return a.stop()}}),null,this,null,Promise)}},{key:"groupedDailyValueFromParams",value:function(e,t){return a.a.async((function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",this.postQuery(b.d.newRequest(null!=t?t:this.defaultDatabase,e)).then((function(e){return e||[]})));case 1:case"end":return r.stop()}}),null,this,null,Promise)}},{key:"holidaysPublic",value:function(e,t){var r;return a.a.async((function(n){for(;;)switch(n.prev=n.next){case 0:return r=b.e.publicHolidays(null!=t?t:this.defaultDatabase,e),n.abrupt("return",this.postQuery(r).then((function(e){return e||[]})));case 2:case"end":return n.stop()}}),null,this,null,Promise)}},{key:"holidaysSchool",value:function(e,t){var r;return a.a.async((function(n){for(;;)switch(n.prev=n.next){case 0:return r=b.e.schoolHolidays(null!=t?t:this.defaultDatabase,e),n.abrupt("return",this.postQuery(r));case 2:case"end":return n.stop()}}),null,this,null,Promise)}},{key:"calendarEvents",value:function(e,t){var r;return a.a.async((function(n){for(;;)switch(n.prev=n.next){case 0:return r=b.a.newRequest(null!=t?t:this.defaultDatabase,e),n.abrupt("return",this.postQuery(r));case 2:case"end":return n.stop()}}),null,this,null,Promise)}},{key:"locationEvents",value:function(e,t){var r;return a.a.async((function(n){for(;;)switch(n.prev=n.next){case 0:return r=b.f.newRequest(null!=t?t:this.defaultDatabase,e),n.abrupt("return",this.postQuery(r));case 2:case"end":return n.stop()}}),null,this,null,Promise)}},{key:"tableData",value:function(e,t,r){return a.a.async((function(n){for(;;)switch(n.prev=n.next){case 0:return n.abrupt("return",this.tableDataRequest({database:null!=r?r:this.defaultDatabase,collection:e,query:{options:{allowDiskUse:!0},pipeline:t?[E.g({field:t})]:[]},operation:"aggregate"}));case 1:case"end":return n.stop()}}),null,this,null,Promise)}},{key:"tableDataPipeline",value:function(e){var t;return a.a.async((function(r){for(;;)switch(r.prev=r.next){case 0:return t=b.i.newRequestPipeline(e),r.abrupt("return",this.postQuery(t).then((function(e){return e||[]})));case 2:case"end":return r.stop()}}),null,this,null,Promise)}},{key:"tableDataRequest",value:function(e){return a.a.async((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.postQuery(e).then((function(e){return e||[]})));case 1:case"end":return t.stop()}}),null,this,null,Promise)}},{key:"checkPermission",value:function(e){var t;return a.a.async((function(r){for(;;)switch(r.prev=r.next){case 0:if(void 0!==this.apiBaseUrl){r.next=2;break}throw"apiBaseUrl undefined, did you call init?";case 2:return t=this.apiBaseUrl+"/auth/login",r.abrupt("return",this.authenticate().then((function(r){return fetch(t,{method:"POST",mode:"cors",headers:{"Content-Type":"application/json"},body:JSON.stringify({token:r,role:e})}).then((function(e){return e.ok?e.json().catch((function(e){console.log("Warning: Login endpoint did not return a response body (role will default to viewer)")})):e.json().then((function(e){throw e}))}))})));case 4:case"end":return r.stop()}}),null,this,null,Promise)}},{key:"authenticate",value:function(){var e;return a.a.async((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=u.a.auth().currentUser){t.next=3;break}throw new Error("You are not currently logged in");case 3:return t.abrupt("return",e.getIdToken());case 4:case"end":return t.stop()}}),null,null,null,Promise)}},{key:"postQuery",value:function(e){var t,r;return a.a.async((function(n){for(;;)switch(n.prev=n.next){case 0:if(void 0!==this.apiBaseUrl){n.next=2;break}throw"apiBaseUrl undefined, did you call init?";case 2:return t=this.apiBaseUrl+"/query",r={"Content-Type":"application/bson"},n.abrupt("return",this.authenticate().then((function(n){return g(t,r,A.a(e),n)})));case 5:case"end":return n.stop()}}),null,this,null,Promise)}},{key:"createUser",value:function(e){var t=this;return a.a.async((function(r){for(;;)switch(r.prev=r.next){case 0:if(void 0!==this.apiBaseUrl){r.next=2;break}throw"apiBaseUrl undefined, did you call init?";case 2:return r.abrupt("return",this.authenticate().then((function(r){return y(t.apiBaseUrl,"auth/createUser",e,"Bearer "+r,"POST")})));case 3:case"end":return r.stop()}}),null,this,null,Promise)}},{key:"updateUser",value:function(e){var t=this;return a.a.async((function(r){for(;;)switch(r.prev=r.next){case 0:if(void 0!==this.apiBaseUrl){r.next=2;break}throw"apiBaseUrl undefined, did you call init?";case 2:return r.abrupt("return",this.authenticate().then((function(r){return y(t.apiBaseUrl,"auth/updateUser",e,"Bearer "+r,"POST")})));case 3:case"end":return r.stop()}}),null,this,null,Promise)}},{key:"deleteUser",value:function(e){var t=this;return a.a.async((function(r){for(;;)switch(r.prev=r.next){case 0:if(void 0!==this.apiBaseUrl){r.next=2;break}throw"apiBaseUrl undefined, did you call init?";case 2:return r.abrupt("return",this.authenticate().then((function(r){return y(t.apiBaseUrl,"auth/deleteUser",e,"Bearer "+r,"POST")})));case 3:case"end":return r.stop()}}),null,this,null,Promise)}},{key:"getUsers",value:function(){var e=this;return a.a.async((function(t){for(;;)switch(t.prev=t.next){case 0:if(void 0!==this.apiBaseUrl){t.next=2;break}throw"apiBaseUrl undefined, did you call init?";case 2:return t.abrupt("return",this.authenticate().then((function(t){return y(e.apiBaseUrl,"auth/getUsers",void 0,"Bearer "+t)})));case 3:case"end":return t.stop()}}),null,this,null,Promise)}},{key:"summaryScreenAllTimeUsers",value:function(){var e;return a.a.async((function(t){for(;;)switch(t.prev=t.next){case 0:return e=b.h.newRequest(),t.abrupt("return",this.postQuery(e).then((function(e){return e?e[0]:{value:0}})));case 2:case"end":return t.stop()}}),null,this,null,Promise)}},{key:"summaryScreenActiveUsers",value:function(e){var t;return a.a.async((function(r){for(;;)switch(r.prev=r.next){case 0:return t=b.g.newRequest(e),r.abrupt("return",this.postQuery(t).then((function(e){return e?e[0]:{value:0}})));case 2:case"end":return r.stop()}}),null,this,null,Promise)}},{key:"feedback",value:function(e){var t;return a.a.async((function(r){for(;;)switch(r.prev=r.next){case 0:return t=b.c.newRequest(e),r.abrupt("return",this.postQuery(t).then((function(e){return e||[]})));case 2:case"end":return r.stop()}}),null,this,null,Promise)}}]),e}()},,,,,,,,,function(e,t,r){"use strict";r.d(t,"a",(function(){return S}));var n,a,o=r(10),i=r.n(o),l=r(11),c=r.n(l),s=r(15),u=r.n(s),d=r(7),p=r.n(d),f=r(14),h=r.n(f),m=r(0),y=r.n(m),g=r(2),b=r(25),A=r(79),E=r(52);function v(e){var t=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=p()(e);if(t){var a=p()(this).constructor;r=Reflect.construct(n,arguments,a)}else r=n.apply(this,arguments);return u()(this,r)}}!function(e){e.up="Up",e.down="Down",e.vertical="Vertical",e.left="Left",e.right="Right",e.horizontal="Horizontal"}(n||(n={})),function(e){e.linear="linear",e.spring="spring"}(a||(a={}));var S=function(e){h()(r,e);var t=v(r);function r(e,n){var o;return i()(this,r),(o=t.call(this,e,n)).close=function(){var e=o.props.expandStyle;e===a.linear?b.a.timing(o.state.anim,{easing:A.a.linear,duration:o.props.duration,toValue:0}).start():e===a.spring&&b.a.spring(o.state.anim,{toValue:0,friction:50,tension:100}).start()},o.open=function(){var e=o.props.expandStyle;e===a.linear?b.a.timing(o.state.anim,{easing:A.a.linear,duration:o.props.duration,toValue:1}).start():e===a.spring&&b.a.spring(o.state.anim,{toValue:1,friction:50,tension:100}).start()},o.setChildrenExpanse=function(e){var t=e.nativeEvent.layout,r=t.width,n=t.height,a=o.isHorizontal()?r:n;o.state.childrenExpanse!==a&&o.setState({childrenExpanse:a})},o.state={anim:o.props.anim||new b.a.Value(e.visible?1:0)},o}return c()(r,[{key:"componentDidUpdate",value:function(e,t){this.props.visible!==e.visible&&(this.props.visible?this.open():this.close())}},{key:"isHorizontal",value:function(){var e=this.props.direction;return e===n.left||e===n.right||e===n.horizontal}},{key:"render",value:function(){var e=this.props,t=e.children,r=e.minExpanse,a=e.maxExpanse,o=e.direction,i=this.state.anim,l=this.isHorizontal(),c=!this.props.visible||void 0!==this.state.childrenExpanse,s=c&&l?i.interpolate({inputRange:[0,1],outputRange:[r,Math.min(this.state.childrenExpanse||0,a)],extrapolate:"clamp"}):void 0,u=c&&!l?i.interpolate({inputRange:[0,1],outputRange:[r,Math.min(this.state.childrenExpanse||0,a)],extrapolate:"clamp"}):void 0,d=r>0?1:i.interpolate({inputRange:[0,.5,.75,1],outputRange:[0,.25,.5,1],extrapolate:"clamp"}),p=l?"row":"column",f="flex-start";return o!==n.left&&o!==n.up||(f="flex-end"),o!==n.vertical&&o!==n.horizontal||(f="center"),y.a.createElement(g.a,{style:{overflow:"hidden",backgroundColor:"#00000000"},pointerEvents:"box-none"},y.a.createElement(b.a.View,{style:{overflow:"web"===E.a.OS?"visible":"scroll",width:s,height:u,opacity:d,minWidth:l?r:void 0,maxWidth:l?a:void 0,minHeight:l?void 0:r,maxHeight:l?void 0:a,flexDirection:p,justifyContent:f},pointerEvents:"box-none"},y.a.createElement(g.a,{onLayout:this.setChildrenExpanse,style:{flexDirection:p},pointerEvents:"box-none"},t)))}}]),r}(y.a.PureComponent);S.defaultProps={expandStyle:a.spring,duration:300,minExpanse:0,maxExpanse:1e4,direction:n.down}},,,,function(e,t,r){"use strict";var n=r(498);r.d(t,"default",(function(){return n.a}));r(499)},,,,,,,,function(e,t,r){"use strict";r.d(t,"a",(function(){return c})),r.d(t,"b",(function(){return s}));var n=r(12),a=r.n(n),o=r(1),i=r(24);function l(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}var c={headerColor:o.a.highlight,backgroundColor:o.a.pageBackground,borderWidth:2,borderRadius:o.d.borderRadius,titleTextStyle:o.b.white.bodyL.bold,messageTextStyle:o.b.black.bodyM.thin,buttonTheme:i.BUTTON_THEME_GLOBAL_MESSAGE,modalOverlayColor:o.a.modalOverlayColor},s=function(e){for(var t=1;t0?t.moveX:t.x0)-n._layout.x,i=(t.moveY>0?t.moveY:t.y0)-n._layout.y,l=t.moveX>0?t.moveX:t.x0,c=t.moveY>0?t.moveY:t.y0;return a&&(o=Math.min(Math.max(o,0),n._layout.width),i=Math.min(Math.max(i,0),n._layout.height)),{x:o,y:i,screenX:l,screenY:c,viewRect:k({},n._layout)}}},n.onTouchGrant=function(e,t){var r=n.props.parentView||n._ref;r.current&&r.current.measure((function(r,a,o,i,l,c){if(n._layout={x:l,y:c,width:o,height:i},void 0!==n.props.onTouchGrant){var s=n.getPanEvent(e,t);s&&n.props.onTouchGrant(s)}}))},n.onTouchMove=function(e,t){if(Math.abs(t.dx)>Math.abs(t.dy)+20&&n.props.scrollView&&n.props.scrollView.current&&"ios"===A.a.OS&&n.props.scrollView.current.setNativeProps({scrollEnabled:!1}),void 0!==n.props.onTouchMove){var r=n.getPanEvent(e,t);r&&n.props.onTouchMove(r)}},n.onTouchRelease=function(e,t){if(n.props.scrollView&&n.props.scrollView.current&&"ios"===A.a.OS&&n.props.scrollView.current.setNativeProps({scrollEnabled:!0}),void 0!==n.props.onTouchRelease){var r=n.getPanEvent(e,t);r&&n.props.onTouchRelease(r)}},n._panResponder=v.a.create({onStartShouldSetPanResponder:function(e,t){return!0},onStartShouldSetPanResponderCapture:function(e,t){return!0},onMoveShouldSetPanResponder:function(e,t){return!0},onMoveShouldSetPanResponderCapture:function(e,t){return!0},onPanResponderTerminationRequest:function(e,t){return!1},onPanResponderGrant:n.onTouchGrant,onPanResponderMove:n.onTouchMove,onPanResponderRelease:n.onTouchRelease,onPanResponderTerminate:n.onTouchRelease}),n.state={},n}return u()(r,[{key:"render",value:function(){return b.a.createElement(E.a,a()({ref:this._ref,style:[{backgroundColor:"transparent"},this.props.style]},this._panResponder.panHandlers,{onLayout:this.props.onLayout,onMouseEnter:this.props.onMouseEnter,onMouseLeave:this.props.onMouseLeave}),this.props.children)}}]),r}(b.a.PureComponent)},,,,,function(e,t,r){"use strict";r.d(t,"a",(function(){return a})),r.d(t,"b",(function(){return h}));var n=r(19),a={replyToAndroidReview:Object(n.createAction)("REPLY_TO_ANDROID_REVIEW",(function(e){return function(t,r){return e({review:t,text:r})}})),replyToIOSReview:Object(n.createAction)("REPLY_TO_IOS_REVIEW",(function(e){return function(t){return e({review:t})}}))},o=r(179),i=r(52),l=r(531),c=r(286),s=r(532),u=r(554),d=r(278),p=r(740),f=r(39),h=[function(e,t){return e.pipe(Object(u.a)(Object(n.isActionOf)(a.replyToAndroidReview)),Object(d.a)((function(e){var t=e.payload,r=t.review,n=t.text,a="https://www.googleapis.com/androidpublisher/v3/applications/{packageName}/reviews/{reviewId}:reply?access_token={accessToken}";return a=(a=(a=a.replace("{packageName}","au.com.wilsonone")).replace("{reviewId}",r.id)).replace("{accessToken}","a7264dccf78df18a10307f1aa2f1c44e56c09360"),Object(l.a)({url:a,text:n})})),Object(d.a)((function(e){var t=e.url,r=e.text;return Object(c.a)(fetch(t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({replyText:r})}))})),Object(d.a)((function(e){return Object(c.a)(e.json())})),Object(d.a)((function(e){var t=e.result,r=t.replyText,n=t.lastEdited.seconds;return console.log("Review reply successful at "+n+": "+r),Object(l.a)(f.a.setGlobalMessage({title:"Success",message:"Your reply was successfully submitted. It will appear in the table following the next data update."}))})),Object(p.a)((function(e){return console.error("Error posting review reply",e),Object(l.a)(f.a.setError({title:"Error",message:"There was an error submitting the review reply. Please try again later."}))})))},function(e,t){return e.pipe(Object(u.a)(Object(n.isActionOf)(a.replyToIOSReview)),Object(d.a)((function(e){var t=e.payload.review,r="https://appstoreconnect.apple.com/WebObjects/iTunesConnect.woa/ra/ng/app/{appId}/ios/ratingsResponses?reviewId={reviewId}";return r=(r=r.replace("{appId}","1368305246")).replace("{reviewId}",t.id),"web"==i.a.OS?window.open(r,"_blank"):o.a.canOpenURL(r)&&o.a.openURL(r),s.a})))}]},function(e,t,r){"use strict";var n=r(148);r.d(t,"default",(function(){return n.a}));r(502)},,,,function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t,r){"use strict";r.d(t,"default",(function(){return A}));var n=r(17),a=r.n(n),o=r(10),i=r.n(o),l=r(11),c=r.n(l),s=r(15),u=r.n(s),d=r(7),p=r.n(d),f=r(14),h=r.n(f),m=r(13),y=r(81),g=r(93);function b(e){var t=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=p()(e);if(t){var a=p()(this).constructor;r=Reflect.construct(n,arguments,a)}else r=n.apply(this,arguments);return u()(this,r)}}g.QueryService.init(m.b.dataService.apiBaseURL,m.b.dataService.database);var A=function(e){h()(r,e);var t=b(r);function r(){return i()(this,r),t.apply(this,arguments)}return c()(r,null,[{key:"bookings",value:function(e){var t;return a.a.async((function(r){for(;;)switch(r.prev=r.next){case 0:if(!e.carParks||0!=e.carParks.length){r.next=2;break}return r.abrupt("return",[]);case 2:return t=y.d.newRequest(e),r.abrupt("return",this.postQuery(t));case 4:case"end":return r.stop()}}),null,this,null,Promise)}},{key:"summaryScreenActiveUsers",value:function(e){var t;return a.a.async((function(r){for(;;)switch(r.prev=r.next){case 0:return t=y.l.newRequest(e),r.abrupt("return",this.postQuery(t).then((function(e){return e?e[0]:{value:0}})));case 2:case"end":return r.stop()}}),null,this,null,Promise)}},{key:"summaryScreenAllTimeUsers",value:function(){var e;return a.a.async((function(t){for(;;)switch(t.prev=t.next){case 0:return e=y.n.newRequest(),t.abrupt("return",this.postQuery(e).then((function(e){return e?e[0]:{value:0}})));case 2:case"end":return t.stop()}}),null,this,null,Promise)}},{key:"averageUserTypePurchases",value:function(e){var t;return a.a.async((function(r){for(;;)switch(r.prev=r.next){case 0:if(!e.carParks||0!=e.carParks.length){r.next=2;break}return r.abrupt("return",[]);case 2:return t=y.b.newRequest(e),r.abrupt("return",this.postQuery(t));case 4:case"end":return r.stop()}}),null,this,null,Promise)}},{key:"averageTransactionsPerUser",value:function(e){var t;return a.a.async((function(r){for(;;)switch(r.prev=r.next){case 0:return t=y.a.newRequest(e),r.abrupt("return",this.postQuery(t).then((function(e){return e&&e.length>0?e[0]:{value:0}})));case 2:case"end":return r.stop()}}),null,this,null,Promise)}},{key:"bookingsRevenue",value:function(e){var t;return a.a.async((function(r){for(;;)switch(r.prev=r.next){case 0:if(!e.carParks||0!=e.carParks.length){r.next=2;break}return r.abrupt("return",[]);case 2:return t=y.h.newRequest(e),r.abrupt("return",this.postQuery(t));case 4:case"end":return r.stop()}}),null,this,null,Promise)}},{key:"productsByBookingCount",value:function(e){var t;return a.a.async((function(r){for(;;)switch(r.prev=r.next){case 0:return t=y.f.byBookingCount(e),r.abrupt("return",this.postQuery(t).then((function(e){return 1===e.length?e[0].products:[]})));case 2:case"end":return r.stop()}}),null,this,null,Promise)}},{key:"productsByValue",value:function(e){var t;return a.a.async((function(r){for(;;)switch(r.prev=r.next){case 0:return t=y.f.byValue(e),r.abrupt("return",this.postQuery(t).then((function(e){return 1===e.length?e[0].products:[]})));case 2:case"end":return r.stop()}}),null,this,null,Promise)}},{key:"bookingsRevenuePrediction",value:function(e){var t;return a.a.async((function(r){for(;;)switch(r.prev=r.next){case 0:if(!e.carParks||0!=e.carParks.length){r.next=2;break}return r.abrupt("return",[]);case 2:return t=y.j.newRequest(e),r.abrupt("return",this.postQuery(t));case 4:case"end":return r.stop()}}),null,this,null,Promise)}},{key:"bookingsRevenuePredictionGrouped",value:function(e){var t;return a.a.async((function(r){for(;;)switch(r.prev=r.next){case 0:if(!e.carParks||0!=e.carParks.length){r.next=2;break}return r.abrupt("return",[]);case 2:return t=y.k.newRequest(e),r.abrupt("return",this.postQuery(t));case 4:case"end":return r.stop()}}),null,this,null,Promise)}},{key:"revenueByCarPark",value:function(e){var t;return a.a.async((function(r){for(;;)switch(r.prev=r.next){case 0:if(!e.carParks||0!=e.carParks.length){r.next=2;break}return r.abrupt("return",{});case 2:return t=y.i.newRequest(e),r.abrupt("return",this.postQuery(t).then((function(e){return e[0]})));case 4:case"end":return r.stop()}}),null,this,null,Promise)}},{key:"bookingCountsByCarPark",value:function(e){var t;return a.a.async((function(r){for(;;)switch(r.prev=r.next){case 0:if(!e.carParks||0!=e.carParks.length){r.next=2;break}return r.abrupt("return",{});case 2:return t=y.c.newRequest(e),r.abrupt("return",this.postQuery(t).then((function(e){return e[0]})));case 4:case"end":return r.stop()}}),null,this,null,Promise)}},{key:"promoCampaignStats",value:function(){var e;return a.a.async((function(t){for(;;)switch(t.prev=t.next){case 0:return e=y.g.newPromoCampaignStatRequest(),t.abrupt("return",this.postQuery(e));case 2:case"end":return t.stop()}}),null,this,null,Promise)}},{key:"summaryScreenAllTimeApplePay",value:function(){var e;return a.a.async((function(t){for(;;)switch(t.prev=t.next){case 0:return e=y.m.newRequest(),t.abrupt("return",this.postQuery(e).then((function(e){return e?e[0]:{value:0}})));case 2:case"end":return t.stop()}}),null,this,null,Promise)}}]),r}(g.QueryService)},function(e,t){},,,function(e,t,r){"use strict";var n=r(12),a=r.n(n),o=r(110),i=r(80);function l(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}var c={bold:{fontFamily:"Roboto-Bold"},regular:{fontFamily:"Roboto-Regular"},thin:{fontFamily:"Roboto-Light"},boldItalic:{fontFamily:"Roboto-BoldItalic"},regularItalic:{fontFamily:"Roboto-RegularItalic"},thinItalic:{fontFamily:"Roboto-LightItalic"}},s={h0:42*i.a.screenScale,h1:28*i.a.screenScale,h2:24*i.a.screenScale,bodyL:20*i.a.screenScale,bodyM:16*i.a.screenScale,bodyS:12*i.a.screenScale,bodyXS:10*i.a.screenScale,bodyXXS:8*i.a.screenScale},u=1.34*i.a.screenScale;function d(e){return function(e){var t=e.sizes||s,r=Object.keys(t),n=e.types||c,o=Object.keys(n),i={};return r.forEach((function(t){var r=s[t],n={};o.forEach((function(t){n[t]=function(e){for(var t=1;t0?b.c.valueUp:e<0?b.c.valueDown:b.c.valueFixed}var R=function(e){p()(r,e);var t=T(r);function r(){var e;a()(this,r);for(var n=arguments.length,o=new Array(n),i=0;i0?r.percentageIncreaseColor:t<0?r.percentageDecreaseColor:b.a.lightGrey},e.renderPercentageChangeElement=function(t){var r=e.getTheme();return void 0===t?null:h.a.createElement(y.a,{style:{flexDirection:"row",alignItems:"center",justifyContent:"center"}},h.a.createElement(g.a,{style:{width:b.d.icons.tiny/2,height:b.d.icons.tiny,tintColor:e.getPercentageChangeColor(t)},source:O(t)}),h.a.createElement(A.a.SpacerSmall,null),h.a.createElement(m.a,{style:[r.percentageFont,{color:e.getPercentageChangeColor(t)}]},Object(S.c)(t,S.a.Percent)))},e}return i()(r,[{key:"getTheme",value:function(){var e=this.props,t=e.theme,r=e.data;return Object(v.i)(t)?t:t(r?r.value:0)}},{key:"render",value:function(){var e=this.props,t=e.data,r=e.dataStampInvalid,n=e.style,a=this.getTheme();if(!t)return h.a.createElement(E.a,{showLoading:!0,style:{alignSelf:n.alignSelf,flex:n.flex,minWidth:n.minWidth,minHeight:n.minHeight,maxWidth:n.maxWidth,maxHeight:n.maxHeight,width:160,height:80}});var o={};return t.description&&(o="center"===a.alignItems?{paddingHorizontal:a.infoButtonTheme.buttonSize}:{paddingRight:a.infoButtonTheme.buttonSize}),h.a.createElement(y.a,{style:{overflow:"hidden",alignSelf:n.alignSelf,alignItems:a.alignItems,flex:n.flex,minWidth:n.minWidth,minHeight:n.minHeight,maxWidth:n.maxWidth,maxHeight:n.maxHeight,backgroundColor:a.backgroundColor,borderRadius:a.borderRadius,borderWidth:a.borderWidth,borderColor:a.borderColor,paddingVertical:b.d.smallMargin,paddingHorizontal:b.d.baseMargin,opacity:r?b.d.invalidOpacity:void 0}},h.a.createElement(m.a,{style:[a.titleFont,o]},t.title),h.a.createElement(m.a,{style:a.valueFont},Object(S.c)(t.value,t.valueType)),this.renderPercentageChangeElement(t.percentageChange),t.secondaryValue&&h.a.createElement(y.a,{style:{marginTop:t.percentageChange?b.d.baseMargin:void 0}},h.a.createElement(m.a,{style:a.secondaryValueFont},t.secondaryValue," ")),t.description&&h.a.createElement(y.a,{style:{position:"absolute",top:b.d.infoButtonPadding,right:b.d.infoButtonPadding}},h.a.createElement(k.InfoButton,{title:t.title,description:t.description,theme:a.infoButtonTheme})))}}]),r}(f.PureComponent);R.defaultProps={style:{},theme:v.a}},function(e,t,r){"use strict";r.d(t,"a",(function(){return c})),r.d(t,"b",(function(){return s}));var n=r(12),a=r.n(n),o=r(1),i=r(67);function l(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}var c={buttonSize:o.d.infoButtonSize,buttonColor:o.a.softHighlight,titleFont:o.b.black.bodyM.regular,descriptionFont:o.b.grey.bodyS.thin,maxWidth:500},s=function(e){for(var t=1;t0){var u=!!o.isVertical,d=n.getBarThickness();if(r=Math.min(Math.max(0,Math.floor((u?e.x:e.y)/d)),o.items.length-1),n.setState({selectedIndex:r}),void 0!==r){var p=o.items[r],f=p.label,h=p.value;if(p.childItems&&l){var m=s;l[r].some((function(t,r){var a=p.childItems.length-r-1;if((m-=t)=1)if(a.isVertical)for(;t*c<50;)c+=2;else for(;t*c<20;)c+=2;return y.a.createElement(g.a,{style:{flexDirection:e?"row":"column"}},a.items.map((function(n,s){return s%c===Math.floor(c/2)?y.a.createElement(g.a,{key:"main_label_"+s,style:{width:e?t*c:void 0,maxWidth:e?void 0:100,height:e?void 0:t*c,maxHeight:e?20+M:void 0,paddingHorizontal:e?r:void 0,paddingVertical:e?void 0:r,alignItems:"center",justifyContent:e?"flex-start":"space-between",flexDirection:e?"column":"row"}},a.isVertical&&y.a.createElement(g.a,{style:{width:1,height:M,backgroundColor:c>1?i.axisColor:void 0}}),y.a.createElement(b.a,{style:s===o?i.selectedLabelFont:i.labelFont,numberOfLines:l},n.label),!a.isVertical&&y.a.createElement(g.a,{style:{width:M,height:1,backgroundColor:c>1?i.axisColor:void 0}})):null})))}},{key:"renderBars",value:function(e,t,r){var n=this,a=this.state,o=a.data,i=a.animValues,l=a.topValue,c=a.selectedIndex,s=this.props.theme,u=this.getBarLength(l,l),d=!0;return!o.isVertical&&t<20&&(d=!1),o.isVertical&&t<50&&(d=!1),y.a.createElement(g.a,{style:{flex:1,flexDirection:e?"row":"column",borderLeftWidth:e?void 0:1,borderLeftColor:e?void 0:s.axisColor,borderBottomWidth:e?1:void 0,borderBottomColor:e?s.axisColor:void 0}},o.items.map((function(a,l){var p=i[l].interpolate({inputRange:[0,u],outputRange:[0,u],extrapolate:"clamp"}),f=l===c?a.selectedColor||s.selectedBarColor:a.color||s.barColor,h={flexDirection:e?"column":"row",height:e?void 0:t,width:e?t:void 0,paddingHorizontal:e?r:void 0,paddingVertical:e?void 0:r,justifyContent:e?"flex-end":"flex-start",alignItems:"center"};return a.childItems?n.renderChildViews(l,h,a,u,e):y.a.createElement(g.a,{key:"main_bar_"+l,style:h},d&&e&&n.textLabel(!1,s,f,e,i[l],a.value,o.valueType),y.a.createElement(A.a.View,{style:{flexDirection:e?"column":"row",width:e?"100%":p,height:e?p:"100%",backgroundColor:f,alignItems:"center",justifyContent:e?"flex-start":"flex-end",overflow:"hidden",borderTopLeftRadius:e?s.barRounding:void 0,borderTopRightRadius:s.barRounding,borderBottomRightRadius:e?void 0:s.barRounding}},d&&n.textLabel(!0,s,f,e,i[l],a.value,o.valueType)),d&&!e&&n.textLabel(!1,s,f,e,i[l],a.value,o.valueType))})))}},{key:"renderChildViews",value:function(e,t,r,n,a){var o=this,i=this.state,l=i.childAnimValues,c=i.data,s=i.selectedChildIndex,u=i.selectedIndex,d=this.props.theme,p=this.getColorMap(c.items);return y.a.createElement(g.a,{key:"main_bar_"+e,style:t},y.a.createElement(g.a,{style:{borderTopLeftRadius:a?d.barRounding:void 0,borderTopRightRadius:d.barRounding,borderBottomRightRadius:a?void 0:d.barRounding,overflow:"hidden",width:"100%"}},r.childItems.map((function(t,r){var i=l[e][r].interpolate({inputRange:[0,n],outputRange:[0,n],extrapolate:"clamp"}),c=void 0===u||void 0===s||u===e&&s===r?1:.6;return o.renderChild(t,i,a,p(r),c)}))))}},{key:"renderChild",value:function(e,t,r,n,a){return y.a.createElement(A.a.View,{key:"child_"+e.label,style:{width:r?"100%":t,height:r?t:"100%",backgroundColor:n,opacity:a}})}},{key:"getBarThickness",value:function(){var e=this.state,t=e.data,r=e.width,n=e.height,a=!!t.isVertical;return Math.max((a?r:n-this.getLegendHeight())/t.items.length,v.d.baseMargin)}},{key:"renderBarChart",value:function(){var e,t=this.state,r=t.data,n=t.width,a=t.height,o=t.axisOpacityAnim,i=this.props,l=i.dataStampInvalid,c=i.legend,s=!!r.isVertical,u=this.getBarThickness(),d=.05*u,p=this.getMaxChildSize(r.items),f=this.getColorMap(r.items);return y.a.createElement(g.a,null,c&&y.a.createElement(g.a,{style:{height:this.getLegendHeight(),maxHeight:this.getLegendHeight()}},y.a.createElement(U.d,{theme:U.a,items:null==p||null==(e=p.childItems)?void 0:e.map((function(e,t){return{title:e.label,color:f(t)}}))})),y.a.createElement(g.a,null,y.a.createElement(A.a.View,{style:{width:n,height:a-this.getLegendHeight(),flexDirection:s?"column":"row",opacity:l?A.a.multiply(o,v.d.invalidOpacity):o}},!s&&this.renderAxisLabels(s,u,d),this.renderBars(s,u,d),s&&this.renderAxisLabels(s,u,d),y.a.createElement(T.a,{getPopupData:this.getPopupData,renderPopupContents:this.renderPopupContents,onPopupHidden:this.onPopupHidden,hoverResponder:this._csvButton})),y.a.createElement(D.CSVButton,{ref:this._csvButton,getCSVData:this.getCSVData})))}},{key:"render",value:function(){var e=this.props.style,t=this.state,r=t.animValues,n=t.data,a=t.rawData,o=t.width,i=t.height,l=void 0===a,c=0===n.items.length||!r||0===r.length,s=e.width!==o||e.height!==i;return l||c||s?y.a.createElement(O.a,{showLoading:l,showNoData:c,style:{width:e.width,height:e.height}}):this.renderBarChart()}}]),r}(m.PureComponent);x.defaultProps={style:{width:200,height:200},theme:k.a}},function(e,t,r){"use strict";r.d(t,"a",(function(){return a}));var n=r(1),a={backgroundColor:n.a.controlBackground,axisColor:n.a.darkGrey,barColor:n.a.highlight,selectedBarColor:n.a.darkGrey,barRounding:n.d.tinyMargin,barFont:n.b.grey.bodyS.thin,labelFont:n.b.grey.bodyS.regular,selectedLabelFont:[n.b.grey.bodyS.regular,{color:n.a.darkGrey}]}},function(e,t,r){"use strict";r.d(t,"a",(function(){return k}));var n=r(10),a=r.n(n),o=r(11),i=r.n(o),l=r(15),c=r.n(l),s=r(7),u=r.n(s),d=r(14),p=r.n(d),f=r(0),h=r.n(f),m=r(2),y=r(5),g=r(158),b=r(20),A=r(89),E=r(4),v=r(1);function S(e){var t=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=u()(e);if(t){var a=u()(this).constructor;r=Reflect.construct(n,arguments,a)}else r=n.apply(this,arguments);return c()(this,r)}}var k=function(e){p()(r,e);var t=S(r);function r(){return a()(this,r),t.apply(this,arguments)}return i()(r,[{key:"renderStars",value:function(e,t){return h.a.createElement(m.a,{style:{alignSelf:"flex-start"}},h.a.createElement(y.a,{style:t},"\u2606\u2606\u2606\u2606\u2606"),h.a.createElement(m.a,{style:{position:"absolute",width:20*e+"%",maxWidth:20*e+"%",overflow:"hidden"}},h.a.createElement(m.a,{style:{width:"200%"}},h.a.createElement(y.a,{style:t,ellipsizeMode:"clip",numberOfLines:1},"\u2605\u2605\u2605\u2605\u2605"))))}},{key:"render",value:function(){var e=this.props,t=e.data,r=e.style,n=e.theme,a=e.dataStampInvalid,o=e.hideNumericalRating;return t?h.a.createElement(m.a,{style:[r,{opacity:a?v.d.invalidOpacity:void 0}]},t.title&&h.a.createElement(y.a,{style:n.titleFont,ellipsizeMode:"tail",numberOfLines:1},t.title),h.a.createElement(m.a,{style:{flexDirection:"row",alignItems:"flex-end"}},!o&&h.a.createElement(y.a,{style:n.ratingFont,ellipsizeMode:"clip",numberOfLines:1},Object(b.c)(t.rating,b.a.Number)),!o&&h.a.createElement(E.a.Spacer,null),this.renderStars(t.rating,n.ratingFont)),t.count&&h.a.createElement(y.a,{style:n.countFont,ellipsizeMode:"tail",numberOfLines:1},Object(b.b)(t.count,b.a.Number)+" Ratings")):h.a.createElement(A.a,{showLoading:!0,style:[{width:300,height:100},r]})}}]),r}(f.PureComponent);k.defaultProps={style:{},theme:g.a}},function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var n=r(1),a=r(256),o={minWidth:12*n.d.baseMargin,height:4*n.d.baseMargin,backgroundColor:n.a.controlBackground,borderWidth:1,borderColor:n.a.lightGrey,borderRadius:n.d.borderRadius,textStyle:n.b.black.bodyS.regular,textPadding:n.d.baseMargin,datePickerPopupTheme:a.DATE_PICKER_POPUP_THEME_DEFAULT}},function(e,t,r){"use strict";r.d(t,"a",(function(){return B}));var n=r(10),a=r.n(n),o=r(11),i=r.n(o),l=r(15),c=r.n(l),s=r(7),u=r.n(s),d=r(14),p=r.n(d),f=r(0),h=r(2),m=r(74),y=r(1),g=r(57),b=r.n(g),A=r(26),E=r(12),v=r.n(E),S=r(5),k=r(33),T=r(30),O=r(120);function R(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}var C=function(e){var t=e.icon,r=e.value,n=e.color,a=void 0===n?y.a.white:n,o=e.rowHeight,i=e.numberOfLines,l=e.header,c=void 0!==l&&l,s=e.textAlignVertical,u=function(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:function(e){};e>0&&t&&t(e)}(e,m)},index:r,hoverResponder:e.hoverResponder})})))},P=A.a.create({column:{overflow:"hidden"}}),w=r(157),M=r(89),x=r(41),V=r(90);function j(e){var t=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=u()(e);if(t){var a=u()(this).constructor;r=Reflect.construct(n,arguments,a)}else r=n.apply(this,arguments);return c()(this,r)}}var B=function(e){p()(r,e);var t=j(r);function r(e){var n;return a()(this,r),(n=t.call(this,e))._csvButton=f.createRef(),n.updateIsScrollable=function(){if(n._layoutW&&n._contentW){var e=n._layoutW=0&&n.props.cellTapAction(n.props.page,e)},n.state={isScrollable:!1},n}return i()(r,[{key:"render",value:function(){var e=this,t=this.props,r=t.data,n=t.page,a=t.pageSize,o=t.style,i=t.theme,l=this.state.isScrollable;if(void 0===r||0===r.titleRow.cells.length){var c=i.renderEmptyRows&&a?i.rowHeight*(a+1):2*y.d.tripleBaseMargin;return f.createElement(M.a,{showLoading:void 0===r,style:{width:o.width,height:c}})}var s=r.titleRow.cells.map((function(e){return(e?e.length:0)+6}));r.rows.forEach((function(e){e.cells.forEach((function(e,t){r.cellFlex&&r.cellFlex[t]?s[t]=r.cellFlex[t]:s[t]+=(e?e.length:0)+6}))}));for(var u=8*(x.min(s)||1),d=0;df)return void h(void 0);var y=Math.atan2(m.x,m.y);y<0&&(y+=2*Math.PI),r.forEach((function(e,t){e.startAngle<=y&&e.endAngle>y&&(a=t,h(t))}))}}if(void 0!==a){var g=d.pieSlices[a];o={title:g.title,value:Object(R.c)(g.value,d.valueType,0),percentage:n>0?100*g.value/n:0}}return o},e.renderPopupContents=function(e){return h.a.createElement(m.a,{style:{alignItems:"center",justifyContent:"center"}},h.a.createElement(E.a,{style:b.b.black.bodyS.regular},e.title),h.a.createElement(E.a,{style:b.b.black.bodyXS.thin},e.value),h.a.createElement(E.a,{style:b.b.grey.bodyXS.thin},Object(R.c)(e.percentage,R.a.Percent)))},e.onPopupHidden=function(){var t=e.props.onSelectSlice;t&&t(void 0)},e.getCSVData=function(){var t,r,n=e.props.data;return{title:null==(t=n.csvDefinition)?void 0:t.title,headers:(null==(r=n.csvDefinition)?void 0:r.headers)||["Category","Value"],data:(n.csvPieSlices||n.pieSlices).map((function(e){return[e.title,Object(R.c)(e.value,n.valueType,0)]}))}},e}return i()(r,[{key:"render",value:function(){var e=this,t=this.props.style,r=t.width,n=t.height,a=Math.min(r,n)/2,o=this.props,i=o.data,l=o.outerRadius,c=void 0===l?a:l,s=o.innerRadius,u=void 0===s?0:s,d=o.startAngle,p=void 0===d?0:d,f=o.endAngle,y=void 0===f?Math.PI:f,g=o.padAngle,A=void 0===g?0:g,E=o.style,R=o.elevation,U=void 0===R?0:R,D=o.selectedIndex,P=.05*a,w=i.pieSlices.map((function(e,t){var r=D===t?c-P*(1-U):c-P;return S.a().outerRadius(r).innerRadius(u).padAngle(A)})),M=i.pieSlices.map((function(e){return e.value})).reduce((function(e,t){return e+t})),x=100*y/(2*Math.PI);if(0===i.pieSlices.length||0===M)return h.a.createElement(m.a,{style:E});var V=S.b().value((function(e){return e.value})).sort((function(e,t){return e+t})).startAngle(p||0).endAngle(y)(i.pieSlices),j=Math.max(6,Math.min(8*a/200,16)),B=Object(O.a)(i.pieSlices.length);return h.a.createElement(m.a,{style:{width:2*a,height:2*a}},h.a.createElement(m.a,{style:{width:2*a,height:2*a}},a>0&&h.a.createElement(v.e,{width:2*a,height:2*a},h.a.createElement(v.a,{x:a,y:a},V.map((function(e,t){var r=i.pieSlices[t],n=w[t](e);return h.a.createElement(v.c,{key:"pie_slice_"+r.title,d:n||void 0,fill:r.color||B(t),strokeWidth:0})})),V.map((function(e,t){var r=e.value/M*x;if(r>=3){var n=r.toFixed(1)+"%",a={x:0,y:.7*c},o=(e.endAngle-e.startAngle)/2,i=e.startAngle+o,l=Object(T.rotateVector2d)(a,i);return h.a.createElement(v.f,{key:"slice_"+t,textAnchor:"middle",alignmentBaseline:"middle",fontSize:""+j,fontWeight:"200",fontFamily:"Verdana",stroke:"none",fill:b.a.black,x:-l.x,y:-l.y,opacity:x/100,style:{userSelect:"none"}},n)}return null})))),a>0&&h.a.createElement(k.a,{getPopupData:function(t){return e.getPopupData(t,V,M)},renderPopupContents:this.renderPopupContents,onPopupHidden:this.onPopupHidden,hoverResponder:this._csvButton})),h.a.createElement(C.CSVButton,{ref:this._csvButton,getCSVData:this.getCSVData}))}}]),r}(f.PureComponent),P=r(89),w=r(83),M=r(4);function x(e){var t=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=u()(e);if(t){var a=u()(this).constructor;r=Reflect.construct(n,arguments,a)}else r=n.apply(this,arguments);return c()(this,r)}}var V=y.a.createAnimatedComponent(D),j=function(e){p()(r,e);var t=x(r);function r(e){var n;return a()(this,r),(n=t.call(this,e)).debouncedUpdate=Object(A.debounce)((function(e){var t=n.props.style,r=t.width,a=t.height;r===n.state.width&&a===n.state.height||n.setState({width:r,height:a});var o=e.data?e.data.pieSlices:void 0,i=n.props.data?n.props.data.pieSlices:void 0;Object(A.isEqual)(o,i)}),b.d.timing.componentDebounce),n.onSelectSlice=function(e){e!==n.state.selectedIndex&&n.onFocus(e)},n.onFocus=function(e){e===n.state.selectedIndex&&(e=void 0),void 0!==e&&n.setState({selectedIndex:e},y.a.timing(n.state.outerElevation,{toValue:1,duration:100,easing:g.a.inOut(g.a.quad)}).start),void 0===e&&y.a.timing(n.state.outerElevation,{toValue:0,duration:100,easing:g.a.inOut(g.a.quad)}).start((function(){n.setState({selectedIndex:e})}))},n.state={endAngle:new y.a.Value(2*Math.PI),outerElevation:new y.a.Value(0),selectedIndex:void 0,width:e.style.width,height:e.style.height},n}return i()(r,[{key:"componentDidMount",value:function(){}},{key:"componentWillUnmount",value:function(){this.debouncedUpdate.cancel(),this.state.outerElevation.stopAnimation()}},{key:"componentDidUpdate",value:function(e){this.debouncedUpdate(e)}},{key:"render",value:function(){var e=this.props,t=e.data,r=e.dataStampInvalid,n=e.style,a=e.legendTheme,o=this.state,i=o.outerElevation,l=o.selectedIndex,c=o.endAngle,s=o.width,u=o.height;if(!t||0===t.pieSlices.length||n.width!==s||n.height!==u)return h.a.createElement(P.a,{showLoading:!t,style:{width:n.width,height:n.height}});var d=Object(O.a)(t.pieSlices.length),p=n.width,f=n.height;a&&(void 0!==a.minWidth&&a.legendOrientation===w.e.Vertical&&(p-=a.minWidth+b.d.baseMargin),void 0!==a.minHeight&&a.legendOrientation===w.e.Horizontal&&(f-=a.minHeight+b.d.baseMargin));var y=Math.min(p,f),g=n.width,A=n.height;return a&&(a.legendOrientation===w.e.Vertical&&(g-=y+b.d.baseMargin),a.legendOrientation===w.e.Horizontal&&(A-=y+b.d.baseMargin)),h.a.createElement(m.a,{style:{width:n.width,height:n.height,flexDirection:a&&a.legendOrientation===w.e.Vertical?"row":void 0,alignItems:"center",justifyContent:"center",opacity:r?b.d.invalidOpacity:void 0}},h.a.createElement(V,{style:{width:y,height:y},outerRadius:n.outerRadius,innerRadius:n.innerRadius,startAngle:0,endAngle:c,padAngle:n.padAngle,elevation:i,selectedIndex:l,onSelectSlice:this.onSelectSlice,data:t}),!!a&&h.a.createElement(M.a.Spacer,null),!!a&&h.a.createElement(w.d,{items:t.pieSlices.map((function(e,t){return{title:e.title,color:e.color||d(t)}})),style:{maxWidth:g,maxHeight:A},theme:a,selectedIndex:l}))}}]),r}(f.PureComponent);j.defaultProps={style:{width:200,height:200,innerRadius:0,padAngle:0}}},,,,,,,,,,,,,,,,,,function(e,t,r){"use strict";var n=r(475);r.d(t,"DashboardDataService",(function(){return n.a}));r(208)},,function(e,t,r){"use strict";var n=r(12),a=r.n(n),o=r(0),i=r(33),l=r(2),c=r(5),s=r(30),u=r(26),d=r(1);function p(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}t.a=function(e){var t=e.count,r=e.page,n=void 0===r?0:r,a=e.pageSize,u=e.theme,p=e.onNextPress,h=e.onPrevPress;if(void 0===a||!u.renderEmptyRows&&t<=a)return null;var m=n*a+1,y=Math.min(t,m+a-1),g=t>0?m+" - "+y+" / "+t:"0 / 0",b=t<=a||1===m,A=t<=a||y===t;return o.createElement(l.a,{style:f.container},o.createElement(c.a,{style:f.text}," ",g," "),o.createElement(s.a,{onPress:h,disabled:b},o.createElement(i.a,{source:d.c.arrowLeft,style:[f.arrow,{tintColor:b?u.disabledPageButtonColor:u.enabledPageButtonColor}]})),o.createElement(s.a,{onPress:p,disabled:A},o.createElement(i.a,{source:d.c.arrowRight,style:[f.arrow,{tintColor:A?u.disabledPageButtonColor:u.enabledPageButtonColor}]})))};var f=u.a.create({container:{flexDirection:"row",alignItems:"center",alignSelf:"flex-end",padding:d.d.baseMargin},text:function(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:s,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case Object(o.getType)(i.a.setHasChanges):return c({},e,{hasChanges:t.payload});case Object(o.getType)(i.a.setMenuItem):return c({},e,{selected:t.payload,hasChanges:!1});case Object(o.getType)(i.a.openMenu):return c({},e,{open:!0});case Object(o.getType)(i.a.closeMenu):return c({},e,{open:!1});case Object(o.getType)(i.a.toggleMenu):return c({},e,{open:!e.open});default:return e}}},function(e,t){},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(e,t,r){"use strict";r.d(t,"a",(function(){return u}));var n=r(12),a=r.n(n),o=r(19),i=r(43);function l(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function c(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:s,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case Object(o.getType)(i.a.resetPassword.request):return c({},e,{updatingUsers:!0});case Object(o.getType)(i.a.resetPassword.success):return c({},e,{updatingUsers:!1,usersError:void 0});case Object(o.getType)(i.a.resetPassword.failure):return c({},e,{updatingUsers:!1,usersError:t.payload});case Object(o.getType)(i.a.createUser.request):return c({},e,{updatingUsers:!0});case Object(o.getType)(i.a.createUser.success):return c({},e,{updatingUsers:!1,users:t.payload,usersError:void 0});case Object(o.getType)(i.a.createUser.failure):return c({},e,{updatingUsers:!1,usersError:t.payload});case Object(o.getType)(i.a.updateUser.request):return c({},e,{updatingUsers:!0});case Object(o.getType)(i.a.updateUser.success):return c({},e,{updatingUsers:!1,users:t.payload,usersError:void 0});case Object(o.getType)(i.a.updateUser.failure):return c({},e,{updatingUsers:!1,usersError:t.payload});case Object(o.getType)(i.a.deleteUser.request):return c({},e,{updatingUsers:!0});case Object(o.getType)(i.a.deleteUser.success):return c({},e,{updatingUsers:!1,users:t.payload,usersError:void 0});case Object(o.getType)(i.a.deleteUser.failure):return c({},e,{updatingUsers:!1,usersError:t.payload});case Object(o.getType)(i.a.getUsers.request):return c({},e,{updatingUsers:!0});case Object(o.getType)(i.a.getUsers.success):return c({},e,{updatingUsers:!1,users:t.payload.map((function(e){return{uid:e.uid,firstName:e.firstName,surname:e.surname,email:e.email,role:e.role}})),usersError:void 0});case Object(o.getType)(i.a.getUsers.failure):return c({},e,{updatingUsers:!1,users:void 0,usersError:t.payload});case Object(o.getType)(i.a.editUser):return c({},e,{manageUserUID:t.payload});default:return e}}},function(e,t){},function(e,t,r){"use strict";r.d(t,"a",(function(){return T}));var n=r(43),a=r(60),o=r(63),i=r.n(o),l=r(93),c=r(39),s=r(75),u=r(77),d=r(122),p=r(116),f=function(e){switch(e){case a.b.administrator:return 3;case a.b.editor:return 2;case a.b.viewer:return 1;case a.b.updateRequired:return 0;default:return-1}},h=function(e){return void 0!==e?e.sort((function(e,t){var r=f(e.role),n=f(t.role)-r;return 0!=n?n:e.emailt.email?1:0})):[]},m=Object(u.b)(n.a.resetPassword.request,(function(e){return l.QueryService.checkPermission(a.b.administrator).then((function(t){return i.a.auth().sendPasswordResetEmail(e,null)})).then((function(){return n.a.resetPassword.success(e)})).catch((function(e){return n.a.resetPassword.failure(e)}))})),y=Object(u.a)(n.a.resetPassword.success,(function(e){return c.a.setGlobalMessage({title:"Check your inbox",message:"An email has been sent to "+e})})),g=Object(u.a)(n.a.resetPassword.failure,(function(e){return c.a.setError({title:"Error",message:e.message})})),b=Object(u.b)(n.a.updateUser.request,(function(e,t){return l.QueryService.updateUser(e).then((function(r){var a=t.value.userAdmin.users.filter((function(t){return t.uid!==e.uid}));return a.push(r),n.a.updateUser.success(h(a))})).catch((function(e){return n.a.updateUser.failure(Object(a.c)(a.a.NoPermission,e.message,void 0))}))})),A=Object(u.a)(n.a.updateUser.success,(function(e,t){return s.Actions.setMenuItem(t.value.menu.selected===p.b?d.b:t.value.menu.selected)})),E=Object(u.a)(n.a.updateUser.failure,(function(e){return c.a.setError({title:"Error",message:e.message})})),v=Object(u.b)(n.a.deleteUser.request,(function(e,t){return l.QueryService.deleteUser(e).then((function(r){var a=t.value.userAdmin.users.filter((function(t){return t.uid!==e.uid}));return n.a.deleteUser.success(h(a))})).catch((function(e){return n.a.deleteUser.failure(Object(a.c)(a.a.NoPermission,e.message,void 0))}))})),S=Object(u.a)(n.a.deleteUser.success,(function(e,t){return s.Actions.setMenuItem(t.value.menu.selected===p.b?d.b:t.value.menu.selected)})),k=Object(u.a)(n.a.deleteUser.failure,(function(e){return c.a.setError({title:"Error",message:e.message})})),T=[m,y,g,Object(u.b)(n.a.createUser.request,(function(e,t){return l.QueryService.createUser(e).then((function(r){return i.a.auth().sendPasswordResetEmail(e.email,null).then((function(a){var o=t.value.userAdmin.users.filter((function(t){return t.email!==e.email}));return o.push(r),n.a.createUser.success(h(o))})).catch((function(e){return n.a.createUser.failure(Object(a.c)(a.a.NoPermission,e.message,void 0))}))})).catch((function(e){return n.a.createUser.failure(Object(a.c)(a.a.NoPermission,e.message,void 0))}))})),Object(u.a)(n.a.createUser.success,(function(e,t){return s.Actions.setMenuItem(t.value.menu.selected===p.b?d.b:t.value.menu.selected)})),Object(u.a)(n.a.createUser.failure,(function(e){return c.a.setError({title:"Error",message:e.message})})),b,A,E,v,S,k,Object(u.b)(n.a.getUsers.request,(function(){return l.QueryService.getUsers().then((function(e){return n.a.getUsers.success(h(e))})).catch((function(e){return n.a.getUsers.failure(Object(a.c)(a.a.NoPermission,"Failed to get user list",void 0))}))})),Object(u.a)(n.a.getUsers.failure,(function(e){return c.a.setError({title:"Error",message:e.message})}))]},,function(e,t,r){"use strict";r.d(t,"a",(function(){return p}));var n=r(0),a=r.n(n),o=r(70),i=r(2),l=r(5),c=r(30),s=r(213),u=r(1),d=r(4);function p(e){var t=e.text,r=e.onPress,n=e.theme,p=void 0===n?s.l:n,f=e.fetching,h=f||e.disabled;return a.a.createElement(c.a,{style:{justifyContent:"center",alignItems:p.stretchWidth?"stretch":"center",opacity:p.disabledFade&&h?.5:void 0},onPress:r,disabled:h},a.a.createElement(i.a,{style:{flexDirection:"row",justifyContent:"center",alignItems:"center",paddingHorizontal:p.paddingHorizontal,paddingVertical:p.paddingVertical,borderRadius:p.borderRadius,backgroundColor:h&&p.disabledBackgroundColor||p.backgroundColor,borderColor:p.borderColor,borderWidth:p.borderWidth,minWidth:p.minWidth,width:p.width,height:p.height}},f&&a.a.createElement(a.a.Fragment,null,a.a.createElement(o.a,{color:u.a.white,animating:!0}),a.a.createElement(d.a.Spacer,null)),a.a.createElement(l.a,{style:p.textStyle},t)))}},function(e,t){},function(e,t,r){"use strict";r.d(t,"a",(function(){return T}));var n=r(12),a=r.n(n),o=r(10),i=r.n(o),l=r(11),c=r.n(l),s=r(15),u=r.n(s),d=r(7),p=r.n(d),f=r(14),h=r.n(f),m=r(0),y=r.n(m),g=r(2),b=r(5),A=r(66),E=r(214);function v(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function S(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:s,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case Object(o.getType)(i.a.setKDSData):return c({},e,a()({},t.payload.key,t.payload.data));default:return e}}},function(e,t){},function(e,t,r){"use strict";r.d(t,"a",(function(){return d}));var n=r(12),a=r.n(n),o=r(19),i=r(137),l=r(9);function c(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function s(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:u,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case Object(o.getType)(i.a.setCarparkList):return s({},e,{},t.payload);case Object(o.getType)(i.a.setSchoolHolidays):return s({},e,{schoolHolidays:t.payload});case Object(o.getType)(i.a.setPublicHolidays):return s({},e,{publicHolidays:t.payload});case Object(o.getType)(i.a.setAppVersions):return s({},e,{appVersions:t.payload});case Object(o.getType)(i.a.setLastImported):return s({},e,{lastImported:t.payload});default:return e}}},function(e,t,r){"use strict";r.d(t,"a",(function(){return a}));var n=r(162),a={carParkList:Object(n.createSelector)((function(e){return e.data}),(function(e){return e.carparkList}))||[]}},function(e,t){},function(e,t,r){"use strict";r.d(t,"a",(function(){return u}));var n=r(12),a=r.n(n),o=r(19),i=r(104);function l(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function c(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:s,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case Object(o.getType)(i.a.clearComponentData):return{dataStampData:{},scrollGraphData:{},barChartData:{},pieChartData:{},valueLabelData:{},labelData:{},dataTableData:{},starRatingData:{},heatmapData:{}};case Object(o.getType)(i.a.setDataStampData):return c({},e,{dataStampData:c({},e.dataStampData,a()({},t.payload.key,t.payload.data))});case Object(o.getType)(i.a.setLabelData):return c({},e,{labelData:c({},e.labelData,a()({},t.payload.key,t.payload.data))});case Object(o.getType)(i.a.setValueLabelData):return c({},e,{valueLabelData:c({},e.valueLabelData,a()({},t.payload.key,t.payload.data))});case Object(o.getType)(i.a.setScrollGraphData):return c({},e,{scrollGraphData:c({},e.scrollGraphData,a()({},t.payload.key,t.payload.data))});case Object(o.getType)(i.a.setBarChartData):return c({},e,{barChartData:c({},e.barChartData,a()({},t.payload.key,t.payload.data))});case Object(o.getType)(i.a.setPieChartData):return c({},e,{pieChartData:c({},e.pieChartData,a()({},t.payload.key,t.payload.data))});case Object(o.getType)(i.a.setDataTableData):return c({},e,{dataTableData:c({},e.dataTableData,a()({},t.payload.key,t.payload.data))});case Object(o.getType)(i.a.setStarRatingData):return c({},e,{starRatingData:c({},e.starRatingData,a()({},t.payload.key,t.payload.data))});case Object(o.getType)(i.a.setHeatmapData):return c({},e,{heatmapData:c({},e.heatmapData,a()({},t.payload.key,t.payload.data))});default:return e}}},function(e,t,r){"use strict";var n=r(48);r.d(t,"ScrollGraphType",(function(){return n.a}));var a=r(203);r.o(a,"ConnectedValueLabel")&&r.d(t,"ConnectedValueLabel",(function(){return a.ConnectedValueLabel})),r.o(a,"LABEL_THEME_TITLE")&&r.d(t,"LABEL_THEME_TITLE",(function(){return a.LABEL_THEME_TITLE})),r.o(a,"Label")&&r.d(t,"Label",(function(){return a.Label})),r.o(a,"kvsComponentSelector")&&r.d(t,"kvsComponentSelector",(function(){return a.kvsComponentSelector}));var o=r(204);r.o(o,"ConnectedValueLabel")&&r.d(t,"ConnectedValueLabel",(function(){return o.ConnectedValueLabel})),r.o(o,"LABEL_THEME_TITLE")&&r.d(t,"LABEL_THEME_TITLE",(function(){return o.LABEL_THEME_TITLE})),r.o(o,"Label")&&r.d(t,"Label",(function(){return o.Label})),r.o(o,"kvsComponentSelector")&&r.d(t,"kvsComponentSelector",(function(){return o.kvsComponentSelector}));var i=r(38);r.o(i,"ConnectedValueLabel")&&r.d(t,"ConnectedValueLabel",(function(){return i.ConnectedValueLabel})),r.o(i,"LABEL_THEME_TITLE")&&r.d(t,"LABEL_THEME_TITLE",(function(){return i.LABEL_THEME_TITLE})),r.o(i,"Label")&&r.d(t,"Label",(function(){return i.Label})),r.o(i,"kvsComponentSelector")&&r.d(t,"kvsComponentSelector",(function(){return i.kvsComponentSelector}));var l=r(23);r.o(l,"ConnectedValueLabel")&&r.d(t,"ConnectedValueLabel",(function(){return l.ConnectedValueLabel})),r.o(l,"LABEL_THEME_TITLE")&&r.d(t,"LABEL_THEME_TITLE",(function(){return l.LABEL_THEME_TITLE})),r.o(l,"Label")&&r.d(t,"Label",(function(){return l.Label})),r.o(l,"kvsComponentSelector")&&r.d(t,"kvsComponentSelector",(function(){return l.kvsComponentSelector}));var c=r(205);r.o(c,"ConnectedValueLabel")&&r.d(t,"ConnectedValueLabel",(function(){return c.ConnectedValueLabel})),r.o(c,"LABEL_THEME_TITLE")&&r.d(t,"LABEL_THEME_TITLE",(function(){return c.LABEL_THEME_TITLE})),r.o(c,"Label")&&r.d(t,"Label",(function(){return c.Label})),r.o(c,"kvsComponentSelector")&&r.d(t,"kvsComponentSelector",(function(){return c.kvsComponentSelector}));var s=r(206);r.o(s,"ConnectedValueLabel")&&r.d(t,"ConnectedValueLabel",(function(){return s.ConnectedValueLabel})),r.o(s,"LABEL_THEME_TITLE")&&r.d(t,"LABEL_THEME_TITLE",(function(){return s.LABEL_THEME_TITLE})),r.o(s,"Label")&&r.d(t,"Label",(function(){return s.Label})),r.o(s,"kvsComponentSelector")&&r.d(t,"kvsComponentSelector",(function(){return s.kvsComponentSelector}));r(473)},function(e,t,r){"use strict";r.d(t,"a",(function(){return R}));var n=r(12),a=r.n(n),o=r(10),i=r.n(o),l=r(11),c=r.n(l),s=r(15),u=r.n(s),d=r(7),p=r.n(d),f=r(14),h=r.n(f),m=r(0),y=r.n(m),g=r(2),b=r(5),A=r(217),E=r(1),v=r(4),S=r(120);function k(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function T(e){for(var t=1;t=a?null:y.a.createElement(A.a.View,{style:{position:"absolute",left:n.width-r.indicatorTheme.width-r.indicatorTheme.padding+r.shadowPadding,top:r.indicatorTheme.padding+r.shadowPadding,backgroundColor:r.indicatorTheme.color,borderRadius:r.indicatorTheme.borderRadius,width:r.indicatorTheme.width,height:i,transform:[{translateY:A.a.multiply(this.state.indicator,o/a).interpolate({inputRange:[0,l],outputRange:[0,l],extrapolate:"clamp"})}]}})}},{key:"renderPopupListBox",value:function(){var e=this,t=this.state,r=t.open,n=t.expand,a=t.anim,o=t.layout,i=this.props,l=i.items,c=i.theme,s=i.selectedValue,u=i.selectedValues,d=l.findIndex((function(e){return e.value===s}));return y.a.createElement(k.a,{animationType:"none",transparent:!0,supportedOrientations:["landscape"],visible:r,ariaHideApp:!1,onRequestClose:function(){e.onClose()}},y.a.createElement(v.a,{onPress:function(){return e.onClose()}},y.a.createElement(g.a,{style:{flex:1,paddingTop:o.y+o.height+O.d.smallMargin-c.shadowPadding,paddingLeft:o.x-c.shadowPadding,alignItems:"flex-start"}},y.a.createElement(T.a,{visible:n,anim:a},y.a.createElement(g.a,null,y.a.createElement(E.a,{initialScrollIndex:d>=0?d:void 0,getItemLayout:this.getItemLayout,style:x({width:o.width,maxHeight:c.maxBoxHeight,borderWidth:c.borderWidth,borderColor:c.borderColor,borderRadius:c.borderRadius,backgroundColor:c.backgroundColor,margin:c.shadowPadding},P.c),data:l,extraData:d,renderItem:function(t){var r=t.item;return y.a.createElement(D,{multiSelect:void 0!=u,item:r,selectedValues:u||[s],theme:c,onValueChange:e.onValueChange})},ListHeaderComponent:y.a.createElement(g.a,{style:{height:c.boxVerticalPadding}}),ListFooterComponent:y.a.createElement(g.a,{style:{height:c.boxVerticalPadding}}),keyExtractor:this.getListKey,showsVerticalScrollIndicator:!1,bounces:!1,scrollEnabled:!0,scrollEventThrottle:16,onScroll:A.a.event([{nativeEvent:{contentOffset:{y:this.state.indicator}}}])}),this.renderScrollIndicator())))))}},{key:"render",value:function(){var e=this.state.anim,t=this.props,r=t.placeholder,n=t.items,a=t.selectedValue,o=t.theme,i=t.style,l=n.find((function(e){return JSON.stringify(e.value)===JSON.stringify(a)})),c=l?l.label:r;return y.a.createElement(g.a,{style:i},y.a.createElement(v.a,{onPress:this.onToggle,disabled:this.props.disabled},y.a.createElement(g.a,{ref:this._ref,style:{height:o.pickerHeight,paddingLeft:O.d.baseMargin,borderWidth:o.borderWidth,borderColor:o.borderColor,borderRadius:o.borderRadius,backgroundColor:o.backgroundColor,minWidth:o.minWidth,flexDirection:"row",alignItems:"center",justifyContent:"space-between"},onLayout:this.onLayout},y.a.createElement(b.a,{style:this.props.disabled?o.pickerDisabledFont:o.pickerFont,numberOfLines:1,ellipsizeMode:"tail"},c),y.a.createElement(A.a.Image,{source:O.c.arrowDown,style:{tintColor:o.iconColor,width:o.iconSize,height:o.iconSize,transform:[{rotate:e.interpolate({inputRange:[0,1],outputRange:["0deg","-180deg"],extrapolate:"clamp"})}]},resizeMode:"contain"}))),this.renderPopupListBox())}}]),r}(y.a.PureComponent);j.defaultProps={style:{},theme:R.a,disabled:!1}},function(e,t,r){"use strict";r.d(t,"a",(function(){return j}));var n=r(12),a=r.n(n),o=r(10),i=r.n(o),l=r(11),c=r.n(l),s=r(15),u=r.n(s),d=r(7),p=r.n(d),f=r(14),h=r.n(f),m=r(0),y=r.n(m),g=r(2),b=r(5),A=r(1),E=r(4),v=r(39),S=r(25),k=r(79);function T(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function O(e){for(var t=1;t.3?z.c.happyFace:z.c.indifferentFace;return function(){return m.a.createElement(G.a,{style:{width:z.d.icons.small,height:z.d.icons.small},source:r})}},Magnitude:function(e){return e?JSON.parse(e).document_sentiment.magnitude:""}};function X(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function q(e){for(var t=1;t0?n+o/a:n}})),r}function ce(e,t,r,n){var a=[];t&&t.forEach((function(t){var r=F.g(t.date).startOf("day"),n=le(r,e),o=le(r.add(24,"hour"),e);n>=0&&o>=0&&a.push({startColumn:n,endColumn:o,label:t.description,color:U.a.green})})),r&&r.forEach((function(t){var r=F.g(t.date).startOf("day"),n=le(r,e),o=le(r.add(24,"hour"),e);n>=0&&o>=0&&a.push({startColumn:n,endColumn:o,label:t.description,color:U.a.red})})),a=function(e){for(var t=[],r=function(r){var n=q({},e[r]),a=t.find((function(e){return n.label===e.label&&(Math.abs(e.endColumn-n.startColumn)<.5||Math.abs(e.startColumn-n.endColumn)<.5)}));void 0!==a?(a.startColumn=Math.min(n.startColumn,a.startColumn),a.endColumn=Math.max(n.endColumn,a.endColumn)):t.push(n)},n=0;n=0&&a.push({startColumn:i,endColumn:i,label:"Version "+t.description,color:U.a.red})}));for(var o=te().month(0).date(1),i=le(o,e);i>=0;)a.push({startColumn:i,endColumn:i,label:o.format("YYYY"),color:U.a.darkGrey}),o.subtract(1,"year"),i=le(o,e);return(i=le(te(),e))>=0&&a.push({startColumn:i,endColumn:i,label:"Today"+te().format(" z"),color:U.a.darkGrey}),a}function se(e,t,r){if(e){var n=[];return e.forEach((function(e){if(r.find((function(t){return t===e.province_state}))){var t=n.find((function(t){return t.date===e.date}));t?(t.confirmed+=e.confirmed,t.recovered+=e.recovered,t.deaths+=e.deaths):n.push(q({},e,{province_state:"Selected States"}))}})),n.sort((function(e,t){return e.date0&&(u=l.filterTopCategoriesToDateRange?Q.d.getTopGroups(t,{start:o,end:i}):Q.d.getTopGroups(t));var d=ie(o,i,u.length);try{t.forEach((function(e){var t=F.b(o,F.g(e.date)),r=d[t];if(r&&(r.value+=e.value,e.group)){var n=u.indexOf(e.group);n>=0&&(r.categoryValues[n]+=e.value)}}));var p=u.map((function(e){return{name:e}})),f=Object(B.clone)(p);u.length>0&&function(e,t,r){if(!(t.length<=r)||function(e){return e.forEach((function(e){var t=e.categoryValues.reduce((function(e,t){return e+t}),0);if(e.value!==t)return!0})),!1}(e)){for(;t.length>=r;)t.pop();t.push({name:"Other",color:U.a.other}),e.forEach((function(e){for(e.csvCategoryValues=Object(B.clone)(e.categoryValues);e.categoryValues.length>=r;)e.categoryValues.pop();var t=e.categoryValues.reduce((function(e,t){return e+t}),0);e.categoryValues.push(e.value-t)}))}}(d,f,s),null!=l.categoryColours&&l.categoryColours.forEach((function(e,t){t=0?l[a].value+=e.value:c+=e.value}}));var s=l.filter((function(e){return e.value>0})).sort((function(e,t){return t.value-e.value}));if(c>0||l.length>a.categoryCount){for(;l.length>=a.categoryCount;){var u=l.pop();u&&(c+=u.value)}l.push({title:"Other",value:c,color:U.a.other})}var d={dataStamp:o,pieSlices:l,csvPieSlices:s,valueType:a.valueType,csvDefinition:a.csvDefinition};A.b.dispatch(H.KVSComponentActions.setPieChartData(e,d))}catch(p){A.b.dispatch(x.a.setError({title:"Error",message:p.message}))}}}function fe(e,t,r,n,a){var o=[];return e&&(e.forEach((function(e){if(e.group&&(void 0===n||e.group in n)){var a=F.g(e.date);if(!a.isBefore(t)&&a.isBefore(r)){var i=o.findIndex((function(t){return t.group===e.group}));i>=0?(o[i].value+=e.value,o[i].count+=e.count):o.push({group:e.group,value:e.value,count:e.count})}}})),a===ne.Average&&o.forEach((function(e){e.value=0===e.count?0:e.value/e.count})),a===ne.Count&&o.forEach((function(e){e.value=e.count}))),o}function he(e,t,r,n,a){var o=fe(e,t,r,n,a).map((function(e){return e.value}));return Object(B.max)(o)||0}function me(e,t,r,n,a,o){if(t)try{!function(e,t,r,n){if(!t)return;try{var a=t.map((function(e){return{label:e.group,value:e.value,count:e.count,color:U.a.blue}})),o=(r.showZeroValues?a:a.filter((function(e){return e.count>0}))).sort((function(e,t){return"value"===r.sortBy?r.invertValence?e.value-t.value:t.value-e.value:r.invertValence?e.labelt.label?-1:1})),i=o.filter((function(e){return e.value>0}));if(null!=r.categoryCount&&o.length>r.categoryCount)if(r.addOtherCategory){for(var l=0,c=0;o.length>=r.categoryCount;){var s=o.pop();r.calculation===ne.Average?l+=((null==s?void 0:s.value)||0)*((null==s?void 0:s.count)||0):l+=(null==s?void 0:s.value)||0,c+=(null==s?void 0:s.count)||0}r.calculation===ne.Average&&c>0&&(l/=c),o.push({label:"Other",value:l,count:c})}else for(;o.length>r.categoryCount;)o.pop();var u={dataStamp:n,items:o,csvItems:i,valueType:W.a.Number,defaultMaxValue:r.defaultMaxValue,csvDefinition:r.csvDefinition};A.b.dispatch(H.KVSComponentActions.setBarChartData(e,u))}catch(d){A.b.dispatch(x.a.setError({title:"Error",message:d.message}))}}(e,fe(t,r,n,a.groupFilter,a.calculation),a,o)}catch(i){A.b.dispatch(x.a.setError({title:"Error",message:i.message}))}}function ye(e,t,r,n,a,o,i){A.b.dispatch(H.KVSComponentActions.setValueLabelData(e,{title:t,description:r,value:n,valueType:a,percentageChange:o,dataStamp:i}))}function ge(e,t,r,n,a){var o=0,i=0;return e.forEach((function(e){if(function(e,t){return!t||void 0!==e.group&&-1!==Object(B.sortedIndexOf)(t,e.group)}(e,a)){var l=F.g(e.date);!l.isBefore(t)&&l.isBefore(r)&&(o+=n===ne.SumProduct?e.count*e.value:e.value,i+=e.count)}})),n===ne.Average&&i>0?o/i:n===ne.Count?i:o}function be(e,t,r,n,a,o,i,l,c,s,u){return Ae({key:e,title:t,description:r,data:n,groupFilter:a,startMoment:o,endMoment:i,valueType:l,calculationType:c,calculatePercentageChange:s,dataStamp:u})}function Ae(e){if(e.data){var t,r=e.groupFilter?e.groupFilter.concat().sort():void 0,n=ge(e.data,e.startMoment,e.endMoment,e.calculationType||ne.Sum,r),a=void 0;if(e.calculatePercentageChange){var o=Z.DashboardDataService.getPrevParams({start:e.startMoment,end:e.endMoment}),i=ge(e.data,o.start,o.end,e.calculationType||ne.Sum,r);0!==i&&(a=100*(n/i-1))}if(e.showCount){var l=ge(e.data,e.startMoment,e.endMoment,ne.Count,r);t=""+(e.showCount.prefix||"")+Object(W.b)(l,W.a.Number)+(e.showCount.suffix||"")}var c={title:e.title,description:e.description,value:n,valueType:e.valueType||W.a.Number,secondaryValue:t,percentageChange:a,dataStamp:e.dataStamp};return A.b.dispatch(H.KVSComponentActions.setValueLabelData(e.key,c)),c}}function Ee(e){if(e.data){var t=e.groupFilter?e.groupFilter.concat().sort():void 0,r=ge(e.data,e.startMoment,e.endMoment,e.valuesRequireSumProduct?ne.SumProduct:ne.Sum,t),n=ge(e.data,e.startMoment,e.endMoment,ne.Count,t),a={title:e.title,rating:r/n,count:n,dataStamp:e.dataStamp};A.b.dispatch(H.KVSComponentActions.setStarRatingData(e.key,a))}}function ve(e,t,r,n,a,o,i){if(t)try{var l=o?o.concat().sort():Object(B.uniqBy)(t,(function(e){return e.group})).map((function(e){return e.group})).sort(),c=l.map((function(e){return{category:e,value:0,count:0,average:0}}));t.forEach((function(e){var t=F.g(e.date);if(!t.isBefore(r)&&t.isBefore(n)&&e.group){var a=Object(B.sortedIndexOf)(l,e.group);-1!==a&&(c[a].value+=e.value,c[a].count+=e.count)}}));var s=c.filter((function(e){return e.count>0}));s.forEach((function(e){e.average=0===e.count?0:e.value/e.count})),s.sort((function(e,t){var r=a?e.average-t.average:t.average-e.average,n=t.count-e.count;return 0!==r?r:n}));var u=[];s.forEach((function(e,t){u[t]={cells:[(t+1).toString(),e.category,K.NumberTwoDecimalPlaces(e.average),K.Number(e.count)]}}));var d={dataStamp:i,titleRow:{cells:["Rank","Category","Rating","Count"]},rows:u,cellFlex:[1,5,1,1]};A.b.dispatch(H.KVSComponentActions.setDataTableData(e,d))}catch(p){A.b.dispatch(x.a.setError({title:"Error",message:p.message}))}}!function(e){e.Sum="Sum",e.Count="Count",e.Average="Average",e.SumProduct="SumProduct"}(ne||(ne={}));var Se=r(35);function ke(e){var t=[];return e.forEach((function(e){var r=t.find((function(t){return e.geoCity===t.name}));void 0===r?t.push({name:e.geoCity,minLatitude:e.latitude,minLongitude:e.longitude,maxLatitude:e.latitude,maxLongitude:e.longitude}):(r.minLatitude=Math.min(r.minLatitude,e.latitude),r.minLongitude=Math.min(r.minLongitude,e.longitude),r.maxLatitude=Math.max(r.maxLatitude,e.latitude),r.maxLongitude=Math.max(r.maxLongitude,e.longitude))})),t}var Te=r(538),Oe=r(64),Re=r(4),Ce=r(72);function Ue(e){var t=Object(b.d)(e.selector),r=Object(b.c)();return h.createElement(y.a,{style:{flexDirection:"row",alignItems:"center",flex:1,minWidth:e.style&&e.style.minWidth?e.style.minWidth:120,maxWidth:e.style&&e.style.maxWidth?e.style.maxWidth:200,minHeight:z.d.tripleBaseMargin}},e.icon&&h.createElement(G.a,{style:{width:z.d.icons.tiny,height:z.d.icons.tiny,tintColor:z.a.grey},source:e.icon}),e.icon&&h.createElement(Re.a.Spacer,null),h.createElement(Ce.PickerBox,{placeholder:e.placeholder,disabled:e.disabled,items:e.items,selectedValue:t,onValueChange:function(t){r(e.onChangeAction(t))},style:{flex:1},theme:Ce.PICKER_BOX_THEME_SLIM}))}var De=function(e){return h.createElement(Ue,{icon:z.c.timeZone,placeholder:"Time Zone",items:Oe.e.map((function(e){var t=J.a.tz(Oe.f(e));return{label:e+", "+t.format("z")+" ("+t.format("Z")+")",value:e}})),selector:Oe.d.timeZoneState,onChangeAction:Oe.a.setTimeZoneState})},Pe=r(539),we=r(283),Me=r(30),xe=r(95),Ve=r(67),je=r(31),Be=r(24),Ie=r(114),Ne=r(13);function Je(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Le(e){var t=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=d()(e);if(t){var a=d()(this).constructor;r=Reflect.construct(n,arguments,a)}else r=n.apply(this,arguments);return s()(this,r)}}var Fe=function(e){f()(r,e);var t=Le(r);function r(){var e;o()(this,r);for(var n=arguments.length,a=new Array(n),i=0;i1e-4||Math.abs(e.longitude-t.longitude)>1e-4||Math.abs(e.latitudeDelta-t.latitudeDelta)>1e-4||Math.abs(e.longitudeDelta-t.longitudeDelta)>1e-4))},e.getCurrentRegion=function(){if(e._mapRef){var t=e._mapRef.getBounds(),r=e._mapRef.getCenter();if(t&&r){var n=t.getNorthEast(),a=t.getSouthWest();return{latitude:r.lat(),longitude:r.lng(),latitudeDelta:Math.abs(n.lat()-a.lat()),longitudeDelta:Math.abs(n.lng()-a.lng())}}}return null},e.onBoundsChanged=Object(B.debounce)((function(){var t=e.props.onRegionChangeComplete;if(e._mapRef&&t){var r=e.getCurrentRegion();e.regionsDifferent(r,e.state.lastRegion)&&t(r)}}),200),e}return l()(r,[{key:"animateCamera",value:function(e,t){if(this._mapRef&&e.center)if(e.zoom){var r={lat:e.center.latitude,lon:e.center.longitude};if(void 0!==this._layout&&void 0!==this._layout.width&&void 0!==this._layout.height){var n=Ke.a.bounds(r,e.zoom,[this._layout.width,this._layout.height]),a={west:n[0],south:n[1],east:n[2],north:n[3]};this._mapRef.fitBounds(a),this._mapRef.panToBounds(a)}}else{var o={lat:e.center.latitude,lng:e.center.longitude};this._mapRef.panTo(o)}}},{key:"componentDidUpdate",value:function(e){var t=this.getCurrentRegion();this.regionsDifferent(t,this.state.lastRegion)&&this.setState({lastRegion:t})}},{key:"render",value:function(){var e=this.props,t=e.initialRegion,r=e.onPress,n=e.style,a=e.onMarkerPress,o=t?{center:{lat:t.latitude,lng:t.longitude}}:{},i=m.a.Children.map(this.props.children,(function(e){return e?m.a.cloneElement(e,{forwardOnPress:a}):e}));return m.a.createElement(y.a,{style:n,onLayout:this.onLayout},m.a.createElement(ze.b,Ge()({onLoad:this.handleMapMounted,mapContainerStyle:n},o,{onBoundsChanged:this.onBoundsChanged,zoom:14,onClick:r,options:{streetViewControl:!1}}),i))}}]),r}(h.PureComponent),_e=r(66),$e=r(221);function et(e){var t=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=d()(e);if(t){var a=d()(this).constructor;r=Reflect.construct(n,arguments,a)}else r=n.apply(this,arguments);return s()(this,r)}}var tt=function(e){f()(r,e);var t=et(r);function r(){var e;o()(this,r);for(var n=arguments.length,a=new Array(n),i=0;i=40?{zoom:0}:Ke.a.viewport(r,[o,i]);e.push(t.getClusters(r,n.zoom))})),e},n.onMarkerPress=function(e,t){var r=n.props.clusterers;if(e&&t&&t.nativeEvent&&t.nativeEvent.coordinate&&t.nativeEvent.id){var a=t.nativeEvent.id.split("_");if(a&&a.length>2&&"c"===a[0]){var o=r[parseInt(a[1],10)],i=parseInt(a[2],10);if(o){var l=o.getClusterExpansionZoom(i)+2;e.animateCamera({center:t.nativeEvent.coordinate,zoom:"web"===ct.a.OS?l:l-1},{duration:500})}}}},n.geoJsonGeometryToLatLng=function(e){var t="Point"===e.type?e.coordinates:[];return 2!==t.length?{latitude:0,longitude:0}:{latitude:t[1],longitude:t[0]}},n.state={clustersPerClusterer:n.determineCurrentClusters()},n}return l()(r,[{key:"componentDidUpdate",value:function(e){var t=this.props,r=t.clusterers,n=t.region,a=t.width,o=t.height;e.region===n&&e.clusterers===r&&e.width===a&&e.height===o||this.setState({clustersPerClusterer:this.determineCurrentClusters()})}},{key:"render",value:function(){var e=this,t=this.props,r=t.renderMarker,n=t.forwardOnPress,a=this.state.clustersPerClusterer,o=[];return a.map((function(t,a){return t.map((function(t){if(t.properties){var i=t.properties.cluster?"c_"+a+"_"+t.properties.cluster_id:"p_"+t.properties.id;o.push(r(i,i,e.geoJsonGeometryToLatLng(t.geometry),!!t.properties.cluster,t.properties,n))}}))})),o}}]),r}(h.PureComponent),ft=O.a.create({clusterOuterCircle:{width:U.d.clusterOuterDiam,height:U.d.clusterOuterDiam,borderRadius:U.d.clusterOuterRad,backgroundColor:Object(Ve.c)(U.a.black,.5),alignItems:"center",justifyContent:"center"},clusterInnerCircle:{width:U.d.clusterInnerDiam,height:U.d.clusterInnerDiam,borderRadius:U.d.clusterInnerRad,backgroundColor:U.a.black,alignItems:"center",justifyContent:"center"},clusterText:ut({},U.b.white.bodyS.bold),marker:{width:U.d.markerPinDims,height:U.d.markerPinDims},markerText:ut({},U.b.white.bodyXS.bold,{textAlign:"center",marginTop:U.d.markerTextMargin})}),ht=r(169);function mt(e){var t=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=d()(e);if(t){var a=d()(this).constructor;r=Reflect.construct(n,arguments,a)}else r=n.apply(this,arguments);return s()(this,r)}}var yt=U.a.grey,gt={latitude:-37.8136,longitude:144.9631,latitudeDelta:.065,longitudeDelta:.075};var bt=function(e){f()(r,e);var t=mt(r);function r(e){var n;o()(this,r),(n=t.call(this,e))._mapRef=null,n._pinClustering=null,n.getDataPoints=function(e){return e.map((function(e){return[e.carpark.latitude||gt.latitude,e.carpark.longitude||gt.longitude]}))},n.getMaxValue=function(e){return Math.max(He.d(e,(function(e){return e.value}))||1,1)},n.clusterMarkers=function(e){var t=e.map((function(e,t){return{type:"Feature",geometry:{type:"Point",coordinates:[e.carpark.longitude,e.carpark.latitude]},properties:{mapItem:e,id:t}}})),r=new lt.a({radius:80,map:function(e){return{sum:e.mapItem.value}},reduce:function(e,t){e.sum+=t.sum}});return r.load(t),r},n.clusterAll=function(){var e=n.props.mapItems.reduce((function(e,t){var r=t.carpark.state,n=e[r]||[];return n.push(t),e[r]=n,e}),{});return Object.values(e).map((function(e){return n.clusterMarkers(e)}))},n.onRegionChanged=function(e){n.setState({latestRegion:e})},n.getRegionForSelectedCity=function(){var e=n.props.selectedCity;if(e){var t=Ze.c.find((function(t){return t.name===e}));if(void 0!==t)return{latitude:t.latitude,longitude:t.longitude,latitudeDelta:.05,longitudeDelta:.06}}return gt},n.renderMarker=function(e,t,r,n,a,o){var i=n?a.sum:a.mapItem.value;return function(e,t,r,n,a,o){return n?m.a.createElement(tt,{key:e,identifier:t,coordinate:r,anchor:{x:.5,y:.5},onPress:o},m.a.createElement(y.a,{style:ft.clusterOuterCircle},m.a.createElement(y.a,{style:ft.clusterInnerCircle},m.a.createElement(R.a,{style:ft.clusterText},a)))):m.a.createElement(tt,{key:e,identifier:e,coordinate:r,image:U.c.mapPin,onPress:o},m.a.createElement(y.a,{style:ft.marker},m.a.createElement(R.a,{style:ft.markerText},a)))}(e,t,r,n,Object(W.b)(i,W.a.Number),o)},n.onMarkerPress=function(e){n._mapRef&&n._pinClustering&&n._pinClustering.onMarkerPress(n._mapRef,e)};var a=n.filterMapItems(e.selectedCity,e.mapItems);return n.state={mapItems:a,maxValue:n.getMaxValue(a),totalRegion:n.getTotalRegion(a),clusterers:n.clusterAll(),latestRegion:n.getRegionForSelectedCity()},n}return l()(r,[{key:"filterMapItems",value:function(e,t){return t.filter((function(t){return t.carpark.geoCity==e}))}},{key:"getTotalRegion",value:function(e){var t=void 0;return e.forEach((function(e){void 0===t?t={minLatitude:e.carpark.latitude,minLongitude:e.carpark.longitude,maxLatitude:e.carpark.latitude,maxLongitude:e.carpark.longitude}:(t.minLatitude=Math.min(t.minLatitude,e.carpark.latitude),t.minLongitude=Math.min(t.minLongitude,e.carpark.longitude),t.maxLatitude=Math.max(t.maxLatitude,e.carpark.latitude),t.maxLongitude=Math.max(t.maxLongitude,e.carpark.longitude))})),void 0===t&&(t={minLatitude:gt.latitude-gt.latitudeDelta,minLongitude:gt.longitude-gt.longitudeDelta,maxLatitude:gt.latitude+gt.latitudeDelta,maxLongitude:gt.longitude+gt.longitudeDelta}),t}}]),l()(r,[{key:"componentDidUpdate",value:function(e){if(e.mapItems!==this.props.mapItems||e.selectedCity!==this.props.selectedCity){var t=this.state.clusterers;e.mapItems!==this.props.mapItems&&(t=this.clusterAll());var r=this.state.latestRegion;if(e.selectedCity!==this.props.selectedCity&&this._mapRef){var n=this.getRegionForSelectedCity();this._mapRef.animateCamera({center:n},{duration:500}),r=n}var a=this.filterMapItems(this.props.selectedCity,this.props.mapItems);this.setState({mapItems:a,maxValue:this.getMaxValue(a),totalRegion:this.getTotalRegion(a),clusterers:t,latestRegion:r})}}},{key:"render",value:function(){for(var e=this,t=this.state,r=t.maxValue,n=t.mapItems,a=t.totalRegion,o=t.clusterers,i=t.latestRegion,l=this.props,c=l.dataStampInvalid,s=l.selectedCity,u=l.selectedOverlay,d=l.cityList,p=l.valueType,f=void 0===p?W.a.Number:p,h=d.find((function(e){return e.name===s})),g=void 0!==h?h:a,b=this.getDataPoints(n),A=He.f().extent([[g.minLatitude-.1,g.minLongitude-.1],[g.maxLatitude+.1,g.maxLongitude+.1]]).polygons(b).map((function(e){return e.map((function(e){return function(e){return{latitude:e[0],longitude:e[1]}}(e)}))})),E=He.e(He.c).domain([0,r]),v=[],S=0;S<=10;S++)v.push(m.a.createElement(y.a,{key:"guide_"+S,style:{flex:1,height:U.d.doubleBaseMargin,backgroundColor:E(r*S/10),margin:.5}}));var k=this.props.style||{},T=k.width,O=k.height;return m.a.createElement(y.a,{style:{width:T,height:O,opacity:c?U.d.invalidOpacity:void 0}},m.a.createElement(ht.a,{visible:"voronoi"===u},m.a.createElement(y.a,{style:{width:T,flexDirection:"row",alignItems:"center",justifyContent:"space-between"}},m.a.createElement(R.a,{style:U.b.grey.bodyS.regular},Object(W.c)(0,f)),m.a.createElement(R.a,{style:U.b.grey.bodyS.regular},Object(W.c)(r,f))),m.a.createElement(y.a,{style:{width:T,flexDirection:"row",backgroundColor:U.a.border,padding:.5}},v),m.a.createElement(Re.a.Spacer,null)),m.a.createElement(y.a,{style:{borderColor:U.a.border,borderWidth:1,borderRadius:U.d.borderRadius,overflow:"hidden",flex:1}},m.a.createElement(it,{ref:function(t){e._mapRef=t},provider:"google",liteMode:!1,zoomEnabled:!0,zoomControlEnabled:!0,style:{flex:1},onMarkerPress:this.onMarkerPress,initialRegion:i,onRegionChangeComplete:this.onRegionChanged},"voronoi"===u&&A.map((function(e,t){var r=Object(Ve.c)(E(n[t].value),.5);return m.a.createElement(ot,{key:"heat_region_"+t,coordinates:e,strokeWidth:1,strokeColor:yt,fillColor:r})})),"voronoi"===u&&n.map((function(e,t){var r={latitude:e.carpark.latitude,longitude:e.carpark.longitude},n=E(e.value);return m.a.createElement(nt,{key:"centroid_"+t,center:r,radius:50,fillColor:n,strokeColor:yt,strokeWidth:1})})),"markers"===u&&m.a.createElement(pt,{ref:function(t){return e._pinClustering=t},width:T,height:O,clusterers:o,region:i,renderMarker:this.renderMarker}))))}}]),r}(h.PureComponent);bt.defaultProps={style:{width:U.d.defaultSize,height:U.d.defaultSize}};var At=r(36),Et=r(89);function vt(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function St(e){for(var t=1;t0||void 0!==r&&r>0;return m.a.createElement(y.a,{style:St({overflow:"hidden"},this.props.style),onLayout:this.onLayout},n&&m.a.Children.map(this.props.children,(function(e){return e&&e.props?m.a.cloneElement(e,{style:St({},e.props.style,{width:t,height:r})}):e})),!n&&m.a.createElement(Et.a,{showLoading:!1,style:St({},this.props.style,{position:"absolute"})}))}}]),r}(m.a.PureComponent),Ot=r(44),Rt=r(120);function Ct(e){var t=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=d()(e);if(t){var a=d()(this).constructor;r=Reflect.construct(n,arguments,a)}else r=n.apply(this,arguments);return s()(this,r)}}var Ut=function(e){f()(r,e);var t=Ct(r);function r(){return o()(this,r),t.apply(this,arguments)}return l()(r,[{key:"render",value:function(){var e=this.props,t=e.data,r=e.categoryIndex,n=e.graphWidth,a=e.graphHeight,o=e.startOffset,i=e.endOffset,l=e.lineColor,c=e.topValue,s=[];if(void 0!==t){var u=i-1,d=this.props.dataStartOffset||0,p=(this.props.dataEndOffset||t.graphItems.length)-1,f=Math.max(Math.min(Math.max(Math.ceil(o-.5),d),t.graphItems.length-1),0),h=Math.max(Math.min(Math.min(Math.floor(u+.5),p),t.graphItems.length-1),0);if(h>f){var y=function(e){var t=0,r=0,n=0,a=0;e.forEach((function(e){t+=e.x,a+=e.x*e.x,r+=e.y,n+=e.x*e.y}));var o=e.length,i=o*a-t*t;return 0===i?{a:0,b:0}:{a:(r*a-t*n)/i,b:(o*n-t*r)/i}}(function(e,t,r,n){var a=[];if(void 0!==n&&n>=0&&nc||E.y<0||E.y>c)if(Math.abs(y.b)>.001){var v={x:-y.a/y.b,y:0},S={x:(c-y.a)/y.b,y:c},k=v.xA.x&&(A=k),T.xc&&(A.y=c),E.y<0&&(E.y=0),E.y>c&&(E.y=c);var O=function(e){return n*(e-o)/(u-o)},R=function(e){return a*(1-e/c)},C="M"+O(A.x)+","+R(A.y)+"L"+O(E.x)+","+R(E.y);s.push(m.a.createElement(Ot.c,{key:"line_of_best_fit",d:C,stroke:l,strokeWidth:2,fillOpacity:0}))}}return s}}]),r}(h.PureComponent);function Dt(e){var t=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=d()(e);if(t){var a=d()(this).constructor;r=Reflect.construct(n,arguments,a)}else r=n.apply(this,arguments);return s()(this,r)}}var Pt=function(e){f()(r,e);var t=Dt(r);function r(){return o()(this,r),t.apply(this,arguments)}return l()(r,[{key:"getTextWidth",value:function(e){var t=4;if(e)for(var r=0;r=f){var a=r*(e.startColumn-i)/(d-i),l=r*(e.endColumn-i)/(d-i);e.endColumn>e.startColumn||(p.push(m.a.createElement(Ot.b,{key:"marker_line_"+e.label+"_"+e.startColumn+"_"+t,x1:a,y1:o,x2:a,y2:n,stroke:e.color,strokeDasharray:[3,3],strokeWidth:"0.5"})),s&&p.push(m.a.createElement(Pt,{key:"marker_label_"+e.label+"_"+e.startColumn+"_"+t,x:(a+l)/2,y:o,label:e.label,color:e.color,backgroundColor:u.backgroundColor})))}}))}return p}}]),r}(h.PureComponent);function xt(e){var t=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=d()(e);if(t){var a=d()(this).constructor;r=Reflect.construct(n,arguments,a)}else r=n.apply(this,arguments);return s()(this,r)}}var Vt=function(e){f()(r,e);var t=xt(r);function r(){return o()(this,r),t.apply(this,arguments)}return l()(r,[{key:"render",value:function(){var e=this.props,t=e.data,r=e.graphWidth,n=e.graphHeight,a=e.startOffset,o=e.endOffset,i=e.axisColor,l=o-1,c=[];if(void 0!==t){for(var s=Math.max(Math.min(Math.ceil(a-.5),t.graphItems.length-1),0),u=Math.max(Math.min(Math.floor(l+.5),t.graphItems.length-1),0),d="",p=Math.floor((u-s)/7),f=1;f=l&&(p+="M"+a+","+r.y+"L"+a+","+(r.y+r.h));var o=z.a.white,i=t.points.find((function(t){return t.column===e}));i&&(o=t.colorMapper(i.value)),s.push(m.a.createElement(Ot.d,{key:"data_band_column_"+e,x:a,y:r.y,width:f,height:r.h,fill:o,strokeWidth:0}))},y=u;y<=d;y++)h(y);s.push(m.a.createElement(Ot.c,{key:"data_band_lines",d:p,stroke:i,strokeWidth:1,fillOpacity:0}))}return s}}]),r}(h.PureComponent),Nt=r(83);function Jt(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Lt(e){for(var t=1;t=c&&e.endColumnc&&u.push({description:e.label,color:e.color})}));var d=n.renderingPrediction()&&void 0!==s.prediction?[{description:"90%",value:n.formatValue(Math.max(s.prediction.max,0))},{description:"50%",value:n.formatValue(Math.max(s.prediction.expected,0))},{description:"10%",value:n.formatValue(Math.max(s.prediction.min,0))}]:void 0,p=[],f=Object(Ve.a)(o.categoryInfo.length);if(void 0!==s.categoryValues&&o.categoryInfo.length>0)for(var h=s.categoryValues.length-1;h>=0;h--)p.push({description:o.categoryInfo[h].name,value:n.formatValue(s.categoryValues[h]),color:o.categoryInfo[h].color||f(h)});return o.colorBands&&o.colorBands.forEach((function(e){var t=e.points.find((function(e){return e.column===c}));t&&p.push({description:e.label,value:Object(W.c)(t.value,e.valueType),color:e.colorMapper(t.value)})})),o.extraLines&&o.extraLines.forEach((function(e){var t=e.points.find((function(e){return e.column===c}));t&&p.push({description:e.description,value:Object(W.c)(t.value,e.valueType),color:e.color})})),{position:{x:t.paddingLeft+(c-i.startOffset)/l,y:z.d.smallMargin},title:s.label,markerLabels:u,value:o.hidePopupTotalValue?void 0:n.formatValue(s.value),predictionLabels:d,categoryLabels:p}},n.renderPopupContents=function(e){var t=n.props.theme;return m.a.createElement(y.a,{style:{minWidth:100,maxWidth:150,width:e.categoryLabels&&e.categoryLabels.length>0?150:void 0}},m.a.createElement(R.a,{style:[z.b.black.bodyS.regular,{alignSelf:"center"}]},e.title),void 0!==e.value&&m.a.createElement(R.a,{style:[z.b.black.bodyS.thin,{alignSelf:"center"}]},e.value),void 0!==e.predictionLabels&&m.a.createElement(y.a,{style:{backgroundColor:t.predictionColor,paddingHorizontal:z.d.smallMargin,paddingVertical:z.d.tinyMargin,marginBottom:z.d.smallMargin,borderRadius:z.d.smallMargin}},e.predictionLabels.map((function(e,t){return m.a.createElement(y.a,{key:"popup_prediction_"+t,style:{flexDirection:"row",alignItems:"center",justifyContent:"space-between"}},m.a.createElement(R.a,{style:z.b.white.bodyXXS.regular},e.description),m.a.createElement(Re.a.Spacer,null),m.a.createElement(R.a,{style:z.b.white.bodyXXS.regular},e.value))}))),void 0!==e.categoryLabels&&e.categoryLabels.map((function(e,t){return m.a.createElement(y.a,{key:"popup_category_"+e+"_"+t,style:{flexDirection:"row",alignItems:"center"}},m.a.createElement(y.a,{style:{width:z.d.smallMargin,height:z.d.smallMargin,backgroundColor:e.color}}),m.a.createElement(Re.a.SpacerSmall,null),m.a.createElement(R.a,{style:z.b.grey.bodyXXS.thin,ellipsizeMode:"tail",numberOfLines:1},e.description),m.a.createElement(Re.a.SpacerSmall,null),m.a.createElement(Re.a.FlexSpacer,null),m.a.createElement(R.a,{style:z.b.grey.bodyXXS.thin},e.value))})),void 0!==e.markerLabels&&e.markerLabels.map((function(e,t){return m.a.createElement(R.a,{key:"popup_marker_label_"+t,style:[z.b.white.bodyXXS.regular,{color:e.color,textAlign:"center",alignSelf:"center"}]},e.description)})))},n.renderParentOverlay=function(e){var t=n.props.theme;return m.a.createElement(y.a,{style:{position:"absolute",width:1,backgroundColor:t.primaryAxisColor,left:e.position.x,top:t.paddingTop,bottom:t.paddingBottom}})},n.getScrubberOffsets=function(){var e=n.props,t=e.scrubberStartOffset,r=e.scrubberEndOffset,a=n.state.data,o=0,i=a.graphItems.length;return t&&r&&(o=t.__getValue(),i=r.__getValue()),{startOffset:o,endOffset:i,minColumn:Math.max(Math.ceil(o),0),maxColumn:Math.min(Math.floor(i),a.graphItems.length)-1}},n.getCSVData=function(){for(var e,t,r=n.state.data,a=n.getScrubberOffsets(),o=r.scrollGraphType!==jt.a.Line&&r.categoryInfo.length>0,i=[],l=function(e){var t=r.graphItems[e];if(o&&t.categoryValues&&t.categoryValues.length>0){var n=void 0!==t.csvCategoryValues&&void 0!==r.csvCategoryInfo,a=n?t.csvCategoryValues:t.categoryValues,l=n?r.csvCategoryInfo:r.categoryInfo,c=[];a.forEach((function(e,r){l.length>r&&c.push({label:t.label,category:l[r].name,value:e})})),c.filter((function(e){return e.value>0})).sort((function(e,t){return t.value-e.value})).forEach((function(e){i.push([e.label,e.category,Object(W.c)(e.value,r.valueType,0)])}))}else i.push([t.label,Object(W.c)(t.value,r.valueType,0)])},c=a.minColumn;c<=a.maxColumn;c++)l(c);return{title:null==(e=r.csvDefinition)?void 0:e.title,headers:(null==(t=r.csvDefinition)?void 0:t.headers)||(o?["Date","Category","Value"]:["Date","Value"]),data:i}};var a=e.data,i=e.style,l=e.theme,c=n.calculatePercentages(a),s=i.width-l.paddingLeft-l.paddingRight,u=i.height-l.paddingTop-l.paddingBottom,d=n.getLegendHeight(u),p=u-d,f=p;(null==a?void 0:a.colorBands)&&a.colorBands.forEach((function(e){f-=e.height}));var h=n.getTopValue(c.graphItems,c.scrollGraphType);return n.state={animating:!1,lastGraphItems:c.graphItems,lastTopValue:h,rawData:a,data:c,topValue:h,width:e.style.width,height:e.style.height,axisHeight:p,graphWidth:s,graphHeight:f,graphAnim:new L.a.Value(0),legendHeight:d},n}return l()(r,[{key:"componentWillUnmount",value:function(){this.debouncedUpdate.cancel(),this.state.graphAnim.stopAnimation()}},{key:"componentDidUpdate",value:function(){this.debouncedUpdate()}},{key:"getMaxValue",value:function(e,t){if(0==e.length)return 0;var r=this.isStacked(t),n=1;return e.forEach((function(e){r?e.value>n&&(n=e.value):e.categoryValues&&e.categoryValues.forEach((function(e){nn&&(n=e.prediction.max)})),n}},{key:"getTopValue",value:function(e,t){for(var r=this.getMaxValue(e,t),n=2;r>100*n;)n*=10;return Math.ceil(r/n)*n}},{key:"calculatePercentages",value:function(e){if(void 0===e)return{graphItems:[],categoryInfo:[],valueType:W.a.Number,scrollGraphType:jt.a.StackedArea,showLineOfBestFit:!1};if(e.scrollGraphType!=jt.a.StackedLinePercentage&&e.scrollGraphType!=jt.a.StackedAreaPercentage)return e;var t=Gt({},e,{valueType:W.a.Percent});return t.graphItems=t.graphItems.map((function(e){var t=void 0!==e.categoryValues?e.categoryValues.map((function(t,r){return e.value>0?100*t/e.value:r===e.categoryValues.length-1?100:0})):void 0;return Gt({},e,{value:100,categoryValues:t})})),t}},{key:"getLegendHeight",value:function(e){var t=this.props.theme.legendTheme;if(t&&t.legendOrientation===Nt.e.Horizontal){var r=t.minHeight,n=t.sizeProportion;return Math.max(r||0,(n||0)*e)}return 0}},{key:"padPoints",value:function(e,t){if(e.length>=t)return e;var r=[];if(0===e.length){for(var n=0;n0)!function(){var a=r.isStacked(r.state.data.scrollGraphType),o=e.map((function(){return 0})),i=e.map((function(e,t){return{x:t,y:o[t]}}));n.push(i);for(var l=function(t){var r=e.map((function(e,r){var n=e.categoryValues&&e.categoryValues.length>t?e.categoryValues[t]:0;return a?o[r]+=n:o[r]=n,{x:r,y:o[r]}}));n.push(r)},c=0;c=0;n--)r.push(Gt({},t[n]));return r}},{key:"renderAnimatedCategories",value:function(e,t,r){var n=this;if(!e&&!t)return null;var a=this.state,o=a.animating,i=a.lastGraphItems,l=a.lastTopValue,c=a.data,s=a.topValue,u=a.graphAnim,d=this.isStacked(c.scrollGraphType),p=Math.max(c.graphItems.length,2),f=p;o&&(f=Math.max(i.length,2));var h=Math.max(f,p),y=this.getCategoryLines(c.graphItems,c.categoryInfo.length),g=[];o&&(g=(g=this.getCategoryLines(i,c.categoryInfo.length)).map((function(e){return n.padPoints(e,h)})),y=y.map((function(e){return n.padPoints(e,h)})));var b=Object(Ve.a)(c.categoryInfo.length),A=[];if(e)for(var E=0;Et.startColumn;return m.a.createElement(Ot.a,{key:"marker_"+o},c&&m.a.createElement(Ot.d,{x:i,y:a,width:l-i,height:n,fill:t.color,fillOpacity:.75}))}))||m.a.createElement(Ot.a,null))}},{key:"getColorBandY",value:function(e){var t=this.state.data.colorBands,r=0;if(t)for(var n=0;n0}));return r.forEach((function(e){e.value=Math.floor(e.value)})),r}},{key:"getCarparkOccupancyData",value:function(){var e=this.props.data.carparkList,t=this.props.bookingCountsByCarParkData,r=e.map((function(e){return{carpark:e,value:(t?t[e.name]:void 0)||0}})).filter((function(e){return!Ne.b.isDemo||e.value>0}));return r.forEach((function(e){e.value=Math.floor(e.value)})),r}},{key:"renderDataControls",value:function(){var e=this.props.data.cityList,t=this.state,r=t.selectedCity,n=t.selectedMapType,a=t.selectedOverlay;return m.a.createElement(je.Group,{style:{padding:U.d.doubleBaseMargin,width:300}},m.a.createElement(Ce.PickerBox,{placeholder:"Select what to view",items:[{label:jr.Revenue,value:jr.Revenue},{label:jr.Occupancy,value:jr.Occupancy}],selectedValue:n,onValueChange:this.onMapTypePicker}),m.a.createElement(Re.a.Spacer,null),m.a.createElement(Ce.PickerBox,{placeholder:"Select how to view the information",items:[{label:Mr.Voronoi,value:"voronoi"},{label:Mr.Markers,value:"markers"}],selectedValue:a,onValueChange:this.onOverlayPicker}),m.a.createElement(Re.a.Spacer,null),m.a.createElement(Ce.PickerBox,{placeholder:"Select the city to view",items:e.map((function(e){return{label:e.name,value:e.name}})),selectedValue:r,onValueChange:this.onCityPicker}))}},{key:"renderDataView",value:function(){var e,t=this.props.data.cityList,r=this.state,n=r.selectedCity,a=r.selectedMapType,o=r.selectedOverlay,i=r.targetDataStamp,l=r.activeDataStamp,c=[];a===jr.Revenue?(c=this.getCarparkRevenueData(),e=W.a.Dollars):a===jr.Occupancy&&(c=this.getCarparkOccupancyData());var s=U.d.doubleBaseMargin,u=U.d.doubleBaseMargin,d=U.d.doubleBaseMargin,p=i!==l;return m.a.createElement(je.Group,{style:{flex:1,paddingHorizontal:s,paddingTop:u,paddingBottom:d}},m.a.createElement(Tt,{style:{flex:1}},m.a.createElement(bt,{dataStampInvalid:p,mapItems:c,selectedCity:n,cityList:t,valueType:e,selectedOverlay:o})))}},{key:"render",value:function(){var e=this.state.dateScrub;return m.a.createElement(y.a,{style:{minWidth:U.d.minPageWidth,backgroundColor:U.a.pageBackground,padding:U.d.doubleBaseMargin,flex:1}},m.a.createElement(je.Group,null,m.a.createElement(Pr,{dateScrub:e,label:this.props.data.lastImported.label,onEvent:this.onScrubberEvent},m.a.createElement(nr,{kvsSelector:H.kvsComponentSelector,dataKey:xr.ScrubberLineGraph,theme:Ht}))),m.a.createElement(Re.a.SpacerDouble,null),m.a.createElement(y.a,{style:{flexDirection:"row",width:"100%",flex:1}},this.renderDataControls(),m.a.createElement(Re.a.SpacerDouble,null),this.renderDataView()))}}]),r}(m.a.Component),Ir=Object(b.b)((function(e){return{data:e.data,revenueByCarParkData:e.kdsData[Vr.RevenueByCarPark],bookingCountsByCarParkData:e.kdsData[Vr.BookingCountsByCarPark]}}))(Br);function Nr(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Jr(e,t,r,n,a,o,i,l,c,s){var u=[],d=[];try{if(a&&a.length>0){u=ie(i,l,a.length),d=a.map((function(e){return{name:e.description,color:e.color}}));var p=void 0!==a.find((function(e){return e.isTotal}));a.forEach((function(e,t){e.revenue&&e.revenue.forEach((function(r){var n=F.b(i,F.g(r.timeStart)),a=u[n];a&&(p&&!e.isTotal||(a.value+=r.totalValue),a.categoryValues[t]+=r.totalValue)}))}))}else u=ie(i,l,1);void 0===o||c.scrollGraphType!==H.ScrollGraphType.Line&&c.scrollGraphType!==H.ScrollGraphType.LayeredLine&&c.scrollGraphType!==H.ScrollGraphType.LayeredArea&&c.scrollGraphType!==H.ScrollGraphType.StackedLine&&c.scrollGraphType!==H.ScrollGraphType.StackedArea||o.forEach((function(e){u.forEach((function(t){var r=F.g(e.timeStart);!r.isBefore(t.start)&&r.isBefore(t.end)&&(void 0===t.prediction?t.prediction={max:e.valueAudP90,expected:e.valueAudP50,min:e.valueAudP10}:(t.prediction.max+=e.valueAudP90,t.prediction.expected+=e.valueAudP50,t.prediction.min+=e.valueAudP10))}))}));var f=ce(u,t,r,n),h={graphItems:u,graphMarkers:f,categoryInfo:d,valueType:W.a.Dollars,scrollGraphType:c.scrollGraphType,showLineOfBestFit:c.showLineOfBestFit,lineOfBestFitStartColumn:c.lineOfBestFitStartMoment?F.b(i,c.lineOfBestFitStartMoment):void 0,lineOfBestFitEndColumn:c.lineOfBestFitEndMoment?F.b(i,c.lineOfBestFitEndMoment):void 0,extraLines:c.extraLines,colorBands:c.colorBands,csvDefinition:c.csvDefinition,dataStamp:s};A.b.dispatch(H.KVSComponentActions.setScrollGraphData(e,h))}catch(m){A.b.dispatch(x.a.setError({title:"Error",message:m.message}))}}function Lr(e,t,r,n,a){if(t){var o=[];t.forEach((function(e){var t=F.g(e.date);if(!t.isBefore(r)&&t.isBefore(n)){var a=o.find((function(t){return t.group===e.group}));void 0!==a?a.value+=e.value:o.push(function(e){for(var t=1;t=0}},{key:"getWeatherDataForState",value:function(e){var t=this.state.dateScrub,r=this.props.kdsData,n=[];return r[sn.DailyWeather].filter((function(t){return t.state===e})).forEach((function(e){if(null!==e.max_temperature){var r=F.g(e.date).startOf("day");n.push({column:r.diff(t.queryStartMoment,"days"),value:Number(e.max_temperature)})}})),{label:e,axisLabel:e,points:n,valueType:W.a.Temperature,colorMapper:Object(Ve.b)(10,40),height:U.d.baseMargin}}},{key:"updateRevenueGraph",value:function(e){var t,r,n,a,o,i,l,c,s,u,d,p,f,h,m,y,g=this;return S.a.async((function(b){for(;;)switch(b.prev=b.next){case 0:if(t=this.state,r=t.dateScrub,n=t.selectedCarParkOrState,a=this.props.kdsData,o=this.props.data,i=o.schoolHolidays,l=o.publicHolidays,c=o.appVersions,s=o.carparkList,u=a[sn.RevenueGraph]){b.next=6;break}return b.abrupt("return");case 6:d=this.mergeSelectedIndividualData({revenue:u.revenue,description:"App Revenue",isTotal:!1,color:dn.app},{revenue:u.webRevenue,description:"Web Revenue",isTotal:!1,color:dn.web},{revenue:[].concat(qr()(u.revenue),qr()(u.webRevenue)),description:"Total Revenue",isTotal:!0,color:dn.total}),this.isOptionSelected(ln.Predictions)&&(p=this.mergeSelectedData(u.predictions,u.webPredictions)),f=Se.i(n,s)||[Oe.b.TAS,Oe.b.VIC,Oe.b.SA,Oe.b.ACT,Oe.b.NSW,Oe.b.WA,Oe.b.QLD,Oe.b.NT],h=[],this.isOptionSelected(ln.Covid)&&(m=se(a[sn.Covid],r.queryStartMoment,f))&&h.push(m),y=[],this.isOptionSelected(ln.Weather)&&f.forEach((function(e){y.push(g.getWeatherDataForState(e))})),Jr(un.RevenueLineGraph,i,l,c,d,p,r.queryStartMoment,r.queryEndMoment,{scrollGraphType:jt.a.LayeredLine,showLineOfBestFit:!0,lineOfBestFitEndMoment:te().add(1,"day"),extraLines:h,colorBands:y,csvDefinition:{headers:["Date","Platform","Value in AUD"]}},e);case 14:case"end":return b.stop()}}),null,this,null,Promise)}},{key:"fetchAndUpdateRevenueGraph",value:function(e){var t,r,n,a,o,i,l,c=this;return S.a.async((function(s){for(;;)switch(s.prev=s.next){case 0:if(t=this.state,r=t.dateScrub,n=t.selectedCarParkOrState,a=this.props.kdsData,o=a[sn.RevenueGraph],i=this.props.data.carparkList,l=n===Ze.b?void 0:Se.h(n,i)||[],!o||o.selectedCarParkOrState!==n){s.next=9;break}this.updateRevenueGraph(e),s.next=10;break;case 9:return s.abrupt("return",Zr.default.getKassandraRevenueData(r.queryStartMoment,r.queryEndMoment,l,n).then((function(t){c.props.dispatch(At.Actions.setKDSData(sn.RevenueGraph,t)),c.updateRevenueGraph(e)})));case 10:case"end":return s.stop()}}),null,this,null,Promise)}},{key:"renderCheckBoxes",value:function(){var e=this.state,t=e.showApp,r=e.showWeb,n=e.showTotal;return m.a.createElement(y.a,{style:{flexDirection:"row",justifyContent:"flex-end"}},m.a.createElement(rn.CheckBox,{checked:t,checkColor:dn.app,text:"App",onPress:this.onAppPress}),m.a.createElement(Re.a.SpacerDouble,null),m.a.createElement(rn.CheckBox,{checked:r,checkColor:dn.web,text:"Web",onPress:this.onWebPress}),m.a.createElement(Re.a.SpacerDouble,null),m.a.createElement(rn.CheckBox,{checked:n,checkColor:dn.total,text:"Total",onPress:this.onTotalPress}))}},{key:"updateComponentData",value:function(){var e,t,r,n,a,o,i,l,c,s,u=this,d=arguments;return S.a.async((function(p){for(;;)switch(p.prev=p.next){case 0:return e=!(d.length>0&&void 0!==d[0])||d[0],t=d.length>1&&void 0!==d[1]&&d[1],r=this.props.data,n=r.schoolHolidays,a=r.publicHolidays,o=r.appVersions,i=this.state,l=i.dateScrub,c=i.selectedCarParkOrState,s=[],e&&(s.push(j.default.tableDataRequest({database:Ne.b.dataService.covidDatabase,collection:"jhu",operation:"aggregate",query:{options:{allowDiskUse:!0},pipeline:[Se.b({field:"country_region",values:["Australia"]}),Se.c({fields:["date","province_state"],firstOutputs:["date","province_state"],sumOutputs:["confirmed","deaths","recovered"]}),Se.g({field:"date"}),Se.f({outputs:["date","confirmed","deaths","recovered","province_state"]})]}}).then((function(e){var t=e.map((function(e){return an({},e,{province_state:Object(Oe.g)(e.province_state)})}));u.props.dispatch(At.Actions.setKDSData(sn.Covid,t))}))),s.push(j.default.tableDataRequest({database:Ne.b.dataService.database,collection:"daily_weather",operation:"aggregate",query:{options:{allowDiskUse:!0},pipeline:[]}}).then((function(e){u.props.dispatch(At.Actions.setKDSData(sn.DailyWeather,e))}))),s.push(Promise.all([j.default.groupedDailyValue("bookings_screen_daily_revenue_by_product"),j.default.groupedDailyValue("bookings_screen_daily_revenue_by_product_web")]).then((function(e){u.props.dispatch(At.Actions.setKDSData(sn.DailyRevenueByProductApp,e[0])),u.props.dispatch(At.Actions.setKDSData(sn.DailyRevenueByProductWeb,e[1])),de(un.ScrubberLineGraph,e[0],n,a,o,l.queryStartMoment,l.queryEndMoment,{scrollGraphType:jt.a.Line,valueType:W.a.Dollars,showLineOfBestFit:!1})}))),s.push(Promise.all([j.default.dailyValue("summary_screen_bookings_revenue"),j.default.dailyValue("summary_screen_bookings_revenue_web")]).then((function(e){u.props.dispatch(At.Actions.setKDSData(sn.BookingsRevenueApp,e[0])),u.props.dispatch(At.Actions.setKDSData(sn.BookingsRevenueWeb,e[1]))}))),s.push(Zr.default.getKassandraRevenueData(l.queryStartMoment,l.queryEndMoment,void 0,c).then((function(e){u.props.dispatch(At.Actions.setKDSData(sn.RevenueGraph,e))})))),t&&(s.push(j.default.groupedDailyValue("summary_screen_purchases_refunds_amended_bookings").then((function(e){u.props.dispatch(At.Actions.setKDSData(sn.PurchasesRefundsAmendedBookings,e))}))),s.push(j.default.dailyValue("bookings_screen_average_app_signup_purchase").then((function(e){u.props.dispatch(At.Actions.setKDSData(sn.AverageAppSignupPurchase,e))}))),s.push(j.default.dailyValue("bookings_screen_average_book_a_bay_purchase").then((function(e){u.props.dispatch(At.Actions.setKDSData(sn.AverageBookABayPurchase,e))}))),s.push(j.default.dailyValue("bookings_screen_average_wilsonone_purchase").then((function(e){u.props.dispatch(At.Actions.setKDSData(sn.AverageWilsonOnePurchase,e))}))),s.push(j.default.groupedDailyValue("bookings_payment_platform").then((function(e){u.props.dispatch(At.Actions.setKDSData(sn.BookingsPaymentPlatform,e))})))),p.abrupt("return",Promise.all(s).then((function(){var e=u.getDataStampWithAllTogglesAndNoRange();u.updateRevenueGraph(e)})));case 8:case"end":return p.stop()}}),null,this,null,Promise)}},{key:"updateFetchedData",value:function(e,t,r){var n=this;return S.a.async((function(a){for(;;)switch(a.prev=a.next){case 0:j.default.bookings({timeStart:e.toISOString(),timeEnd:t.toISOString(),limit:1e3}).then((function(e){en.createDataTableData(un.BookingsTable,e,{columns:[{title:"Date",field:"datetime",valueFormatter:K.Date},{title:"Hour",field:"datetime",valueFormatter:K.Hour},{title:"ID",field:"pseudoId"},{title:Ne.b.strings.Car_Park,field:"carPark"},{title:Ne.b.strings.Product,field:"product"},{title:"City",field:"city"},{title:"Value",field:"value",valueFormatter:K.Dollars}]},r)})),this.state.showMoreContent&&j.default.tableDataRequest({database:Ne.b.dataService.database,collection:"daily_bookings_by_unique_user_and_platform",operation:"aggregate",query:{options:{allowDiskUse:!0},pipeline:[Se.d({start:e,end:t}),Se.b({field:"platform",values:this.getFilterValues()}),Se.c({fields:["userId"],addCount:"value"}),Se.c({fields:[],sumOutputs:["value"],addCount:"count"})]}}).then((function(r){var a=n.getDataStampWithSomeToggles(e,t);ye(un.AverageBookingCountLabel,"Average "+Ne.b.strings.Bookings+" per "+Ne.b.strings.Booked+" User",n.getDynamicLabelDescription("The average number of "+Ne.b.strings.bookings+" per user that made at least one "+Ne.b.strings.booking+" with the "," during the selected time period."),r.length>0?r[0].value/r[0].count:0,W.a.Number,void 0,a)}));case 2:case"end":return a.stop()}}),null,this,null,Promise)}},{key:"getDataStampWithSomeToggles",value:function(e,t){var r=this.state,n=r.showApp,a=r.showWeb,o=r.showTotal;return Object(rr.a)(e,t)+" "+n+" "+a+" "+o}},{key:"getDataStampWithSomeTogglesAndNoRange",value:function(){var e=this.state;return e.showApp+" "+e.showWeb+" "+e.showTotal}},{key:"getDataStampWithAllTogglesAndNoRange",value:function(){var e=this.state,t=e.showApp,r=e.showWeb,n=e.showTotal,a=e.selectedCarParkOrState;return this.isOptionSelected(ln.Covid)+" "+this.isOptionSelected(ln.Weather)+" "+t+" "+r+" "+n+" "+this.isOptionSelected(ln.Predictions)+" "+a}},{key:"mergeSelectedData",value:function(e,t){var r=this.state,n=r.showApp,a=r.showWeb;return r.showTotal||n&&a?e.concat(t):n?e:a?t:[]}},{key:"mergeSelectedIndividualData",value:function(e,t,r){var n=this.state,a=n.showApp,o=n.showWeb,i=n.showTotal,l=[];return a&&(l=l.concat(e)),o&&(l=l.concat(t)),i&&(l=l.concat(r)),l}},{key:"getFilterValues",value:function(){var e=this.state,t=e.showApp,r=e.showWeb,n=e.showTotal,a=[];return(t||n)&&(a.push("ANDROID"),a.push("IOS")),(r||n)&&a.push("WEB"),a}},{key:"render",value:function(){var e=this,t=this.state,r=t.dateScrub,n=t.selectedCarParkOrState;return m.a.createElement(Re.a.Screen,null,m.a.createElement(je.Group,null,m.a.createElement(Pr,{dateScrub:r,label:this.props.data.lastImported.label,onEvent:this.onScrubberEvent},m.a.createElement(nr,{kvsSelector:H.kvsComponentSelector,dataKey:un.ScrubberLineGraph,theme:Ht}))),m.a.createElement(Re.a.SpacerDouble,null),m.a.createElement(je.Group,null,m.a.createElement(y.a,{style:{flexDirection:"row"}},m.a.createElement(pr.Label,{data:{text:"State"},theme:pr.LABEL_THEME_TITLE}),m.a.createElement(Re.a.SpacerDouble,null),m.a.createElement(Re.a.FlexSpacer,null),this.renderCarparksPicker(),m.a.createElement(Re.a.SpacerDouble,null),this.renderCheckBoxes())),m.a.createElement(Re.a.SpacerDouble,null),m.a.createElement(je.Group,null,m.a.createElement(y.a,{style:{flexDirection:"row"}},m.a.createElement(pr.Label,{data:{text:"Revenue"},theme:pr.LABEL_THEME_TITLE}),m.a.createElement(Re.a.SpacerDouble,null),m.a.createElement(Re.a.FlexSpacer,null),this.renderOptionsPicker()),m.a.createElement(Re.a.SpacerDouble,null),m.a.createElement(pr.Label,{data:{text:"Daily Revenue",description:this.getDynamicLabelDescription("The total daily revenue for "+Ne.b.strings.bookings+" made with the "," during the selected time period in "+n+".")},theme:pr.LABEL_THEME_COMPONENT_CAPTION}),this.renderGraph(un.RevenueLineGraph,un.DataStampWithAllTogglesAndNoRange,3),m.a.createElement(Re.a.SpacerDouble,null)),m.a.createElement(Re.a.SpacerDouble,null),this.state.showMoreContent?m.a.createElement(m.a.Fragment,null,m.a.createElement(je.Group,{style:{flexDirection:"row"}},m.a.createElement(Wr.ConnectedValueLabel,{kvsSelector:H.kvsComponentSelector,dataKey:un.PurchasesLabel,dataStampKey:un.DataStamp,style:{flex:1},theme:Wr.VALUE_LABEL_THEME_LARGE}),m.a.createElement(Re.a.SpacerDouble,null),m.a.createElement(Wr.ConnectedValueLabel,{kvsSelector:H.kvsComponentSelector,dataKey:un.RefundsLabel,dataStampKey:un.DataStamp,style:{flex:1},theme:Wr.VALUE_LABEL_THEME_LARGE}),m.a.createElement(Re.a.SpacerDouble,null),m.a.createElement(Wr.ConnectedValueLabel,{kvsSelector:H.kvsComponentSelector,dataKey:un.AmendedBookingsLabel,dataStampKey:un.DataStamp,style:{flex:1},theme:Wr.VALUE_LABEL_THEME_LARGE}),m.a.createElement(Re.a.SpacerDouble,null),m.a.createElement(Wr.ConnectedValueLabel,{kvsSelector:H.kvsComponentSelector,dataKey:un.BookingsRevenueLabel,dataStampKey:un.DataStampWithSomeToggles,style:{flex:1},theme:Wr.VALUE_LABEL_THEME_LARGE}),m.a.createElement(Re.a.SpacerDouble,null),m.a.createElement(Wr.ConnectedValueLabel,{kvsSelector:H.kvsComponentSelector,dataKey:un.BookingsLabel,dataStampKey:un.DataStampWithSomeToggles,style:{flex:1},theme:Wr.VALUE_LABEL_THEME_LARGE}),m.a.createElement(Re.a.SpacerDouble,null),m.a.createElement(y.a,{style:{flex:1}},m.a.createElement(Wr.ConnectedValueLabel,{kvsSelector:H.kvsComponentSelector,dataKey:un.AverageBookingValueLabel,dataStampKey:un.DataStampWithSomeToggles,style:{minWidth:"100%"}}),m.a.createElement(Re.a.Spacer,null),m.a.createElement(Wr.ConnectedValueLabel,{kvsSelector:H.kvsComponentSelector,dataKey:un.AverageBookingCountLabel,dataStampKey:un.DataStampWithSomeToggles,style:{minWidth:"100%"}}))),m.a.createElement(Re.a.SpacerDouble,null),m.a.createElement(je.Group,null,m.a.createElement(y.a,{style:{flexDirection:"row"}},m.a.createElement(pr.Label,{data:{text:"Revenue by "+Ne.b.strings.Product+" Type"},theme:pr.LABEL_THEME_TITLE}),m.a.createElement(Re.a.SpacerDouble,null),m.a.createElement(Re.a.FlexSpacer,null),this.renderProductTypePicker()),m.a.createElement(Re.a.SpacerDouble,null),m.a.createElement(y.a,{style:{flexDirection:"row"}},m.a.createElement(y.a,{style:{flex:2}},m.a.createElement(pr.Label,{data:{text:"Daily Revenue by "+Ne.b.strings.Product+" Type",description:this.getDynamicLabelDescription("The breakdown of daily revenue by "+Ne.b.strings.product+" type for "+Ne.b.strings.bookings+" made with the "," during the selected time period.")},theme:pr.LABEL_THEME_COMPONENT_CAPTION}),this.renderGraph(un.ProductLineGraph,un.DataStampWithSomeToggles,2)),m.a.createElement(Re.a.SpacerDouble,null),m.a.createElement(y.a,{style:{flex:1}},m.a.createElement(pr.Label,{data:{text:"Revenue by "+Ne.b.strings.Product+" Type",description:this.getDynamicLabelDescription("The breakdown of total revenue by "+Ne.b.strings.product+" type for "+Ne.b.strings.bookings+" made with the "," during the selected time period.")},theme:pr.LABEL_THEME_COMPONENT_CAPTION}),m.a.createElement(Tt,{style:{flex:1}},m.a.createElement(Fr.ConnectedPieChart,{kvsSelector:H.kvsComponentSelector,dataKey:un.ProductPieChart,dataStampKey:un.DataStampWithSomeToggles}))))),m.a.createElement(Re.a.SpacerDouble,null),m.a.createElement(je.Group,null,m.a.createElement(pr.Label,{data:{text:"App Revenue by Payment Method"},theme:pr.LABEL_THEME_TITLE}),m.a.createElement(Re.a.SpacerDouble,null),m.a.createElement(y.a,{style:{flexDirection:"row"}},m.a.createElement(y.a,{style:{flex:2}},m.a.createElement(pr.Label,{data:{text:"Payment Revenue"},theme:pr.LABEL_THEME_COMPONENT_CAPTION}),this.renderGraph(un.PaymentTypeLineGraph,un.DataStamp,2)),m.a.createElement(y.a,{style:{flex:1}},m.a.createElement(pr.Label,{data:{text:"App Revenue by Payment Type",description:"The breakdown of total revenue by payment type for "+Ne.b.strings.bookings+" made by the App during the selected time period."},theme:pr.LABEL_THEME_COMPONENT_CAPTION}),m.a.createElement(Tt,{style:{flex:1}},m.a.createElement(Fr.ConnectedPieChart,{kvsSelector:H.kvsComponentSelector,dataKey:un.PaymentTypePieChart,dataStampKey:un.DataStamp}))))),m.a.createElement(Re.a.SpacerDouble,null),m.a.createElement(je.Group,null,m.a.createElement(pr.Label,{data:{text:"App "+Ne.b.strings.Bookings,description:"The list of all "+Ne.b.strings.bookings+" made with the App during the selected time period."},theme:pr.LABEL_THEME_TITLE}),m.a.createElement(Re.a.SpacerDouble,null),m.a.createElement(Tt,null,m.a.createElement(Hr.ConnectedDataTable,{kvsSelector:H.kvsComponentSelector,dataKey:un.BookingsTable,dataStampKey:un.DataStamp,pageSize:10})))):m.a.createElement(Be.Button,{text:"Show More",theme:an({},Be.BUTTON_THEME_FIXED_RED,{textStyle:U.b.white.bodyM.bold,minWidth:"auto"}),onPress:function(){var t=!e.state.showMoreContent;e.setState({showMoreContent:t}),e.updateComponentData(!t,t).then(e.updateAfterToggle).catch((function(t){e.props.dispatch(x.a.setError({title:"Error",message:t.message}))}))}}))}}]),r}(m.a.Component),yn=Object(b.b)((function(e){return{data:e.data,kdsData:e.kdsData}}))(mn),gn=r(134);function bn(e){var t=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=d()(e);if(t){var a=d()(this).constructor;r=Reflect.construct(n,arguments,a)}else r=n.apply(this,arguments);return s()(this,r)}}!function(e){e.GroupedDailyErrors="MonitoringScreen Grouped Daily Errors",e.GroupedDailyUserUnexpectedErrors="MonitoringScreen Grouped Daily User Unexpected Errors",e.UserEventStream="MonitoringScreen User Event Stream",e.UserEventStreamLoginIds="MonitoringScreen User Event Stream Login Ids",e.UserEventStreamErrors="UserEventStreamErrors"}(pn||(pn={})),function(e){e.DataStamp="MonitoringScreen Data Stamp",e.ScrubberLineGraph="MonitoringScreen Scrubber Line Graph",e.ErrorBarChart="MonitoringScreen Error Bar Chart",e.ErrorsDetailTable="MonitoringScreen Error Details Table",e.UserEventStreamTable="MonitoringScreen User Event Stream"}(fn||(fn={}));var An=function(e){f()(r,e);var t=bn(r);function r(e){var n;o()(this,r),(n=t.call(this,e)).onScrubberEvent=function(e,t,r){var a=Object(rr.a)(e,t);r!==sr.Changing&&r!==sr.Changed||n.props.dispatch(H.KVSComponentActions.setDataStampData(fn.DataStamp,a)),r===sr.Changed&&(!function(e,t,r,n,a,o){if(t){for(var i=Q.d.getTopGroups(t),l=[],c=r.clone();c.isBefore(n);c.add(1,"day"))l.push({label:c.format("D MMM"),value:0,color:U.a.blue,childItems:i.map((function(e){return{label:e,value:0}}))});try{var s=i.length>a.categoryCount;t.forEach((function(e){var t=F.g(e.date).diff(r,"days");if(t>=0&&t=0?l[t].childItems[n].value+=e.value:s=!0}else s=!0}));var u=l.map((function(e){return q({},e,{childItems:e.childItems.filter((function(e){return e.value>0})).sort((function(e,t){return t.value-e.value}))})}));s&&l.forEach((function(e){for(;e.childItems.length>=a.categoryCount;)e.childItems.pop();var t=e.childItems.reduce((function(e,t){return e+t.value}),0);e.childItems.push({label:"Other",value:e.value-t})}));var d={dataStamp:o,items:l,csvItems:u,valueType:W.a.Number,isVertical:a.isVertical,csvDefinition:a.csvDefinition};A.b.dispatch(H.KVSComponentActions.setBarChartData(e,d))}catch(p){A.b.dispatch(x.a.setError({title:"Error",message:p.message}))}}}(fn.ErrorBarChart,n.props.kdsData[pn.GroupedDailyErrors],e,t,{categoryCount:20,isVertical:!0,csvDefinition:{headers:["Date","Error","Count"]}},a),en.createDataTableData(fn.ErrorsDetailTable,n.props.kdsData[pn.GroupedDailyUserUnexpectedErrors],{dateFilter:{field:"event_date",startMoment:e,endMoment:t},columns:[{title:"Date",field:"event_date",valueFormatter:K.Date},{title:"Event",field:"event_name"},{title:"Error Tag",field:"error_tag"},{title:"Error",field:"error"},{title:"Count",field:"count",valueFormatter:K.Number}]},a),n.updateFetchedData(e,t,a))},n.updateUserEventStreamTableData=function(){var e=n.state,t=e.dateScrub,r=e.filterLoginId,a=e.filterError,o=n.props.kdsData[pn.UserEventStream],i=Dr(t),l=Object(rr.a)(i.startMoment,i.endMoment),c=r&&o?o.filter((function(e){return e.loginId===r})):o;en.createDataTableData(fn.UserEventStreamTable,a&&c?c.filter((function(e){return e.error===a})):c,{columns:[{title:"Date and Time",field:"datetime",valueFormatter:K.DateTimeZone},{title:"Login Id",field:"loginId"},{title:"Event",field:"event_name"},{title:"Error Tag",field:"errorTag"},{title:"Error",field:"error"},{title:"Platform",field:"platform"},{title:"App Version",field:"version"}]},l)},n.onFilterLoginIdChange=function(e){n.setState({filterLoginId:e},n.updateUserEventStreamTableData)},n.onFilterErrorChange=function(e){n.setState({filterError:e},n.updateUserEventStreamTableData)},n.props.dispatch(H.KVSComponentActions.clearComponentData());var a=re({});return n.state={dateScrub:a,filterLoginId:void 0},n}return l()(r,[{key:"componentDidMount",value:function(){var e=this,t=this.state.dateScrub;this.updateComponentData().then((function(){var r=Dr(t);e.onScrubberEvent(r.startMoment,r.endMoment,sr.Changed)})).catch((function(t){e.props.dispatch(x.a.setError({title:"Error",message:t.message}))}))}},{key:"updateComponentData",value:function(){var e,t,r,n,a,o,i=this;return S.a.async((function(l){for(;;)switch(l.prev=l.next){case 0:return e=this.props.data,t=e.schoolHolidays,r=e.publicHolidays,n=e.appVersions,a=this.state.dateScrub,(o=[]).push(j.default.tableDataRequest({database:M.b.dataService.database,collection:"grouped_daily_user_unexpected_errors",operation:"aggregate",query:{options:{allowDiskUse:!0},pipeline:[Se.c({fields:["event_date","error"],firstOutputs:["event_date","error"],sumOutputs:["count"]}),Se.g({field:"event_date"}),Se.f({projectOutputs:[{from:"event_date",to:"date"},{from:"error",to:"group"},{from:"count",to:"value"},{from:"count",to:"count"}]})]}}).then((function(e){i.props.dispatch(At.Actions.setKDSData(pn.GroupedDailyErrors,e)),de(fn.ScrubberLineGraph,e,t,r,n,a.queryStartMoment,a.queryEndMoment,{scrollGraphType:jt.a.StackedArea,categoryCount:20,valueType:W.a.Number})}))),o.push(j.default.tableDataRequest({collection:"grouped_daily_user_unexpected_errors",database:M.b.dataService.database,operation:"aggregate",query:{options:{allowDiskUse:!0},pipeline:[Se.g({field:"hour"}),Se.g({field:"event_date"})]}}).then((function(e){i.props.dispatch(At.Actions.setKDSData(pn.GroupedDailyUserUnexpectedErrors,e))}))),l.abrupt("return",Promise.all(o));case 6:case"end":return l.stop()}}),null,this,null,Promise)}},{key:"updateFetchedData",value:function(e,t,r){var n,a,o,i=this;return S.a.async((function(r){for(;;)switch(r.prev=r.next){case 0:n=this.state,a=n.filterLoginId,o=n.filterError,j.default.tableDataRequest({database:M.b.dataService.database,collection:"user_event_stream",operation:"aggregate",query:{options:{allowDiskUse:!0},pipeline:[Se.d({start:e,end:t},"datetime"),Se.g({field:"datetime"}),Se.e({limit:5e4})]}}).then((function(e){i.props.dispatch(At.Actions.setKDSData(pn.UserEventStream,e));var t=e.filter((function(e){return e.error})),r=Object(B.uniqBy)(t,(function(e){return e.loginId})).map((function(e){return e.loginId})).sort();i.props.dispatch(At.Actions.setKDSData(pn.UserEventStreamLoginIds,r));var n=Object(B.uniqBy)(t,(function(e){return e.error})).map((function(e){return e.error})).sort();i.props.dispatch(At.Actions.setKDSData(pn.UserEventStreamErrors,n)),void 0!==a&&void 0===r.find((function(e){return e===a}))&&i.setState({filterLoginId:void 0}),void 0!==o&&void 0===n.find((function(e){return e===o}))&&i.setState({filterError:void 0}),i.updateUserEventStreamTableData()})).catch((function(e){i.props.dispatch(x.a.setError({title:"Error",message:e.message}))}));case 2:case"end":return r.stop()}}),null,this,null,Promise)}},{key:"render",value:function(){var e,t,r=this.state.dateScrub,n=this.props.kdsData,a=null!=(e=n[pn.UserEventStreamLoginIds])?e:[],o=[{label:"All users",value:void 0}];a.forEach((function(e){o.push({label:e,value:e})}));var i=null!=(t=n[pn.UserEventStreamErrors])?t:[],l=[{label:"Errors",value:void 0}];return i.forEach((function(e){l.push({label:e,value:e})})),m.a.createElement(Re.a.Screen,{forceScrollbar:!0},m.a.createElement(je.Group,null,m.a.createElement(Pr,{dateScrub:r,label:this.props.data.lastImported.label,onEvent:this.onScrubberEvent},m.a.createElement(nr,{kvsSelector:H.kvsComponentSelector,dataKey:fn.ScrubberLineGraph,theme:Ht}))),m.a.createElement(Re.a.SpacerDouble,null),m.a.createElement(je.Group,null,m.a.createElement(pr.Label,{data:{text:"Top Errors",description:"The top errors for network calls"},theme:pr.LABEL_THEME_SUBHEADING}),m.a.createElement(Re.a.Spacer,null),m.a.createElement(Tt,{calculateHeight:!0,aspectRatio:3},m.a.createElement(gn.ConnectedBarChart,{kvsSelector:H.kvsComponentSelector,dataKey:fn.ErrorBarChart,scrubberStartOffset:r.scrubberStartOffset,scrubberEndOffset:r.scrubberEndOffset,legend:!0,dataStampKey:fn.DataStamp}))),m.a.createElement(Re.a.SpacerDouble,null),m.a.createElement(je.Group,null,m.a.createElement(pr.Label,{data:{text:"Errors",description:"The list of all errors made with the App during the selected time period."},theme:pr.LABEL_THEME_TITLE}),m.a.createElement(Re.a.Spacer,null),m.a.createElement(Tt,null,m.a.createElement(Hr.ConnectedDataTable,{kvsSelector:H.kvsComponentSelector,dataKey:fn.ErrorsDetailTable,dataStampKey:fn.DataStamp,pageSize:10}))),m.a.createElement(Re.a.SpacerDouble,null),m.a.createElement(je.Group,null,m.a.createElement(y.a,{style:{flexDirection:"row"}},m.a.createElement(pr.Label,{data:{text:"User Event Stream",description:"The list of user events from the App during the selected time period optionally filtered by a user's login id. Note that only users who generated at least one error in the selected time period will be shown in the picker."},style:{flex:1},theme:pr.LABEL_THEME_TITLE}),m.a.createElement(Re.a.SpacerDouble,null),m.a.createElement(Ce.PickerBox,{placeholder:"Filter by Login Id?",items:o,style:{flex:1},selectedValue:this.state.filterLoginId,onValueChange:this.onFilterLoginIdChange}),m.a.createElement(Re.a.SpacerDouble,null),m.a.createElement(Ce.PickerBox,{placeholder:"Filter by error?",items:l,style:{flex:1},selectedValue:this.state.filterError,onValueChange:this.onFilterErrorChange})),m.a.createElement(Re.a.Spacer,null),m.a.createElement(Tt,null,m.a.createElement(Hr.ConnectedDataTable,{kvsSelector:H.kvsComponentSelector,dataKey:fn.UserEventStreamTable,dataStampKey:fn.DataStamp,pageSize:10}))))}}]),r}(m.a.Component),En=Object(b.b)((function(e){return{data:e.data,kdsData:e.kdsData}}))(An),vn=r(109);function Sn(e){var t=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=d()(e);if(t){var a=d()(this).constructor;r=Reflect.construct(n,arguments,a)}else r=n.apply(this,arguments);return s()(this,r)}}var kn={DailyRatingsByCarPark:"SurveysScreen Daily Ratings By "+Ne.b.strings.Car_Park,DailyBookingsRevenueByStateAndCarParkApp:"SurveyScreen Daily "+Ne.b.strings.Bookings+" Revenue By State"},Tn={DataStamp:"SurveysScreen Data Stamp",ScrubberGraph:"SurveysScreen Scrubber Graph",AverageRatingLabel:"SurveysScreen Average Rating Label",BookingPercentageWithRatingLabel:"SurveysScreen "+Ne.b.strings.Booking+" Percentage With Rating Label",PositiveFeedbackCountLabel:"SurveysScreen Positive Feedback Count Label",PositiveFeedbackBarChart:"SurveysScreen Positive Feedback Bar Chart",NegativeFeedbackCountLabel:"SurveysScreen Negative Feedback Count Label",NegativeFeedbackBarChart:"SurveysScreen Negative Feedback Bar Chart",HighestRatedCarParksTable:"SurveysScreen Highest Rated "+Ne.b.strings.Car_Parks+" Table",LowestRatedCarParksTable:"SurveysScreen Lowest Rated "+Ne.b.strings.Car_Parks+" Table"},On=function(e){f()(r,e);var t=Sn(r);function r(e){var n;return o()(this,r),(n=t.call(this,e)).refreshComponents=function(){var e=Dr(n.state.dateScrub);n.onScrubberEvent(e.startMoment,e.endMoment,sr.Changed)},n.onScrubberEvent=function(e,t,r){var a=n.props.carParkList,o=n.state.filter,i=n.getDataStamp(e,t,o);if(r!==sr.Changing&&r!==sr.Changed||n.props.dispatch(H.KVSComponentActions.setDataStampData(Tn.DataStamp,i)),r===sr.Changed){var l=Object(Se.h)(o,a),c=n.props.kdsData[kn.DailyRatingsByCarPark];Ae({key:Tn.AverageRatingLabel,title:"Average Rating",description:"The average user rating for the selected "+Ne.b.strings.car_park+"(s) over the selected time period. Users rate their "+Ne.b.strings.parking+" experience from 1 to 5.",data:c,groupFilter:l,startMoment:e,endMoment:t,valueType:W.a.Number,calculationType:ne.Average,showCount:{suffix:" Ratings"},calculatePercentageChange:!0,dataStamp:i});var s=n.props.kdsData[kn.DailyBookingsRevenueByStateAndCarParkApp]||void 0,u=n.calculateTotalCount(s,e,t,l,"car_park_name","datetime"),d=n.calculateTotalCount(c,e,t,l,"group","date");ye(Tn.BookingPercentageWithRatingLabel,Ne.b.strings.Bookings+" with a Rating","The percentage of "+Ne.b.strings.bookings+" that were given a rating for the selected "+Ne.b.strings.car_park+"(s) over the selected time period.",u>d&&u>0?100*d/u:0,W.a.Percent,void 0,i),ve(Tn.HighestRatedCarParksTable,n.props.kdsData[kn.DailyRatingsByCarPark],e,t,!1,l,i),ve(Tn.LowestRatedCarParksTable,c,e,t,!0,l,i),n.updateFetchedData(e,t,i,l)}},n.onCarparkPicker=function(e){n.setState({filter:e},n.refreshComponents)},n.renderBarChart=function(e){var t=n.state.dateScrub;return m.a.createElement(Tt,{calculateHeight:!0,aspectRatio:1.5},m.a.createElement(gn.ConnectedBarChart,{kvsSelector:H.kvsComponentSelector,dataKey:e,dataStampKey:Tn.DataStamp,scrubberStartOffset:t.scrubberStartOffset,scrubberEndOffset:t.scrubberEndOffset}))},n.renderGraphFilterPicker=function(){var e=n.props.data.carparkList,t=n.state.filter;return m.a.createElement(y.a,{style:{flexDirection:"row",justifyContent:"space-between"}},m.a.createElement(Ce.PickerBox,{placeholder:Ze.a,items:[{label:Ze.a,value:Ze.a}].concat(qr()(e.map((function(e){return{label:e.name,value:e.name}})))),selectedValue:n.state.filter,onValueChange:n.onCarparkPicker,style:{flex:1}}),m.a.createElement(Re.a.SpacerDouble,null),m.a.createElement(Ce.PickerBox,{placeholder:Ze.b,items:[{label:Ze.b,value:Ze.b}].concat(qr()(Oe.e.map((function(e){return{label:e,value:e}})))),selectedValue:n.state.filter,onValueChange:n.onCarparkPicker,style:{flex:1}}),m.a.createElement(Re.a.Spacer,null),m.a.createElement(vn.InfoButton,{title:"Filtering Results",description:n.getGraphFilterDescription(t)}))},n.getRatingsTheme=function(e){return e>=4?Wr.VALUE_LABEL_THEME_HUGE_GREEN_CENTERED:e>=2?Wr.VALUE_LABEL_THEME_HUGE_ORANGE_CENTERED:e>=1?Wr.VALUE_LABEL_THEME_HUGE_RED_CENTERED:Wr.VALUE_LABEL_THEME_HUGE_GREY_CENTERED},n.props.dispatch(H.KVSComponentActions.clearComponentData()),n.state={dateScrub:re({}),filter:Ze.a},n}return l()(r,[{key:"componentDidMount",value:function(){var e=this;this.updateComponentData().then((function(t){var r=Dr(e.state.dateScrub);e.onScrubberEvent(r.startMoment,r.endMoment,sr.Changed)}))}},{key:"updateComponentData",value:function(){var e,t,r,n,a,o,i=this;return S.a.async((function(l){for(;;)switch(l.prev=l.next){case 0:return e=this.props.data,t=e.schoolHolidays,r=e.publicHolidays,n=e.appVersions,a=this.state.dateScrub,(o=[]).push(j.default.groupedDailyValue("daily_rating_counts_by_rating").then((function(e){de(Tn.ScrubberGraph,e,t,r,n,a.queryStartMoment,a.queryEndMoment,{categoryList:["1","2","3","4","5"],scrollGraphType:jt.a.StackedArea,valueType:W.a.Number})}))),o.push(j.default.groupedDailyValue("ratings_screen_daily_ratings_by_carpark").then((function(e){i.props.dispatch(At.Actions.setKDSData(kn.DailyRatingsByCarPark,e))}))),o.push(j.default.tableData("daily_bookings_revenue_by_state_and_carpark_app").then((function(e){i.props.dispatch(At.Actions.setKDSData(kn.DailyBookingsRevenueByStateAndCarParkApp,e))}))),l.abrupt("return",Promise.all(o));case 7:case"end":return l.stop()}}),null,this,null,Promise)}},{key:"getDataStamp",value:function(e,t,r){return Object(rr.a)(e,t)+" "+r}},{key:"updateFetchedData",value:function(e,t,r,n){var a=this;return S.a.async((function(o){for(;;)switch(o.prev=o.next){case 0:j.default.feedback({collectionKey:"ratings_screen_daily_feedback_by_type_and_carpark",start:e,end:t,categories:n}).then((function(n){var o=n&&n.filter((function(e){return 5===e.value})),i=n&&n.filter((function(e){return e.value<=4})),l=he(o,e,t,void 0,ne.Count),c=he(i,e,t,void 0,ne.Count),s=Math.max(l,c);a.props.dispatch(H.KVSComponentActions.setLabelData(Tn.PositiveFeedbackCountLabel,{text:(o?o.length:0)+" Positive Rating Attributes"})),me(Tn.PositiveFeedbackBarChart,o,e,t,{categoryCount:5,calculation:ne.Count,sortBy:"value",invertValence:!1,defaultMaxValue:s,csvDefinition:{headers:["Response","Count"]}},r),a.props.dispatch(H.KVSComponentActions.setLabelData(Tn.NegativeFeedbackCountLabel,{text:(i?i.length:0)+" Negative Rating Attributes"})),me(Tn.NegativeFeedbackBarChart,i,e,t,{categoryCount:5,calculation:ne.Count,sortBy:"value",invertValence:!1,defaultMaxValue:s,csvDefinition:{headers:["Response","Count"]}},r)}));case 1:case"end":return o.stop()}}),null,null,null,Promise)}},{key:"calculateTotalCount",value:function(e,t,r,n,a,o){var i=arguments.length>6&&void 0!==arguments[6]?arguments[6]:"count",l=0;return e&&e.forEach((function(e){if(void 0===n||void 0!==n.find((function(t){return t===e[a]}))){var c=F.g(e[o]);!c.isBefore(t)&&c.isBefore(r)&&(l+=e[i])}})),l}},{key:"getGraphFilterDescription",value:function(e){return void 0===e||e===Ze.a?"Results include "+Ne.b.strings.bookings+" for all "+Ne.b.strings.car_parks+" in Australia.":void 0!==Oe.e.find((function(t){return t===e}))?"Results include "+Ne.b.strings.bookings+" for any "+Ne.b.strings.car_park+" in "+e+".":"Results are for "+Ne.b.strings.bookings_at+" "+e+"."}},{key:"render",value:function(){var e=this.state.dateScrub;return m.a.createElement(y.a,{style:{minWidth:U.d.minPageWidth,backgroundColor:U.a.pageBackground,padding:U.d.doubleBaseMargin}},m.a.createElement(je.Group,null,m.a.createElement(Pr,{dateScrub:e,label:this.props.data.lastImported.label,onEvent:this.onScrubberEvent},m.a.createElement(nr,{kvsSelector:H.kvsComponentSelector,dataKey:Tn.ScrubberGraph,theme:Ht})),!Ne.b.isDemo&&m.a.createElement(Re.a.SpacerDouble,null),!Ne.b.isDemo&&this.renderGraphFilterPicker()),m.a.createElement(Re.a.SpacerDouble,null),m.a.createElement(je.Group,null,m.a.createElement(pr.Label,{data:{text:"Ratings"},style:{flex:1},theme:pr.LABEL_THEME_TITLE}),m.a.createElement(Re.a.Spacer,null),m.a.createElement(Wr.ConnectedValueLabel,{kvsSelector:H.kvsComponentSelector,dataKey:Tn.AverageRatingLabel,dataStampKey:Tn.DataStamp,style:{maxWidth:250,minHeight:140},theme:this.getRatingsTheme}),m.a.createElement(Re.a.Spacer,null),m.a.createElement(Wr.ConnectedValueLabel,{kvsSelector:H.kvsComponentSelector,dataKey:Tn.BookingPercentageWithRatingLabel,dataStampKey:Tn.DataStamp,style:{maxWidth:250},theme:Wr.VALUE_LABEL_THEME_MEDIUM_CENTERED})),m.a.createElement(Re.a.SpacerDouble,null),m.a.createElement(je.Group,null,m.a.createElement(y.a,{style:{flexDirection:"row"}},m.a.createElement(y.a,{style:{flex:1}},m.a.createElement(pr.Label,{data:{text:"Positive Rating Attributes",description:"The breakdown of the positive feedback that was recieved for the selected "+Ne.b.strings.car_park+"(s) over the selected time period."},theme:pr.LABEL_THEME_SUBHEADING}),m.a.createElement(pr.ConnectedLabel,{kvsSelector:H.kvsComponentSelector,dataKey:Tn.PositiveFeedbackCountLabel,theme:pr.LABEL_THEME_LIGHT}),m.a.createElement(Re.a.Spacer,null),this.renderBarChart(Tn.PositiveFeedbackBarChart)),m.a.createElement(Re.a.SpacerDouble,null),m.a.createElement(y.a,{style:{flex:1}},m.a.createElement(pr.Label,{data:{text:"Negative Rating Attributes",description:"The breakdown of the negative feedback that was recieved for the selected "+Ne.b.strings.car_park+"(s) over the selected time period."},theme:pr.LABEL_THEME_SUBHEADING}),m.a.createElement(pr.ConnectedLabel,{kvsSelector:H.kvsComponentSelector,dataKey:Tn.NegativeFeedbackCountLabel,theme:pr.LABEL_THEME_LIGHT}),m.a.createElement(Re.a.Spacer,null),this.renderBarChart(Tn.NegativeFeedbackBarChart)))),m.a.createElement(Re.a.SpacerDouble,null),m.a.createElement(je.Group,null,m.a.createElement(y.a,{style:{flexDirection:"row"}},m.a.createElement(y.a,{style:{flex:1}},m.a.createElement(pr.Label,{data:{text:"Highest Rated "+Ne.b.strings.Car_Parks,description:"The top ranked "+Ne.b.strings.car_parks+" based on the user feedback for the selected "+Ne.b.strings.car_park+"(s) over the selected time period. Rating is the average rating and count is the number of ratings made for that "+Ne.b.strings.car_park+"."},theme:pr.LABEL_THEME_SUBHEADING}),m.a.createElement(Re.a.Spacer,null),m.a.createElement(Tt,{style:{width:"100%"}},m.a.createElement(Hr.ConnectedDataTable,{kvsSelector:H.kvsComponentSelector,dataKey:Tn.HighestRatedCarParksTable,dataStampKey:Tn.DataStamp,pageSize:10}))),m.a.createElement(Re.a.SpacerDouble,null),m.a.createElement(y.a,{style:{flex:1}},m.a.createElement(pr.Label,{data:{text:"Lowest Rated "+Ne.b.strings.Car_Parks,description:"The worst ranked "+Ne.b.strings.car_parks+" based on the user feedback from the selected "+Ne.b.strings.car_park+"(s) over the selected time period. Rating is the average rating and count is the number of ratings made for that "+Ne.b.strings.car_park+"."},theme:pr.LABEL_THEME_SUBHEADING}),m.a.createElement(Re.a.Spacer,null),m.a.createElement(Tt,{style:{width:"100%"}},m.a.createElement(Hr.ConnectedDataTable,{kvsSelector:H.kvsComponentSelector,dataKey:Tn.LowestRatedCarParksTable,dataStampKey:Tn.DataStamp,pageSize:10}))))))}}]),r}(m.a.Component),Rn=Object(b.b)((function(e){return{kdsData:e.kdsData,data:e.data,carParkList:V.DataSelectors.carParkList(e)}}))(On),Cn=r(197),Un=r(138),Dn=r(27),Pn=r.n(Dn);function wn(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Mn(e){for(var t=1;t0)for(var r=e.length-1;r>=0;r--){var n=e[r],a={date:n.dateTime,value:n.averageUserRatingForCurrentVersion*n.userRatingCountForCurrentVersion,count:n.userRatingCountForCurrentVersion};if(r0)for(var r=e.length-1;r>=0;r--){var n=e[r],a={date:n.date,value:n.totalRating,count:n.count};if(r0&&(u=100*s.value/c.value);var d={title:"Percent Used",description:"The total promo codes used as a percentage of the total sent for the date range",value:u,valueType:W.a.Percent,dataStamp:a};n.props.dispatch(H.KVSComponentActions.setValueLabelData(Ta(ga.PromoPercentUsedValue,i),d))}))}},n.renderUploadSection=function(e){var t=n.state.fileDisplay[e.campaignId]||!1;return m.a.createElement(ht.a,{visible:t},m.a.createElement(Re.a.Spacer,null),m.a.createElement(y.a,{style:{flex:1,borderColor:U.a.lightGrey,borderRadius:U.d.borderRadius,borderWidth:1,marginRight:U.d.baseMargin,padding:U.d.baseMargin}},n.renderFileTable(e),m.a.createElement(Re.a.SpacerDouble,null),m.a.createElement(y.a,{style:{flexDirection:"row"}},m.a.createElement(Re.a.FlexSpacer,null),m.a.createElement(Be.Button,{text:"Upload",theme:Sa({},Be.SOLID_BUTTON_THEME,{backgroundColor:U.a.blue}),onPress:function(){return n.selectFile(e.campaignId)}}))))},n.renderFileTable=function(e){var t;return m.a.createElement(y.a,null,m.a.createElement(y.a,{style:{flexDirection:"row",alignItems:"flex-end"}},m.a.createElement(y.a,{style:{minWidth:400,flex:1,flexDirection:"row"}},m.a.createElement(R.a,{style:z.b.black.bodyM.bold},"Code Files")),m.a.createElement(Re.a.SpacerDouble,null),m.a.createElement(R.a,{style:[{width:150},z.b.black.bodyS.bold]},"Initial Count"),m.a.createElement(Re.a.SpacerDouble,null),m.a.createElement(R.a,{style:[{width:150},z.b.black.bodyS.bold]},"Remaining"),m.a.createElement(Re.a.SpacerDouble,null),m.a.createElement(y.a,{style:{width:60}},m.a.createElement(R.a,{style:[z.b.black.bodyS.bold,{textAlign:"center"}]},"Delete"))),m.a.createElement(Re.a.Spacer,null),m.a.createElement(Re.a.HorizontalLine,null),null==(t=e.codeFiles)?void 0:t.map((function(t){return m.a.createElement(y.a,{key:e.campaignId+"_"+t.fileName},m.a.createElement(Re.a.Spacer,null),m.a.createElement(y.a,{style:{flexDirection:"row",alignItems:"center"}},m.a.createElement(y.a,{style:{flex:1,minWidth:400,flexDirection:"row"}},m.a.createElement(R.a,{style:{marginLeft:U.d.doubleBaseMargin}},t.fileName)),m.a.createElement(Re.a.SpacerDouble,null),m.a.createElement(R.a,{style:{width:150}},t.initialCount),m.a.createElement(Re.a.SpacerDouble,null),m.a.createElement(R.a,{style:{width:150}},t.remainingCount),m.a.createElement(Re.a.SpacerDouble,null),m.a.createElement(y.a,{style:{width:60,flexDirection:"row"}},m.a.createElement(Re.a.FlexSpacer,null),m.a.createElement(Me.a,{onPress:function(){return n.checkDeleteCodeFile(e,t)}},m.a.createElement(G.a,{source:U.c.close,style:{tintColor:U.a.red,height:U.d.icons.medium,width:U.d.icons.medium}})),m.a.createElement(Re.a.FlexSpacer,null))),m.a.createElement(Re.a.Spacer,null),m.a.createElement(Re.a.HorizontalLine,null),m.a.createElement(Re.a.Spacer,null))})))},n.alertCloseHandler=function(){n.setState({alert:{show:!1}})},n.checkDeleteCodeFile=function(e,t){n.setState({alert:{show:!0,title:"Are you sure?",onClose:n.alertCloseHandler,message:"Do you want to delete code file ("+t.fileName+")",buttons:[{text:"Cancel"},{text:"Delete",theme:Be.ERROR_BUTTON_THEME,onPress:function(){n.onDeleteCodeFile(e,t)}}]}})},n.onDeleteCodeFile=function(e,t){var r=Sa({},n.state.showProgressIndicator);r[e.campaignId]=!0,n.setState({showProgressIndicator:r}),ca.default.deleteCodeFile({campaignId:e.campaignId,file:t.fileName},n.state.useProdPromoService).then((function(t){setTimeout((function(){n.updateKVSComponentKeys().then((function(){var t=Sa({},n.state.showProgressIndicator);t[e.campaignId]=!1,n.setState({showProgressIndicator:t})}))}),1e3)}))},n.selectFile=function(e){Aa.a({type:"text/csv"}).then((function(t){if("success"===t.type){var r=Sa({},n.state.showProgressIndicator);r[e]=!0,n.setState({showProgressIndicator:r});var a={campaignId:e,file:t.file};ca.default.uploadCodeFile(a,n.state.useProdPromoService).then((function(r){if(r.success)setTimeout((function(){n.updateKVSComponentKeys().then((function(){var t=Sa({},n.state.showProgressIndicator);t[e]=!1,n.setState({showProgressIndicator:t})}))}),1e3);else{var a,o=Sa({},n.state.showProgressIndicator);o[e]=!1,n.setState({showProgressIndicator:o,alert:{show:!0,title:"Failed to upload file: "+(null==(a=t.file)?void 0:a.name),message:r.message,onClose:n.alertCloseHandler,buttons:[{text:"OK"}]}})}}))}}))},n.onCloseEditCampaign=function(){n.setState({editingCampaign:void 0})},n.onSaveCampaignDetails=function(e){var t;return S.a.async((function(r){for(;;)switch(r.prev=r.next){case 0:return(t=Sa({},n.state.showProgressIndicator))[e.campaignId]=!0,n.setState({showProgressIndicator:t}),r.abrupt("return",ca.default.setCampaign(e,n.state.useProdPromoService).then((function(t){var r=n.props.kdsData[ya.PromoAdminCampaigns],a=r.findIndex((function(t){return t.campaignId===e.campaignId}));r[a]=e,n.props.dispatch(At.Actions.setKDSData(ya.PromoAdminCampaigns,r));var o=Sa({},n.state.showProgressIndicator);o[e.campaignId]=!1,n.setState({showProgressIndicator:o})})).catch((function(){n.props.dispatch(x.a.setError({title:"Error",message:"Something went wrong."})),t[e.campaignId]=!1,n.setState({showProgressIndicator:t})})));case 4:case"end":return r.stop()}}),null,null,null,Promise)},n.props.dispatch(H.KVSComponentActions.clearComponentData());var a=te().subtract(364,"days"),i=J.a.utc("2020-09-01T00:00:00Z"),l=re({queryEndMoment:te().add(32,"days"),scrubberStartMoment:J.a.max(i,a)});return n.state={dateScrub:l,editingCampaign:void 0,showProgressIndicator:{},useProdPromoService:M.b.configType===M.a.Production,fileDisplay:{},alert:{show:!1}},n}return l()(r,[{key:"componentDidMount",value:function(){this.updateKVSComponentKeys()}},{key:"updateKVSComponentKeys",value:function(){var e,t=this;return S.a.async((function(r){for(;;)switch(r.prev=r.next){case 0:return(e=[]).push(ca.default.getAllCampaigns(this.state.useProdPromoService).then((function(e){var r=function(e){var t=0;switch(e.campaignType){case ba.c.RewardPeriodic:t+=30;break;case ba.c.ReferralReward:t+=20;break;case ba.c.ReferralBooking:t+=10}return e.campaignActive&&(t+=1),t};return e=e.sort((function(e,t){return r(t)-r(e)})),t.props.dispatch(At.Actions.setKDSData(ya.PromoAdminCampaigns,e)),t.onCampaignsFetched(e)}))),r.abrupt("return",Promise.all(e).then((function(){var e=Dr(t.state.dateScrub);t.onScrubberEvent(e.startMoment,e.endMoment,sr.Changed)})).catch((function(e){t.props.dispatch(x.a.setError({title:"Error",message:e.message}))})));case 3:case"end":return r.stop()}}),null,this,null,Promise)}},{key:"onCampaignsFetched",value:function(e){var t,r,n,a,o,i=this;return S.a.async((function(l){for(;;)switch(l.prev=l.next){case 0:return t=this.props.data,r=t.schoolHolidays,n=t.publicHolidays,a=t.appVersions,o=this.state.dateScrub,l.abrupt("return",j.default.dailyMultiValueToGroupedDailyValue("promo_campaign_stats_daily",["Sent","Used"],["count_sent","count_used"],void 0,["campaign_id"]).then((function(t){i.props.dispatch(At.Actions.setKDSData(ya.PromoStatsGroupedDaily,t)),de(ga.Scrubber,t,r,n,a,o.queryStartMoment,o.queryEndMoment,{categoryCount:2,scrollGraphType:jt.a.LayeredArea,valueType:W.a.Number}),e&&e.forEach((function(e){var l=e.campaignId,c=t.filter((function(e){return e.campaign_id==l}));de(Ta(ga.PromoStatsGraph,l),c,r,n,a,o.queryStartMoment,o.queryEndMoment,{categoryCount:2,scrollGraphType:jt.a.LayeredArea,valueType:W.a.Number});var s={title:"Total Remaining",description:"The total promo codes remaining in this campaign",value:i.getTotalRemainingCodes(e),valueType:W.a.Number};i.props.dispatch(H.KVSComponentActions.setValueLabelData(Ta(ga.PromoCountRemainingValue,l),s))}))})));case 3:case"end":return l.stop()}}),null,this,null,Promise)}},{key:"getTotalRemainingCodes",value:function(e){var t=0;return e.codeFiles&&e.codeFiles.forEach((function(e){t+=e.remainingCount||0})),t}},{key:"render",value:function(){var e=this,t=this.state,r=t.dateScrub,n=(t.useProdPromoService,this.props.kdsData[ya.PromoAdminCampaigns]);return m.a.createElement(y.a,{style:{minWidth:U.d.minPageWidth,backgroundColor:U.a.pageBackground,padding:U.d.doubleBaseMargin}},m.a.createElement(je.Group,null,m.a.createElement(Pr,{dateScrub:r,label:this.props.data.lastImported.label,onEvent:this.onScrubberEvent},m.a.createElement(nr,{kvsSelector:H.kvsComponentSelector,dataKey:ga.Scrubber,theme:Ht})),!1),n&&n.map((function(t){return e.renderCampaign(t)})),this.state.editingCampaign&&m.a.createElement(pa,{campaign:this.state.editingCampaign,editing:!0,onSaveCampaign:this.onSaveCampaignDetails,onClose:this.onCloseEditCampaign}),m.a.createElement(Ea.b,{show:this.state.alert.show,title:this.state.alert.title,message:this.state.alert.message,buttons:this.state.alert.buttons,onClose:this.state.alert.onClose}))}},{key:"renderCampaign",value:function(e){var t=this.state.dateScrub,r=e.campaignId,n=this.state.showProgressIndicator[e.campaignId];return m.a.createElement(y.a,{key:r,style:{marginTop:U.d.doubleBaseMargin}},m.a.createElement(y.a,null,m.a.createElement(je.Group,null,m.a.createElement(H.Label,{data:{text:e.campaignName,description:"Count of sent and used promotion codes for the "+e.campaignName+" campaign"},theme:H.LABEL_THEME_TITLE}),m.a.createElement(Tt,{calculateHeight:!0,aspectRatio:3},m.a.createElement(y.a,{style:{flexDirection:"row"}},this.renderCampaignDetails(e),m.a.createElement(y.a,{style:{flex:3}},m.a.createElement(Tt,{style:{flex:1}},m.a.createElement(nr,{kvsSelector:H.kvsComponentSelector,dataKey:Ta(ga.PromoStatsGraph,r),scrubberStartOffset:t.scrubberStartOffset,scrubberEndOffset:t.scrubberEndOffset,theme:Wt})),m.a.createElement(Re.a.SpacerDouble,null),m.a.createElement(y.a,{style:{flexDirection:"row"}},m.a.createElement(H.ConnectedValueLabel,{kvsSelector:H.kvsComponentSelector,dataKey:Ta(ga.PromoCountSentValue,r),dataStampKey:ga.DataStamp,style:{flex:1}}),m.a.createElement(Re.a.Spacer,null),m.a.createElement(H.ConnectedValueLabel,{kvsSelector:H.kvsComponentSelector,dataKey:Ta(ga.PromoCountUsedValue,r),dataStampKey:ga.DataStamp,style:{flex:1}}),m.a.createElement(Re.a.Spacer,null),m.a.createElement(H.ConnectedValueLabel,{kvsSelector:H.kvsComponentSelector,dataKey:Ta(ga.PromoPercentUsedValue,r),dataStampKey:ga.DataStamp,style:{flex:1}}),m.a.createElement(Re.a.Spacer,null),m.a.createElement(H.ConnectedValueLabel,{kvsSelector:H.kvsComponentSelector,dataKey:Ta(ga.PromoCountRemainingValue,r),style:{flex:1}}))))),this.renderUploadSection(e))),n&&m.a.createElement(y.a,{style:{position:"absolute",top:0,bottom:0,left:0,right:0,backgroundColor:U.a.lightGrey,opacity:.7}},m.a.createElement(Re.a.FlexSpacer,null),m.a.createElement(g.a,{style:{flex:2}}),m.a.createElement(Re.a.FlexSpacer,null)))}},{key:"renderCampaignDetails",value:function(e){var t=this,r=this.state.fileDisplay[e.campaignId]||!1,n=e.campaignActive,a=e.campaignHidden;return m.a.createElement(y.a,{style:{flex:1,borderColor:U.a.lightGrey,borderRadius:U.d.borderRadius,borderWidth:1,marginRight:U.d.baseMargin,padding:U.d.baseMargin}},m.a.createElement(y.a,{style:{flexDirection:"row"}},n&&m.a.createElement(R.a,{style:z.b.green.bodyS.bold},"Active"),!n&&m.a.createElement(R.a,{style:z.b.red.bodyS.bold},"Inactive"),m.a.createElement(Re.a.Spacer,null),a&&m.a.createElement(R.a,{style:z.b.grey.bodyS.bold},"Hidden"),m.a.createElement(Re.a.FlexSpacer,null),this.props.canEdit&&m.a.createElement(Me.a,{onPress:function(){t.setState({editingCampaign:e})}},m.a.createElement(y.a,{style:{flexDirection:"row",alignItems:"center"}},m.a.createElement(Re.a.Icon,{source:U.c.edit,size:U.d.icons.small}),m.a.createElement(Re.a.Spacer,null))),m.a.createElement(Me.a,{onPress:function(){var n=Sa({},t.state.fileDisplay);n[e.campaignId]=!r,t.setState({fileDisplay:n})}},m.a.createElement(y.a,{style:{flexDirection:"row",alignItems:"center"}},m.a.createElement(Re.a.Icon,{source:U.c.promo,size:U.d.icons.small,tintColor:U.a.black})))),m.a.createElement(Re.a.Spacer,null),m.a.createElement(C.a,null,[this.renderLabeledValue("Description",e.campaignDescription),this.renderLabeledValue("Short Description",e.campaignShortDescription),this.renderLabeledValue("Share Description",e.campaignShareDescription||""),this.renderLabeledValue("Reward Label",e.campaignRewardLabel),this.renderLabeledValue("End Date",J()(e.campaignEndDate).format("DD/MM/yyyy")),this.renderLabeledValue("Terms and Conditions",e.campaignTermsAndConditions),this.renderLabeledValue("Codes Title",e.promoCodeTitle),this.renderLabeledValue("Codes Description",e.promoCodeDescription),this.renderLabeledValue("Codes All Expire",J()(e.promoCodeExpiry).format("DD/MM/yyyy")),this.renderLabeledValue("Codes Valid Days",e.promoCodeValidDays.toString()),e.rewardBookingsTarget&&this.renderLabeledValue("Reward Bookings",e.rewardBookingsTarget.toString()),e.rewardDaysWindow&&e.campaignType===ba.c.RewardRolling&&this.renderLabeledValue("Reward Days",e.rewardDaysWindow.toString()),e.rewardMaxPromosInPeriod&&e.campaignType===ba.c.RewardPeriodic&&this.renderLabeledValue("Max Promos in Period",e.rewardMaxPromosInPeriod.toString())]),m.a.createElement(Re.a.Spacer,null))}},{key:"renderLabeledValue",value:function(e,t){if(t)return m.a.createElement(y.a,{key:e},m.a.createElement(R.a,{style:z.b.black.bodyXS.bold},e),m.a.createElement(R.a,{style:z.b.black.bodyXS.regular},t),m.a.createElement(Re.a.Spacer,null))}}]),r}(m.a.Component),Ra=Object(b.b)((function(e){var t=e.user.userDetails,r=!!t&&t.role===P.e.administrator;return{data:e.data,kdsData:e.kdsData,canEdit:r}}))(Oa),Ca=r(543),Ua=r.n(Ca);function Da(e){var t=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=d()(e);if(t){var a=d()(this).constructor;r=Reflect.construct(n,arguments,a)}else r=n.apply(this,arguments);return s()(this,r)}}var Pa,wa,Ma=r(717),xa=function(e){f()(r,e);var t=Da(r);function r(){return o()(this,r),t.apply(this,arguments)}return l()(r,[{key:"render",value:function(){return m.a.createElement(Ua.a,{originWhitelist:["*"],source:{html:U.d.isWeb?Ma:"

Information about Kassandra

"},style:{flex:1,padding:U.d.doubleBaseMargin},scrollEnabled:!1})}}]),r}(m.a.Component),Va=r(160);!function(e){e.DailyBookingsRevenueByPlatform="PlatformScreen Daily Bookings Revenue By Platform"}(Pa||(Pa={})),function(e){e.DataStamp="PlatformScreen Data Stamp",e.ScrubberGraph="PlatformScreen Scrubber Graph",e.OSVersionPieChart="PlatformScreen OS Version Pie Chart",e.AndroidVersionPieChart="PlatformScreen Android Version Pie Chart",e.IOSVersionPieChart="PlatformScreen iOS Version Pie Chart",e.AppVersionPieChart="PlatformScreen App Version Pie Chart",e.PlatformPieChart="PlatformScreen Platform Pie Chart",e.MobileModelBarChart="PlatformScreen Mobile Model Bar Chart",e.BookingValuePieChart="PlatformScreen Booking Value Pie Chart"}(wa||(wa={}));function ja(e){var t=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=d()(e);if(t){var a=d()(this).constructor;r=Reflect.construct(n,arguments,a)}else r=n.apply(this,arguments);return s()(this,r)}}var Ba=function(e){f()(r,e);var t=ja(r);function r(){return o()(this,r),t.apply(this,arguments)}return l()(r,[{key:"componentDidMount",value:function(){this.update()}},{key:"componentDidUpdate",value:function(e){Object(B.isEqual)(e,this.props)||this.update()}},{key:"update",value:function(){var e,t,r,n,a;return S.a.async((function(o){for(;;)switch(o.prev=o.next){case 0:if(e=this.props,t=e.dailyData,r=e.groupedDailyData,n=e.dateScrub,a=e.calendarEvents,void 0===t){o.next=3;break}return o.abrupt("return",ue(wa.ScrubberGraph,t,null==a?void 0:a.schoolHolidays,null==a?void 0:a.publicHolidays,null==a?void 0:a.appVersions,n.queryStartMoment,n.queryEndMoment,{scrollGraphType:jt.a.Line,valueType:W.a.Number,showLineOfBestFit:!1}));case 3:if(void 0===r){o.next=5;break}return o.abrupt("return",de(wa.ScrubberGraph,r,null==a?void 0:a.schoolHolidays,null==a?void 0:a.publicHolidays,null==a?void 0:a.appVersions,n.queryStartMoment,n.queryEndMoment,{categoryList:["IOS","ANDROID"],scrollGraphType:jt.a.StackedArea,valueType:W.a.Dollars}));case 5:case"end":return o.stop()}}),null,this,null,Promise)}},{key:"render",value:function(){var e=this.props,t=e.dateScrub,r=e.lastImported,n=e.onScrubberEvent;return m.a.createElement(je.Group,null,m.a.createElement(Pr,{dateScrub:t,label:r,onEvent:n},m.a.createElement(nr,{kvsSelector:H.kvsComponentSelector,dataKey:wa.ScrubberGraph,theme:Ht})))}}]),r}(m.a.PureComponent),Ia=r(93),Na=r(55);function Ja(e,t,r,n){var a=[Na.c({start:e,end:t},"date")];return n&&a.push(Na.a(n)),a.push(Na.b({fields:["userId",r],firstOutputs:["date",r]})),a.push(Na.b({fields:[r],firstOutputs:["date",r],addCount:"value"})),a.push(Na.f({outputs:["date","value"],projectOutputs:[{from:r,to:"group"},{from:"value",to:"count"}]})),Ia.QueryService.tableDataRequest({database:Ne.b.dataService.database,collection:"platform_unique_users",operation:"aggregate",query:{options:{allowDiskUse:!0},pipeline:a}})}function La(e){var t=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=d()(e);if(t){var a=d()(this).constructor;r=Reflect.construct(n,arguments,a)}else r=n.apply(this,arguments);return s()(this,r)}}var Fa=function(e){f()(r,e);var t=La(r);function r(){return o()(this,r),t.apply(this,arguments)}return l()(r,[{key:"componentDidUpdate",value:function(e){var t=this.props.dataSync;void 0!==t&&(void 0!==e.dataSync&&e.dataSync.dataStamp===t.dataStamp||this.update(t))}},{key:"update",value:function(e){var t=this;return S.a.async((function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",Ja(e.startMoment,e.endMoment,this.props.field,this.props.filter).then((function(r){pe(t.props.kvsComponentKey,r,e.startMoment,e.endMoment,{categoryCount:10,valueType:W.a.Number,csvDefinition:{headers:t.props.csvHeaders}},e.dataStamp)})));case 1:case"end":return r.stop()}}),null,this,null,Promise)}},{key:"render",value:function(){return m.a.createElement(je.Group,{style:{flex:1}},m.a.createElement(pr.Label,{data:{text:this.props.title,description:this.props.description},theme:pr.LABEL_THEME_SUBHEADING}),m.a.createElement(Re.a.SpacerDouble,null),m.a.createElement(Tt,{style:{maxHeight:400},aspectRatio:1.5,calculateHeight:!0},m.a.createElement(Fr.ConnectedPieChart,{kvsSelector:H.kvsComponentSelector,dataKey:this.props.kvsComponentKey,dataStampKey:wa.DataStamp,legendTheme:Nt.c})))}}]),r}(m.a.PureComponent);function Wa(e){return m.a.createElement(Fa,{dataSync:e.dataSync,kvsComponentKey:wa.AndroidVersionPieChart,title:"Android Version",description:"The breakdown of the Android operating system version of devices used to access the app over the selected time period.",field:"mobileOSVersion",filter:{field:"platform",values:["ANDROID"]},csvHeaders:["Android Version","User Count"]})}function Ha(e){return m.a.createElement(Fa,{dataSync:e.dataSync,kvsComponentKey:wa.IOSVersionPieChart,title:"iOS Version",description:"The breakdown of the iOS operating system version of devices used to access the app over the selected time period.",field:"mobileOSVersion",filter:{field:"platform",values:["IOS"]},csvHeaders:["iOS Version","User Count"]})}function Za(e){return m.a.createElement(Fa,{dataSync:e.dataSync,kvsComponentKey:wa.PlatformPieChart,title:"Platform",description:"The breakdown of the mobile platform being used to access the app over the selected time period.",field:"platform",csvHeaders:["Mobile Platform","User Count"]})}function Qa(e){return m.a.createElement(Fa,{dataSync:e.dataSync,kvsComponentKey:wa.AppVersionPieChart,title:"App Version",description:"The breakdown of the app version being used over the selected time period. This shows results for both iOS and Android devices.",field:"appVersion",csvHeaders:["App Version","User Count"]})}function Ga(e){var t=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=d()(e);if(t){var a=d()(this).constructor;r=Reflect.construct(n,arguments,a)}else r=n.apply(this,arguments);return s()(this,r)}}var za=function(e){f()(r,e);var t=Ga(r);function r(){return o()(this,r),t.apply(this,arguments)}return l()(r,[{key:"componentDidUpdate",value:function(e){var t=this.props.dataSync;void 0!==t&&(void 0!==e.dataSync&&e.dataSync.dataStamp===t.dataStamp||this.update(t))}},{key:"update",value:function(e){return S.a.async((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",Ja(e.startMoment,e.endMoment,"mobileModel",this.props.filter).then((function(t){me(wa.MobileModelBarChart,t,e.startMoment,e.endMoment,{categoryCount:20,addOtherCategory:!0,calculation:ne.Sum,sortBy:"value",invertValence:!1,csvDefinition:{headers:["Phone Model","Count"]}},e.dataStamp)})));case 1:case"end":return t.stop()}}),null,this,null,Promise)}},{key:"render",value:function(){var e=this.props.dateScrub;return m.a.createElement(je.Group,{style:{flex:1}},m.a.createElement(pr.Label,{data:{text:"Phone Models",description:this.props.description||"The breakdown of the mobile phone models used to access the app over the selected time period. This shows results for both iOS and Android devices."},theme:pr.LABEL_THEME_SUBHEADING}),m.a.createElement(Re.a.SpacerDouble,null),m.a.createElement(Tt,{style:{minHeight:500,flex:1}},m.a.createElement(gn.ConnectedBarChart,{kvsSelector:H.kvsComponentSelector,dataKey:wa.MobileModelBarChart,dataStampKey:wa.DataStamp,scrubberStartOffset:e.scrubberStartOffset,scrubberEndOffset:e.scrubberEndOffset})))}}]),r}(m.a.PureComponent);function Ya(e){var t=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=d()(e);if(t){var a=d()(this).constructor;r=Reflect.construct(n,arguments,a)}else r=n.apply(this,arguments);return s()(this,r)}}var Ka=function(e){f()(r,e);var t=Ya(r);function r(){return o()(this,r),t.apply(this,arguments)}return l()(r,[{key:"componentDidUpdate",value:function(e){var t=this.props.dataSync;void 0!==t&&(void 0!==e.dataSync&&e.dataSync.dataStamp===t.dataStamp||this.update(t))}},{key:"update",value:function(e){var t;return S.a.async((function(r){for(;;)switch(r.prev=r.next){case 0:return t=this.props.data,r.abrupt("return",pe(wa.BookingValuePieChart,t,e.startMoment,e.endMoment,{categoryCount:10,valueType:W.a.Dollars,csvDefinition:{headers:this.props.csvHeaders}},e.dataStamp));case 2:case"end":return r.stop()}}),null,this,null,Promise)}},{key:"render",value:function(){return m.a.createElement(je.Group,{style:{flex:1}},m.a.createElement(pr.Label,{data:{text:this.props.title,description:this.props.description},theme:pr.LABEL_THEME_SUBHEADING}),m.a.createElement(Re.a.SpacerDouble,null),m.a.createElement(Tt,{style:{maxHeight:400},aspectRatio:1.5,calculateHeight:!0},m.a.createElement(Fr.ConnectedPieChart,{kvsSelector:H.kvsComponentSelector,dataKey:this.props.kvsComponentKey,dataStampKey:wa.DataStamp,legendTheme:Nt.c})))}}]),r}(m.a.PureComponent);function Xa(e){return m.a.createElement(Ka,{dataSync:e.dataSync,data:e.data,kvsComponentKey:wa.BookingValuePieChart,title:Ne.b.strings.Booking+" Value Per Platform",description:"The breakdown of "+Ne.b.strings.booking+" value based on the mobile platform used to make the "+Ne.b.strings.booking+" (iOS or Android).",csvHeaders:["Mobile Platform","Value in AUD"]})}function qa(e){var t=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=d()(e);if(t){var a=d()(this).constructor;r=Reflect.construct(n,arguments,a)}else r=n.apply(this,arguments);return s()(this,r)}}var _a=function(e){f()(r,e);var t=qa(r);function r(e){var n;return o()(this,r),(n=t.call(this,e)).onScrubberEvent=function(e,t,r){if(r===sr.Changing||r===sr.Changed){var a=Object(rr.a)(e,t);n.props.dispatch(H.KVSComponentActions.setDataStampData(wa.DataStamp,a)),r===sr.Changed&&n.setState({dataSync:{startMoment:e,endMoment:t,dataStamp:a}})}},n.props.dispatch(H.KVSComponentActions.clearComponentData()),n.state={dateScrub:re({})},n}return l()(r,[{key:"componentDidMount",value:function(){var e=this,t=this.state.dateScrub;this.updateComponentData().then((function(){var r=Dr(t);e.onScrubberEvent(r.startMoment,r.endMoment,sr.Changed)})).catch((function(t){e.props.dispatch(x.a.setError({title:"Error",message:t.message}))}))}},{key:"updateComponentData",value:function(){var e,t=this;return S.a.async((function(r){for(;;)switch(r.prev=r.next){case 0:return(e=[]).push(Va.a.groupedDailyValue("daily_bookings_revenue_by_platform").then((function(e){t.props.dispatch(At.Actions.setKDSData(Pa.DailyBookingsRevenueByPlatform,e))}))),r.abrupt("return",Promise.all(e));case 3:case"end":return r.stop()}}),null,null,null,Promise)}},{key:"render",value:function(){var e=this.state,t=e.dateScrub,r=e.dataSync,n=this.props.data,a=n.lastImported,o=n.schoolHolidays,i=n.publicHolidays,l=n.appVersions,c=this.props.kdsData[Pa.DailyBookingsRevenueByPlatform];return m.a.createElement(Re.a.Screen,{forceScrollbar:!0},m.a.createElement(Ba,{dateScrub:t,groupedDailyData:c,calendarEvents:{schoolHolidays:o,publicHolidays:i,appVersions:l},lastImported:a.label,onScrubberEvent:this.onScrubberEvent}),m.a.createElement(Re.a.SpacerDouble,null),m.a.createElement(y.a,{style:{flexDirection:"row",width:"100%"}},m.a.createElement(Wa,{dataSync:r}),m.a.createElement(Re.a.SpacerDouble,null),m.a.createElement(Ha,{dataSync:r})),m.a.createElement(Re.a.SpacerDouble,null),m.a.createElement(y.a,{style:{flexDirection:"row",width:"100%"}},m.a.createElement(Za,{dataSync:r}),m.a.createElement(Re.a.SpacerDouble,null),m.a.createElement(Qa,{dataSync:r})),m.a.createElement(Re.a.SpacerDouble,null),m.a.createElement(y.a,{style:{flexDirection:"row",width:"100%"}},m.a.createElement(za,{dateScrub:t,dataSync:r}),m.a.createElement(Re.a.SpacerDouble,null),m.a.createElement(Xa,{dataSync:r,data:c})),m.a.createElement(Re.a.SpacerDouble,null))}}]),r}(m.a.Component),$a=Object(b.b)((function(e){return{data:e.data,kdsData:e.kdsData}}))(_a),eo=r(122),to=r(116),ro=r(63),no=r.n(ro),ao=r(162),oo=Object(ao.createSelector)([function(e){return e.user}],(function(e){var t=e.userDetails;return!!t&&t.role===P.e.administrator})),io=r(168),lo=r.n(io),co=r(16);function so(e){var t=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=d()(e);if(t){var a=d()(this).constructor;r=Reflect.construct(n,arguments,a)}else r=n.apply(this,arguments);return s()(this,r)}}var uo,po,fo,ho,mo,yo,go,bo,Ao,Eo,vo,So,ko=function e(t,r=""){o()(this,e),this.basePath=r,t&&(this.configuration=t,this.basePath=t.basePath||this.basePath)},To=function(e){f()(r,e);var t=so(r);function r(e,n){var a;return o()(this,r),(a=t.call(this,n)).field=e,a.name="RequiredError",a}return r}(lo()(Error));!function(e){e[e.Entry="Entry"]="Entry",e[e.Exit="Exit"]="Exit",e[e.PAAccess="PAAccess"]="PAAccess",e[e.Dual="Dual"]="Dual"}(uo||(uo={})),function(e){e[e.Pre="Pre"]="Pre",e[e.Post="Post"]="Post",e[e.Entered="Entered"]="Entered",e[e.Exited="Exited"]="Exited",e[e.Cancelled="Cancelled"]="Cancelled",e[e.NotStarted="NotStarted"]="NotStarted"}(po||(po={})),function(e){e[e.Initial="initial"]="Initial",e[e.Entered="entered"]="Entered",e[e.Exited="exited"]="Exited"}(fo||(fo={})),function(e){e[e.Stop="stop"]="Stop",e[e.Start="start"]="Start"}(ho||(ho={})),function(e){e[e.PENDING="RETRY_PENDING"]="PENDING",e[e.SUCCESSFUL="RETRY_SUCCESSFUL"]="SUCCESSFUL",e[e.LIMITEXCEEDED="RETRY_LIMIT_EXCEEDED"]="LIMITEXCEEDED",e[e.NOTALLOWED="RETRY_NOT_ALLOWED"]="NOTALLOWED"}(mo||(mo={})),function(e){e[e.Start="start"]="Start",e[e.Stop="stop"]="Stop"}(yo||(yo={})),function(e){e[e.Pending="pending"]="Pending",e[e.Normal="normal"]="Normal",e[e.Suspect="suspect"]="Suspect",e[e.Denied="denied"]="Denied"}(go||(go={})),function(e){e[e.Pre="Pre"]="Pre",e[e.Post="Post"]="Post",e[e.Entered="Entered"]="Entered",e[e.Exited="Exited"]="Exited",e[e.Cancelled="Cancelled"]="Cancelled",e[e.NotStarted="NotStarted"]="NotStarted"}(bo||(bo={})),function(e){e[e.Keep="Keep"]="Keep",e[e.Release="Release"]="Release",e[e.Delete="Delete"]="Delete"}(Ao||(Ao={})),function(e){e[e.Entry="Entry"]="Entry",e[e.Exit="Exit"]="Exit",e[e.PAAccess="PAAccess"]="PAAccess",e[e.Dual="Dual"]="Dual"}(Eo||(Eo={})),function(e){e[e.Pending="pending"]="Pending",e[e.Normal="normal"]="Normal",e[e.Suspect="suspect"]="Suspect",e[e.Denied="denied"]="Denied"}(vo||(vo={})),function(e){e[e.Ok="ok"]="Ok",e[e.Warning="warning"]="Warning",e[e.Error="error"]="Error",e[e.Unknown="unknown"]="Unknown"}(So||(So={}));var Oo,Ro=function(e){return{access:function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(null===t||void 0===t)throw new To("body","Required parameter body was null or undefined when calling access.");var n="/elevate/access",a=co.parse(n,!0),o=Ge()({method:"POST"},r),i={},l={};if(e&&e.apiKey){var c="function"===typeof e.apiKey?e.apiKey("X-API-Key"):e.apiKey;i["X-API-Key"]=c}i["Content-Type"]="application/json",a.query=Ge()({},a.query,l,r.query),delete a.search,o.headers=Ge()({},i,r.headers);var s=!0;return o.body=s?JSON.stringify(t||{}):t||"",{url:co.format(a),options:o}},accessStatus:function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n="/elevate/accessStatus",a=co.parse(n,!0),o=Ge()({method:"POST"},r),i={},l={};if(e&&e.apiKey){var c="function"===typeof e.apiKey?e.apiKey("X-API-Key"):e.apiKey;i["X-API-Key"]=c}i["Content-Type"]="application/json",a.query=Ge()({},a.query,l,r.query),delete a.search,o.headers=Ge()({},i,r.headers);var s=!0;return o.body=s?JSON.stringify(t||{}):t||"",{url:co.format(a),options:o}},activateUser:function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(null===t||void 0===t)throw new To("body","Required parameter body was null or undefined when calling activateUser.");var n="/elevate/user",a=co.parse(n,!0),o=Ge()({method:"POST"},r),i={},l={};if(e&&e.apiKey){var c="function"===typeof e.apiKey?e.apiKey("X-API-Key"):e.apiKey;i["X-API-Key"]=c}i["Content-Type"]="application/json",a.query=Ge()({},a.query,l,r.query),delete a.search,o.headers=Ge()({},i,r.headers);var s=!0;return o.body=s?JSON.stringify(t||{}):t||"",{url:co.format(a),options:o}},addUserPlate:function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(null===t||void 0===t)throw new To("body","Required parameter body was null or undefined when calling addUserPlate.");var n="/elevate/userPlates",a=co.parse(n,!0),o=Ge()({method:"POST"},r),i={},l={};if(e&&e.apiKey){var c="function"===typeof e.apiKey?e.apiKey("X-API-Key"):e.apiKey;i["X-API-Key"]=c}i["Content-Type"]="application/json",a.query=Ge()({},a.query,l,r.query),delete a.search,o.headers=Ge()({},i,r.headers);var s=!0;return o.body=s?JSON.stringify(t||{}):t||"",{url:co.format(a),options:o}},conflictResolve:function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(null===t||void 0===t)throw new To("body","Required parameter body was null or undefined when calling conflictResolve.");var n="/elevate/userPlates/conflict",a=co.parse(n,!0),o=Ge()({method:"POST"},r),i={},l={};if(e&&e.apiKey){var c="function"===typeof e.apiKey?e.apiKey("X-API-Key"):e.apiKey;i["X-API-Key"]=c}i["Content-Type"]="application/json",a.query=Ge()({},a.query,l,r.query),delete a.search,o.headers=Ge()({},i,r.headers);var s=!0;return o.body=s?JSON.stringify(t||{}):t||"",{url:co.format(a),options:o}},getUser:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r="/elevate/user",n=co.parse(r,!0),a=Ge()({method:"GET"},t),o={},i={};if(e&&e.apiKey){var l="function"===typeof e.apiKey?e.apiKey("X-API-Key"):e.apiKey;o["X-API-Key"]=l}return n.query=Ge()({},n.query,i,t.query),delete n.search,a.headers=Ge()({},o,t.headers),{url:co.format(n),options:a}},getUserPlates:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r="/elevate/userPlates",n=co.parse(r,!0),a=Ge()({method:"GET"},t),o={},i={};if(e&&e.apiKey){var l="function"===typeof e.apiKey?e.apiKey("X-API-Key"):e.apiKey;o["X-API-Key"]=l}return n.query=Ge()({},n.query,i,t.query),delete n.search,a.headers=Ge()({},o,t.headers),{url:co.format(n),options:a}},healthcheck:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r="/healthcheck",n=co.parse(r,!0),a=Ge()({method:"GET"},t),o={},i={};return void 0!==e&&(i.verbose=e),n.query=Ge()({},n.query,i,t.query),delete n.search,a.headers=Ge()({},o,t.headers),{url:co.format(n),options:a}},movement:function(t,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(null===t||void 0===t)throw new To("body","Required parameter body was null or undefined when calling movement.");var a="/elevate/movement",o=co.parse(a,!0),i=Ge()({method:"POST"},n),l={},c={};if(e&&e.apiKey){var s="function"===typeof e.apiKey?e.apiKey("X-API-Key"):e.apiKey;l["X-API-Key"]=s}void 0!==r&&(c.mockEparkTimeout=r),l["Content-Type"]="application/json",o.query=Ge()({},o.query,c,n.query),delete o.search,i.headers=Ge()({},l,n.headers);var u=!0;return i.body=u?JSON.stringify(t||{}):t||"",{url:co.format(o),options:i}},removeUserPlate:function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(null===t||void 0===t)throw new To("body","Required parameter body was null or undefined when calling removeUserPlate.");var n="/elevate/userPlates",a=co.parse(n,!0),o=Ge()({method:"DELETE"},r),i={},l={};if(e&&e.apiKey){var c="function"===typeof e.apiKey?e.apiKey("X-API-Key"):e.apiKey;i["X-API-Key"]=c}i["Content-Type"]="application/json",a.query=Ge()({},a.query,l,r.query),delete a.search,o.headers=Ge()({},i,r.headers);var s=!0;return o.body=s?JSON.stringify(t||{}):t||"",{url:co.format(a),options:o}},updateUser:function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(null===t||void 0===t)throw new To("body","Required parameter body was null or undefined when calling updateUser.");var n="/elevate/user",a=co.parse(n,!0),o=Ge()({method:"PUT"},r),i={},l={};if(e&&e.apiKey){var c="function"===typeof e.apiKey?e.apiKey("X-API-Key"):e.apiKey;i["X-API-Key"]=c}i["Content-Type"]="application/json",a.query=Ge()({},a.query,l,r.query),delete a.search,o.headers=Ge()({},i,r.headers);var s=!0;return o.body=s?JSON.stringify(t||{}):t||"",{url:co.format(a),options:o}},updateUserPlate:function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(null===t||void 0===t)throw new To("body","Required parameter body was null or undefined when calling updateUserPlate.");var n="/elevate/userPlates",a=co.parse(n,!0),o=Ge()({method:"PUT"},r),i={},l={};if(e&&e.apiKey){var c="function"===typeof e.apiKey?e.apiKey("X-API-Key"):e.apiKey;i["X-API-Key"]=c}i["Content-Type"]="application/json",a.query=Ge()({},a.query,l,r.query),delete a.search,o.headers=Ge()({},i,r.headers);var s=!0;return o.body=s?JSON.stringify(t||{}):t||"",{url:co.format(a),options:o}},userRefresh:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r="/elevate/user/refresh",n=co.parse(r,!0),a=Ge()({method:"POST"},t),o={},i={};if(e&&e.apiKey){var l="function"===typeof e.apiKey?e.apiKey("X-API-Key"):e.apiKey;o["X-API-Key"]=l}return n.query=Ge()({},n.query,i,t.query),delete n.search,a.headers=Ge()({},o,t.headers),{url:co.format(n),options:a}}}},Co=function(e){return{access:function(t,r){var n=Ro(e).access(t,r);return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return fetch(e+n.url,n.options).then((function(e){if(e.status>=200&&e.status<300)return e.json();throw e}))}},accessStatus:function(t,r){var n=Ro(e).accessStatus(t,r);return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return fetch(e+n.url,n.options).then((function(e){if(e.status>=200&&e.status<300)return e.json();throw e}))}},activateUser:function(t,r){var n=Ro(e).activateUser(t,r);return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return fetch(e+n.url,n.options).then((function(e){if(e.status>=200&&e.status<300)return e.json();throw e}))}},addUserPlate:function(t,r){var n=Ro(e).addUserPlate(t,r);return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return fetch(e+n.url,n.options).then((function(e){if(e.status>=200&&e.status<300)return e.json();throw e}))}},conflictResolve:function(t,r){var n=Ro(e).conflictResolve(t,r);return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return fetch(e+n.url,n.options).then((function(e){if(e.status>=200&&e.status<300)return e.json();throw e}))}},getUser:function(t){var r=Ro(e).getUser(t);return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return fetch(e+r.url,r.options).then((function(e){if(e.status>=200&&e.status<300)return e.json();throw e}))}},getUserPlates:function(t){var r=Ro(e).getUserPlates(t);return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return fetch(e+r.url,r.options).then((function(e){if(e.status>=200&&e.status<300)return e.json();throw e}))}},healthcheck:function(t,r){var n=Ro(e).healthcheck(t,r);return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return fetch(e+n.url,n.options).then((function(e){if(e.status>=200&&e.status<300)return e.json();throw e}))}},movement:function(t,r,n){var a=Ro(e).movement(t,r,n);return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return fetch(e+a.url,a.options).then((function(e){if(e.status>=200&&e.status<300)return e.json();throw e}))}},removeUserPlate:function(t,r){var n=Ro(e).removeUserPlate(t,r);return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return fetch(e+n.url,n.options).then((function(e){if(e.status>=200&&e.status<300)return e.json();throw e}))}},updateUser:function(t,r){var n=Ro(e).updateUser(t,r);return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return fetch(e+n.url,n.options).then((function(e){if(e.status>=200&&e.status<300)return e.json();throw e}))}},updateUserPlate:function(t,r){var n=Ro(e).updateUserPlate(t,r);return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return fetch(e+n.url,n.options).then((function(e){if(e.status>=200&&e.status<300)return e.json();throw e}))}},userRefresh:function(t){var r=Ro(e).userRefresh(t);return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return fetch(e+r.url,r.options).then((function(e){if(e.status>=200&&e.status<300)return e.json();throw e}))}}}},Uo=(function(e){f()(r,e);var t=so(r);function r(){return o()(this,r),t.apply(this,arguments)}l()(r,[{key:"access",value:function(e,t){return Co(this.configuration).access(e,t)(this.basePath)}},{key:"accessStatus",value:function(e,t){return Co(this.configuration).accessStatus(e,t)(this.basePath)}},{key:"activateUser",value:function(e,t){return Co(this.configuration).activateUser(e,t)(this.basePath)}},{key:"addUserPlate",value:function(e,t){return Co(this.configuration).addUserPlate(e,t)(this.basePath)}},{key:"conflictResolve",value:function(e,t){return Co(this.configuration).conflictResolve(e,t)(this.basePath)}},{key:"getUser",value:function(e){return Co(this.configuration).getUser(e)(this.basePath)}},{key:"getUserPlates",value:function(e){return Co(this.configuration).getUserPlates(e)(this.basePath)}},{key:"healthcheck",value:function(e,t){return Co(this.configuration).healthcheck(e,t)(this.basePath)}},{key:"movement",value:function(e,t,r){return Co(this.configuration).movement(e,t,r)(this.basePath)}},{key:"removeUserPlate",value:function(e,t){return Co(this.configuration).removeUserPlate(e,t)(this.basePath)}},{key:"updateUser",value:function(e,t){return Co(this.configuration).updateUser(e,t)(this.basePath)}},{key:"updateUserPlate",value:function(e,t){return Co(this.configuration).updateUserPlate(e,t)(this.basePath)}},{key:"userRefresh",value:function(e){return Co(this.configuration).userRefresh(e)(this.basePath)}}])}(ko),function(e){return{forceWhitelistUpdate:function(t,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(null===t||void 0===t)throw new To("userId","Required parameter userId was null or undefined when calling forceWhitelistUpdate.");var a="/elevate/admin/user/{userId}/whitelist".replace("{userId}",encodeURIComponent(String(t))),o=co.parse(a,!0),i=Ge()({method:"POST"},n),l={},c={};if(e&&e.apiKey){var s="function"===typeof e.apiKey?e.apiKey("Authorization"):e.apiKey;l.Authorization=s}return void 0!==r&&(c.force=r),o.query=Ge()({},o.query,c,n.query),delete o.search,i.headers=Ge()({},l,n.headers),{url:co.format(o),options:i}},getAdminUser:function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(null===t||void 0===t)throw new To("email","Required parameter email was null or undefined when calling getAdminUser.");var n="/elevate/admin/user/{email}".replace("{email}",encodeURIComponent(String(t))),a=co.parse(n,!0),o=Ge()({method:"GET"},r),i={},l={};if(e&&e.apiKey){var c="function"===typeof e.apiKey?e.apiKey("Authorization"):e.apiKey;i.Authorization=c}return a.query=Ge()({},a.query,l,r.query),delete a.search,o.headers=Ge()({},i,r.headers),{url:co.format(a),options:o}},getAdminUserPlates:function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(null===t||void 0===t)throw new To("email","Required parameter email was null or undefined when calling getAdminUserPlates.");var n="/elevate/admin/user/{email}/userPlates".replace("{email}",encodeURIComponent(String(t))),a=co.parse(n,!0),o=Ge()({method:"GET"},r),i={},l={};if(e&&e.apiKey){var c="function"===typeof e.apiKey?e.apiKey("Authorization"):e.apiKey;i.Authorization=c}return a.query=Ge()({},a.query,l,r.query),delete a.search,o.headers=Ge()({},i,r.headers),{url:co.format(a),options:o}},getFeatureFlags:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r="/elevate/admin/feature-flags",n=co.parse(r,!0),a=Ge()({method:"GET"},t),o={},i={};if(e&&e.apiKey){var l="function"===typeof e.apiKey?e.apiKey("Authorization"):e.apiKey;o.Authorization=l}return n.query=Ge()({},n.query,i,t.query),delete n.search,a.headers=Ge()({},o,t.headers),{url:co.format(n),options:a}},getUserEparkRetries:function(t,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(null===t||void 0===t)throw new To("email","Required parameter email was null or undefined when calling getUserEparkRetries.");var a="/elevate/admin/user/{email}/eparkRetries".replace("{email}",encodeURIComponent(String(t))),o=co.parse(a,!0),i=Ge()({method:"GET"},n),l={},c={};if(e&&e.apiKey){var s="function"===typeof e.apiKey?e.apiKey("Authorization"):e.apiKey;l.Authorization=s}return void 0!==r&&(c.appSessionId=r),o.query=Ge()({},o.query,c,n.query),delete o.search,i.headers=Ge()({},l,n.headers),{url:co.format(o),options:i}},getUserSessionDetail:function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(null===t||void 0===t)throw new To("appSessionId","Required parameter appSessionId was null or undefined when calling getUserSessionDetail.");var n="/elevate/admin/user/{appSessionId}/appSession".replace("{appSessionId}",encodeURIComponent(String(t))),a=co.parse(n,!0),o=Ge()({method:"GET"},r),i={},l={};if(e&&e.apiKey){var c="function"===typeof e.apiKey?e.apiKey("Authorization"):e.apiKey;i.Authorization=c}return a.query=Ge()({},a.query,l,r.query),delete a.search,o.headers=Ge()({},i,r.headers),{url:co.format(a),options:o}},getUserSessions:function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(null===t||void 0===t)throw new To("email","Required parameter email was null or undefined when calling getUserSessions.");var n="/elevate/admin/user/{email}/userSessions".replace("{email}",encodeURIComponent(String(t))),a=co.parse(n,!0),o=Ge()({method:"GET"},r),i={},l={};if(e&&e.apiKey){var c="function"===typeof e.apiKey?e.apiKey("Authorization"):e.apiKey;i.Authorization=c}return a.query=Ge()({},a.query,l,r.query),delete a.search,o.headers=Ge()({},i,r.headers),{url:co.format(a),options:o}},getUserWhitelist:function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(null===t||void 0===t)throw new To("email","Required parameter email was null or undefined when calling getUserWhitelist.");var n="/elevate/admin/user/{email}/userWhitelist".replace("{email}",encodeURIComponent(String(t))),a=co.parse(n,!0),o=Ge()({method:"GET"},r),i={},l={};if(e&&e.apiKey){var c="function"===typeof e.apiKey?e.apiKey("Authorization"):e.apiKey;i.Authorization=c}return a.query=Ge()({},a.query,l,r.query),delete a.search,o.headers=Ge()({},i,r.headers),{url:co.format(a),options:o}},runRetryTask:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r="/elevate/admin/tasks/retry-run",n=co.parse(r,!0),a=Ge()({method:"POST"},t),o={},i={};if(e&&e.apiKey){var l="function"===typeof e.apiKey?e.apiKey("Authorization"):e.apiKey;o.Authorization=l}return n.query=Ge()({},n.query,i,t.query),delete n.search,a.headers=Ge()({},o,t.headers),{url:co.format(n),options:a}},runSubscriptionSync:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r="/elevate/admin/subscriptions/runsync",n=co.parse(r,!0),a=Ge()({method:"POST"},t),o={},i={};if(e&&e.apiKey){var l="function"===typeof e.apiKey?e.apiKey("Authorization"):e.apiKey;o.Authorization=l}return n.query=Ge()({},n.query,i,t.query),delete n.search,a.headers=Ge()({},o,t.headers),{url:co.format(n),options:a}},setFeatureFlag:function(t,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(null===t||void 0===t)throw new To("name","Required parameter name was null or undefined when calling setFeatureFlag.");if(null===r||void 0===r)throw new To("body","Required parameter body was null or undefined when calling setFeatureFlag.");var a="/elevate/admin/feature-flags/{name}".replace("{name}",encodeURIComponent(String(t))),o=co.parse(a,!0),i=Ge()({method:"PUT"},n),l={},c={};if(e&&e.apiKey){var s="function"===typeof e.apiKey?e.apiKey("Authorization"):e.apiKey;l.Authorization=s}l["Content-Type"]="application/json",o.query=Ge()({},o.query,c,n.query),delete o.search,i.headers=Ge()({},l,n.headers);var u=!0;return i.body=u?JSON.stringify(r||{}):r||"",{url:co.format(o),options:i}}}}),Do=function(e){return{forceWhitelistUpdate:function(t,r,n){var a=Uo(e).forceWhitelistUpdate(t,r,n);return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return fetch(e+a.url,a.options).then((function(e){if(e.status>=200&&e.status<300)return e;throw e}))}},getAdminUser:function(t,r){var n=Uo(e).getAdminUser(t,r);return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return fetch(e+n.url,n.options).then((function(e){if(e.status>=200&&e.status<300)return e.json();throw e}))}},getAdminUserPlates:function(t,r){var n=Uo(e).getAdminUserPlates(t,r);return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return fetch(e+n.url,n.options).then((function(e){if(e.status>=200&&e.status<300)return e.json();throw e}))}},getFeatureFlags:function(t){var r=Uo(e).getFeatureFlags(t);return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return fetch(e+r.url,r.options).then((function(e){if(e.status>=200&&e.status<300)return e.json();throw e}))}},getUserEparkRetries:function(t,r,n){var a=Uo(e).getUserEparkRetries(t,r,n);return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return fetch(e+a.url,a.options).then((function(e){if(e.status>=200&&e.status<300)return e.json();throw e}))}},getUserSessionDetail:function(t,r){var n=Uo(e).getUserSessionDetail(t,r);return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return fetch(e+n.url,n.options).then((function(e){if(e.status>=200&&e.status<300)return e.json();throw e}))}},getUserSessions:function(t,r){var n=Uo(e).getUserSessions(t,r);return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return fetch(e+n.url,n.options).then((function(e){if(e.status>=200&&e.status<300)return e.json();throw e}))}},getUserWhitelist:function(t,r){var n=Uo(e).getUserWhitelist(t,r);return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return fetch(e+n.url,n.options).then((function(e){if(e.status>=200&&e.status<300)return e.json();throw e}))}},runRetryTask:function(t){var r=Uo(e).runRetryTask(t);return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return fetch(e+r.url,r.options).then((function(e){if(e.status>=200&&e.status<300)return e.json();throw e}))}},runSubscriptionSync:function(t){var r=Uo(e).runSubscriptionSync(t);return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return fetch(e+r.url,r.options).then((function(e){if(e.status>=200&&e.status<300)return e.json();throw e}))}},setFeatureFlag:function(t,r,n){var a=Uo(e).setFeatureFlag(t,r,n);return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return fetch(e+a.url,a.options).then((function(e){if(e.status>=200&&e.status<300)return e.json();throw e}))}}}},Po=function(e){f()(r,e);var t=so(r);function r(){return o()(this,r),t.apply(this,arguments)}return l()(r,[{key:"forceWhitelistUpdate",value:function(e,t,r){return Do(this.configuration).forceWhitelistUpdate(e,t,r)(this.basePath)}},{key:"getAdminUser",value:function(e,t){return Do(this.configuration).getAdminUser(e,t)(this.basePath)}},{key:"getAdminUserPlates",value:function(e,t){return Do(this.configuration).getAdminUserPlates(e,t)(this.basePath)}},{key:"getFeatureFlags",value:function(e){return Do(this.configuration).getFeatureFlags(e)(this.basePath)}},{key:"getUserEparkRetries",value:function(e,t,r){return Do(this.configuration).getUserEparkRetries(e,t,r)(this.basePath)}},{key:"getUserSessionDetail",value:function(e,t){return Do(this.configuration).getUserSessionDetail(e,t)(this.basePath)}},{key:"getUserSessions",value:function(e,t){return Do(this.configuration).getUserSessions(e,t)(this.basePath)}},{key:"getUserWhitelist",value:function(e,t){return Do(this.configuration).getUserWhitelist(e,t)(this.basePath)}},{key:"runRetryTask",value:function(e){return Do(this.configuration).runRetryTask(e)(this.basePath)}},{key:"runSubscriptionSync",value:function(e){return Do(this.configuration).runSubscriptionSync(e)(this.basePath)}},{key:"setFeatureFlag",value:function(e,t,r){return Do(this.configuration).setFeatureFlag(e,t,r)(this.basePath)}}]),r}(ko),wo=function(){function e(){o()(this,e)}return l()(e,null,[{key:"getAPIConfig",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return e?M.b.elevateService.prod:M.b.elevateService.staging}},{key:"getApi",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],r=e.getAPIConfig(t),n=r.apiKey,a=r.apiBaseUrl;return new Po({apiKey:n},a)}},{key:"authenticate",value:function(){var e;return S.a.async((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=no.a.auth().currentUser){t.next=3;break}throw new Error("You are not currently logged in");case 3:return t.abrupt("return",e.getIdToken());case 4:case"end":return t.stop()}}),null,null,null,Promise)}},{key:"getUser",value:function(t,r){return e.authenticate().then((function(n){return e.getApi(t).getAdminUser(r,{headers:{Authorization:n}}).then((function(e){return e.user})).catch((function(e){console.error("Error getting Elevate user",e)}))}))}},{key:"getAllSessions",value:function(t,r){return e.authenticate().then((function(n){return e.getApi(t).getUserSessions(r,{headers:{Authorization:n}}).then((function(e){return{sessions:e.sessions}})).catch((function(){return{sessions:[]}}))}))}},{key:"getUserSessionDetail",value:function(t,r){return e.authenticate().then((function(n){return e.getApi(t).getUserSessionDetail(r,{headers:{Authorization:n}}).then((function(e){return e.session||{}}))}))}},{key:"getUserWhitelist",value:function(t,r){return e.authenticate().then((function(n){return e.getApi(t).getUserWhitelist(r,{headers:{Authorization:n}}).then((function(e){return e.whitelistEntries||[]}))}))}},{key:"resendWhitelist",value:function(t,r){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return e.authenticate().then((function(a){return e.getApi(t).forceWhitelistUpdate(r,n,{headers:{Authorization:a}}).then((function(){}))}))}},{key:"getUserPlates",value:function(t,r){return e.authenticate().then((function(n){return e.getApi(t).getAdminUserPlates(r,{headers:{Authorization:n}}).then((function(e){return e.plates||[]}))}))}},{key:"getEparkRetries",value:function(t,r){return e.getEparkRetriesForAppSession(t,r,void 0)}},{key:"getEparkRetriesForAppSession",value:function(t,r,n){return e.authenticate().then((function(a){var o=e.getAPIConfig(t).apiBaseUrl+"/elevate/admin/user/"+encodeURIComponent(r)+"/eparkRetries";return n&&(o+="?appSessionId="+encodeURIComponent(n)),fetch(o,{headers:{Authorization:a}}).then((function(e){if(e.status>=200&&e.status<300)return e.json();throw new Error("eparkRetries: "+e.status)})).then((function(e){return e.retries||[]})).catch((function(e){return console.error("Error getting ePark retries",e),[]}))}))}},{key:"runSubscriptionSync",value:function(t){return e.authenticate().then((function(r){var n=e.getAPIConfig(t).apiBaseUrl;return fetch(n+"/elevate/admin/subscriptions/runsync",{method:"POST",headers:{Authorization:r,"Content-Type":"application/json"}}).then((function(e){return 202===e.status||200===e.status?e.json().catch((function(){return{}})):e.json().then((function(t){return Promise.reject(new Error((null==t?void 0:t.message)||"subscriptions/runsync: "+e.status))}))}))}))}},{key:"runRetryTask",value:function(t){return e.authenticate().then((function(r){var n=e.getAPIConfig(t).apiBaseUrl;return fetch(n+"/elevate/admin/tasks/retry-run",{method:"POST",headers:{Authorization:r,"Content-Type":"application/json"}}).then((function(e){return 202===e.status||200===e.status?e.json().catch((function(){return{}})):e.json().then((function(t){return Promise.reject(new Error((null==t?void 0:t.message)||"tasks/retry-run: "+e.status))}))}))}))}},{key:"getFeatureFlags",value:function(t){return e.authenticate().then((function(r){var n=e.getAPIConfig(t).apiBaseUrl;return fetch(n+"/elevate/admin/feature-flags",{headers:{Authorization:r}}).then((function(e){if(e.status>=200&&e.status<300)return e.json();throw new Error("feature-flags: "+e.status)})).then((function(e){return e.featureFlags||[]}))}))}},{key:"setFeatureFlag",value:function(t,r,n){return e.authenticate().then((function(a){var o=e.getAPIConfig(t).apiBaseUrl;return fetch(o+"/elevate/admin/feature-flags/"+encodeURIComponent(r),{method:"PUT",headers:{Authorization:a,"Content-Type":"application/json"},body:JSON.stringify({value:n})}).then((function(e){if(!(e.status>=200&&e.status<300))return e.json().then((function(t){return Promise.reject(new Error((null==t?void 0:t.message)||"set feature flag: "+e.status))}))}))}))}}]),e}(),Mo=function(){function e(){o()(this,e)}return l()(e,null,[{key:"getAPIConfig",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return e?M.b.promoPushService.prod:M.b.promoPushService.staging}},{key:"getApi",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],r=e.getAPIConfig(t),n=r.apiKey,a=r.apiBaseUrl;return new ba.a({apiKey:n},a)}},{key:"authenticate",value:function(){var e;return S.a.async((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=no.a.auth().currentUser){t.next=3;break}throw new Error("You are not currently logged in");case 3:return t.abrupt("return",e.getIdToken());case 4:case"end":return t.stop()}}),null,null,null,Promise)}},{key:"adminGetUserPacks",value:function(t,r,n){return e.authenticate().then((function(a){return e.getApi(n).adminGetUserPacks(t,r,{headers:{Authorization:a}})}))}},{key:"adminDeleteUserPacks",value:function(t,r,n){return e.authenticate().then((function(a){return e.getApi(n).adminDeleteUserPack(t,r,{headers:{Authorization:a}})}))}},{key:"adminFixInvalidPass",value:function(t,r){return e.authenticate().then((function(n){return e.getApi(r).adminFixInvalidPass(t,{headers:{Authorization:n}})}))}},{key:"adminAllocatePackCode",value:function(t,r,n){return e.authenticate().then((function(a){return e.getApi(n).adminAllocatePackCode(t,r,{headers:{Authorization:a}})}))}},{key:"adminAllocatePack",value:function(t,r,n){return e.authenticate().then((function(a){return e.getApi(n).adminAllocatePack(t,r,{headers:{Authorization:a}})}))}},{key:"adminGetProducts",value:function(t){return e.authenticate().then((function(r){return e.getApi(t).adminGetProducts({headers:{Authorization:r}})}))}},{key:"adminUpdateProducts",value:function(t,r){return e.authenticate().then((function(n){return e.getApi(r).adminUpdateProducts(t,{headers:{Authorization:n}})}))}}]),e}(),xo=r(277),Vo=r(286),jo=r(278),Bo=r(740);function Io(e,t,r,n,a){return Object(Vo.a)(fetch(function(e,t,r){return(e=e.replace(/\/$/,""))+"/"+t+(null!=r?r:"")}(e,t,r),n)).pipe(Object(jo.a)((function(e){if(e.status>=200&&e.status<300)try{return e.json()}catch(t){throw{message:"Parse error: "+JSON.stringify(t)}}return e.text().then((function(t){var r=t||e.statusText||"Status "+e.status,n={};if(t)try{n=JSON.parse(t)}catch(a){throw{message:r}}if(!n.message)throw{message:r};throw n}))})),Object(Bo.a)((function(e){return function(e,t,r,n){throw n&&(r&&r.method?e.tag=r.method+" "+t:e.tag=t,e.tracked=!0,n(e)),e}(e,t,n,a)})))}function No(e){return function(e,t){var r;return(null!=(r=e.ServiceList)?r:[]).findIndex((function(e){return e.Service===t}))>=0}(e,Oo.WilsonOne)}function Jo(e){return{Id:e.Id,AXCarparkID:e.AXCarparkID,StationNumber:e.StationNumber,StationImageWithUrl:e.StationImageWithUrl,Name:e.Label,BestPrice:e.BestPrice||"",IsWilsonOne:No(e),Location:e.Location,PrintTickets:!1}}function Lo(){return Io(M.b.cmsBaseUrl,"GetListActiveCarParks").pipe(Object(xo.a)((function(e){return(e.CarParksList||[]).map(Jo)})))}!function(e){e[e.Casual=1]="Casual",e[e.Monthly=2]="Monthly",e[e.Night=3]="Night",e[e.Weekend=4]="Weekend",e[e.Disabled=6]="Disabled",e[e.Earlybird=15]="Earlybird",e[e.WilsonOne=18]="WilsonOne",e[e.EPark=22]="EPark"}(Oo||(Oo={}));var Fo=r(148);function Wo(e,t){Object(h.useEffect)((function(){var t=function(t){e()&&(t.preventDefault(),t.returnValue=!0)};return window.addEventListener("beforeunload",t),function(){window.removeEventListener("beforeunload",t)}}),t)}var Ho=r(255),Zo=function(e){var t=e.children,r=e.style;return m.a.createElement(R.a,{selectable:!0,style:[r]},t)};function Qo(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Go(e){for(var t=1;t=e.length?{done:!0}:{done:!1,value:e[t++]}};throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}return(t=e["function"===typeof Symbol?Symbol.iterator:"@@iterator"]()).next.bind(t)}function ci(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r0&&function(){for(var e,t=p?qr()(p).sort((function(e,t){var r,n;return(null!=(r=e.insertTimestamp)?r:"").localeCompare(null!=(n=t.insertTimestamp)?n:"")})):[],r=function(e,t){return"RETRY_PENDING"===e?null!=t&&t>=1?"Failed (will retry)":"Pending":"RETRY_LIMIT_EXCEEDED"===e?"Failed (limit exceeded)":"RETRY_SUCCESSFUL"===e?"Succeeded":e?e.replace(/_/g," ").toLowerCase():"\u2014"},n=function(e){return!!(null==e?void 0:e.trim())},a=function(e){return n(e.stopSessionRequest)&&!n(e.startSessionRequest)},o=function(e){var t;return!(null==(t=e.sessionId)?void 0:t.trim())&&!a(e)},i=[],l=c.eparkSessions.filter((function(e){var t;return null==(t=e.sessionId)?void 0:t.trim()})),s=c.eparkSessions.filter((function(e){var t;return!(null==(t=e.sessionId)?void 0:t.trim())})),u=li(l);!(e=u()).done;){var d,f,h,g,b=e.value;if(i.push({time:null!=(d=b.startTimestamp)?d:"",label:"Session started"}),b.stopped&&(null!=(f=b.stopTimestamp)?f:b.stopTimestampDisplay))i.push({time:null!=(h=null!=(g=b.stopTimestamp)?g:b.stopTimestampDisplay)?h:"",label:"Session stopped"})}for(var A,E=li(s);!(A=E()).done;){var v,S=A.value;if(a(S))i.push({time:null!=(v=S.startTimestamp)?v:"",label:"Stop attempted \u2192 Failed",errorCode:S.errorCode,errorDescription:S.errorDescription,stopRequest:S.stopSessionRequest});else if(o(S)){var k;i.push({time:null!=(k=S.startTimestamp)?k:"",label:"Start attempted \u2192 Failed",errorCode:S.errorCode,errorDescription:S.errorDescription})}}for(var T,O=s.find((function(e){return o(e)})),C=function(e){var t,n=r(e.status,e.retryCount),a=null!=e.retryCount?" (attempt "+e.retryCount+")":"",o="start"===e.retryType,c=o?void 0:l.find((function(t){return t.sessionId===e.eparkSessionId}));if(null==(t=e.attemptErrors)?void 0:t.length)e.attemptErrors.forEach((function(e,t){var r;i.push({time:null!=(r=e.insertTimestamp)?r:"",label:o?"Start retry (attempt "+(t+1)+") \u2192 Failed":"Stop retry (attempt "+(t+1)+") \u2192 Failed",errorCode:e.errorCode,errorDescription:e.errorDescription})}));else{var s,u,d=null!=(s=null!=(u=e.updateTimestamp)?u:e.insertTimestamp)?s:"";i.push({time:d,label:o?"Start retry"+a+" \u2192 "+n:"Stop retry"+a+" \u2192 "+n,errorCode:o?null==O?void 0:O.errorCode:null==c?void 0:c.errorCode,errorDescription:o?null==O?void 0:O.errorDescription:null==c?void 0:c.errorDescription})}},U=li(t);!(T=U()).done;){C(T.value)}return i.sort((function(e,t){return ui(e.time)-ui(t.time)})),m.a.createElement(m.a.Fragment,null,m.a.createElement(y.a,{style:{marginBottom:z.d.baseMargin}},m.a.createElement(R.a,{style:[ti.subTitle,{marginBottom:4}]},"ePark session & retries"),m.a.createElement(R.a,{style:[ti.bodyText,{color:z.a.grey,marginBottom:8}]},"Start Booking No = session started by a booking ending. End Booking No = session ended by a booking starting."),i.length>0&&m.a.createElement(y.a,{style:{paddingVertical:8,paddingHorizontal:12,backgroundColor:z.a.pageBackground,borderLeftWidth:4,borderLeftColor:z.a.orange,borderRadius:4,marginBottom:12}},m.a.createElement(R.a,{style:[ti.bodyText,{fontWeight:"bold",marginBottom:6}]},"Order of events"),i.map((function(e,t){var r;return m.a.createElement(y.a,{key:t,style:{marginBottom:6}},m.a.createElement(R.a,{style:[ti.bodyText,{marginBottom:2}]},t+1,". ",e.label,e.time?" \u2014 "+(si(e.time)||e.time):""),(null!=(r=e.errorCode)?r:e.errorDescription)&&m.a.createElement(R.a,{style:[ti.bodyText,{color:z.a.grey,marginLeft:16}]},"Error: ",[e.errorCode,e.errorDescription].filter(Boolean).join(" \u2014 ")))})))),l.map((function(e,r){var n,a,o=t.find((function(t){return"stop"===t.retryType&&t.eparkSessionId===e.sessionId}));return m.a.createElement(ii,{session:e,index:r,key:"session-"+(null!=(n=e.sessionId)?n:r),retryStatus:null==o?void 0:o.status,retryLabel:o?"Stop retry: "+o.status:void 0,eventLabel:"ePark Session "+(null!=(a=e.sessionId)?a:"")+(e.stopped?" \xb7 Stopped: YES":"")})})),s.map((function(e,t){var r,i;return a(e)&&n(e.stopSessionRequest)?m.a.createElement(y.a,{key:"failure-stop-"+t,style:{marginVertical:8,padding:12,borderRadius:6,borderLeftWidth:4,borderLeftColor:z.a.orange,backgroundColor:"rgba(248, 112, 40, 0.08)"}},m.a.createElement(R.a,{style:[ti.bodyText,{fontWeight:"bold",marginBottom:4}]},"Stop attempt (failed) \u2014 ",si(e.startTimestamp)||e.startTimestamp),(null!=(r=e.errorCode)?r:e.errorDescription)&&m.a.createElement(R.a,{style:[ti.bodyText,{color:z.a.grey,marginBottom:6}]},[e.errorCode,e.errorDescription].filter(Boolean).join(" \u2014 ")),m.a.createElement(y.a,{style:ti.header},m.a.createElement(R.a,{style:ti.headerText},"Stop request (attempt that failed)")),m.a.createElement(y.a,{style:ti.cell},m.a.createElement(Zo,{style:ti.bodyText},e.stopSessionRequest))):o(e)&&n(e.startSessionRequest)?m.a.createElement(y.a,{key:"failure-start-"+t,style:{marginVertical:8,padding:12,borderRadius:6,borderLeftWidth:4,borderLeftColor:z.a.grey,backgroundColor:"rgba(128, 128, 128, 0.06)"}},m.a.createElement(R.a,{style:[ti.bodyText,{fontWeight:"bold",marginBottom:4}]},"Start attempt (failed) \u2014 ",si(e.startTimestamp)||e.startTimestamp),(null!=(i=e.errorCode)?i:e.errorDescription)&&m.a.createElement(R.a,{style:[ti.bodyText,{color:z.a.grey,marginBottom:6}]},[e.errorCode,e.errorDescription].filter(Boolean).join(" \u2014 ")),m.a.createElement(y.a,{style:ti.header},m.a.createElement(R.a,{style:ti.headerText},"Start request (attempt that failed)")),m.a.createElement(y.a,{style:ti.cell},m.a.createElement(Zo,{style:ti.bodyText},e.startSessionRequest))):null})),t.map((function(e,t){var r,n;if(0===(null!=(r=null==(n=e.attemptErrors)?void 0:n.length)?r:0))return null;var a="start"===e.retryType;return e.attemptErrors.map((function(e,r){var n,o;return m.a.createElement(y.a,{key:"retry-attempt-"+t+"-"+r,style:{marginVertical:8,padding:12,borderRadius:6,borderLeftWidth:4,borderLeftColor:a?z.a.grey:z.a.orange,backgroundColor:a?"rgba(128, 128, 128, 0.06)":"rgba(248, 112, 40, 0.08)"}},m.a.createElement(R.a,{style:[ti.bodyText,{fontWeight:"bold",marginBottom:4}]},a?"Start":"Stop"," retry (attempt ",r+1,") (failed) \u2014"," ",null!=(n=si(e.insertTimestamp)||e.insertTimestamp)?n:""),(null!=(o=e.errorCode)?o:e.errorDescription)&&m.a.createElement(R.a,{style:[ti.bodyText,{color:z.a.grey}]},[e.errorCode,e.errorDescription].filter(Boolean).join(" \u2014 ")))}))})),t.length>0&&m.a.createElement(y.a,{style:{marginTop:20,paddingVertical:12,paddingHorizontal:14,backgroundColor:z.a.pageBackground,borderLeftWidth:4,borderLeftColor:z.a.blue,borderRadius:4,marginBottom:12}},m.a.createElement(R.a,{style:[ti.subTitle,{marginBottom:10}]},"Retries"),t.map((function(e,n){var a,o,i=r(e.status,e.retryCount),l="RETRY_PENDING"===e.status,c="RETRY_LIMIT_EXCEEDED"===e.status,s="RETRY_SUCCESSFUL"===e.status,u=s?"rgba(0, 128, 0, 0.08)":c?"rgba(208, 64, 32, 0.08)":l?"rgba(248, 112, 40, 0.08)":"transparent",d=s?z.a.green:c?z.a.red:z.a.orange,p=(null!=(a=null==(o=e.attemptErrors)?void 0:o.length)?a:0)>0;return m.a.createElement(y.a,{key:n,style:{marginBottom:n=0?o:void 0)}})).finally((function(){return p(!1)}))}),[e.useProd,e.userEmail]);return Object(h.useEffect)((function(){y()}),[y]),m.a.createElement(Re.a.Screen,{paddingVertical:z.d.quadBaseMargin,paddingHorizontal:z.d.eightBaseMargin},m.a.createElement(Me.a,{style:{position:"absolute",top:z.d.doubleBaseMargin,left:z.d.doubleBaseMargin},onPress:e.back},m.a.createElement(G.a,{source:z.c.arrowLeft,style:{width:z.d.icons.medium,height:z.d.icons.medium,tintColor:z.a.grey}})),m.a.createElement(Me.a,{style:{position:"absolute",top:z.d.doubleBaseMargin,right:z.d.doubleBaseMargin,flexDirection:"row",alignItems:"center"},onPress:y,disabled:d},d?m.a.createElement(g.a,{size:"small",color:z.a.grey}):m.a.createElement(R.a,{style:[z.b.black.bodyS.regular,{color:z.a.grey}]},"Refresh")),m.a.createElement(pr.Label,{data:{text:"App Sessions"},theme:pr.LABEL_THEME_TITLE}),void 0!==l&&m.a.createElement(di,{appSession:null==n?void 0:n[l],useProd:e.useProd,userEmail:e.userEmail,back:function(){c(void 0)}}),n&&!l&&m.a.createElement(qo,{data:n,onTap:function(e){c(e)}}))};function fi(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function hi(e){for(var t=1;t5,p=o&&s>5;return 0===s?m.a.createElement(R.a,{style:z.b.grey.bodyS.regularItalic},"No bundles found."):m.a.createElement(m.a.Fragment,null,m.a.createElement(bi,null),u&&u.map((function(t,r){return m.a.createElement(Ai,{userId:e.userEmail,bundle:t,key:r,onTrashPressed:function(){return e.onTrashPressed(t)},onToolsPressed:function(){return e.onToolsPressed(t)},onAddCodePressed:function(){return e.onAddCodePressed(t)},refresh:e.onSearchPressed,actionsDisabled:e.actionsDisabled})})),m.a.createElement(Re.a.SpacerDouble,null),d&&m.a.createElement(Be.Button,{text:"Show All",theme:vi({},Be.BUTTON_THEME_FIXED_RED,{textStyle:z.b.white.bodyM.bold,minWidth:"auto"}),onPress:l}),p&&m.a.createElement(Be.Button,{text:"Show Less",theme:vi({},Be.BUTTON_THEME_FIXED_RED,{textStyle:z.b.white.bodyM.bold,minWidth:"auto"}),onPress:c}))}var ki=function(){function e(){o()(this,e)}return l()(e,null,[{key:"getAPIConfig",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return e?M.b.promoPushService.prod:M.b.promoPushService.staging}},{key:"getApi",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],r=e.getAPIConfig(t),n=r.apiKey,a=r.apiBaseUrl;return new ba.d({apiKey:n},a)}},{key:"authenticate",value:function(){var e;return S.a.async((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=no.a.auth().currentUser){t.next=3;break}throw new Error("You are not currently logged in");case 3:return t.abrupt("return",e.getIdToken());case 4:case"end":return t.stop()}}),null,null,null,Promise)}},{key:"deleteUserAccountData",value:function(t,r){return e.authenticate().then((function(n){return e.getApi(r).deleteUserAccountData(t,{headers:{Authorization:n}})}))}}]),e}();function Ti(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Oi(e){for(var t=1;t0&&a(Ri.REQUESTING_CONFIRMATION)}),[e.userEmail]),u=Object(h.useCallback)((function(){a(Ri.PROCESSING),ki.deleteUserAccountData(e.userEmail,e.prod).then((function(e){c(e.message),a(Ri.PROCESSING_COMPLETE)})).catch((function(){return a(Ri.REQUEST_ERROR)}))}),[e.userEmail]),d=Object(h.useCallback)((function(){n==Ri.REQUESTING_CONFIRMATION&&a(Ri.NOT_OPEN)}),[a]),p=Object(h.useMemo)((function(){switch(n){case Ri.REQUESTING_CONFIRMATION:return"Are you sure?";case Ri.PROCESSING:return"Deleting ...";case Ri.NOT_OPEN:return"";case Ri.REQUEST_ERROR:return"Something went wrong";default:return"Delete user account"}}),[n]),f=Object(h.useMemo)((function(){switch(n){case Ri.REQUESTING_CONFIRMATION:return m.a.createElement(R.a,null,"This will delete user account data for ",m.a.createElement(R.a,{style:U.b.black.bodyS.bold},e.userEmail));case Ri.PROCESSING:return m.a.createElement(m.a.Fragment,null,m.a.createElement(R.a,null,"Deleting user account data, please wait..."),m.a.createElement(y.a,{style:{flex:1,justifyContent:"center",width:"100%"}},m.a.createElement(Re.a.SpacerDouble,null),m.a.createElement(g.a,{color:U.a.red})));case Ri.PROCESSING_COMPLETE:return m.a.createElement(R.a,{style:Ci.messageStyle},l);case Ri.REQUEST_ERROR:return m.a.createElement(R.a,{style:U.b.red.bodyS.regularItalic},"There was an error processing your request. Please try again later","\n"," or contact Wilson Parking Support.");default:return m.a.createElement(m.a.Fragment,null)}}),[n]),b=Object(h.useMemo)((function(){switch(n){case Ri.REQUEST_ERROR:case Ri.REQUESTING_CONFIRMATION:return[{text:"Cancel",theme:Oi({},Be.BUTTON_THEME_CANCEL,{textStyle:U.b.red.bodyM.bold,minWidth:"auto",borderColor:U.a.red,paddingHorizontal:U.d.doubleBaseMargin}),onPress:d},{text:"Delete",theme:Oi({},Be.BUTTON_THEME_FIXED_RED,{textStyle:U.b.white.bodyM.bold,minWidth:"auto"}),onPress:u}];case Ri.PROCESSING_COMPLETE:return[{text:"Ok",theme:Oi({},Be.BUTTON_THEME_FIXED_RED,{textStyle:U.b.white.bodyM.bold,minWidth:"auto"}),onPress:function(){a(Ri.NOT_OPEN),e.refresh(e.prod)}}];default:return[]}}),[n]),A=Object(h.useMemo)((function(){return n!==Ri.NOT_OPEN}),[n]);return Wo((function(){return A}),[A]),m.a.createElement(je.Group,null,m.a.createElement(pr.Label,{data:{text:"Delete User Account Data"},theme:pr.LABEL_THEME_TITLE}),m.a.createElement(Re.a.SpacerDouble,null),m.a.createElement(y.a,{style:{alignItems:"flex-start"}},m.a.createElement(Be.Button,{text:"Delete",theme:Oi({},Be.BUTTON_THEME_FIXED_RED,{textStyle:U.b.white.bodyM.bold,minWidth:"auto"}),onPress:s})),A&&m.a.createElement(Ea.c,{onClose:d,show:A,title:p,buttons:b,theme:Ci},f))}function Di(e){return m.a.createElement(y.a,null,m.a.createElement(y.a,{style:{height:U.d.tripleBaseMargin,backgroundColor:U.a.pageBackground,flexDirection:"row",justifyContent:"space-between"}},m.a.createElement(y.a,{style:{flex:1}},m.a.createElement(Zo,{style:U.b.black.bodyM.regular},"UserId: ",e.user.userId)),m.a.createElement(y.a,{style:{flex:1}},m.a.createElement(R.a,{style:U.b.black.bodyM.regular},"AccessAllowed: ",e.user.accessAllowed?"Y":"N")),m.a.createElement(y.a,{style:{flex:1}},m.a.createElement(R.a,{style:U.b.black.bodyM.regular},"Lpr Blocked: ",e.user.lprBlocked?"Y":"N"))))}function Pi(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function wi(e){for(var t=1;t0&&c(Mi.REQUESTING_CONFIRMATION)}),[null==(t=e.userDetails)?void 0:t.userID]),b=Object(h.useCallback)((function(){var t,r;c(Mi.PROCESSING),Fo.a.adminDeleteUserBan(null!=(t=null==(r=e.userDetails)?void 0:r.userID)?t:"",e.prod).then((function(e){p(e.message),c(Mi.PROCESSING_COMPLETE)})).catch((function(){return c(Mi.REQUEST_ERROR)}))}),[null==(r=e.userDetails)?void 0:r.userID]),A=Object(h.useCallback)((function(){l==Mi.REQUESTING_CONFIRMATION&&c(Mi.NOT_OPEN)}),[c,l]),E=Object(h.useMemo)((function(){switch(l){case Mi.REQUESTING_CONFIRMATION:return"Are you sure?";case Mi.PROCESSING:return"Unlocking ...";case Mi.NOT_OPEN:return"";case Mi.REQUEST_ERROR:return"Something went wrong";default:return"Unlocked user account"}}),[l]),v=Object(h.useMemo)((function(){switch(l){case Mi.REQUESTING_CONFIRMATION:var t;return m.a.createElement(R.a,null,"This will unlock the user account for"," ",m.a.createElement(R.a,{style:U.b.black.bodyS.bold},null==(t=e.userDetails)?void 0:t.userID));case Mi.PROCESSING:return m.a.createElement(m.a.Fragment,null,m.a.createElement(R.a,null,"Unlocking user account, please wait..."),m.a.createElement(y.a,{style:{flex:1,justifyContent:"center",width:"100%"}},m.a.createElement(Re.a.SpacerDouble,null),m.a.createElement(g.a,{color:U.a.red})));case Mi.PROCESSING_COMPLETE:return m.a.createElement(R.a,{style:xi.messageStyle},d);case Mi.REQUEST_ERROR:return m.a.createElement(R.a,{style:U.b.red.bodyS.regularItalic},"There was an error processing your request. Please try again later","\n"," or contact Wilson Parking Support.");default:return m.a.createElement(m.a.Fragment,null)}}),[l]),S=Object(h.useMemo)((function(){switch(l){case Mi.REQUEST_ERROR:case Mi.REQUESTING_CONFIRMATION:return[{text:"Cancel",theme:wi({},Be.BUTTON_THEME_CANCEL,{textStyle:U.b.red.bodyM.bold,minWidth:"auto",borderColor:U.a.red,paddingHorizontal:U.d.doubleBaseMargin}),onPress:A},{text:"Confirm",theme:wi({},Be.BUTTON_THEME_FIXED_RED,{textStyle:U.b.white.bodyM.bold,minWidth:"auto"}),onPress:b}];case Mi.PROCESSING_COMPLETE:return[{text:"Ok",theme:wi({},Be.BUTTON_THEME_FIXED_RED,{textStyle:U.b.white.bodyM.bold,minWidth:"auto"}),onPress:function(){c(Mi.NOT_OPEN),e.refresh(e.prod)}}];default:return[]}}),[l]),k=Object(h.useMemo)((function(){return l!==Mi.NOT_OPEN}),[l]);return Wo((function(){return k}),[k]),m.a.createElement(je.Group,null,m.a.createElement(y.a,{style:{flex:1,justifyContent:"space-between",flexDirection:"row"}},m.a.createElement(pr.Label,{data:{text:"User Payment Lock"},theme:pr.LABEL_THEME_TITLE}),m.a.createElement(Re.a.SpacerDouble,null),m.a.createElement(Be.Button,{text:"Unlock User",theme:wi({},Be.BUTTON_THEME_FIXED_RED,{textStyle:U.b.white.bodyM.bold,minWidth:"auto"}),disabled:0==(null==(n=e.userDetails)?void 0:n.banStatus)||void 0,onPress:f})),m.a.createElement(Re.a.Spacer,null),m.a.createElement(R.a,{style:U.b.grey.bodyS.regularItalic},"All data shown is from the last 30 days."),m.a.createElement(Re.a.SpacerDouble,null),m.a.createElement(Vi,null),m.a.createElement(Re.a.Spacer,null),m.a.createElement(ji,{userDetails:e.userDetails}),m.a.createElement(Re.a.SpacerDouble,null),(null==(a=e.userDetails)?void 0:a.paymentUpdates)&&e.userDetails.paymentUpdates.length>0&&m.a.createElement(m.a.Fragment,null,m.a.createElement(Bi,null),m.a.createElement(Re.a.Spacer,null),m.a.createElement(Ii,{userDetails:e.userDetails})),k&&m.a.createElement(Ea.c,{onClose:A,show:k,title:E,buttons:S,theme:xi},v))}!function(e){e[e.NOT_OPEN=0]="NOT_OPEN",e[e.REQUESTING_CONFIRMATION=1]="REQUESTING_CONFIRMATION",e[e.PROCESSING=2]="PROCESSING",e[e.PROCESSING_COMPLETE=3]="PROCESSING_COMPLETE",e[e.REQUEST_ERROR=4]="REQUEST_ERROR"}(Mi||(Mi={}));var Ji=function(e){var t,r,n=e.userPlate,a=e.row;return m.a.createElement(y.a,null,m.a.createElement(y.a,{style:[ti.row,{backgroundColor:(t=a,r=Hr.DATA_TABLE_THEME_DEFAULT,t%2===0?r.secondaryColor:r.primaryColor)}]},m.a.createElement(y.a,{style:ti.cell},m.a.createElement(Zo,{style:ti.bodyText},n.plate)),m.a.createElement(y.a,{style:ti.cell},m.a.createElement(Zo,{style:ti.bodyText},n.state)),m.a.createElement(y.a,{style:ti.cell},m.a.createElement(Zo,{style:ti.bodyText},n.lprEnabled?"Y":"N")),m.a.createElement(y.a,{style:ti.cell},m.a.createElement(Zo,{style:ti.bodyText},n.conflict?"Y":"N")),m.a.createElement(y.a,{style:ti.cell},m.a.createElement(Zo,{style:ti.bodyText},n.lprVerified?"Y":"N"))))},Li=function(e){var t=e.data;return m.a.createElement(m.a.Fragment,null,t&&m.a.createElement(y.a,null,m.a.createElement(y.a,{style:ti.header},m.a.createElement(y.a,{style:{flex:1}},m.a.createElement(R.a,{style:ti.headerText},"Plate")),m.a.createElement(y.a,{style:{flex:1}},m.a.createElement(R.a,{style:ti.headerText},"State")),m.a.createElement(y.a,{style:{flex:1}},m.a.createElement(R.a,{style:ti.headerText},"LprEnabled")),m.a.createElement(y.a,{style:{flex:1}},m.a.createElement(R.a,{style:ti.headerText},"Conflict")),m.a.createElement(y.a,{style:{flex:1}},m.a.createElement(R.a,{style:ti.headerText},"LprVerified"))),t.map((function(e,t){return m.a.createElement(Ji,{key:t,userPlate:e,row:t})}))))},Fi=function(e){var t=Object(h.useState)(void 0),r=Pn()(t,2),n=r[0],a=r[1];return Object(h.useEffect)((function(){if(!n){var t=e.useProd,r=e.userEmail;wo.getUserPlates(t,r).then((function(e){a(e)}))}})),m.a.createElement(Re.a.Screen,{paddingVertical:z.d.quadBaseMargin,paddingHorizontal:z.d.eightBaseMargin},m.a.createElement(Me.a,{style:{position:"absolute",top:z.d.doubleBaseMargin,left:z.d.doubleBaseMargin},onPress:e.back},m.a.createElement(G.a,{source:z.c.arrowLeft,style:{width:z.d.icons.medium,height:z.d.icons.medium,tintColor:z.a.grey}})),m.a.createElement(pr.Label,{data:{text:"User Plates"},theme:pr.LABEL_THEME_TITLE}),n&&m.a.createElement(Li,{data:n}))};function Wi(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Hi(e){for(var t=1;t0&&a(Xi.REQUESTING_CONFIRMATION)}),[e.userId]),d=Object(h.useCallback)((function(){a(Xi.PROCESSING),wo.resendWhitelist(e.prod,e.userId,l).then((function(){return a(Xi.PROCESSING_COMPLETE)})).catch((function(){return a(Xi.REQUEST_ERROR)}))}),[e.userId,e.prod,l]),p=Object(h.useCallback)((function(){a(Xi.NOT_OPEN),c(!1)}),[]),f=Object(h.useMemo)((function(){switch(n){case Xi.REQUESTING_CONFIRMATION:return"Re-send whitelist requests?";case Xi.PROCESSING:return"Sending ...";case Xi.REQUEST_ERROR:return"Something went wrong";case Xi.PROCESSING_COMPLETE:return"Whitelist update enqueued";default:return""}}),[n]),A=Object(h.useMemo)((function(){switch(n){case Xi.REQUESTING_CONFIRMATION:return m.a.createElement(m.a.Fragment,null,m.a.createElement(R.a,null,"This will re-send the whitelist requests for ",m.a.createElement(R.a,{style:U.b.black.bodyS.bold},e.userId),"."),m.a.createElement(Re.a.SpacerDouble,null),m.a.createElement(rn.CheckBox,{theme:rn.CHECK_BOX_THEME_NO_BORDER,checked:l,text:"Force re-send (bypass duplicate-skip check)",onPress:c}));case Xi.PROCESSING:return m.a.createElement(m.a.Fragment,null,m.a.createElement(R.a,null,"Sending whitelist update, please wait..."),m.a.createElement(y.a,{style:{flex:1,justifyContent:"center",width:"100%"}},m.a.createElement(Re.a.SpacerDouble,null),m.a.createElement(g.a,{color:U.a.red})));case Xi.PROCESSING_COMPLETE:return m.a.createElement(R.a,{style:qi.messageStyle},"The whitelist update has been enqueued and will be processed shortly.");case Xi.REQUEST_ERROR:return m.a.createElement(R.a,{style:U.b.red.bodyS.regularItalic},"There was an error processing your request. Please try again later","\n"," or contact Wilson Parking Support.");default:return m.a.createElement(m.a.Fragment,null)}}),[n,l,e.userId]),E=Object(h.useMemo)((function(){switch(n){case Xi.REQUEST_ERROR:case Xi.REQUESTING_CONFIRMATION:return[{text:"Cancel",theme:Ki({},Be.BUTTON_THEME_CANCEL,{textStyle:U.b.red.bodyM.bold,minWidth:"auto",borderColor:U.a.red,paddingHorizontal:U.d.doubleBaseMargin}),onPress:p},{text:"Confirm",theme:Ki({},Be.BUTTON_THEME_FIXED_RED,{textStyle:U.b.white.bodyM.bold,minWidth:"auto"}),onPress:d}];case Xi.PROCESSING_COMPLETE:return[{text:"Ok",theme:Ki({},Be.BUTTON_THEME_FIXED_RED,{textStyle:U.b.white.bodyM.bold,minWidth:"auto"}),onPress:p}];default:return[]}}),[n,p,d]),v=Object(h.useMemo)((function(){return n!==Xi.NOT_OPEN}),[n]);return Wo((function(){return v}),[v]),s?m.a.createElement(m.a.Fragment,null,m.a.createElement(Be.Button,{text:"Re-send Whitelist Requests",theme:Ki({},Be.BUTTON_THEME_FIXED_RED,{textStyle:U.b.white.bodyM.bold,minWidth:"auto"}),onPress:u}),v&&m.a.createElement(Ea.c,{onClose:p,show:v,title:f,buttons:E,theme:qi},A)):null}!function(e){e[e.NOT_OPEN=0]="NOT_OPEN",e[e.REQUESTING_CONFIRMATION=1]="REQUESTING_CONFIRMATION",e[e.PROCESSING=2]="PROCESSING",e[e.PROCESSING_COMPLETE=3]="PROCESSING_COMPLETE",e[e.REQUEST_ERROR=4]="REQUEST_ERROR"}(Xi||(Xi={}));var $i=function(e){var t=Object(h.useState)(void 0),r=Pn()(t,2),n=r[0],a=r[1];return Object(h.useEffect)((function(){if(!n){var t=e.useProd,r=e.userEmail;wo.getUserWhitelist(t,r).then((function(e){a(e)}))}})),m.a.createElement(Re.a.Screen,{paddingVertical:z.d.quadBaseMargin,paddingHorizontal:z.d.eightBaseMargin},m.a.createElement(Me.a,{style:{position:"absolute",top:z.d.doubleBaseMargin,left:z.d.doubleBaseMargin},onPress:e.back},m.a.createElement(G.a,{source:z.c.arrowLeft,style:{width:z.d.icons.medium,height:z.d.icons.medium,tintColor:z.a.grey}})),m.a.createElement(y.a,{style:{flexDirection:"row",justifyContent:"space-between",alignItems:"center"}},m.a.createElement(pr.Label,{data:{text:"Whitelist Requests"},theme:pr.LABEL_THEME_TITLE}),m.a.createElement(_i,{userId:e.userId,prod:e.useProd})),n&&m.a.createElement(zi,{data:n}))};function el(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function tl(e){for(var t=1;t=e.length?{done:!0}:{done:!1,value:e[t++]}};throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}return(t=e["function"===typeof Symbol?Symbol.iterator:"@@iterator"]()).next.bind(t)}function nl(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r0&&(j(!0),Ie(e).then((function(){return S.a.async((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,S.a.awrap(new Promise((function(e){return setTimeout(e,1e3)})));case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),null,null,null,Promise)})).then((function(){return p(!0)})).finally((function(){return j(!1)})))}),[n]);Object(h.useEffect)((function(){Mo.adminGetProducts(N).then((function(e){G(e)}))}),[N]),Object(h.useEffect)((function(){Fo.a.adminGetPaymentDetailUpdates(n,N).then((function(e){se(e)}))}),[N]),Object(h.useEffect)((function(){Lo().toPromise().then((function(e){W(e)}))}),[N]);var Je=Object(h.useMemo)((function(){var e=[];if(null!=Q)for(var t,r=function(t){var r=null==F?void 0:F.find((function(e){return e.AXCarparkID===t.carParks[0]}));null!=r&&e.push({product:t,site:r})},n=rl(Q);!(t=n()).done;){r(t.value)}return e}),[Q,F]),Le=Object(h.useMemo)((function(){var e=[{label:"",value:void 0}],t=Je.filter((function(e){return e})).map((function(e){return{label:"("+e.site.AXCarparkID+") "+e.site.Name+" - "+e.product.count+" Daily Passes",value:e}}));return t.sort((function(e,t){return e.label.localeCompare(t.label)})),e=e.concat(t)}),[Q,F]);return m.a.createElement(m.a.Fragment,null,m.a.createElement(Re.a.Screen,null,!1,m.a.createElement(pr.Label,{data:{text:"Search for a user account by email address"},theme:pr.LABEL_THEME_LIGHT}),m.a.createElement(Re.a.Spacer,null),m.a.createElement(y.a,{style:{flexDirection:"row"}},m.a.createElement(xe.a,{style:{minWidth:28*z.d.baseMargin,height:4*z.d.baseMargin,borderWidth:1,borderColor:z.a.lightGrey,borderRadius:z.d.borderRadius,padding:z.d.baseMargin},value:n,onChangeText:a,onSubmitEditing:function(){return Ne(N)},placeholder:"name@email.com"}),m.a.createElement(Re.a.SpacerDouble,null),m.a.createElement(Be.Button,{text:"Search",theme:tl({},Be.BUTTON_THEME_FIXED_RED,{textStyle:z.b.white.bodyM.bold,minWidth:"auto"}),onPress:function(){return Ne(N)},fetching:De})),ye&&m.a.createElement($i,{back:function(){ge(!1)},userEmail:n,userId:null!=(e=null==X?void 0:X.userId)?e:"",useProd:N}),Ee&&m.a.createElement(Fi,{back:function(){ve(!1)},userEmail:n,useProd:N}),Te&&m.a.createElement(pi,{back:function(){Oe(!1)},userEmail:n,useProd:N}),!Te&&!ye&&!Ee&&m.a.createElement(m.a.Fragment,null,T&&m.a.createElement(m.a.Fragment,null,m.a.createElement(Re.a.SpacerDouble,null),m.a.createElement(R.a,{style:z.b.black.bodyM.bold},"An error has occured"),m.a.createElement(R.a,{style:z.b.red.bodyS.bold},"Error: ",A)),!T&&m.a.createElement(m.a.Fragment,null,!D&&d&&!V&&m.a.createElement(m.a.Fragment,null,m.a.createElement(Re.a.SpacerDouble,null),m.a.createElement(R.a,{style:z.b.black.bodyM.bold},"Not Displaying?"),m.a.createElement(R.a,{style:z.b.red.bodyS.bold},"\u2022 The email is invalid."),m.a.createElement(R.a,{style:z.b.red.bodyS.bold},"\u2022 The email has no valid user account.")),d&&D&&m.a.createElement(m.a.Fragment,null,m.a.createElement(Re.a.SpacerDouble,null),m.a.createElement(je.Group,null,m.a.createElement(y.a,{style:{flex:1,justifyContent:"space-between",flexDirection:"row"}},m.a.createElement(pr.Label,{data:{text:"Active User Bundles"},theme:pr.LABEL_THEME_TITLE}),m.a.createElement(Be.Button,{text:"Add New",theme:tl({},Be.BUTTON_THEME_FIXED_BLUE,{textStyle:z.b.white.bodyM.bold,minWidth:"auto"}),disabled:!Ue,onPress:function(e){return c({type:"for_adding_bundle",bundle:e,action:Ve})}})),m.a.createElement(Re.a.SpacerDouble,null),m.a.createElement(Si,{bundleData:ee,numBundlesToShow:5,userEmail:n,onTrashPressed:function(e){return c({type:"for_trashing",bundle:e,action:we})},onToolsPressed:function(e){return c({type:"for_tools",bundle:e,action:Pe})},onAddCodePressed:function(e){return c({type:"for_adding_code",bundle:e,action:Me})},onSearchPressed:function(){return Ne(N)},actionsDisabled:!1}))),d&&!Ce&&m.a.createElement(m.a.Fragment,null,m.a.createElement(Re.a.SpacerDouble,null),m.a.createElement(je.Group,null,m.a.createElement(pr.Label,{data:{text:"Inactive User Bundles"},theme:pr.LABEL_THEME_TITLE}),m.a.createElement(Re.a.SpacerDouble,null),m.a.createElement(Si,{bundleData:ae,numBundlesToShow:5,userEmail:n,onTrashPressed:function(){return c(void 0)},onToolsPressed:function(){return c(void 0)},onAddCodePressed:function(e){return c({type:"for_adding_code",bundle:e,action:Me})},onSearchPressed:function(){return Ne(N)},actionsDisabled:!0}))),X&&m.a.createElement(m.a.Fragment,null,m.a.createElement(Re.a.SpacerDouble,null),m.a.createElement(je.Group,null,m.a.createElement(pr.Label,{data:{text:"Elevate user"},theme:pr.LABEL_THEME_TITLE}),m.a.createElement(Re.a.SpacerDouble,null),m.a.createElement(Di,{user:X}),m.a.createElement(Re.a.SpacerDouble,null),m.a.createElement(y.a,{style:{flexDirection:"row"}},m.a.createElement(Be.Button,{text:"View App Sessions",onPress:function(){Oe(!0)}}),m.a.createElement(Re.a.SpacerDouble,null),m.a.createElement(Be.Button,{text:"View Whitelist Requests",onPress:function(){ge(!0)}}),m.a.createElement(Re.a.SpacerDouble,null),m.a.createElement(Be.Button,{text:"View User Plates",onPress:function(){ve(!0)}})))),l&&m.a.createElement(yi,{bundleAlert:l,closeHandler:function(){c(void 0),fe(void 0)},filterItems:Le,fetching:V,error:pe}),Ue&&D&&d&&m.a.createElement(m.a.Fragment,null,m.a.createElement(Re.a.SpacerDouble,null),m.a.createElement(Ni,{userDetails:ce,prod:N,refresh:function(){return Ne(N)}}),m.a.createElement(Re.a.SpacerDouble,null),m.a.createElement(Ui,{userEmail:n,prod:N,refresh:function(){return Ne(N)}}))))))}var il=r(131),ll=r(19);function cl(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function sl(e){for(var t=1;t=e.length?{done:!0}:{done:!1,value:e[t++]}};throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}return(t=e["function"===typeof Symbol?Symbol.iterator:"@@iterator"]()).next.bind(t)}function bl(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r0&&e.price>0&&""!=e.description)}function Sl(e){if(null==e.input)return!0;var t=e.input,r=t.description,n=t.count,a=t.price;if(""===r.trim())return!1;var o=parseInt(n,10);if(isNaN(o))return!1;var i=parseFloat(a.replace("$","").trim());return!isNaN(i)}function kl(e){return null!=e.input}function Tl(e){if(kl(e)){var t=parseInt(e.input.count,10),r=parseFloat(e.input.price.replace("$","").trim());return isNaN(t)||isNaN(r)?"":Object(W.c)(t*r,W.a.Dollars)}return Object(W.c)(e.count*e.price,W.a.Dollars)}var Ol={description:"",count:"",price:""};function Rl(e,t){return t.includes(e.state)}function Cl(e){if(kl(e))return z.a.lightGrey;if(!vl(e))return z.a.orange;switch(e.state){case"added":return z.a.green;case"removed":return z.a.red;case"modified":return z.a.yellow;default:return z.a.pageBackground}}var Ul=function(e){var t=e.actionsDisabled?.5:1;return m.a.createElement(Me.a,{disabled:e.actionsDisabled,onPress:e.onPress},m.a.createElement(G.a,{source:e.icon,style:{width:z.d.icons.small,height:z.d.icons.small,tintColor:e.color,opacity:t}}))};function Dl(){return m.a.createElement(y.a,{style:{width:"100%",height:1,backgroundColor:z.a.border}})}function Pl(e){var t,r,n,a,o,i,l=Object(b.d)(oo),c=Object(h.useCallback)((function(){var t,r=null==(t=e.product).input?yl({},t,{input:{description:t.description,count:""+t.count,price:Object(W.c)(t.price,W.a.Dollars)}}):yl({},t);e.onProductChange(r)}),[e.product,e.onProductChange]),s=Object(h.useCallback)((function(){e.onProductReverted()}),[e.onProductReverted]),u=Object(h.useCallback)((function(){e.onProductRemoved()}),[e.onProductRemoved]),d=Object(h.useCallback)((function(){var t=function(e){if(null==e.input)return e;var t=e.input,r=t.description,n=t.count,a=t.price,o=parseInt(n,10),i=parseFloat(a.replace("$","").trim());return Object(il.a)(e,(function(e){e.description=r,e.count=o,e.price=i,e.gst=.1*e.price,e.input=void 0}))}(e.product);e.onProductChange(t)}),[e.product,e.onProductChange]),p=Object(h.useCallback)((function(){var t,r=(t=e.product,Object(il.a)(t,(function(e){e.input=void 0})));e.onProductChange(r)}),[e.product,e.onProductChange]),f=Object(h.useCallback)((function(t){var r=Object(il.a)(e.product,(function(e){e.input.count=t}));e.onProductChange(r)}),[e.product,e.onProductChange]),g=Object(h.useCallback)((function(t){var r=Object(il.a)(e.product,(function(e){e.input.description=t}));e.onProductChange(r)}),[e.product,e.onProductChange]),A=Object(h.useCallback)((function(t){var r=Object(il.a)(e.product,(function(e){e.input.price=t}));e.onProductChange(r)}),[e.product,e.onProductChange]),E=kl(e.product),v=e.product.carParks[0],S=null!=(t=null==(r=e.product.input)?void 0:r.count)?t:""+e.product.count,k=null!=(n=null==(a=e.product.input)?void 0:a.description)?n:e.product.description,T=null!=(o=null==(i=e.product.input)?void 0:i.price)?o:Object(W.c)(e.product.price,W.a.Dollars);return m.a.createElement(y.a,null,m.a.createElement(y.a,{style:{backgroundColor:Cl(e.product),flexDirection:"row",height:z.d.tripleBaseMargin,alignItems:"center"}},m.a.createElement(y.a,{style:{flex:2}},m.a.createElement(ul,{contents:v,rowWidth:50,editable:!1})),m.a.createElement(Re.a.SpacerDouble,null),m.a.createElement(y.a,{style:{flex:2,flexDirection:"row-reverse"}},m.a.createElement(ul,{contents:S,rowWidth:50,editable:E,onValueChange:f,textAlign:"right"})),m.a.createElement(Re.a.SpacerDouble,null),m.a.createElement(y.a,{style:{flex:2}},m.a.createElement(ul,{contents:k,rowWidth:100,editable:E,onValueChange:g})),m.a.createElement(Re.a.SpacerDouble,null),m.a.createElement(y.a,{style:{flex:2,flexDirection:"row-reverse"}},m.a.createElement(ul,{contents:T,rowWidth:50,editable:E,onValueChange:A,textAlign:"right"})),m.a.createElement(Re.a.SpacerDouble,null),m.a.createElement(y.a,{style:{flex:2,flexDirection:"row-reverse",alignItems:"center"}},m.a.createElement(ul,{contents:Tl(e.product),editable:!1,textAlign:"right"})),m.a.createElement(Re.a.SpacerDouble,null),m.a.createElement(y.a,{style:{flex:6,flexDirection:"row",alignItems:"center"}},m.a.createElement(Re.a.FlexSpacer,null),l&&m.a.createElement(wl,{product:e.product,disabled:e.actionsDisabled,onConfirmPress:d,onCancelPress:p,onDeletePress:u,onEditPress:c,onUndoPress:s}))),m.a.createElement(Dl,null))}function wl(e){var t,r=[];if(kl(e.product)){var n=Sl(e.product);r.push(m.a.createElement(Ul,{key:"confirm",onPress:e.onConfirmPress,icon:z.c.check,color:z.a.highlight,actionsDisabled:!n})),r.push(m.a.createElement(Ul,{key:"cancel",onPress:e.onCancelPress,icon:z.c.cross,color:z.a.red,actionsDisabled:!1}))}else{var a="removed"!==e.product.state,o=Rl(e.product,["added","unmodified"]),i=Rl(e.product,["modified","removed"]);t=function(e){if(!vl(e))return"Invalid";switch(e.state){case"added":return"Added";case"modified":return"Modified";case"removed":return"Removed"}}(e.product),a&&r.push(m.a.createElement(Ul,{key:"edit",onPress:e.onEditPress,icon:z.c.edit,color:z.a.highlight,actionsDisabled:e.disabled})),o&&r.push(m.a.createElement(Ul,{key:"delete",onPress:e.onDeletePress,icon:z.c.trash,color:z.a.red,actionsDisabled:e.disabled})),i&&r.push(m.a.createElement(Ul,{key:"undo",onPress:e.onUndoPress,icon:z.c.undo,color:z.a.orange,actionsDisabled:e.disabled}))}return r.length<2&&(r.push(m.a.createElement(y.a,{style:{width:z.d.icons.small}})),r.reverse()),m.a.createElement(y.a,{style:{flexDirection:"row",alignItems:"center"}},null!=t&&m.a.createElement(m.a.Fragment,null,m.a.createElement(R.a,{style:U.b.black.bodyXS.boldItalic},t),m.a.createElement(Re.a.Spacer,null)),r)}function Ml(){var e=Object(b.d)(oo);return m.a.createElement(y.a,null,m.a.createElement(y.a,{style:{height:z.d.tripleBaseMargin,backgroundColor:z.a.pageBackground,flexDirection:"row",alignItems:"center"}},m.a.createElement(y.a,{style:{flex:2}},m.a.createElement(R.a,{style:z.b.black.bodyS.bold},"Site ID")),m.a.createElement(Re.a.SpacerDouble,null),m.a.createElement(y.a,{style:{flex:2,flexDirection:"row-reverse"}},m.a.createElement(R.a,{style:z.b.black.bodyS.bold},"Count")),m.a.createElement(Re.a.SpacerDouble,null),m.a.createElement(y.a,{style:{flex:2}},m.a.createElement(R.a,{style:z.b.black.bodyS.bold},"Description")),m.a.createElement(Re.a.SpacerDouble,null),m.a.createElement(y.a,{style:{flex:2,flexDirection:"row-reverse"}},m.a.createElement(R.a,{style:z.b.black.bodyS.bold},"Price")),m.a.createElement(Re.a.SpacerDouble,null),m.a.createElement(y.a,{style:{flex:2,flexDirection:"row-reverse"}},m.a.createElement(R.a,{style:z.b.black.bodyS.bold},"Total Price")),m.a.createElement(Re.a.SpacerDouble,null),m.a.createElement(y.a,{style:{flex:6,flexDirection:"row-reverse"}},e&&m.a.createElement(R.a,{style:z.b.black.bodyS.bold},"Actions"))),m.a.createElement(Dl,null))}function xl(e){return 0===e.products.length?m.a.createElement(R.a,{style:z.b.grey.bodyS.regularItalic},"No bundles found."):m.a.createElement(m.a.Fragment,null,m.a.createElement(Ml,null),e.products.map((function(t){return m.a.createElement(Pl,{key:t.id,product:t,onProductChange:function(t){return e.onProductChange(t)},onProductReverted:function(){return e.onProductReverted(t)},onProductRemoved:function(){return e.onProductRemoved(t)},actionsDisabled:e.actionsDisabled})})))}function Vl(e){var t=0;if("undefined"===typeof Symbol||null==e["function"===typeof Symbol?Symbol.iterator:"@@iterator"]){if(Array.isArray(e)||(e=function(e,t){if(!e)return;if("string"===typeof e)return jl(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return jl(e,t)}(e)))return function(){return t>=e.length?{done:!0}:{done:!1,value:e[t++]}};throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}return(t=e["function"===typeof Symbol?Symbol.iterator:"@@iterator"]()).next.bind(t)}function jl(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r0;return m.a.createElement(C.a,{style:{flex:1},contentContainerStyle:{paddingVertical:z.d.quadBaseMargin,paddingHorizontal:z.d.eightBaseMargin},showsVerticalScrollIndicator:!1},m.a.createElement(R.a,{style:[z.b.black.bodyL.bold,{marginBottom:z.d.doubleBaseMargin}]},"Task Admin"),m.a.createElement(je.Group,null,m.a.createElement(R.a,{style:[z.b.black.bodyM.bold,{marginBottom:z.d.baseMargin}]},"One-off tasks"),m.a.createElement(R.a,{style:[z.b.black.bodyS.regular,{color:z.a.grey,marginBottom:z.d.doubleBaseMargin}]},"Run these tasks in the background. They may take a while to complete."),m.a.createElement(y.a,{style:{flexDirection:"row",flexWrap:"wrap"}},m.a.createElement(y.a,{style:{marginRight:z.d.baseMargin,marginBottom:z.d.baseMargin}},m.a.createElement(Be.Button,{text:"Run subscription sync",theme:Gl({},Be.BUTTON_THEME_FIXED_BLUE,{textStyle:z.b.white.bodyM.bold,minWidth:"auto"}),onPress:function(){a(void 0),p(!0),wo.runSubscriptionSync(e.useProd).then((function(e){var t;return a(null!=(t=null==e?void 0:e.message)?t:"Sync started.")})).catch((function(e){var t;return a(null!=(t=null==e?void 0:e.message)?t:"Request failed.")})).finally((function(){return p(!1)}))},fetching:d})),m.a.createElement(y.a,{style:{marginBottom:z.d.baseMargin}},m.a.createElement(Be.Button,{text:"Run ePark retry task",theme:Gl({},Be.BUTTON_THEME_FIXED_BLUE,{textStyle:z.b.white.bodyM.bold,minWidth:"auto"}),onPress:function(){c(void 0),A(!0),wo.runRetryTask(e.useProd).then((function(e){var t;return c(null!=(t=null==e?void 0:e.message)?t:"Retry task started.")})).catch((function(e){var t;return c(null!=(t=null==e?void 0:e.message)?t:"Request failed.")})).finally((function(){return A(!1)}))},fetching:b}))),n?m.a.createElement(R.a,{style:[z.b.black.bodyS.regular,{marginTop:z.d.baseMargin,color:z.a.grey}]},"Subscription sync: ",n):null,l?m.a.createElement(R.a,{style:[z.b.black.bodyS.regular,{marginTop:z.d.baseMargin,color:z.a.grey}]},"Retry task: ",l):null),m.a.createElement(Re.a.SpacerDouble,null),m.a.createElement(je.Group,null,m.a.createElement(R.a,{style:[z.b.black.bodyM.bold,{marginBottom:z.d.baseMargin}]},"Feature flags"),m.a.createElement(R.a,{style:[z.b.black.bodyS.regular,{color:z.a.grey,marginBottom:z.d.doubleBaseMargin}]},"Toggle flags below. Changes are not sent until you tap Save."),U?m.a.createElement(R.a,{style:[z.b.black.bodyS.regular,{color:z.a.grey}]},"Loading\u2026"):M?m.a.createElement(R.a,{style:[z.b.black.bodyS.regular,{color:z.a.red}]},M):S&&S.length>0?m.a.createElement(m.a.Fragment,null,m.a.createElement(y.a,{style:{marginBottom:z.d.doubleBaseMargin}},S.map((function(e){var t,r,n=null!=(t=e.name)?t:"",a=zl(e.value)||zl(B[n]),o=function(e){var t,r,n;return null!=(t=null!=(r=B[null!=(n=e.name)?n:""])?r:e.value)?t:""}(e),i=!!a&&"true"===(null!=(r=o)?r:"").toLowerCase();return m.a.createElement(y.a,{key:n,style:{flexDirection:"row",alignItems:"center",paddingVertical:z.d.baseMargin,borderBottomWidth:1,borderBottomColor:z.a.border}},m.a.createElement(y.a,{style:{flex:1}},m.a.createElement(R.a,{style:[z.b.black.bodyM.regular]},n),e.description?m.a.createElement(R.a,{style:[z.b.black.bodyS.regular,{color:z.a.grey,marginTop:2}]},e.description):null),a?m.a.createElement(Zl.a,{value:i,onValueChange:function(e){return function(e,t){var r,n=null==S?void 0:S.find((function(t){return t.name===e})),a=null!=(r=null==n?void 0:n.value)?r:"";I((function(r){var n=Gl({},r);return t===a?delete n[e]:n[e]=t,n})),Q(void 0)}(n,e?"true":"false")},trackColor:{false:z.a.lightGrey,true:z.a.blue},thumbColor:z.a.white}):m.a.createElement(R.a,{style:[z.b.black.bodyS.regular,{color:z.a.grey}]},o||"\u2014"))}))),m.a.createElement(y.a,{style:{flexDirection:"row",alignItems:"center",marginTop:z.d.baseMargin}},m.a.createElement(Be.Button,{text:"Save",theme:Gl({},Be.BUTTON_THEME_FIXED_RED,{textStyle:z.b.white.bodyM.bold,minWidth:"auto"}),onPress:function(){if(Y){Q(void 0),F(!0);var t=Object.entries(B).map((function(t){var r=Pn()(t,2),n=r[0],a=r[1];return wo.setFeatureFlag(e.useProd,n,a)}));Promise.all(t).then((function(){Q("Feature flags saved."),I({}),G()})).catch((function(e){var t;return Q(null!=(t=null==e?void 0:e.message)?t:"Save failed.")})).finally((function(){return F(!1)}))}},fetching:L,disabled:!Y}),m.a.createElement(y.a,{style:{marginLeft:z.d.baseMargin}},Z?m.a.createElement(R.a,{style:[z.b.black.bodyS.regular,{color:Z.includes("failed")?z.a.red:z.a.green}]},Z):null))):m.a.createElement(R.a,{style:[z.b.black.bodyS.regular,{color:z.a.grey}]},"No feature flags defined.")))};function Kl(e){var t=0;if("undefined"===typeof Symbol||null==e["function"===typeof Symbol?Symbol.iterator:"@@iterator"]){if(Array.isArray(e)||(e=function(e,t){if(!e)return;if("string"===typeof e)return Xl(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Xl(e,t)}(e)))return function(){return t>=e.length?{done:!0}:{done:!1,value:e[t++]}};throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}return(t=e["function"===typeof Symbol?Symbol.iterator:"@@iterator"]()).next.bind(t)}function Xl(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r60&&(o=!0),window.history.pushState({},"",$l(n.selected))),o&&S.a.async((function(e){for(;;)switch(e.prev=e.next){case 0:j.default.tableDataRequest({database:M.b.dataService.database,collection:"user_event_stream",operation:"aggregate",query:{options:{allowDiskUse:!0},pipeline:[Se.d({start:J.a.utc().subtract(7,"day"),end:J.a.utc().add(1,"day")},"datetime"),Se.g({field:"datetime"}),Se.e({limit:1}),Se.f({outputs:["datetime"]})]}}).then((function(e){var t=e.length>0?e[0].datetime:void 0,r=J()().toISOString(),n="Last Imported: "+F.c(t,r);A.b.dispatch(V.DataActions.setLastImported({datetime:t,datetimeChecked:r,label:n}))})).catch((function(e){A.b.dispatch(x.a.setError({title:"Error",message:e.message}))}));case 1:case"end":return e.stop()}}),null,null,null,Promise);case 8:case"end":return t.stop()}}),null,this,null,Promise)}},{key:"render",value:function(){var e=this.props.global,t=e.fontsLoading,r=e.globalMessage,n=this.props.user,a=n.firebaseLoading,o=n.userDetails;return t||a?m.a.createElement(y.a,{style:[tc.container,{alignItems:"center",justifyContent:"center"}]},m.a.createElement(g.a,{size:"large",color:U.a.grey})):o?m.a.createElement(y.a,{style:tc.container},m.a.createElement(y.a,{style:{flex:1,flexDirection:"row"}},m.a.createElement(Pe.SideMenu,{title:Ne.b.name,logo:U.c.logo,menuItems:this._menuItems,version:Ne.b.version,user:this.props.user.userDetails}),m.a.createElement(y.a,{style:{flex:1}},m.a.createElement(Te.ScreenHeader,null,m.a.createElement(De,null),m.a.createElement(Re.a.SpacerDouble,null)),m.a.createElement(C.a,{key:this.props.menu.selected,style:{width:"100%"},showsVerticalScrollIndicator:U.d.isWeb,contentContainerStyle:{height:U.d.isWeb?"100%":void 0,flexGrow:U.d.isWeb?void 0:1}},this.renderSelectedPage()))),m.a.createElement(we.GlobalDialog,{globalMessage:r})):m.a.createElement(y.a,{style:tc.container},m.a.createElement(We,null),m.a.createElement(we.GlobalDialog,{globalMessage:r}))}}]),n}(m.a.Component),tc=O.a.create({container:{position:"absolute",left:0,right:0,top:0,bottom:0,backgroundColor:U.a.pageBackground}}),rc=Object(b.b)((function(e){return{global:e.global,menu:e.menu,timeZone:e.timeZone,user:e.user,data:e.data}}))(ec);function nc(e){var t=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=d()(e);if(t){var a=d()(this).constructor;r=Reflect.construct(n,arguments,a)}else r=n.apply(this,arguments);return s()(this,r)}}var ac=function(e){f()(r,e);var t=nc(r);function r(){var e;o()(this,r);for(var n=arguments.length,a=new Array(n),i=0;i\n\nKassandra\n\n\n\n\n
\n

Vision

\n

Kassandra enables businesses to explore and gain insights from the data collected by their apps and web services, through interactive dashboards and ML-powered predictive modelling.

\n

Description

\n

Kassandra is a toolkit of services and API\'s that enables the creation of insightful interactive dashboards for consumption through a web portal and mobile devices.

\n

The target audience for Kassandra is a business with large volumes of analytics data stored in a data lake or repository. Kassandra integrates with the data lake to extract and process meaningful information from the collected analytics. The data is stored in a readily queryable format, and is made available to companion services for visualisation and prediction through web and mobile dashboards.

\n

Components

\n

\n

Kassandra Data Service and API

\n

The Kassandra Data Service (KDS) provides a datastore that sits between a business\'s data lake and dashboard services. Through a simple and flexible integration API, users can create their own data mining methods and store them in the data service for visualisation and further processing by other Kassandra services.

\n

Every client has their own dedicated database within KDS, isolated from other clients and secured with user-level controls applied.

\n

Kassandra Visualisation SDK

\n

Kassandra provides a Visualisation SDK (KVS) for building web and mobile dashboards in React Native. Using KVS, a developer can easily produce a live dashboard simply by laying out supplied components and binding them to their Kassandra Data Service account.

\n

KVS includes a comprehensive set of interactive components for visualising data sourced from the Kassandra Data service.

\n

Visualisation Components

\n
    \n
  • Line graphs
  • \n
  • Bar graphs
  • \n
  • Pie charts
  • \n
  • Timeline scrubbers
  • \n
  • Geo maps with specialised data and tilemap overlays
  • \n
  • Tables
  • \n
\n

KVS can be integrated into React Native apps, Expo online apps and React Native Web apps.

\n

Kassandra Forecast Service

\n

The Kassandra Forecast Service (KFS) leverages AWS Forecast to produce timeline data series predictions on data stored in KDS. KFS can be configured to periodically update the predictions on an ongoing basis. Prediction data is saved in KDS where it can be consumed by other Kassandra services.

\n

Kassandra Admin Console

\n

The Kassandra Admin Console is a planned future service, that will enable users to manage their Kassandra services, users and subscriptions through a user friendly web console.

\n

Market differentiators

\n
    \n
  • High quality interactive visualisations
  • \n
  • Native to mobile and web
  • \n
  • Tight prebuilt integrations between data lake, data and client layers - creating a new dashboard should be a plug and play experience
  • \n
\n
\n\n\n'}],[[570,1,2]]]); //# sourceMappingURL=app.a397d573.chunk.js.map