(this.webpackJsonp=this.webpackJsonp||[]).push([[0],[,function(e,t,r){"use strict";var n=r(89);r.d(t,"a",(function(){return n.a}));var a=r(64);r.d(t,"d",(function(){return a.a}));var o=r(227);r.d(t,"b",(function(){return o.a}));var i=r(228);r.d(t,"c",(function(){return i.a}))},,,,,function(e,t,r){"use strict";var n=r(0),a=r.n(n),o=r(3),i=r(28),s=r(1);t.a={Screen:function(e){return a.a.createElement(o.a,{style:{minWidth:s.d.minPageWidth,minHeight:e.forceScrollbar?"101%":void 0,backgroundColor:s.a.pageBackground,paddingVertical:e.paddingVertical||s.d.doubleBaseMargin,paddingHorizontal:e.paddingHorizontal||s.d.doubleBaseMargin}},e.children)},Icon:function(e){return a.a.createElement(i.a,{source:e.source,style:{width:e.size?e.size:s.d.icons.medium,height:e.size?e.size:s.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:s.d.smallMargin,height:s.d.smallMargin}})},Spacer:function(){return a.a.createElement(o.a,{style:{width:s.d.baseMargin,height:s.d.baseMargin}})},SpacerDouble:function(){return a.a.createElement(o.a,{style:{width:s.d.doubleBaseMargin,height:s.d.doubleBaseMargin}})},SpacerTriple:function(){return a.a.createElement(o.a,{style:{width:s.d.tripleBaseMargin,height:s.d.tripleBaseMargin}})},SpacerQuad:function(){return a.a.createElement(o.a,{style:{width:s.d.quadBaseMargin,height:s.d.quadBaseMargin}})},SpacerSix:function(){return a.a.createElement(o.a,{style:{width:s.d.sixBaseMargin,height:s.d.sixBaseMargin}})},HorizontalLine:function(e){var t=e.color,r=void 0===t?s.a.lightGrey:t;return a.a.createElement(o.a,{style:{width:"100%",borderWidth:1,borderColor:r}})}}},,,,,,,,,,function(e,t,r){"use strict";var n=r(10),a=r.n(n),o=r(89);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}var s=function(e){for(var t=1;t2&&void 0!==arguments[2]?arguments[2]:function(e,t){switch(t){case n.Number:return e%1!==0&&Math.abs(e)<1e4?2:0;case n.Dollars:return Math.abs(e)<1e4?2:0;case n.Percent:return 1;case n.Temperature:return 0}return 0}(e,t),s=a(e.toFixed(r));return o(t)+s+i(t)}function c(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),o(t)+r+i(t)}r.d(t,"a",(function(){return n})),r.d(t,"c",(function(){return s})),r.d(t,"b",(function(){return c})),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(237);r.d(t,"Label",(function(){return n.a}));var a=r(369);r.d(t,"ConnectedLabel",(function(){return a.a}));var o=r(370);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,"VALUE_LABEL_THEME_LARGE")&&r.d(t,"VALUE_LABEL_THEME_LARGE",(function(){return o.VALUE_LABEL_THEME_LARGE})),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}))},,,function(e,t,r){"use strict";var n=r(10),a=r.n(n),o=r(15),i={enableAppPicker:Object(o.createAction)("app/ENABLE_APP_PICKER"),disableAppPicker:Object(o.createAction)("app/DISABLE_APP_PICKER"),setSelectedApp:Object(o.createAction)("app/SET_SELECTED_APP",(function(e){return function(t){return e(t)}}))},s=r(97);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 l(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.enableAppPicker):return l({},e,{appPickerEnabled:!0});case Object(o.getType)(i.disableAppPicker):return l({},e,{appPickerEnabled:!1,selectedApp:s.e});case Object(o.getType)(i.setSelectedApp):return l({},e,{selectedApp:t.payload});default:return e}},p=r(605),f={selectedApp:Object(p.createSelector)((function(e){return e.app}),(function(e){return e.selectedApp}))};r.d(t,"c",(function(){return d})),r.d(t,"a",(function(){return i})),r.d(t,"f",(function(){return s.d})),r.d(t,"b",(function(){return s.a})),r.d(t,"e",(function(){return s.c})),r.d(t,"d",(function(){return f}))},,,,,function(e,t,r){"use strict";r.d(t,"a",(function(){return a}));var n=r(15),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";var n=r(356);r.d(t,"Button",(function(){return n.a}));var a=r(357);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_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}));var o=r(229);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_RED",(function(){return o.d})),r.d(t,"BUTTON_THEME_GLOBAL_ERROR",(function(){return o.e})),r.d(t,"BUTTON_THEME_GLOBAL_MESSAGE",(function(){return o.f})),r.d(t,"BUTTON_THEME_LARGE_BLUE",(function(){return o.g})),r.d(t,"BUTTON_THEME_LARGE_GREEN",(function(){return o.h})),r.d(t,"BUTTON_THEME_LARGE_GREY",(function(){return o.i}))},,function(e,t,r){"use strict";var n=r(584);r.d(t,"Group",(function(){return n.a}));r(585),r(242)},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";var n,a=r(10),o=r.n(a),i=r(15),s={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 l(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)(s.setFontsLoading):return l({},e,{fontsLoading:t.payload});case Object(i.getType)(s.setBusy):return l({},e,{busy:e.busy+(t.payload?1:-1)});case Object(i.getType)(s.setGlobalMessage):return l({},e,{globalMessage:t.payload?l({type:n.Info},t.payload):void 0});case Object(i.getType)(s.setError):return l({},e,{globalMessage:t.payload?l({type:n.Error},t.payload):void 0});default:return e}};r.d(t,"c",(function(){return d})),r.d(t,"a",(function(){return s})),r.d(t,"b",(function(){return n}))},function(e,t,r){"use strict";var n=r(103),a=r(917),o=r(235),i=r(318),s=r(74),c=r.n(s),l=r(918),u=r(25),d=r(42),p=r(85),f=r(45),h=r(92),g=r(58),b=r(19),m=r(173),y=r(174),A=Object(n.c)({app:u.c,global:d.c,menu:p.Reducers,user:f.c,userAdmin:h.Reducers,kdsData:g.Reducers,kvsComponent:b.KVSComponentReducers,data:m.DataReducers}),v=l.a.apply(void 0,c()(f.b).concat(c()(h.Epics),c()(y.b)));r.d(t,"b",(function(){return O})),r.d(t,"a",(function(){return S}));var E={key:"root",storage:o.a,whitelist:[]},O=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,s=Object(n.e)(e,i.apply(void 0,o));return r.run(v),s}(Object(i.a)(E,A)),S=Object(i.b)(O)},,function(e,t,r){"use strict";var n=r(10),a=r.n(n),o=r(15),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 s(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]:l,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(51),p=r(17),f=r.n(p),h=r(61),g=r.n(h),b=r(52),m=r(85),y=r(66),A=r(160),v=[Object(y.b)(i.signUp.request,(function(e){return g.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(y.b)(i.login.request,(function(e){return g.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(y.b)(i.federatedLogin.request,(function(){var e=new g.a.auth.GoogleAuthProvider;return g.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(y.b)(i.checkPermissions.request,(function(){return b.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}}(g.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=g.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(g.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()}}))}))})),Object(y.a)(i.setLoggedOut,(function(){return m.Actions.setMenuItem(A.a)}))];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 v}))},,function(e,t,r){"use strict";r.d(t,"a",(function(){return a})),r.d(t,"b",(function(){return o}));var n=r(23);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,"c",(function(){return s})),r.d(t,"a",(function(){return c})),r.d(t,"h",(function(){return l})),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(10),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";return{$match:a()({},t,{$gte:new Date(e.start.toISOString()),$lt:new Date(e.end.toISOString())})}}function c(e){return{$match:a()({},e.field,{$in:e.values})}}function l(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";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";var n=r(159);r.d(t,"QueryService",(function(){return n.a}));r(351)},,,,function(e,t,r){"use strict";var n,a,o=r(175);switch(function(e){e[e.Development=0]="Development",e[e.Production=1]="Production"}(n||(n={})),o.a.manifest.extra.configType){case"prod":case"production":a=n.Production;break;default:a=n.Development}var i={configType:a,version:o.a.manifest.version+"-dev",dataService:{apiBaseUrl:"https://kassandra-data-service.api.adapptor.io",database:"lotterywest"},firebaseConfig:{apiKey:"AIzaSyAXf77d4bmaqGMZhPDZ3qV-2vyLLdAUpbg",authDomain:"lotterywest-command.firebaseapp.com",databaseURL:"https://lotterywest-command.firebaseio.com",projectId:"lotterywest-command",storageBucket:"lotterywest-command.appspot.com",messagingSenderId:"846591159402",appId:"1:846591159402:web:c651b818ceb1a4cc1e6e13"},firestoreConfig:{apiKey:"AIzaSyCkYy_d3--jhpzYckxNDXcNVRyiNON2Ppg",authDomain:"lotterywest-dev.firebaseapp.com",databaseURL:"https://lotterywest-dev.firebaseio.com",projectId:"lotterywest-dev",storageBucket:"lotterywest-dev.appspot.com",messagingSenderId:"117826760541",appId:"1:117826760541:web:5207006c1cb1302b0e82b4",measurementId:"G-T835JBQBYM"},name:"Lotterywest Command",variant:"Dev Alpha"},s={configType:a,version:o.a.manifest.version+"-prod",dataService:{apiBaseUrl:"https://kassandra-data-service.api.adapptor.io",database:"lotterywest-prod"},firebaseConfig:{apiKey:"AIzaSyAXf77d4bmaqGMZhPDZ3qV-2vyLLdAUpbg",authDomain:"lotterywest-command.firebaseapp.com",databaseURL:"https://lotterywest-command.firebaseio.com",projectId:"lotterywest-command",storageBucket:"lotterywest-command.appspot.com",messagingSenderId:"846591159402",appId:"1:846591159402:web:c651b818ceb1a4cc1e6e13"},firestoreConfig:{apiKey:"AIzaSyAu8o3Ns_JItXNxOxzwLWemeRxy-VPpFJA",authDomain:"lotterywest-prod.firebaseapp.com",databaseURL:"https://lotterywest-prod.firebaseio.com",projectId:"lotterywest-prod",storageBucket:"lotterywest-prod.appspot.com",messagingSenderId:"1000079586696",appId:"1:1000079586696:web:28c055cbed4cc58fac763d",measurementId:"G-DJ04Z32NX8"},name:"Lotterywest Command",variant:"Alpha"};t.a=a===n.Development?i:s},,function(e,t,r){"use strict";var n=r(360);r.d(t,"Reducers",(function(){return n.a}));var a=r(231);r.d(t,"Actions",(function(){return a.a}));r(361)},,,,,,function(e,t,r){"use strict";var n=r(46),a=r(75),o=r(175),i=a.a.get("window"),s=i.width,c=i.height,l="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 g={isAndroid:l,isIos:u,isWeb:d,screenWidth:s,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*s,500),borderRadius:5,infoButtonSize:14,infoButtonPadding:5,invalidOpacity:.5,timing:{componentDebounce:200,componentThrottle:400}};t.a=g},function(e,t,r){"use strict";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 E})),r.d(o,"createProjection",(function(){return O}));var i={};r.r(i),r.d(i,"getTopGroups",(function(){return C})),r.d(i,"newRequest",(function(){return w}));var s={};r.r(s),r.d(s,"newRequest",(function(){return j}));var c={};r.r(c),r.d(c,"newRequest",(function(){return T}));var l={};r.r(l),r.d(l,"newRequest",(function(){return _}));var u={};r.r(u),r.d(u,"newRequest",(function(){return U}));var d={};r.r(d),r.d(d,"newRequestPipeline",(function(){return G}));var p=r(49);function f(e,t){return{database:e,collection:"public_holidays",operation:"aggregate",query:{pipeline:g(t)}}}function h(e,t){return{database:e,collection:"school_holidays",operation:"aggregate",query:{pipeline:b(t)}}}function g(e){return[m(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:y("$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 b(e){return[m(e),{$group:{_id:"$date",states:{$push:"$region_code"}}},{$project:{_id:!1,date:"$_id",description:{$concat:["School holiday ",y("$states")]}}},{$sort:{date:1}}]}function m(e){var t=p.c(e);return e.states&&(t.$match.region_code={$in:e.states}),t}function y(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:v(t)}}}function v(e){return[p.c(e),{$project:{_id:!1,date:"$"+(e.dateKey||"date"),description:"$"+(e.descriptionKey||"description")}},{$sort:{date:1}}]}function E(e,t){return{database:e,collection:t.collectionKey,operation:"aggregate",query:{options:{allowDiskUse:!0},pipeline:S(t)}}}function O(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 S(e){var t=[{$project:O(e)}];return e.filter&&t.unshift(p.a(e.filter)),t}function C(e,t,r){var n=r||"group",a=[];e.forEach((function(e){var t=e[n];if(t){var r=a.find((function(e){return e.group===t}));r?r.value+=e.value:a.push({group:t,value:e.value})}})),a.sort((function(e,t){return e.value0?{$match:x({},t.$match,{category:{$in:e.categories}})}:t}function U(e,t){return{database:e,collection:t.collectionKey,operation:"aggregate",query:{options:{allowDiskUse:!0},pipeline:V(t)}}}function V(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 H=r(159);function G(e){return{database:e.database||H.a.defaultDatabase||"NO_DATABASE_DEFINED",collection:e.collection,operation:"aggregate",query:{options:{allowDiskUse:!0},pipeline:e.pipeline}}}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 s})),r.d(t,"g",(function(){return c})),r.d(t,"c",(function(){return l})),r.d(t,"f",(function(){return u})),r.d(t,"i",(function(){return d}))},function(e,t,r){"use strict";r.d(t,"a",(function(){return c})),r.d(t,"b",(function(){return l}));var n=r(15),a=r(636),o=r(311),i=r(198),s=r(319);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 l(e,t){return function(r,o){return r.pipe(Object(a.a)(Object(n.isActionOf)(e)),Object(i.a)((function(e){return Object(s.a)(t(e.payload,o))})))}}},,,function(e,t,r){"use strict";r.d(t,"b",(function(){return a})),r.d(t,"a",(function(){return o}));var n=r(209);function a(e,t){return e.replace("rgb","rgba").replace(")",", "+t+")")}function o(e){return n.c(n.a).domain([0,Math.max(e,1)])}},,,,,,,,,,,function(e,t,r){"use strict";var n,a=r(10),o=r.n(a),i=r(7),s=r.n(i),c=r(11),l=r.n(c),u=r(12),d=r.n(u),p=r(8),f=r.n(p),h=r(13),g=r.n(h),b=r(0),m=r.n(b),y=r(9),A=r(18),v=r(70),E=r(3),O=r(72),S=r(155),C=r(1),w=r(6),D=r(28),k=r(31),j=r(20),T=function(e){function t(){return s()(this,t),d()(this,f()(t).apply(this,arguments))}return g()(t,e),l()(t,[{key:"render",value:function(){var e=this.props,t=e.onPrevPress,r=e.onNextPress;return b.createElement(E.a,{style:P.container},b.createElement(k.a,{onPress:t},b.createElement(D.a,{source:C.c.arrowLeft,style:P.arrow})),b.createElement(k.a,{onPress:r},b.createElement(D.a,{source:C.c.arrowRight,style:P.arrow})))}}]),t}(b.PureComponent),P=j.a.create({container:{flexDirection:"row",alignItems:"center"},arrow:{width:C.d.icons.small,height:C.d.icons.small,margin:-C.d.tinyMargin,tintColor:C.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"}(n||(n={}));var L={legendOrientation:n.Vertical,minWidth:100,alignItems:"flex-start",backgroundColor:C.a.controlBackground,borderColor:C.a.border,borderWidth:1,borderRadius:C.d.borderRadius,font:C.b.grey.bodyS.thin},B=function(e){for(var t=1;tt-c&&(u.x=t-c-i),u.y+s>r-c&&(u.y=r-c-s)),b.a.createElement(m.a,{style:D({position:"absolute",top:u.y,left:u.x,maxWidth:t-2*c,maxHeight:r-2*c,paddingHorizontal:E.d.smallMargin,backgroundColor:E.a.pageBackground,borderRadius:E.d.smallMargin,borderWidth:1,borderColor:E.a.border},O.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 b.a.createElement(m.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,s=n.parentHeight,c=v.a.get("window"),l=c.width,u=c.height;return b.a.createElement(S.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&&b.a.createElement(A.a,{animationType:"none",transparent:!0,supportedOrientations:["landscape"],visible:!!a||!!o,ariaHideApp:!1},this.renderOuterView(l,u)),!t&&(a||o)&&this.renderOuterView(i,s))}}]),t}(g.PureComponent);k.defaultProps={isModal:!1,updateOnTouchMove:!0},r.d(t,"a",(function(){return k}))},,,,,,,function(e,t,r){"use strict";r.d(t,"b",(function(){return M}));var n=r(7),a=r.n(n),o=r(11),i=r.n(o),s=r(12),c=r.n(s),l=r(8),u=r.n(l),d=r(13),p=r.n(d),f=r(0),h=r.n(f),g=r(3),b=r(9),m=r(28),y=r(31),A=r(6),v=r(81),E=r(1),O=r(36),S=r(23),C=r(85),w=r(45),D=r(92),k=r(124),j=[{flex:1},{flex:1.5},{flex:.5},{flex:.5,alignItems:"flex-end"}],T=E.d.tripleBaseMargin,P=function(e){function t(e){var r;return a()(this,t),(r=c()(this,u()(t).call(this,e))).onAddUser=function(){r.props.dispatch(D.Actions.editUser(void 0)),r.props.dispatch(C.Actions.setMenuItem(k.b))},r.onEditUser=function(e){r.props.dispatch(D.Actions.editUser(e)),r.props.dispatch(C.Actions.setMenuItem(k.b))},r.onDeleteUser=function(e){r.props.dispatch(D.Actions.updateUser.request({uid:e,role:w.e.inactive}))},r.renderUserListSeparator=function(){return h.a.createElement(g.a,{style:{width:"100%",height:1,backgroundColor:E.a.border}})},r.renderUserListHeader=function(){return h.a.createElement(g.a,null,h.a.createElement(g.a,{style:{height:T,backgroundColor:E.a.pageBackground,flexDirection:"row",alignItems:"center"}},h.a.createElement(g.a,{style:j[0]},h.a.createElement(b.a,{style:E.b.black.bodyS.regular},"Name")),h.a.createElement(g.a,{style:j[1]},h.a.createElement(b.a,{style:E.b.black.bodyS.regular},"Email")),h.a.createElement(g.a,{style:j[2]},h.a.createElement(b.a,{style:E.b.black.bodyS.regular},"Role")),h.a.createElement(g.a,{style:j[3]},h.a.createElement(b.a,{style:E.b.black.bodyS.regular},"Actions"))),r.renderUserListSeparator())},r.renderUserListItem=function(e){var t=r.props.userAdmin.updatingUsers;return h.a.createElement(g.a,{key:e.uid},h.a.createElement(g.a,{style:{flexDirection:"row",height:T,alignItems:"center"}},h.a.createElement(g.a,{style:j[0]},h.a.createElement(b.a,{style:E.b.black.bodyXS.thin},(e.firstName||"")+(void 0!==e.firstName&&void 0!==e.surname?" ":"")+(e.surname||""))),h.a.createElement(g.a,{style:j[1]},h.a.createElement(b.a,{style:E.b.black.bodyXS.thin},e.email||"Google user")),h.a.createElement(g.a,{style:j[2]},h.a.createElement(b.a,{style:E.b.black.bodyXS.thin},e.role)),h.a.createElement(g.a,{style:[j[3],{flexDirection:"row",alignItems:"center",justifyContent:"flex-end"}]},h.a.createElement(y.a,{onPress:function(){return r.onEditUser(e.uid)},disabled:t},h.a.createElement(m.a,{source:E.c.edit,style:{width:E.d.icons.small,height:E.d.icons.small,tintColor:E.a.highlight}})),e.role!=w.e.inactive&&h.a.createElement(A.a.Spacer,null),e.role!=w.e.inactive&&h.a.createElement(y.a,{onPress:function(){return r.onDeleteUser(e.uid)},disabled:t},h.a.createElement(m.a,{source:E.c.trash,style:{width:E.d.icons.small,height:E.d.icons.small,tintColor:E.a.red}})))),r.renderUserListSeparator())},r.state={fetchedUsers:!1},r}return p()(t,e),i()(t,[{key:"componentDidMount",value:function(){this.props.userAdmin.updatingUsers||(this.setState({fetchedUsers:!0}),this.props.dispatch(D.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(D.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:E.d.quadBaseMargin,paddingHorizontal:E.d.eightBaseMargin},h.a.createElement(g.a,{style:{flexDirection:"row",alignItems:"center",justifyContent:"space-between"}},h.a.createElement(b.a,{style:E.b.black.bodyL.bold},"Active Users"),h.a.createElement(O.Button,{text:"Add new user",onPress:this.onAddUser,disabled:n,theme:O.BUTTON_THEME_FIXED_RED})),h.a.createElement(A.a.SpacerDouble,null),this.renderUserListHeader(),h.a.createElement(g.a,null,void 0!==r&&h.a.createElement(g.a,{style:{opacity:void 0===r||n?E.d.invalidOpacity:void 0}},r.map((function(t){return e.renderUserListItem(t)}))),n&&h.a.createElement(v.a,{style:{width:"100%",height:"100%",minHeight:3*T,maxHeight:20*T,position:"absolute",backgroundColor:void 0===r?E.a.loadingBackground:void 0},activityIndicatorColor:E.a.black})),h.a.createElement(A.a.SpacerDouble,null))}}]),t}(h.a.Component);P.title="Settings";t.a=Object(S.b)((function(e){return{userAdmin:e.userAdmin}}))(P);var M=P.title},,,function(e,t,r){"use strict";var n=r(10),a=r.n(n),o=r(7),i=r.n(o),s=r(11),c=r.n(s),l=r(12),u=r.n(l),d=r(8),p=r.n(d),f=r(13),h=r.n(f),g=r(0),b=r.n(g),m=r(3),y=r(9),A=r(94),v=r(28),E=r(31),O=r(6),S=r(1),C=r(313),w=r(36),D=r(23),k=r(45),j=[{role:k.e.administrator,text:"Administrator",secondaryText:"Access all the features of Command including user management"},{role:k.e.editor,text:"Editor",secondaryText:"View access to all the features of Command and limited ability to make amendments"},{role:k.e.viewer,text:"Viewer",secondaryText:"View access to all the features of Command"},{role:k.e.inactive,text:"Inactive",secondaryText:"No access permissions"}],T=r(85),P=r(92),M=r(121);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 B(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()}}))}function b(e,t,r,n){var o,i,s,c,l=arguments;return a.a.async((function(a){for(;;)switch(a.prev=a.next){case 0:return o=l.length>4&&void 0!==l[4]?l[4]:"GET",i={headers:{Authorization:n,"Content-Type":"application/json"},method:o,mode:"cors"},s=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("&"),s+="?"+c),a.abrupt("return",g(s,i));case 6:case"end":return a.stop()}}))}function m(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",g(e,o));case 2:case"end":return a.stop()}}))}var y=r(65),A=r(606),v=r(49);r.d(t,"a",(function(){return E}));var E=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,s=arguments;return a.a.async((function(a){for(;;)switch(a.prev=a.next){case 0:return r=s.length>1&&void 0!==s[1]?s[1]:"$date",n=s.length>2&&void 0!==s[2]?s[2]:"$value",o=s.length>3&&void 0!==s[3]?s[3]:"$count",i=s.length>4?s[4]:void 0,a.abrupt("return",this.postQuery(y.b.newRequest(null!=(t=i)?t:this.defaultDatabase,{collectionKey:e,dateKey:r,valueKey:n||void 0,countKey:o||void 0})).then((function(e){return e||[]})));case 5:case"end":return a.stop()}}),null,this)}},{key:"dailyValueFromParams",value:function(e,t){var r;return a.a.async((function(n){for(;;)switch(n.prev=n.next){case 0:return n.abrupt("return",this.postQuery(y.b.newRequest(null!=(r=t)?r:this.defaultDatabase,e)).then((function(e){return e||[]})));case 1:case"end":return n.stop()}}),null,this)}},{key:"dailyMultiValue",value:function(e,t){var r,n,o,i,s,c=arguments;return a.a.async((function(a){for(;;)switch(a.prev=a.next){case 0:return n=c.length>2&&void 0!==c[2]?c[2]:[],o=c.length>3&&void 0!==c[3]?c[3]:[],i=c.length>4&&void 0!==c[4]?c[4]:"$date",s=c.length>5?c[5]:void 0,a.abrupt("return",this.postQuery(y.b.newRequest(null!=(r=s)?r:this.defaultDatabase,{collectionKey:e,dateKey:i,multiValueKeys:t,multiCountKeys:n,extraKeys:o})).then((function(e){return t.map((function(t,r){var a=n[r];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)}},{key:"groupedDailyValue",value:function(e){var t,r,n,o,i,s,c=arguments;return a.a.async((function(a){for(;;)switch(a.prev=a.next){case 0:return r=c.length>1&&void 0!==c[1]?c[1]:"$date",n=c.length>2&&void 0!==c[2]?c[2]:"$value",o=c.length>3&&void 0!==c[3]?c[3]:"$count",i=c.length>4&&void 0!==c[4]?c[4]:"$category",s=c.length>5?c[5]:void 0,a.abrupt("return",this.postQuery(y.d.newRequest(null!=(t=s)?t:this.defaultDatabase,{collectionKey:e,dateKey:r,valueKey:n||void 0,countKey:o||void 0,groupKey:i})).then((function(e){return e||[]})));case 6:case"end":return a.stop()}}),null,this)}},{key:"dailyMultiValueToGroupedDailyValue",value:function(e,t,r){var n,o,i,s,c,l,u=arguments;return a.a.async((function(a){for(;;)switch(a.prev=a.next){case 0:return o=u.length>3&&void 0!==u[3]?u[3]:[],i=u.length>4&&void 0!==u[4]?u[4]:[],s=u.length>5?u[5]:void 0,c=u.length>6&&void 0!==u[6]?u[6]:"$date",l=u.length>7?u[7]:void 0,a.abrupt("return",this.postQuery(y.b.newRequest(null!=(n=l)?n:this.defaultDatabase,{collectionKey:e,dateKey:c,multiValueKeys:r,multiCountKeys:o,extraKeys:i,filter:s})).then((function(e){return t.map((function(t,n){var a=r[n],s=o[n];return(e||[]).map((function(e){var r={date:e.date,group:t,value:a?e[a]:1,count:s?e[s]:1};return i.length>0&&i.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)}},{key:"groupedDailyValueFromParams",value:function(e,t){var r;return a.a.async((function(n){for(;;)switch(n.prev=n.next){case 0:return n.abrupt("return",this.postQuery(y.d.newRequest(null!=(r=t)?r:this.defaultDatabase,e)).then((function(e){return e||[]})));case 1:case"end":return n.stop()}}),null,this)}},{key:"holidaysPublic",value:function(e,t){var r,n;return a.a.async((function(a){for(;;)switch(a.prev=a.next){case 0:return n=y.e.publicHolidays(null!=(r=t)?r:this.defaultDatabase,e),a.abrupt("return",this.postQuery(n).then((function(e){return e||[]})));case 2:case"end":return a.stop()}}),null,this)}},{key:"holidaysSchool",value:function(e,t){var r,n;return a.a.async((function(a){for(;;)switch(a.prev=a.next){case 0:return n=y.e.schoolHolidays(null!=(r=t)?r:this.defaultDatabase,e),a.abrupt("return",this.postQuery(n));case 2:case"end":return a.stop()}}),null,this)}},{key:"calendarEvents",value:function(e,t){var r,n;return a.a.async((function(a){for(;;)switch(a.prev=a.next){case 0:return n=y.a.newRequest(null!=(r=t)?r:this.defaultDatabase,e),a.abrupt("return",this.postQuery(n));case 2:case"end":return a.stop()}}),null,this)}},{key:"locationEvents",value:function(e,t){var r,n;return a.a.async((function(a){for(;;)switch(a.prev=a.next){case 0:return n=y.f.newRequest(null!=(r=t)?r:this.defaultDatabase,e),a.abrupt("return",this.postQuery(n));case 2:case"end":return a.stop()}}),null,this)}},{key:"tableData",value:function(e,t,r){var n;return a.a.async((function(a){for(;;)switch(a.prev=a.next){case 0:return a.abrupt("return",this.tableDataRequest({database:null!=(n=r)?n:this.defaultDatabase,collection:e,query:{options:{allowDiskUse:!0},pipeline:t?[v.g({field:t})]:[]},operation:"aggregate"}));case 1:case"end":return a.stop()}}),null,this)}},{key:"tableDataPipeline",value:function(e){var t;return a.a.async((function(r){for(;;)switch(r.prev=r.next){case 0:return t=y.i.newRequestPipeline(e),r.abrupt("return",this.postQuery(t).then((function(e){return e||[]})));case 2:case"end":return r.stop()}}),null,this)}},{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)}},{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)}},{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()}}))}},{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 m(t,r,A.a(e),n)})));case 5:case"end":return n.stop()}}),null,this)}},{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 b(t.apiBaseUrl,"auth/createUser",e,"Bearer "+r,"POST")})));case 3:case"end":return r.stop()}}),null,this)}},{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 b(t.apiBaseUrl,"auth/updateUser",e,"Bearer "+r,"POST")})));case 3:case"end":return r.stop()}}),null,this)}},{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 b(t.apiBaseUrl,"auth/deleteUser",e,"Bearer "+r,"POST")})));case 3:case"end":return r.stop()}}),null,this)}},{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 b(e.apiBaseUrl,"auth/getUsers",void 0,"Bearer "+t)})));case 3:case"end":return t.stop()}}),null,this)}},{key:"summaryScreenAllTimeUsers",value:function(){var e;return a.a.async((function(t){for(;;)switch(t.prev=t.next){case 0:return e=y.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)}},{key:"summaryScreenActiveUsers",value:function(e){var t;return a.a.async((function(r){for(;;)switch(r.prev=r.next){case 0:return t=y.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)}},{key:"feedback",value:function(e){var t;return a.a.async((function(r){for(;;)switch(r.prev=r.next){case 0:return t=y.c.newRequest(e),r.abrupt("return",this.postQuery(t).then((function(e){return e||[]})));case 2:case"end":return r.stop()}}),null,this)}}]),e}()},function(e,t,r){"use strict";r.d(t,"a",(function(){return o})),r.d(t,"b",(function(){return i}));var n=r(25),a=r(16),o=n.f.UsageScreen,i=a.c.logo},,,,,,,,function(e,t,r){"use strict";r(248);var n=r(597);r.d(t,"ConnectedPieChart",(function(){return n.a}));r(213)},function(e,t,r){"use strict";r(244);var n=r(598);r.d(t,"ConnectedBarChart",(function(){return n.a}));r(212),r(245)},,,,function(e,t,r){"use strict";var n=r(131);r.d(t,"DataActions",(function(){return n.a}));var a=r(373);r.d(t,"DataReducers",(function(){return a.a}));r(507)},function(e,t,r){"use strict";var n=r(15),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(623),r(146)),i=r(46),s=(r(319),r(624),r(625)),c=r(636),l=r(198),u=(r(915),r(916),r(42),[function(e,t){return e.pipe(Object(c.a)(Object(n.isActionOf)(a.replyToAndroidReview)),Object(l.a)((function(e){var t=e.payload.review,r="https://play.google.com/store/apps/details?id=au.gov.wa.lotterywest.lwpo&reviewId={reviewId}";return r=r.replace("{reviewId}",encodeURIComponent(t.id)),"web"==i.a.OS?window.open(r,"_blank"):o.a.canOpenURL(r)&&o.a.openURL(r),s.a})))},function(e,t){return e.pipe(Object(c.a)(Object(n.isActionOf)(a.replyToIOSReview)),Object(l.a)((function(e){var t=e.payload.review,r="https://appstoreconnect.apple.com/WebObjects/iTunesConnect.woa/ra/ng/app/967096969/ios/ratingsResponses?reviewId={reviewId}";return r=r.replace("{reviewId}",t.id),"web"==i.a.OS?window.open(r,"_blank"):o.a.canOpenURL(r)&&o.a.openURL(r),s.a})))}]);r.d(t,"a",(function(){return a})),r.d(t,"b",(function(){return u}))},,,,,,,,,,,,,,,,,,,function(e,t,r){"use strict";r.d(t,"a",(function(){return c})),r.d(t,"b",(function(){return l}));var n=r(10),a=r.n(n),o=r(1),i=r(36);function s(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},l=function(e){for(var t=1;t0?t.moveX:t.x0)-r._layout.x,i=(t.moveY>0?t.moveY:t.y0)-r._layout.y,s=t.moveX>0?t.moveX:t.x0,c=t.moveY>0?t.moveY:t.y0;return a&&(o=Math.min(Math.max(o,0),r._layout.width),i=Math.min(Math.max(i,0),r._layout.height)),{x:o,y:i,screenX:s,screenY:c,viewRect:S({},r._layout)}}},r.onTouchGrant=function(e,t){var n=r.props.parentView||r._ref;n.current&&n.current.measure((function(n,a,o,i,s,c){if(r._layout={x:s,y:c,width:o,height:i},void 0!==r.props.onTouchGrant){var l=r.getPanEvent(e,t);l&&r.props.onTouchGrant(l)}}))},r.onTouchMove=function(e,t){if(Math.abs(t.dx)>Math.abs(t.dy)+20&&r.props.scrollView&&r.props.scrollView.current&&"ios"===A.a.OS&&r.props.scrollView.current.setNativeProps({scrollEnabled:!1}),void 0!==r.props.onTouchMove){var n=r.getPanEvent(e,t);n&&r.props.onTouchMove(n)}},r.onTouchRelease=function(e,t){if(r.props.scrollView&&r.props.scrollView.current&&"ios"===A.a.OS&&r.props.scrollView.current.setNativeProps({scrollEnabled:!0}),void 0!==r.props.onTouchRelease){var n=r.getPanEvent(e,t);n&&r.props.onTouchRelease(n)}},r._panResponder=E.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:r.onTouchGrant,onPanResponderMove:r.onTouchMove,onPanResponderRelease:r.onTouchRelease,onPanResponderTerminate:r.onTouchRelease}),r.state={},r}return b()(t,e),u()(t,[{key:"render",value:function(){return y.a.createElement(v.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)}}]),t}(y.a.PureComponent)},,,,function(e,t,r){"use strict";var n=r(601);r.d(t,"PickerBox",(function(){return n.a}));var a=r(580);r.o(a,"PICKER_BOX_THEME_SLIM")&&r.d(t,"PICKER_BOX_THEME_SLIM",(function(){return a.PICKER_BOX_THEME_SLIM}));var o=r(239);r.d(t,"PICKER_BOX_THEME_SLIM",(function(){return o.b}))},function(e,t,r){"use strict";var n=r(246);r.d(t,"StarRating",(function(){return n.a}));var a=r(599);r.d(t,"ConnectedStarRating",(function(){return a.a}));var o=r(216);r.o(o,"STAR_RATING_THEME_DEFAULT")&&r.d(t,"STAR_RATING_THEME_DEFAULT",(function(){return o.STAR_RATING_THEME_DEFAULT}));var i=r(157);r.d(t,"STAR_RATING_THEME_DEFAULT",(function(){return i.a}))},,,,function(e,t){},function(e,t){},,function(e,t){},function(e,t){},,,,,,,,,function(e,t,r){"use strict";r.d(t,"appList",(function(){return A})),r.d(t,"default",(function(){return v}));var n=r(17),a=r.n(n),o=r(7),i=r.n(o),s=r(11),c=r.n(s),l=r(12),u=r.n(l),d=r(8),p=r.n(d),f=r(13),h=r.n(f),g=r(56),b=r(52),m=r(25),y=r(267);b.QueryService.init(g.a.dataService.apiBaseUrl,g.a.dataService.database);var A=[{appId:m.b.iOS,operatingSystem:m.e.iOS},{appId:m.b.Android,operatingSystem:m.e.Android},{appId:m.b.iOSDev,operatingSystem:m.e.iOS},{appId:m.b.AndroidDev,operatingSystem:m.e.Android}],v=function(e){function t(){return i()(this,t),u()(this,p()(t).apply(this,arguments))}return h()(t,e),c()(t,null,[{key:"usageScreenAllTimeUsers",value:function(e){var t;return a.a.async((function(r){for(;;)switch(r.prev=r.next){case 0:return t=y.b.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)}}]),t}(b.QueryService)},,function(e,t,r){"use strict";var n=r(10),a=r.n(n),o=r(89),i=r(64);function s(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"}},l={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||l,r=Object.keys(t),n=e.types||c,o=Object.keys(n),i={};return r.forEach((function(t){var r=l[t],n={};o.forEach((function(t){n[t]=function(e){for(var t=1;t0?y.c.valueUp:e<0?y.c.valueDown:y.c.valueFixed}var w=function(e){function t(){var e,r;a()(this,t);for(var n=arguments.length,o=new Array(n),i=0;i0?t.percentageIncreaseColor:e<0?t.percentageDecreaseColor:y.a.lightGrey},r.renderPercentageChangeElement=function(e){var t=r.getTheme();return void 0===e?null:h.a.createElement(b.a,{style:{flexDirection:"row",alignItems:"center",justifyContent:"center"}},h.a.createElement(m.a,{style:{width:y.d.icons.tiny/2,height:y.d.icons.tiny,tintColor:r.getPercentageChangeColor(e)},source:C(e)}),h.a.createElement(A.a.SpacerSmall,null),h.a.createElement(g.a,{style:[t.percentageFont,{color:r.getPercentageChangeColor(e)}]},Object(O.c)(e,O.a.Percent)))},r}return p()(t,e),i()(t,[{key:"getTheme",value:function(){var e=this.props,t=e.theme,r=e.data;return Object(E.g)(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(v.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(b.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:y.d.smallMargin,paddingHorizontal:y.d.baseMargin,opacity:r?y.d.invalidOpacity:void 0}},h.a.createElement(g.a,{style:[a.titleFont,o]},t.title),h.a.createElement(g.a,{style:a.valueFont},Object(O.c)(t.value,t.valueType)),this.renderPercentageChangeElement(t.percentageChange),t.secondaryValue&&h.a.createElement(b.a,{style:{marginTop:t.percentageChange?y.d.baseMargin:void 0}},h.a.createElement(g.a,{style:a.secondaryValueFont},t.secondaryValue," ")),t.description&&h.a.createElement(b.a,{style:{position:"absolute",top:y.d.infoButtonPadding,right:y.d.infoButtonPadding}},h.a.createElement(S.InfoButton,{title:t.title,description:t.description,theme:a.infoButtonTheme})))}}]),t}(f.PureComponent);w.defaultProps={style:{},theme:E.a}},function(e,t,r){"use strict";r.d(t,"a",(function(){return c})),r.d(t,"b",(function(){return l}));var n=r(10),a=r.n(n),o=r(1),i=r(69);function s(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},l=function(e){for(var t=1;t0){var u=!!o.isVertical,d=r.getBarThickness();if(n=Math.min(Math.max(0,Math.floor((u?e.x:e.y)/d)),o.items.length-1),r.setState({selectedIndex:n}),void 0!==n){var p=o.items[n],f=p.label,h=p.value;if(p.childItems&&s){var g=l;s[n].some((function(t,n){var a=p.childItems.length-n-1;if((g-=t)=1)if(a.isVertical)for(;t*c<50;)c+=2;else for(;t*c<20;)c+=2;return b.a.createElement(m.a,{style:{flexDirection:e?"row":"column"}},a.items.map((function(n,l){return l%c===Math.floor(c/2)?b.a.createElement(m.a,{key:"main_label_"+l,style:{width:e?t*c:void 0,maxWidth:e?void 0:100,height:e?void 0:t*c,maxHeight:e?20+_: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&&b.a.createElement(m.a,{style:{width:1,height:_,backgroundColor:c>1?i.axisColor:void 0}}),b.a.createElement(y.a,{style:l===o?i.selectedLabelFont:i.labelFont,numberOfLines:s},n.label),!a.isVertical&&b.a.createElement(m.a,{style:{width:_,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,s=a.topValue,c=a.selectedIndex,l=this.props.theme,u=this.getBarLength(s,s),d=!0;return!o.isVertical&&t<20&&(d=!1),o.isVertical&&t<50&&(d=!1),b.a.createElement(m.a,{style:{flex:1,flexDirection:e?"row":"column",borderLeftWidth:e?void 0:1,borderLeftColor:e?void 0:l.axisColor,borderBottomWidth:e?1:void 0,borderBottomColor:e?l.axisColor:void 0}},o.items.map((function(a,s){var p=i[s].interpolate({inputRange:[0,u],outputRange:[0,u],extrapolate:"clamp"}),f=s===c?a.selectedColor||l.selectedBarColor:a.color||l.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(s,h,a,u,e):b.a.createElement(m.a,{key:"main_bar_"+s,style:h},d&&e&&n.textLabel(!1,l,f,e,i[s],a.value,o.valueType),b.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?l.barRounding:void 0,borderTopRightRadius:l.barRounding,borderBottomRightRadius:e?void 0:l.barRounding}},d&&n.textLabel(!0,l,f,e,i[s],a.value,o.valueType)),d&&!e&&n.textLabel(!1,l,f,e,i[s],a.value,o.valueType))})))}},{key:"renderChildViews",value:function(e,t,r,n,a){var o=this,i=this.state,s=i.childAnimValues,c=i.data,l=i.selectedChildIndex,u=i.selectedIndex,d=this.props.theme,p=this.getColorMap(c.items);return b.a.createElement(m.a,{key:"main_bar_"+e,style:t},b.a.createElement(m.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=s[e][r].interpolate({inputRange:[0,n],outputRange:[0,n],extrapolate:"clamp"}),c=void 0===u||void 0===l||u===e&&l===r?1:.6;return o.renderChild(t,i,a,p(r),c)}))))}},{key:"renderChild",value:function(e,t,r,n,a){return b.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,E.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,s=i.dataStampInvalid,c=i.legend,l=!!r.isVertical,u=this.getBarThickness(),d=.05*u,p=this.getMaxChildSize(r.items),f=this.getColorMap(r.items);return b.a.createElement(m.a,null,c&&b.a.createElement(m.a,{style:{height:this.getLegendHeight(),maxHeight:this.getLegendHeight()}},b.a.createElement(j.d,{theme:j.a,items:null==p?void 0:null==(e=p.childItems)?void 0:e.map((function(e,t){return{title:e.label,color:f(t)}}))})),b.a.createElement(m.a,null,b.a.createElement(A.a.View,{style:{width:n,height:a-this.getLegendHeight(),flexDirection:l?"column":"row",opacity:s?A.a.multiply(o,E.d.invalidOpacity):o}},!l&&this.renderAxisLabels(l,u,d),this.renderBars(l,u,d),l&&this.renderAxisLabels(l,u,d),b.a.createElement(C.a,{getPopupData:this.getPopupData,renderPopupContents:this.renderPopupContents,onPopupHidden:this.onPopupHidden,hoverResponder:this._csvButton})),b.a.createElement(T.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,s=void 0===a,c=0===n.items.length||!r||0===r.length,l=e.width!==o||e.height!==i;return s||c||l?b.a.createElement(w.a,{showLoading:s,showNoData:c,style:{width:e.width,height:e.height}}):this.renderBarChart()}}]),t}(g.PureComponent);R.defaultProps={style:{width:200,height:200},theme:S.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 O}));var n=r(7),a=r.n(n),o=r(11),i=r.n(o),s=r(12),c=r.n(s),l=r(8),u=r.n(l),d=r(13),p=r.n(d),f=r(0),h=r.n(f),g=r(3),b=r(9),m=r(157),y=r(21),A=r(81),v=r(6),E=r(1),O=function(e){function t(){return a()(this,t),c()(this,u()(t).apply(this,arguments))}return p()(t,e),i()(t,[{key:"renderStars",value:function(e,t){return h.a.createElement(g.a,{style:{alignSelf:"flex-start"}},h.a.createElement(b.a,{style:t},"\u2606\u2606\u2606\u2606\u2606"),h.a.createElement(g.a,{style:{position:"absolute",width:20*e+"%",maxWidth:20*e+"%",overflow:"hidden"}},h.a.createElement(g.a,{style:{width:"200%"}},h.a.createElement(b.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(g.a,{style:[r,{opacity:a?E.d.invalidOpacity:void 0}]},t.title&&h.a.createElement(b.a,{style:n.titleFont,ellipsizeMode:"tail",numberOfLines:1},t.title),h.a.createElement(g.a,{style:{flexDirection:"row",alignItems:"flex-end"}},!o&&h.a.createElement(b.a,{style:n.ratingFont,ellipsizeMode:"clip",numberOfLines:1},Object(y.c)(t.rating,y.a.Number)),!o&&h.a.createElement(v.a.Spacer,null),this.renderStars(t.rating,n.ratingFont)),t.count&&h.a.createElement(b.a,{style:n.countFont,ellipsizeMode:"tail",numberOfLines:1},Object(y.b)(t.count,y.a.Number)+" Ratings")):h.a.createElement(A.a,{showLoading:!0,style:[{width:300,height:100},r]})}}]),t}(f.PureComponent);O.defaultProps={style:{},theme:m.a}},function(e,t,r){"use strict";var n=r(7),a=r.n(n),o=r(11),i=r.n(o),s=r(12),c=r.n(s),l=r(8),u=r.n(l),d=r(13),p=r.n(d),f=r(0),h=r(3),g=r(79),b=r(1),m=r(74),y=r.n(m),A=r(20),v=r(10),E=r.n(v),O=r(9),S=r(28),C=r(31),w=r(114);function D(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 k=function(e){var t=e.icon,r=e.value,n=e.color,a=void 0===n?b.a.white:n,o=e.rowHeight,i=e.numberOfLines,s=e.header,c=void 0!==s&&s,l=e.textAlignVertical,u=function(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:function(e){};e>0&&t&&t(e)}(e,g)},index:r,hoverResponder:e.hoverResponder})})))},P=A.a.create({column:{overflow:"hidden"}}),M=r(110),L=r(81),B=r(29),x=r(82);r.d(t,"a",(function(){return _}));var _=function(e){function t(e){var r;return a()(this,t),(r=c()(this,u()(t).call(this,e)))._csvButton=f.createRef(),r.updateIsScrollable=function(){if(r._layoutW&&r._contentW){var e=r._layoutW=0&&r.props.cellTapAction(r.props.page,e)},r.state={isScrollable:!1},r}return p()(t,e),i()(t,[{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,s=this.state.isScrollable;if(void 0===r||0===r.titleRow.cells.length){var c=i.renderEmptyRows&&a?i.rowHeight*(a+1):2*b.d.tripleBaseMargin;return f.createElement(L.a,{showLoading:void 0===r,style:{width:o.width,height:c}})}var l=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]?l[t]=r.cellFlex[t]:l[t]+=(e?e.length:0)+6}))}));for(var u=8*(B.min(l)||1),d=0;df)return void h(void 0);var b=Math.atan2(g.x,g.y);b<0&&(b+=2*Math.PI),t.forEach((function(e,t){e.startAngle<=b&&e.endAngle>b&&(a=t,h(t))}))}}if(void 0!==a){var m=d.pieSlices[a];o={title:m.title,value:Object(D.c)(m.value,d.valueType,0),percentage:n>0?100*m.value/n:0}}return o},r.renderPopupContents=function(e){return h.a.createElement(g.a,{style:{alignItems:"center",justifyContent:"center"}},h.a.createElement(v.a,{style:y.b.black.bodyS.regular},e.title),h.a.createElement(v.a,{style:y.b.black.bodyXS.thin},e.value),h.a.createElement(v.a,{style:y.b.grey.bodyXS.thin},Object(D.c)(e.percentage,D.a.Percent)))},r.onPopupHidden=function(){var e=r.props.onSelectSlice;e&&e(void 0)},r.getCSVData=function(){var e,t,n=r.props.data;return{title:null==(e=n.csvDefinition)?void 0:e.title,headers:(null==(t=n.csvDefinition)?void 0:t.headers)||["Category","Value"],data:(n.csvPieSlices||n.pieSlices).map((function(e){return[e.title,Object(D.c)(e.value,n.valueType,0)]}))}},r}return p()(t,e),i()(t,[{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,s=o.outerRadius,c=void 0===s?a:s,l=o.innerRadius,u=void 0===l?0:l,d=o.startAngle,p=void 0===d?0:d,f=o.endAngle,b=void 0===f?Math.PI:f,m=o.padAngle,A=void 0===m?0:m,v=o.style,D=o.elevation,j=void 0===D?0:D,T=o.selectedIndex,P=.05*a,M=i.pieSlices.map((function(e,t){var r=T===t?c-P*(1-j):c-P;return O.a().outerRadius(r).innerRadius(u).padAngle(A)})),L=i.pieSlices.map((function(e){return e.value})).reduce((function(e,t){return e+t})),B=100*b/(2*Math.PI);if(0===i.pieSlices.length||0===L)return h.a.createElement(g.a,{style:v});var x=O.b().value((function(e){return e.value})).sort((function(e,t){return e+t})).startAngle(p||0).endAngle(b)(i.pieSlices),_=Math.max(6,Math.min(8*a/200,16)),R=Object(w.a)(i.pieSlices.length);return h.a.createElement(g.a,{style:{width:2*a,height:2*a}},h.a.createElement(g.a,{style:{width:2*a,height:2*a}},a>0&&h.a.createElement(E.e,{width:2*a,height:2*a},h.a.createElement(E.a,{x:a,y:a},x.map((function(e,t){var r=i.pieSlices[t],n=M[t](e);return h.a.createElement(E.c,{key:"pie_slice_"+r.title,d:n||void 0,fill:r.color||R(t),strokeWidth:0})})),x.map((function(e,t){var r=e.value/L*B;if(r>=3){var n=r.toFixed(1)+"%",a={x:0,y:.7*c},o=(e.endAngle-e.startAngle)/2,i=e.startAngle+o,s=Object(C.rotateVector2d)(a,i);return h.a.createElement(E.f,{key:"slice_"+t,textAnchor:"middle",alignmentBaseline:"middle",fontSize:""+_,fontWeight:"200",fontFamily:"Verdana",stroke:"none",fill:y.a.black,x:-s.x,y:-s.y,opacity:B/100,style:{userSelect:"none"}},n)}return null})))),a>0&&h.a.createElement(S.a,{getPopupData:function(t){return e.getPopupData(t,x,L)},renderPopupContents:this.renderPopupContents,onPopupHidden:this.onPopupHidden,hoverResponder:this._csvButton})),h.a.createElement(k.CSVButton,{ref:this._csvButton,getCSVData:this.getCSVData}))}}]),t}(f.PureComponent),T=r(81),P=r(80),M=r(6);r.d(t,"a",(function(){return x}));var L=b.a.createAnimatedComponent(j),B=100,x=function(e){function t(e){var r;return a()(this,t),(r=c()(this,u()(t).call(this,e))).debouncedUpdate=Object(A.debounce)((function(e){var t=r.props.style,n=t.width,a=t.height;n===r.state.width&&a===r.state.height||r.setState({width:n,height:a});var o=e.data?e.data.pieSlices:void 0,i=r.props.data?r.props.data.pieSlices:void 0;Object(A.isEqual)(o,i)}),y.d.timing.componentDebounce),r.onSelectSlice=function(e){e!==r.state.selectedIndex&&r.onFocus(e)},r.onFocus=function(e){e===r.state.selectedIndex&&(e=void 0),void 0!==e&&r.setState({selectedIndex:e},b.a.timing(r.state.outerElevation,{toValue:1,duration:B,easing:m.a.inOut(m.a.quad)}).start),void 0===e&&b.a.timing(r.state.outerElevation,{toValue:0,duration:B,easing:m.a.inOut(m.a.quad)}).start((function(){r.setState({selectedIndex:e})}))},r.state={endAngle:new b.a.Value(2*Math.PI),outerElevation:new b.a.Value(0),selectedIndex:void 0,width:e.style.width,height:e.style.height},r}return p()(t,e),i()(t,[{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,s=o.selectedIndex,c=o.endAngle,l=o.width,u=o.height;if(!t||0===t.pieSlices.length||n.width!==l||n.height!==u)return h.a.createElement(T.a,{showLoading:!t,style:{width:n.width,height:n.height}});var d=Object(w.a)(t.pieSlices.length),p=n.width,f=n.height;a&&(void 0!==a.minWidth&&a.legendOrientation===P.e.Vertical&&(p-=a.minWidth+y.d.baseMargin),void 0!==a.minHeight&&a.legendOrientation===P.e.Horizontal&&(f-=a.minHeight+y.d.baseMargin));var b=Math.min(p,f),m=n.width,A=n.height;return a&&(a.legendOrientation===P.e.Vertical&&(m-=b+y.d.baseMargin),a.legendOrientation===P.e.Horizontal&&(A-=b+y.d.baseMargin)),h.a.createElement(g.a,{style:{width:n.width,height:n.height,flexDirection:a&&a.legendOrientation===P.e.Vertical?"row":void 0,alignItems:"center",justifyContent:"center",opacity:r?y.d.invalidOpacity:void 0}},h.a.createElement(L,{style:{width:b,height:b},outerRadius:n.outerRadius,innerRadius:n.innerRadius,startAngle:0,endAngle:c,padAngle:n.padAngle,elevation:i,selectedIndex:s,onSelectSlice:this.onSelectSlice,data:t}),!!a&&h.a.createElement(M.a.Spacer,null),!!a&&h.a.createElement(P.d,{items:t.pieSlices.map((function(e,t){return{title:e.title,color:e.color||d(t)}})),style:{maxWidth:m,maxHeight:A},theme:a,selectedIndex:s}))}}]),t}(f.PureComponent);x.defaultProps={style:{width:200,height:200,innerRadius:0,padAngle:0}}},,,,,,,,,,,,,,,,,,,function(e,t,r){"use strict";var n={};r.r(n),r.d(n,"newRequest",(function(){return s}));var a={};r.r(a),r.d(a,"newRequest",(function(){return l}));r(65);var o=r(56),i=r(49);function s(e){return{database:o.a.dataService.database,collection:e.collection,operation:"aggregate",query:{options:{allowDiskUse:!0},pipeline:c(e)}}}function c(e){return[i.c({start:e.start,end:e.end},e.dateKey),{$group:{_id:{date:{$dateToString:{format:"%Y-%m-%d",date:"$event_timestamp"}},hour:{$dateToString:{format:"%H",date:"$event_timestamp"}},event_name:"$event_name",custom_attributes:"$custom_attributes.key"},hour:{$first:{$dateToString:{format:"%H",date:"$event_timestamp"}}},date:{$first:{$dateToString:{format:"%Y-%m-%d",date:"$event_timestamp"}}},event_name:{$first:"$event_name"},count:{$sum:1},custom_attributes:{$first:"$custom_attributes"}}},{$project:{_id:!1,hour:!0,date:!0,count:!0,event_name:!0,custom_attributes:!0,value:!0}},{$sort:{date:-1,hour:-1}}]}function l(e){return{database:o.a.dataService.database,collection:"summary_screen_unique_users",operation:"aggregate",query:{options:{allowDiskUse:!0},pipeline:u(e)}}}function u(e){return[i.a({field:"app_id",values:[e.app_id]}),i.b({fields:["app_id"],sumOutputs:["value"]})]}r.d(t,"a",(function(){return n})),r.d(t,"b",(function(){return a}))},,,,,,,function(e,t){e.exports=google.maps.visualization},,,,,,,,,,,,,,,,,,,,,,,,function(e,t){},,,,,,,,,,,,,,,function(e,t,r){"use strict";var n=r(358);r.d(t,"CheckBox",(function(){return n.a}));var a=r(359);r.o(a,"CHECK_BOX_THEME_RADIO")&&r.d(t,"CHECK_BOX_THEME_RADIO",(function(){return a.CHECK_BOX_THEME_RADIO}));var o=r(230);r.d(t,"CHECK_BOX_THEME_RADIO",(function(){return o.b}))},,,,function(e,t,r){"use strict";var n=r(602);r.d(t,"GlobalDialog",(function(){return n.a}));r(583),r(193)},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(e,t,r){"use strict";r.d(t,"a",(function(){return u}));var n=r(10),a=r.n(n),o=r(15),i=r(144);function s(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]:l,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case Object(o.getType)(i.a.setMenuItem):return c({},e,{selected:t.payload});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){},function(e,t,r){"use strict";r.d(t,"a",(function(){return u}));var n=r(10),a=r.n(n),o=r(15),i=r(30);function s(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]:l,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 C}));var n=r(30),a=r(51),o=r(61),i=r.n(o),s=r(52),c=r(42),l=r(85),u=r(66),d=r(121),p=r(124),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})):[]},g=Object(u.b)(n.a.resetPassword.request,(function(e){return s.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)}))})),b=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})})),m=Object(u.a)(n.a.resetPassword.failure,(function(e){return c.a.setError({title:"Error",message:e.message})})),y=Object(u.b)(n.a.updateUser.request,(function(e,t){return s.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 l.Actions.setMenuItem(t.value.menu.selected===p.b?d.b:t.value.menu.selected)})),v=Object(u.a)(n.a.updateUser.failure,(function(e){return c.a.setError({title:"Error",message:e.message})})),E=Object(u.b)(n.a.deleteUser.request,(function(e,t){return s.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))}))})),O=Object(u.a)(n.a.deleteUser.success,(function(e,t){return l.Actions.setMenuItem(t.value.menu.selected===p.b?d.b:t.value.menu.selected)})),S=Object(u.a)(n.a.deleteUser.failure,(function(e){return c.a.setError({title:"Error",message:e.message})})),C=[g,b,m,Object(u.b)(n.a.createUser.request,(function(e,t){return s.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 l.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})})),y,A,v,E,O,S,Object(u.b)(n.a.getUsers.request,(function(){return s.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 A}));var n=r(7),a=r.n(n),o=r(11),i=r.n(o),s=r(12),c=r.n(s),l=r(8),u=r.n(l),d=r(13),p=r.n(d),f=r(0),h=r.n(f),g=r(3),b=r(9),m=r(31),y=r(229),A=function(e){function t(){return a()(this,t),c()(this,u()(t).apply(this,arguments))}return p()(t,e),i()(t,[{key:"render",value:function(){var e=this.props,t=e.text,r=e.disabled,n=e.onPress,a=e.theme,o=void 0===a?y.j:a;return h.a.createElement(m.a,{style:{justifyContent:"center",alignItems:o.stretchWidth?"stretch":"center",opacity:o.disabledFade&&r?.5:void 0},onPress:n,disabled:r},h.a.createElement(g.a,{style:{justifyContent:"center",alignItems:"center",paddingHorizontal:o.paddingHorizontal,paddingVertical:o.paddingVertical,borderRadius:o.borderRadius,backgroundColor:r&&o.disabledBackgroundColor||o.backgroundColor,borderColor:o.borderColor,borderWidth:o.borderWidth,minWidth:o.minWidth,width:o.width,height:o.height}},h.a.createElement(b.a,{style:o.textStyle},t)))}}]),t}(h.a.PureComponent)},function(e,t){},function(e,t,r){"use strict";r.d(t,"a",(function(){return S}));var n=r(10),a=r.n(n),o=r(7),i=r.n(o),s=r(11),c=r.n(s),l=r(12),u=r.n(l),d=r(8),p=r.n(d),f=r(13),h=r.n(f),g=r(0),b=r.n(g),m=r(3),y=r(9),A=r(72),v=r(230);function E(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;t0&&void 0!==arguments[0]?arguments[0]:l,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 u}));var n=r(10),a=r.n(n),o=r(15),i=r(98);function s(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]:l,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(39);r.d(t,"ScrollGraphType",(function(){return n.a}));var a=r(212);r.o(a,"ConnectedValueLabel")&&r.d(t,"ConnectedValueLabel",(function(){return a.ConnectedValueLabel})),r.o(a,"VALUE_LABEL_THEME_LARGE")&&r.d(t,"VALUE_LABEL_THEME_LARGE",(function(){return a.VALUE_LABEL_THEME_LARGE})),r.o(a,"kvsComponentSelector")&&r.d(t,"kvsComponentSelector",(function(){return a.kvsComponentSelector}));var o=r(213);r.o(o,"ConnectedValueLabel")&&r.d(t,"ConnectedValueLabel",(function(){return o.ConnectedValueLabel})),r.o(o,"VALUE_LABEL_THEME_LARGE")&&r.d(t,"VALUE_LABEL_THEME_LARGE",(function(){return o.VALUE_LABEL_THEME_LARGE})),r.o(o,"kvsComponentSelector")&&r.d(t,"kvsComponentSelector",(function(){return o.kvsComponentSelector}));var i=r(130);r.o(i,"ConnectedValueLabel")&&r.d(t,"ConnectedValueLabel",(function(){return i.ConnectedValueLabel})),r.o(i,"VALUE_LABEL_THEME_LARGE")&&r.d(t,"VALUE_LABEL_THEME_LARGE",(function(){return i.VALUE_LABEL_THEME_LARGE})),r.o(i,"kvsComponentSelector")&&r.d(t,"kvsComponentSelector",(function(){return i.kvsComponentSelector}));var s=r(22);r.o(s,"ConnectedValueLabel")&&r.d(t,"ConnectedValueLabel",(function(){return s.ConnectedValueLabel})),r.o(s,"VALUE_LABEL_THEME_LARGE")&&r.d(t,"VALUE_LABEL_THEME_LARGE",(function(){return s.VALUE_LABEL_THEME_LARGE})),r.o(s,"kvsComponentSelector")&&r.d(t,"kvsComponentSelector",(function(){return s.kvsComponentSelector}));var c=r(215);r.o(c,"ConnectedValueLabel")&&r.d(t,"ConnectedValueLabel",(function(){return c.ConnectedValueLabel})),r.o(c,"VALUE_LABEL_THEME_LARGE")&&r.d(t,"VALUE_LABEL_THEME_LARGE",(function(){return c.VALUE_LABEL_THEME_LARGE})),r.o(c,"kvsComponentSelector")&&r.d(t,"kvsComponentSelector",(function(){return c.kvsComponentSelector}));var l=r(216);r.o(l,"ConnectedValueLabel")&&r.d(t,"ConnectedValueLabel",(function(){return l.ConnectedValueLabel})),r.o(l,"VALUE_LABEL_THEME_LARGE")&&r.d(t,"VALUE_LABEL_THEME_LARGE",(function(){return l.VALUE_LABEL_THEME_LARGE})),r.o(l,"kvsComponentSelector")&&r.d(t,"kvsComponentSelector",(function(){return l.kvsComponentSelector}));r(371)},function(e,t,r){"use strict";r.d(t,"a",(function(){return w}));var n=r(10),a=r.n(n),o=r(7),i=r.n(o),s=r(11),c=r.n(s),l=r(12),u=r.n(l),d=r(8),p=r.n(d),f=r(13),h=r.n(f),g=r(0),b=r.n(g),m=r(3),y=r(9),A=r(233),v=r(1),E=r(6),O=r(114);function S(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.a.setSchoolHolidays):return l({},e,{schoolHolidays:t.payload});case Object(o.getType)(i.a.setPublicHolidays):return l({},e,{publicHolidays:t.payload});case Object(o.getType)(i.a.setAppVersionsIos):return l({},e,{appVersionsIos:t.payload});case Object(o.getType)(i.a.setAppVersionsAndroid):return l({},e,{appVersionsAndroid:t.payload});case Object(o.getType)(i.a.setLastImported):return l({},e,{lastImported:t.payload});default:return e}}},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(e,t){},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(e,t,r){"use strict";r.d(t,"a",(function(){return f}));var n=r(17),a=r.n(n),o=r(10),i=r.n(o),s=r(7),c=r.n(s),l=r(11),u=r.n(l);function d(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 p(e){for(var t=1;t0?l+" - "+u+" / "+t:"0 / 0",p=t<=o||1===l,f=t<=o||u===t;return n.createElement(g.a,{style:D.container},n.createElement(v.a,{style:D.text}," ",d," "),n.createElement(E.a,{onPress:c,disabled:p},n.createElement(A.a,{source:S.c.arrowLeft,style:[D.arrow,{tintColor:p?i.disabledPageButtonColor:i.enabledPageButtonColor}]})),n.createElement(E.a,{onPress:s,disabled:f},n.createElement(A.a,{source:S.c.arrowRight,style:[D.arrow,{tintColor:f?i.disabledPageButtonColor:i.enabledPageButtonColor}]})))},D=O.a.create({container:{flexDirection:"row",alignItems:"center",alignSelf:"flex-end",padding:S.d.baseMargin},text:function(e){for(var t=1;t0?1:i.interpolate({inputRange:[0,.5,.75,1],outputRange:[0,.25,.5,1],extrapolate:"clamp"}),p=s?"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(A.a,{style:{overflow:"hidden",backgroundColor:"#00000000"},pointerEvents:"box-none"},y.a.createElement(E.a.View,{style:{overflow:"web"===k.a.OS?"visible":"scroll",width:l,height:u,opacity:d,minWidth:s?r:void 0,maxWidth:s?a:void 0,minHeight:s?void 0:r,maxHeight:s?void 0:a,flexDirection:p,justifyContent:f},pointerEvents:"box-none"},y.a.createElement(A.a,{onLayout:this.setChildrenExpanse,style:{flexDirection:p},pointerEvents:"box-none"},t)))}}]),t}(y.a.PureComponent);j.defaultProps={expandStyle:a.spring,duration:300,minExpanse:0,maxExpanse:1e4,direction:n.down};var T=r(1),P=r(239),M=r(6),L=function(e){function t(){return c()(this,t),p()(this,h()(t).apply(this,arguments))}return b()(t,e),u()(t,[{key:"render",value:function(){var e=this.props,t=e.item,r=e.theme,n=e.selectedValues,a=e.onValueChange,o=e.multiSelect,i=void 0!==n.find((function(e){return e===t.value}));return y.a.createElement(S.a,{onPress:function(){return a(t.value)}},y.a.createElement(A.a,{style:{paddingHorizontal:T.d.baseMargin,height:r.itemHeight,flexDirection:"row",alignItems:"center",justifyContent:"flex-start"}},o&&function(e){return y.a.createElement(A.a,{style:{flexDirection:"row"}},y.a.createElement(A.a,{style:{width:r.outerCheckSize,height:r.outerCheckSize,borderWidth:r.borderWidth,borderColor:r.outerCheckColor,borderRadius:r.outerCheckBorderRadius,justifyContent:"center",alignItems:"center"}},e&&y.a.createElement(A.a,{style:{width:r.innerCheckSize,height:r.innerCheckSize,backgroundColor:r.innerCheckColor,borderRadius:r.innerCheckBorderRadius}})),y.a.createElement(M.a.Spacer,null))}(i),y.a.createElement(v.a,{style:i?r.selectedItemFont:r.unselectedItemFont,numberOfLines:1,ellipsizeMode:"tail"},t.label)))}}]),t}(y.a.PureComponent),B=r(113),x=r(29);function _(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 R(e){for(var t=1;t=a?null:y.a.createElement(E.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:E.a.multiply(this.state.indicator,o/a).interpolate({inputRange:[0,s],outputRange:[0,s],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,s=i.items,c=i.theme,l=i.selectedValue,u=i.selectedValues,d=s.findIndex((function(e){return e.value===l}));return y.a.createElement(w.a,{animationType:"none",transparent:!0,supportedOrientations:["landscape"],visible:r,ariaHideApp:!1,onRequestClose:function(){e.onClose()}},y.a.createElement(S.a,{onPress:function(){return e.onClose()}},y.a.createElement(A.a,{style:{flex:1,paddingTop:o.y+o.height+T.d.smallMargin-c.shadowPadding,paddingLeft:o.x-c.shadowPadding,alignItems:"flex-start"}},y.a.createElement(j,{visible:n,anim:a},y.a.createElement(A.a,null,y.a.createElement(O.a,{initialScrollIndex:d>=0?d:void 0,getItemLayout:this.getItemLayout,style:R({width:o.width,maxHeight:c.maxBoxHeight,borderWidth:c.borderWidth,borderColor:c.borderColor,borderRadius:c.borderRadius,backgroundColor:c.backgroundColor,margin:c.shadowPadding},B.c),data:s,extraData:d,renderItem:function(t){var r=t.item;return y.a.createElement(L,{multiSelect:void 0!=u,item:r,selectedValues:u||[l],theme:c,onValueChange:e.onValueChange})},ListHeaderComponent:y.a.createElement(A.a,{style:{height:c.boxVerticalPadding}}),ListFooterComponent:y.a.createElement(A.a,{style:{height:c.boxVerticalPadding}}),keyExtractor:this.getListKey,showsVerticalScrollIndicator:!1,bounces:!1,scrollEnabled:!0,scrollEventThrottle:16,onScroll:E.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,s=n.find((function(e){return JSON.stringify(e.value)===JSON.stringify(a)})),c=s?s.label:r;return y.a.createElement(A.a,{style:i},y.a.createElement(S.a,{onPress:this.onToggle,disabled:this.props.disabled},y.a.createElement(A.a,{ref:this._ref,style:{height:o.pickerHeight,paddingLeft:T.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(v.a,{style:this.props.disabled?o.pickerDisabledFont:o.pickerFont,numberOfLines:1,ellipsizeMode:"tail"},c),y.a.createElement(E.a.Image,{source:T.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())}}]),t}(y.a.PureComponent);I.defaultProps={style:{},theme:P.a,disabled:!1}},function(e,t,r){"use strict";var n=r(10),a=r.n(n),o=r(7),i=r.n(o),s=r(11),c=r.n(s),l=r(12),u=r.n(l),d=r(8),p=r.n(d),f=r(13),h=r.n(f),g=r(0),b=r.n(g),m=r(3),y=r(9),A=r(1),v=r(6),E=r(42),O=r(18),S=r(70);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 w(e){for(var t=1;t2&&void 0!==arguments[2]?arguments[2]:1;switch(t){case a.Quarter:return e.clone().add(3*r,a.Month)}return e.clone().add(r,t)}function K(e,t){return F(e,t)?function(e,t){return Q(e,t,-(arguments.length>2&&void 0!==arguments[2]?arguments[2]:1))}(e,t):W(e,t)}function z(e,t){return F(e,t)?Q(e,t):Q(W(e,t),t)}var q=r(21),Y=r(19),X=r(627),J=r(65),$=r(28),Z=r(1);function ee(e){return e.toString().replace(/\B(?=(\d{3})+(?!\d))/g,",")}var te={Number:function(e){var t=e%1!==0&&Math.abs(e)<1e4?2:0;return ee(e.toFixed(t))},NumberTwoDecimalPlaces:function(e){return ee(e.toFixed(2))},Percent:function(e){return ee(e.toFixed(1))+"%"},Dollars:function(e){var t=Math.abs(e)<1e4?2:0;return"$"+ee(e.toFixed(t))},Stars:function(e){for(var t="",r=.5;r<=e;r++)t+="\u2b51";return t},Date:function(e){return H(e).format("D MMM YYYY")},DateTime:function(e){return H(e).format("D MMM YYYY, h:mm a")},DateTimeZone:function(e){return G(e).format("D MMM YYYY, h:mm a (z)")},Hour:function(e){return H(e).format("H")},Score:function(e){if(!e)return function(){};var t=JSON.parse(e).document_sentiment.score,r=t<-.3?Z.c.sadFace:t>.3?Z.c.happyFace:Z.c.indifferentFace;return function(){return b.a.createElement($.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 re(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 ne(e){for(var t=1;t0?n+o/a:n}})),r}function he(e,t,r,n){var a=[];t&&t.forEach((function(t){var r=H(t.date).startOf("day"),n=fe(r,e),o=fe(r.add(24,"hour"),e);n>=0&&o>=0&&a.push({startColumn:n,endColumn:o,label:t.description,color:T.a.green})})),r&&r.forEach((function(t){var r=H(t.date).startOf("day"),n=fe(r,e),o=fe(r.add(24,"hour"),e);n>=0&&o>=0&&a.push({startColumn:n,endColumn:o,label:t.description,color:T.a.red})})),a=function(e){for(var t=[],r=function(r){var n=ne({},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:T.a.red})}));for(var o=se().month(0).date(1),i=fe(o,e);i>=0;)a.push({startColumn:i,endColumn:i,label:o.format("YYYY"),color:T.a.darkGrey}),o.subtract(1,"year"),i=fe(o,e);return(i=fe(se(),e))>=0&&a.push({startColumn:i,endColumn:i,label:"Today"+se().format(" z"),color:T.a.darkGrey}),a}function ge(e,t,r,n,a,o,i,s,c){if(t){var l=pe(o,i,0);try{t.forEach((function(e){var t=H(e.date);l.forEach((function(r){!t.isBefore(r.start)&&t.isBefore(r.end)&&(r.value+=e.value)}))}));var u=he(l,r,n,a),d={graphItems:l,graphMarkers:u,categoryInfo:[],valueType:s.valueType,scrollGraphType:s.scrollGraphType,showLineOfBestFit:s.showLineOfBestFit,csvDefinition:s.csvDefinition,dataStamp:c};v.b.dispatch(Y.KVSComponentActions.setScrollGraphData(e,d))}catch(p){v.b.dispatch(B.a.setError({title:"Error",message:p.message}))}}}function be(e,t,r,n,a,o,i,s,c){if(t){var l=void 0!==s.categoryList?s.categoryList.length:s.categoryCount||0,u=s.categoryList||[];void 0===s.categoryList&&l>0&&(u=J.d.getTopGroups(t));var d=pe(o,i,u.length);try{t.forEach((function(e){var t=N(o,H(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(x.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:T.a.other}),e.forEach((function(e){for(e.csvCategoryValues=Object(x.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,l);var h=he(d,r,n,a),g={graphItems:d,graphMarkers:h,categoryInfo:f,csvCategoryInfo:p,valueType:s.valueType,scrollGraphType:s.scrollGraphType,showLineOfBestFit:s.showLineOfBestFit||!1,hidePopupTotalValue:s.hidePopupTotalValue,csvDefinition:s.csvDefinition,dataStamp:c};v.b.dispatch(Y.KVSComponentActions.setScrollGraphData(e,g))}catch(b){v.b.dispatch(B.a.setError({title:"Error",message:b.message}))}}}function me(e,t,r,n,a,o){if(t){var i=a.groupField||"group",s=(a.categories||J.d.getTopGroups(t,void 0,i)).map((function(e){return{title:e,value:0}}));try{var c=0;t.forEach((function(e){var t=H(e.date);if(!t.isBefore(r)&&t.isBefore(n)){var a=s.findIndex((function(t){var r=e[i];return r&&t.title===r}));a>=0?s[a].value+=e.value:c+=e.value}}));var l=s.filter((function(e){return e.value>0})).sort((function(e,t){return t.value-e.value}));if(c>0||s.length>a.categoryCount){for(;s.length>=a.categoryCount;){var u=s.pop();u&&(c+=u.value)}s.push({title:"Other",value:c,color:T.a.other})}var d={dataStamp:o,pieSlices:s,csvPieSlices:l,valueType:a.valueType,csvDefinition:a.csvDefinition};v.b.dispatch(Y.KVSComponentActions.setPieChartData(e,d))}catch(p){v.b.dispatch(B.a.setError({title:"Error",message:p.message}))}}}function ye(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=H(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===le.Average&&o.forEach((function(e){e.value=0===e.count?0:e.value/e.count})),a===le.Count&&o.forEach((function(e){e.value=e.count}))),o}function Ae(e,t,r,n,a){var o=ye(e,t,r,n,a).map((function(e){return e.value}));return Object(x.max)(o)||0}function ve(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:T.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(o.length>r.categoryCount)if(r.addOtherCategory){for(var s=0,c=0;o.length>=r.categoryCount;){var l=o.pop();r.calculation===le.Average?s+=((null==l?void 0:l.value)||0)*((null==l?void 0:l.count)||0):s+=(null==l?void 0:l.value)||0,c+=(null==l?void 0:l.count)||0}r.calculation===le.Average&&c>0&&(s/=c),o.push({label:"Other",value:s,count:c})}else for(;o.length>r.categoryCount;)o.pop();var u={dataStamp:n,items:o,csvItems:i,valueType:q.a.Number,defaultMaxValue:r.defaultMaxValue,csvDefinition:r.csvDefinition};v.b.dispatch(Y.KVSComponentActions.setBarChartData(e,u))}catch(d){v.b.dispatch(B.a.setError({title:"Error",message:d.message}))}}(e,ye(t,r,n,a.groupFilter,a.calculation),a,o)}catch(i){v.b.dispatch(B.a.setError({title:"Error",message:i.message}))}}function Ee(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(x.sortedIndexOf)(t,e.group)}(e,a)){var n=H(e.date);!n.isBefore(t)&&n.isBefore(r)&&(o+=e.value,i+=e.count)}})),n===le.Average&&i>0?o/i:n===le.Count?i:o}function Oe(e,t,r,n,a,o,i,s,c,l,u){return Se({key:e,title:t,description:r,data:n,groupFilter:a,startMoment:o,endMoment:i,valueType:s,calculationType:c,calculatePercentageChange:l,dataStamp:u})}function Se(e){if(e.data){var t,r=e.groupFilter?e.groupFilter.concat().sort():void 0,n=Ee(e.data,e.startMoment,e.endMoment,e.calculationType||le.Sum,r),a=void 0;if(e.calculatePercentageChange){var o=X.DashboardDataService.getPrevParams({start:e.startMoment,end:e.endMoment}),i=Ee(e.data,o.start,o.end,e.calculationType||le.Sum,r);0!==i&&(a=100*(n/i-1))}if(e.showCount){var s=Ee(e.data,e.startMoment,e.endMoment,le.Count,r);t=""+(e.showCount.prefix||"")+Object(q.b)(s,q.a.Number)+(e.showCount.suffix||"")}var c={title:e.title,description:e.description,value:n,valueType:e.valueType||q.a.Number,secondaryValue:t,percentageChange:a,dataStamp:e.dataStamp};return v.b.dispatch(Y.KVSComponentActions.setValueLabelData(e.key,c)),c}}function Ce(e,t,r,n,a){if(t){var o=[];t.forEach((function(e){var t=I.a.utc(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(ne({},e))}})),o.sort((function(e,t){return e.value0}));l.forEach((function(e){e.average=0===e.count?0:e.value/e.count})),l.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=[];l.forEach((function(e,t){u[t]={cells:[(t+1).toString(),e.category,te.NumberTwoDecimalPlaces(e.average),te.Number(e.count)]}}));var d={dataStamp:i,titleRow:{cells:["Rank","Category","Rating","Count"]},rows:u,cellFlex:[1,5,1,1]};v.b.dispatch(Y.KVSComponentActions.setDataTableData(e,d))}catch(p){v.b.dispatch(B.a.setError({title:"Error",message:p.message}))}}!function(e){e.Sum="Sum",e.Count="Count",e.Average="Average"}(le||(le={}));var De=r(173),ke=r(86),je=r(56);var Te=r(630),Pe=r(6),Me=r(207);function Le(e){var t=Object(A.d)(e.selector),r=Object(A.c)();return g.createElement(m.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&&g.createElement($.a,{style:{width:Z.d.icons.tiny,height:Z.d.icons.tiny,tintColor:Z.a.grey},source:e.icon}),e.icon&&g.createElement(Pe.a.Spacer,null),g.createElement(Me.PickerBox,{placeholder:e.placeholder,disabled:e.disabled,items:e.items,selectedValue:t,onValueChange:function(t){r(e.onChangeAction(t))},style:{flex:1},theme:Me.PICKER_BOX_THEME_SLIM}))}var Be=function(e){return b.a.createElement(Le,{placeholder:"App",icon:T.c.platform,selector:P.d.selectedApp,items:ke.appList.map((function(e){return{label:e.appId+" ("+e.operatingSystem+")",value:e}})),onChangeAction:P.a.setSelectedApp,style:{minWidth:200,maxWidth:350},disabled:e.disabled})},xe=r(631),_e=r(317),Re=r(31),Ie=r(94),Ue=r(69),Ve=r(38),He=r(36),Ge=r(160);function Ne(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 Fe=function(e){function t(){var e,r;i()(this,t);for(var n=arguments.length,a=new Array(n),o=0;o0||void 0!==r&&r>0;return b.a.createElement(m.a,{style:Ye({overflow:"hidden"},this.props.style),onLayout:this.onLayout},n&&b.a.Children.map(this.props.children,(function(e){return e&&e.props?b.a.cloneElement(e,{style:Ye({},e.props.style,{width:t,height:r})}):e})),!n&&b.a.createElement(ze.a,{showLoading:!1,style:Ye({},this.props.style,{position:"absolute"})}))}}]),t}(b.a.PureComponent),Je=r(203),$e={borderWidth:1,borderColor:Z.a.highlight,controlBackgroundColor:Z.a.controlBackground,backgroundColor:Z.a.highlight,iconColor:Z.a.highlight};function Ze(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 et(e){for(var t=1;tf){var g=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||v.y<0||v.y>c)if(Math.abs(g.b)>.001){var E={x:-g.a/g.b,y:0},O={x:(c-g.a)/g.b,y:c},S=E.xA.x&&(A=S),C.xc&&(A.y=c),v.y<0&&(v.y=0),v.y>c&&(v.y=c);var w=function(e){return n*(e-o)/(u-o)},D=function(e){return a*(1-e/c)},k="M"+w(A.x)+","+D(A.y)+"L"+w(v.x)+","+D(v.y);l.push(b.a.createElement(Ot.c,{key:"line_of_best_fit",d:k,stroke:s,strokeWidth:2,fillOpacity:0}))}}return l}}]),t}(g.PureComponent),wt=function(e){function t(){return i()(this,t),u()(this,p()(t).apply(this,arguments))}return h()(t,e),c()(t,[{key:"getTextWidth",value:function(e){var t=4;if(e)for(var r=0;r=f){var a=r*(e.startColumn-i)/(d-i),s=r*(e.endColumn-i)/(d-i);e.endColumn>e.startColumn||(p.push(b.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"})),l&&p.push(b.a.createElement(wt,{key:"marker_label_"+e.label+"_"+e.startColumn+"_"+t,x:(a+s)/2,y:o,label:e.label,color:e.color,backgroundColor:u.backgroundColor})))}}))}return p}}]),t}(g.PureComponent),kt=function(e){function t(){return i()(this,t),u()(this,p()(t).apply(this,arguments))}return h()(t,e),c()(t,[{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,s=o-1,c=[];if(void 0!==t){for(var l=Math.max(Math.min(Math.ceil(a-.5),t.graphItems.length-1),0),u=Math.max(Math.min(Math.floor(s+.5),t.graphItems.length-1),0),d="",p=Math.floor((u-l)/7),f=1;f=s&&(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)),l.push(b.a.createElement(Ot.d,{key:"data_band_column_"+e,x:a,y:r.y,width:f,height:r.h,fill:o,strokeWidth:0}))},g=u;g<=d;g++)h(g);l.push(b.a.createElement(Ot.c,{key:"data_band_lines",d:p,stroke:i,strokeWidth:1,fillOpacity:0}))}return l}}]),t}(g.PureComponent),Pt=r(80);function Mt(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=r.renderingPrediction()&&void 0!==l.prediction?[{description:"90%",value:r.formatValue(Math.max(l.prediction.max,Wt))},{description:"50%",value:r.formatValue(Math.max(l.prediction.expected,Wt))},{description:"10%",value:r.formatValue(Math.max(l.prediction.min,Wt))}]:void 0,p=[],f=Object(Ue.a)(o.categoryInfo.length);if(void 0!==l.categoryValues&&o.categoryInfo.length>0)for(var h=l.categoryValues.length-1;h>=0;h--)p.push({description:o.categoryInfo[h].name,value:r.formatValue(l.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(q.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(q.c)(t.value,e.valueType),color:e.color})})),{position:{x:t.paddingLeft+(c-i.startOffset)/s,y:Z.d.smallMargin},title:l.label,markerLabels:u,value:o.hidePopupTotalValue?void 0:r.formatValue(l.value),predictionLabels:d,categoryLabels:p}},r.renderPopupContents=function(e){var t=r.props.theme;return b.a.createElement(m.a,{style:{minWidth:100,maxWidth:150,width:e.categoryLabels&&e.categoryLabels.length>0?150:void 0}},b.a.createElement(k.a,{style:[Z.b.black.bodyS.regular,{alignSelf:"center"}]},e.title),void 0!==e.value&&b.a.createElement(k.a,{style:[Z.b.black.bodyS.thin,{alignSelf:"center"}]},e.value),void 0!==e.predictionLabels&&b.a.createElement(m.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 b.a.createElement(m.a,{key:"popup_prediction_"+t,style:{flexDirection:"row",alignItems:"center",justifyContent:"space-between"}},b.a.createElement(k.a,{style:Z.b.white.bodyXXS.regular},e.description),b.a.createElement(Pe.a.Spacer,null),b.a.createElement(k.a,{style:Z.b.white.bodyXXS.regular},e.value))}))),void 0!==e.categoryLabels&&e.categoryLabels.map((function(e,t){return b.a.createElement(m.a,{key:"popup_category_"+e+"_"+t,style:{flexDirection:"row",alignItems:"center"}},b.a.createElement(m.a,{style:{width:Z.d.smallMargin,height:Z.d.smallMargin,backgroundColor:e.color}}),b.a.createElement(Pe.a.SpacerSmall,null),b.a.createElement(k.a,{style:Z.b.grey.bodyXXS.thin,ellipsizeMode:"tail",numberOfLines:1},e.description),b.a.createElement(Pe.a.SpacerSmall,null),b.a.createElement(Pe.a.FlexSpacer,null),b.a.createElement(k.a,{style:Z.b.grey.bodyXXS.thin},e.value))})),void 0!==e.markerLabels&&e.markerLabels.map((function(e,t){return b.a.createElement(k.a,{key:"popup_marker_label_"+t,style:[Z.b.white.bodyXXS.regular,{color:e.color,textAlign:"center",alignSelf:"center"}]},e.description)})))},r.renderParentOverlay=function(e){var t=r.props.theme;return b.a.createElement(m.a,{style:{position:"absolute",width:1,backgroundColor:t.primaryAxisColor,left:e.position.x,top:t.paddingTop,bottom:t.paddingBottom}})},r.getScrubberOffsets=function(){var e=r.props,t=e.scrubberStartOffset,n=e.scrubberEndOffset,a=r.state.data,o=0,i=a.graphItems.length;return t&&n&&(o=t.__getValue(),i=n.__getValue()),{startOffset:o,endOffset:i,minColumn:Math.max(Math.ceil(o),0),maxColumn:Math.min(Math.floor(i),a.graphItems.length)-1}},r.getCSVData=function(){for(var e,t,n=r.state.data,a=r.getScrubberOffsets(),o=n.scrollGraphType!==jt.a.Line&&n.categoryInfo.length>0,i=[],s=function(e){var t=n.graphItems[e];if(o&&t.categoryValues&&t.categoryValues.length>0){var r=void 0!==t.csvCategoryValues&&void 0!==n.csvCategoryInfo,a=r?t.csvCategoryValues:t.categoryValues,s=r?n.csvCategoryInfo:n.categoryInfo,c=[];a.forEach((function(e,r){s.length>r&&c.push({label:t.label,category:s[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(q.c)(e.value,n.valueType,0)])}))}else i.push([t.label,Object(q.c)(t.value,n.valueType,0)])},c=a.minColumn;c<=a.maxColumn;c++)s(c);return{title:null==(e=n.csvDefinition)?void 0:e.title,headers:(null==(t=n.csvDefinition)?void 0:t.headers)||(o?["Date","Category","Value"]:["Date","Value"]),data:i}};var n=e.data,a=e.style,o=e.theme,s=r.calculatePercentages(n),c=a.width-o.paddingLeft-o.paddingRight,l=a.height-o.paddingTop-o.paddingBottom,d=r.getLegendHeight(l),f=l-d,h=f;(null==n?void 0:n.colorBands)&&n.colorBands.forEach((function(e){h-=e.height}));var g=r.getTopValue(s.graphItems,s.scrollGraphType);return r.state={animating:!1,lastGraphItems:s.graphItems,lastTopValue:g,rawData:n,data:s,topValue:g,width:e.style.width,height:e.style.height,axisHeight:f,graphWidth:c,graphHeight:h,graphAnim:new U.a.Value(0),legendHeight:d},r}return h()(t,e),c()(t,[{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:q.a.Number,scrollGraphType:jt.a.StackedArea,showLineOfBestFit:!1};if(e.scrollGraphType!=jt.a.StackedLinePercentage&&e.scrollGraphType!=jt.a.StackedAreaPercentage)return e;var t=It({},e,{valueType:q.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 It({},e,{value:100,categoryValues:t})})),t}},{key:"getLegendHeight",value:function(e){var t=this.props.theme.legendTheme;if(t&&t.legendOrientation===Pt.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 s=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(It({},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,s=a.lastTopValue,c=a.data,l=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),g=this.getCategoryLines(c.graphItems,c.categoryInfo.length),m=[];o&&(m=(m=this.getCategoryLines(i,c.categoryInfo.length)).map((function(e){return n.padPoints(e,h)})),g=g.map((function(e){return n.padPoints(e,h)})));var y=Object(Ue.a)(c.categoryInfo.length),A=[];if(e)for(var v=0;vt.startColumn;return b.a.createElement(Ot.a,{key:"marker_"+o},c&&b.a.createElement(Ot.d,{x:i,y:a,width:s-i,height:n,fill:t.color,fillOpacity:.75}))}))||b.a.createElement(Ot.a,null))}},{key:"getColorBandY",value:function(e){var t=this.state.data.colorBands,r=0;if(t)for(var n=0;na.categoryCount;t.forEach((function(e){var t=H(e.date).diff(r,"days");if(t>=0&&t=0?s[t].childItems[n].value+=e.value:l=!0}else l=!0}));var u=s.map((function(e){return ne({},e,{childItems:e.childItems.filter((function(e){return e.value>0})).sort((function(e,t){return t.value-e.value}))})}));l&&s.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:s,csvItems:u,valueType:q.a.Number,isVertical:a.isVertical,csvDefinition:a.csvDefinition};v.b.dispatch(Y.KVSComponentActions.setBarChartData(e,d))}catch(p){v.b.dispatch(B.a.setError({title:"Error",message:p.message}))}}}(cr.ErrorBarChart,r,e,t,{isVertical:!0,categoryCount:20})},s=function(e,t,r){var n=Object(zt.a)(e,t);!function(e,t,r,n,a){if(t){var o=[];try{t.forEach((function(e){var t=_.a.find(e.custom_attributes,{key:"ERROR_TITLE"}),a=_.a.find(e.custom_attributes,{key:"ERROR_MESSAGE"}),i=_.a.find(e.custom_attributes,{key:"ERROR_STATUS"}),s=_.a.find(e.custom_attributes,{key:"ORIGIN"}),c=I.a.utc(e.date);!c.isBefore(r)&&c.isBefore(n)&&o.push({cells:[e.date,e.hour,e.event_name,s?s.value:"",t?t.value:"",a?a.value:"",i?i.value:"",e.count.toString()]})}));var i={dataStamp:a,titleRow:{cells:["Date","Hour","Event","Origin","Title","Message","Status","Count"]},rows:o};v.b.dispatch(Y.KVSComponentActions.setDataTableData(e,i))}catch(s){v.b.dispatch(B.a.setError({title:"Error",message:s.message}))}}}(cr.ErrorsDetailTable,r,e,t,n)},c=Object(g.useCallback)((function(e,t,a){var o=Object(zt.a)(e,t);a!==tt.Changing&&a!==tt.Changed||r(Y.KVSComponentActions.setDataStampData(cr.DataStamp,o)),a===tt.Changed&&(i(e,t,n[sr.ErrorsByDayData]),s(e,t,n[sr.ErrorsDetailData]))}),[n]);return b.a.createElement(m.a,{style:{minWidth:T.d.minPageWidth,backgroundColor:T.a.pageBackground,padding:T.d.doubleBaseMargin}},b.a.createElement(Ve.Group,null,b.a.createElement(Et,{dateScrub:t,onEvent:c,label:a.lastImported.label},b.a.createElement(qt,{kvsSelector:Y.kvsComponentSelector,dataKey:cr.EventsByDayGraph,theme:xt}))),b.a.createElement(Pe.a.SpacerDouble,null),b.a.createElement(Ve.Group,null,b.a.createElement(ot.Label,{data:{text:"Top Errors",description:"The top errors for network calls during the selected time period."},theme:ot.LABEL_THEME_SUBHEADING}),b.a.createElement(Pe.a.SpacerDouble,null),o(cr.ErrorBarChart,3)),b.a.createElement(Ve.Group,null,b.a.createElement(ot.Label,{data:{text:"Errors",description:"The list of all errors made with the App during the selected time period."},theme:ot.LABEL_THEME_TITLE}),b.a.createElement(Pe.a.SpacerDouble,null),b.a.createElement(Xe,null,b.a.createElement(ar.ConnectedDataTable,{kvsSelector:Y.kvsComponentSelector,dataKey:cr.ErrorsDetailTable,dataStampKey:cr.DataStamp,pageSize:10}))))},dr=r(61),pr=r.n(dr),fr=r(74),hr=r.n(fr),gr=r(110),br=r(208);function mr(e,t,r,n,a){try{var o={cells:r.columns.map((function(e){return e.title}))},i=[];t&&t.forEach((function(e){var t=!0;if(r.dateFilter){var n=H(e[r.dateFilter.field]);t=!n.isBefore(r.dateFilter.startMoment)&&n.isBefore(r.dateFilter.endMoment)}if(t){var a=[];r.columns.forEach((function(t){var r=e[t.field];a.push(void 0!==r&&null!==r?t.valueFormatter?t.valueFormatter(r):r:"")})),i.push({cells:a})}}));var s={dataStamp:n,titleRow:o,rows:i,cellFlex:a};v.b.dispatch(Y.KVSComponentActions.setDataTableData(e,s))}catch(c){v.b.dispatch(B.a.setError({title:"Error",message:c.message}))}}function yr(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 Ar=function(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(r=",a.startMoment.toISOString()).where("time","<=",a.endMoment.toISOString()).get());case 4:i=p.sent,o=i.docs.map((function(e){return e.data()})).map((function(e){return e.time=I()(e.time),e})).sort((function(e,t){return t.time-e.time})),p.next=12;break;case 8:return p.prev=8,p.t0=p.catch(1),_(!0),p.abrupt("return");case 12:e(Jt.Actions.setKDSData(Br.FeedbackData,o)),s=r.schoolHolidays,c=r.publicHolidays,l=r.appVersionsIos,u=r.appVersionsAndroid,d=n?l:u,be(xr.ScrubberGraph,[],s,c,d,U.queryStartMoment,U.queryEndMoment,{scrollGraphType:Y.ScrollGraphType.Line,valueType:q.a.Number}),Ar.createDataTableData(xr.FeedbackTable,o,{columns:[{title:"First name",field:"firstname"},{title:"Last name",field:"lastname"},{title:"Username",field:"username"},{title:"Email",field:"email"},{title:"Type",field:"type"},{title:"Subject",field:"subject"},{title:"Message",field:"message"},{title:"Date",field:"time",valueFormatter:function(e){return e.format("DD/MM/YYYY")}},{title:"Rating",field:"rating",valueFormatter:H},{title:"CS",field:"customerService",valueFormatter:G},{title:"Info",field:"deviceInfo",valueFormatter:N}]},t,[10,10,10,10,5,20,50,10,5,5,5]);case 17:case"end":return p.stop()}}),null,null,[[1,8]])}),[Nr,r]);Object(g.useEffect)((function(){F(void 0)}),[x]);var W=Object(g.useCallback)((function(){return S.a.async((function(e){for(;;)switch(e.prev=e.next){case 0:if(!u||!h){e.next=15;break}return e.prev=1,M(!0),e.next=5,S.a.awrap(Gr.signInWithEmailAndPassword(u,h));case 5:_(!1),e.next=12;break;case 8:e.prev=8,e.t0=e.catch(1),C(e.t0.message),_(!0);case 12:return e.prev=12,M(!1),e.finish(12);case 15:case"end":return e.stop()}}),null,null,[[1,8,12,15]])}),[u,h]);return b.a.createElement(m.a,{style:_r.container},b.a.createElement(Ve.Group,null,b.a.createElement(Et,{dateScrub:U,onEvent:V},b.a.createElement(qt,{kvsSelector:Y.kvsComponentSelector,dataKey:xr.ScrubberGraph,theme:xt}))),b.a.createElement(Pe.a.SpacerDouble,null),b.a.createElement(Ve.Group,null,b.a.createElement(ot.Label,{data:{text:"App Feedback",description:"Customer feedback submitted via the app."},theme:ot.LABEL_THEME_SUBHEADING}),b.a.createElement(Pe.a.Spacer,null),b.a.createElement(Xe,{style:{width:"100%"}},b.a.createElement(ar.ConnectedDataTable,{kvsSelector:Y.kvsComponentSelector,dataKey:xr.FeedbackTable,dataStampKey:xr.DataStamp,pageSize:10,theme:gr.b})),i&&b.a.createElement(Ir,{info:i,onDismiss:function(){return s(void 0)}})),x&&b.a.createElement(Rr,{error:O,disableButton:j,onDismiss:W,onChangeUsername:d,onChangePassword:y}))};!function(e){e.ScreenViewsByDay="UsageScreen ScreenViewsByDay",e.UniqueUsers="UsageScreen UniqueUsers",e.UserSessions="UsageScreen UserSessions",e.AllTimeUsers="UsageScreen AllTimeUsers"}(Ur||(Ur={})),function(e){e.DataStamp="UsageScreen Data Stamp",e.ScrubberGraph="UsageScreen Scrubber Graph",e.UniqueUsersLineGraph="UsageScreen Unique Users Line Graph",e.SessionsLineGraph="UsageScreen Sessions Line Graph",e.ActiveUsersLabel="UsageScreen Active Users Label",e.AllTimeUsersLabel="UsageScreen All Time Users Label",e.TopScreensViewedTable="UsageScreen Top Screens Viewed Table",e.TopScreensViewedPieChart="UsageScreen Top Screens Viewed Pie Chart",e.UserSessionsLabel="UsageScreen Sessions Label"}(Vr||(Vr={}));var Wr,Qr,Kr=function(e){function t(e){var r;i()(this,t),(r=u()(this,p()(t).call(this,e))).onScrubberEvent=function(e,t,n){var a=Object(zt.a)(e,t)+r.props.selectedApp.appId;n!==tt.Changing&&n!==tt.Changed||r.props.dispatch(Y.KVSComponentActions.setDataStampData(Vr.DataStamp,a)),n===tt.Changed&&(Ce(Vr.TopScreensViewedTable,r.props.kdsData[Ur.ScreenViewsByDay],e,t,a),me(Vr.TopScreensViewedPieChart,r.props.kdsData[Ur.ScreenViewsByDay],e,t,{categoryCount:20,valueType:q.a.Number,csvDefinition:{headers:["Screen","Views"]}},a),Oe(Vr.ActiveUsersLabel,"Unique Users","The number of unique users using the app during the selected time period.",r.props.kdsData[Ur.UniqueUsers],void 0,e,t,q.a.Number,le.Sum,!0,q.a.Number),Oe(Vr.UserSessionsLabel,"User Sessions","The number of sessions in the app during the selected time period.",r.props.kdsData[Ur.UserSessions],void 0,e,t,q.a.Number,le.Sum,!0,q.a.Number))},r.renderGraph=function(e){var t=r.state.dateScrub;return b.a.createElement(Xe,{calculateHeight:!0,aspectRatio:3},b.a.createElement(qt,{kvsSelector:Y.kvsComponentSelector,dataKey:e,scrubberStartOffset:t.scrubberStartOffset,scrubberEndOffset:t.scrubberEndOffset}))},r.props.dispatch(Y.KVSComponentActions.clearComponentData());var n=ce({queryEndMoment:se().add(1,"days"),scrubberStartMoment:se().subtract(29,"days")});return r.state={dateScrub:n},r}return h()(t,e),c()(t,[{key:"reloadData",value:function(){var e=this,t=this.state.dateScrub;this.updateComponentData().then((function(){var r=vt(t);e.onScrubberEvent(r.startMoment,r.endMoment,tt.Changed)})).catch((function(t){e.props.dispatch(B.a.setError({title:"Error",message:t.message}))}))}},{key:"componentDidUpdate",value:function(e){(0==e.data.appVersionsIos.length&&this.props.data.appVersionsIos.length>0||0==e.data.appVersionsAndroid.length&&this.props.data.appVersionsAndroid.length>0||e.selectedApp.appId!==this.props.selectedApp.appId)&&this.reloadData()}},{key:"componentDidMount",value:function(){this.reloadData()}},{key:"updateComponentData",value:function(){var e,t,r,n,a,o,i,s,c,l,u=this;return S.a.async((function(d){for(;;)switch(d.prev=d.next){case 0:return e=this.state.dateScrub,t=this.props.data,r=t.appVersionsIos,n=t.appVersionsAndroid,a=this.props.selectedApp,o="ios"===a.operatingSystem?r:n,i=[],s={collectionKey:"summary_screen_screen_views_by_day",dateKey:"$date",groupKey:"$category",filter:{field:"app_id",values:[a.appId]}},i.push(ke.default.groupedDailyValueFromParams(s).then((function(e){u.props.dispatch(Jt.Actions.setKDSData(Ur.ScreenViewsByDay,e))}))),c={collectionKey:"summary_screen_unique_users",dateKey:"$date",valueKey:"$value",countKey:"$count",filter:{field:"app_id",values:[a.appId]}},i.push(ke.default.usageScreenAllTimeUsers({app_id:a.appId}).then((function(e){var t,r,n,a,o,i,s;t=Vr.AllTimeUsersLabel,r="All Time Users",n="Total number of unique users that have accessed the app at any point",a=e.value,o=q.a.Number,i=void 0,s=void 0,v.b.dispatch(Y.KVSComponentActions.setValueLabelData(t,{title:r,description:n,value:a,valueType:o,percentageChange:i,dataStamp:s}))}))),i.push(ke.default.dailyValueFromParams(c).then((function(t){u.props.dispatch(Jt.Actions.setKDSData(Ur.UniqueUsers,t)),ge(Vr.ScrubberGraph,t,void 0,void 0,o,e.queryStartMoment,e.queryEndMoment,{scrollGraphType:jt.a.Line,valueType:q.a.Number,showLineOfBestFit:!1}),ge(Vr.UniqueUsersLineGraph,t,void 0,void 0,o,e.queryStartMoment,e.queryEndMoment,{scrollGraphType:jt.a.Line,valueType:q.a.Number,showLineOfBestFit:!0,csvDefinition:{headers:["Date","Unique Users"]}})}))),l={collectionKey:"summary_screen_sessions",dateKey:"$date",valueKey:"$value",countKey:"$count",filter:{field:"app_id",values:[a.appId]}},i.push(ke.default.dailyValueFromParams(l).then((function(t){u.props.dispatch(Jt.Actions.setKDSData(Ur.UserSessions,t)),ge(Vr.SessionsLineGraph,t,void 0,void 0,o,e.queryStartMoment,e.queryEndMoment,{scrollGraphType:jt.a.Line,valueType:q.a.Number,showLineOfBestFit:!0,csvDefinition:{headers:["Date","Session Count"]}})}))),d.abrupt("return",Promise.all(i));case 13:case"end":return d.stop()}}),null,this)}},{key:"render",value:function(){var e=this.state.dateScrub;return b.a.createElement(m.a,{style:{minWidth:T.d.minPageWidth,backgroundColor:T.a.pageBackground,padding:T.d.doubleBaseMargin}},b.a.createElement(Ve.Group,null,b.a.createElement(Et,{dateScrub:e,onEvent:this.onScrubberEvent,label:this.props.data.lastImported.label},b.a.createElement(qt,{kvsSelector:Y.kvsComponentSelector,dataKey:Vr.ScrubberGraph,theme:xt}))),b.a.createElement(Pe.a.SpacerDouble,null),b.a.createElement(Ve.Group,null,b.a.createElement(m.a,{style:{flexDirection:"row"}},b.a.createElement(Y.ConnectedValueLabel,{kvsSelector:Y.kvsComponentSelector,dataKey:Vr.UserSessionsLabel,style:{flex:1},theme:Y.VALUE_LABEL_THEME_LARGE}),b.a.createElement(Pe.a.SpacerDouble,null),b.a.createElement(Y.ConnectedValueLabel,{kvsSelector:Y.kvsComponentSelector,dataKey:Vr.ActiveUsersLabel,style:{flex:1},theme:Y.VALUE_LABEL_THEME_LARGE}),b.a.createElement(Pe.a.SpacerDouble,null),b.a.createElement(Y.ConnectedValueLabel,{kvsSelector:Y.kvsComponentSelector,dataKey:Vr.AllTimeUsersLabel,theme:Y.VALUE_LABEL_THEME_LARGE,style:{flex:1}})),b.a.createElement(Pe.a.SpacerDouble,null),b.a.createElement(m.a,{style:{flexDirection:"row"}},b.a.createElement(m.a,{style:{flex:1}},b.a.createElement(ot.Label,{data:{text:"Unique Users",description:"The number of unique users that accessed the app each day."},theme:ot.LABEL_THEME_COMPONENT_CAPTION}),this.renderGraph(Vr.UniqueUsersLineGraph)))),b.a.createElement(Pe.a.SpacerDouble,null),b.a.createElement(Ve.Group,null,b.a.createElement(m.a,{style:{flexDirection:"row"}},b.a.createElement(m.a,{style:{flex:1}},b.a.createElement(m.a,{style:{flex:1}},b.a.createElement(ot.Label,{data:{text:"User Sessions",description:"The number of distinct sessions (a period of use for a given user) recorded for each day."},theme:ot.LABEL_THEME_COMPONENT_CAPTION}),this.renderGraph(Vr.SessionsLineGraph))))),b.a.createElement(Pe.a.SpacerDouble,null),b.a.createElement(Ve.Group,null,b.a.createElement(ot.Label,{data:{text:"Top Screens Viewed",description:"The number of times each screen has been viewed during the given time interval by any user."},theme:ot.LABEL_THEME_SUBHEADING}),b.a.createElement(Pe.a.SpacerDouble,null),b.a.createElement(m.a,{style:{flexDirection:"row"}},b.a.createElement(Xe,{style:{flex:2}},b.a.createElement(ar.ConnectedDataTable,{kvsSelector:Y.kvsComponentSelector,dataKey:Vr.TopScreensViewedTable,dataStampKey:Vr.DataStamp,pageSize:10})),b.a.createElement(Pe.a.SpacerDouble,null),b.a.createElement(Xe,{style:{flex:1}},b.a.createElement(nr.ConnectedPieChart,{kvsSelector:Y.kvsComponentSelector,dataKey:Vr.TopScreensViewedPieChart,dataStampKey:Vr.DataStamp})))),b.a.createElement(Pe.a.SpacerDouble,null))}}]),t}(b.a.Component),zr=Object(A.b)((function(e){return{kdsData:e.kdsData,data:e.data,selectedApp:P.d.selectedApp(e)}}))(Kr),qr=r(130),Yr=r(105),Xr=r(97);!function(e){e.DailyRatingsByGame="SurveysScreen Daily Ratings By Game"}(Wr||(Wr={})),function(e){e.DataStamp="SurveysScreen Data Stamp",e.ScrubberGraph="SurveysScreen Scrubber Graph",e.AverageRatingLabel="SurveysScreen Average Rating Label",e.PositiveFeedbackCountLabel="SurveysScreen Positive Feedback Count Label",e.PositiveFeedbackBarChart="SurveysScreen Positive Feedback Bar Chart",e.NegativeFeedbackCountLabel="SurveysScreen Negative Feedback Count Label",e.NegativeFeedbackBarChart="SurveysScreen Negative Feedback Bar Chart",e.HighestRatedGameTable="SurveysScreen Highest Rated Games Table",e.LowestRatedGameTable="SurveysScreen Lowest Rated Games Table"}(Qr||(Qr={}));var Jr,$r,Zr="All games",en=[Xr.b.SaturdayLotto,Xr.b.MondayLotto,Xr.b.WednesdayLotto,Xr.b.OzLotto,Xr.b.Powerball,Xr.b.SetForLife,Xr.b.Super66],tn=function(e){function t(e){var r;return i()(this,t),(r=u()(this,p()(t).call(this,e))).refreshComponents=function(){var e=vt(r.state.dateScrub);r.onScrubberEvent(e.startMoment,e.endMoment,tt.Changed)},r.onScrubberEvent=function(e,t,n){var a=r.state.filter,o=r.getDataStamp(e,t,a);if(n!==tt.Changing&&n!==tt.Changed||r.props.dispatch(Y.KVSComponentActions.setDataStampData(Qr.DataStamp,o)),n===tt.Changed){var i=a==Zr?en:[a],s=r.props.kdsData[Wr.DailyRatingsByGame];Se({key:Qr.AverageRatingLabel,title:"Average Rating",description:"The average user rating for the selected game(s) over the selected time period. Users rate their gaming experience from 1 to 5.",data:s,groupFilter:i,startMoment:e,endMoment:t,valueType:q.a.Number,calculationType:le.Average,showCount:{suffix:" Ratings"},calculatePercentageChange:!0,dataStamp:o}),we(Qr.HighestRatedGameTable,s,e,t,!1,i,o),we(Qr.LowestRatedGameTable,s,e,t,!0,i,o);var c=r.state.filter==Zr?void 0:[r.state.filter];r.updateFetchedData(e,t,o,c)}},r.renderBarChart=function(e){var t=r.state.dateScrub;return b.a.createElement(Xe,{calculateHeight:!0,aspectRatio:1.5},b.a.createElement(ir.ConnectedBarChart,{kvsSelector:Y.kvsComponentSelector,dataKey:e,dataStampKey:Qr.DataStamp,scrubberStartOffset:t.scrubberStartOffset,scrubberEndOffset:t.scrubberEndOffset}))},r.getRatingsTheme=function(e){return e>=4?qr.VALUE_LABEL_THEME_HUGE_GREEN_CENTERED:e>=2?qr.VALUE_LABEL_THEME_HUGE_ORANGE_CENTERED:e>=1?qr.VALUE_LABEL_THEME_HUGE_RED_CENTERED:qr.VALUE_LABEL_THEME_HUGE_GREY_CENTERED},r.onGamePicker=function(e){r.setState({filter:e},r.refreshComponents)},r.renderGraphFilterPicker=function(){var e=r.state.filter;return b.a.createElement(m.a,null,b.a.createElement(Me.PickerBox,{placeholder:Zr,items:[{label:Zr,value:Zr}].concat(hr()(en.map((function(e){return{label:e,value:e}})))),selectedValue:r.state.filter,onValueChange:r.onGamePicker,style:{flex:1}}),b.a.createElement(Yr.InfoButton,{title:"Filtering Results",description:r.getGraphFilterDescription(e)}))},r.props.dispatch(Y.KVSComponentActions.clearComponentData()),r.state={dateScrub:ce({}),filter:Zr},r}return h()(t,e),c()(t,[{key:"componentDidMount",value:function(){var e=this;this.updateComponentData().then((function(t){var r=vt(e.state.dateScrub);e.onScrubberEvent(r.startMoment,r.endMoment,tt.Changed)}))}},{key:"updateComponentData",value:function(){var e,t,r,n,a,o,i,s,c,l=this;return S.a.async((function(u){for(;;)switch(u.prev=u.next){case 0:return e=this.props.data,t=e.schoolHolidays,r=e.publicHolidays,n=e.appVersionsIos,a=e.appVersionsAndroid,o=this.props.selectedApp,i="ios"===o.operatingSystem?n:a,s=this.state.dateScrub,(c=[]).push(ke.default.groupedDailyValue("survey_counts_by_rating").then((function(e){be(Qr.ScrubberGraph,e,t,r,i,s.queryStartMoment,s.queryEndMoment,{categoryList:["1","2","3","4","5"],scrollGraphType:jt.a.StackedArea,valueType:q.a.Number})}))),c.push(ke.default.groupedDailyValue("survey_total_ratings_by_game").then((function(e){l.props.dispatch(Jt.Actions.setKDSData(Wr.DailyRatingsByGame,e))}))),u.abrupt("return",Promise.all(c));case 8:case"end":return u.stop()}}),null,this)}},{key:"getDataStamp",value:function(e,t,r){return Object(zt.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:ke.default.feedback({collectionKey:"survey_feedback_by_type_and_game",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})),s=Ae(o,e,t,void 0,le.Count),c=Ae(i,e,t,void 0,le.Count),l=Math.max(s,c);a.props.dispatch(Y.KVSComponentActions.setLabelData(Qr.PositiveFeedbackCountLabel,{text:(o?o.length:0)+" Positive Rating Attributes"})),ve(Qr.PositiveFeedbackBarChart,o,e,t,{categoryCount:5,calculation:le.Count,sortBy:"value",invertValence:!1,defaultMaxValue:l,csvDefinition:{headers:["Response","Count"]}},r),a.props.dispatch(Y.KVSComponentActions.setLabelData(Qr.NegativeFeedbackCountLabel,{text:(i?i.length:0)+" Negative Rating Attributes"})),ve(Qr.NegativeFeedbackBarChart,i,e,t,{categoryCount:5,calculation:le.Count,sortBy:"value",invertValence:!1,defaultMaxValue:l,csvDefinition:{headers:["Response","Count"]}},r)}));case 1:case"end":return o.stop()}}))}},{key:"getGraphFilterDescription",value:function(e){return void 0===e||e===Zr?"Results include ratings for games.":"Results are for ratings for deliveries to "+e+"."}},{key:"render",value:function(){var e=this.state.dateScrub;return b.a.createElement(m.a,{style:{minWidth:T.d.minPageWidth,backgroundColor:T.a.pageBackground,padding:T.d.doubleBaseMargin}},b.a.createElement(Ve.Group,null,b.a.createElement(Et,{dateScrub:e,label:this.props.data.lastImported.label,onEvent:this.onScrubberEvent},b.a.createElement(qt,{kvsSelector:Y.kvsComponentSelector,dataKey:Qr.ScrubberGraph,theme:xt})),b.a.createElement(Pe.a.SpacerDouble,null),this.renderGraphFilterPicker()),b.a.createElement(Pe.a.SpacerDouble,null),b.a.createElement(Ve.Group,null,b.a.createElement(ot.Label,{data:{text:"Ratings"},style:{flex:1},theme:ot.LABEL_THEME_TITLE}),b.a.createElement(Pe.a.Spacer,null),b.a.createElement(qr.ConnectedValueLabel,{kvsSelector:Y.kvsComponentSelector,dataKey:Qr.AverageRatingLabel,dataStampKey:Qr.DataStamp,style:{maxWidth:250,minHeight:140},theme:this.getRatingsTheme})),b.a.createElement(Pe.a.SpacerDouble,null),b.a.createElement(Ve.Group,null,b.a.createElement(m.a,{style:{flexDirection:"row"}},b.a.createElement(m.a,{style:{flex:1}},b.a.createElement(ot.Label,{data:{text:"Positive Rating Attributes",description:"The breakdown of the positive feedback that was recieved for the selected game(s) over the selected time period."},theme:ot.LABEL_THEME_SUBHEADING}),b.a.createElement(ot.ConnectedLabel,{kvsSelector:Y.kvsComponentSelector,dataKey:Qr.PositiveFeedbackCountLabel,theme:ot.LABEL_THEME_LIGHT}),b.a.createElement(Pe.a.Spacer,null),this.renderBarChart(Qr.PositiveFeedbackBarChart)),b.a.createElement(Pe.a.SpacerDouble,null),b.a.createElement(m.a,{style:{flex:1}},b.a.createElement(ot.Label,{data:{text:"Negative Rating Attributes",description:"The breakdown of the negative feedback that was recieved for the selected game(s) over the selected time period."},theme:ot.LABEL_THEME_SUBHEADING}),b.a.createElement(ot.ConnectedLabel,{kvsSelector:Y.kvsComponentSelector,dataKey:Qr.NegativeFeedbackCountLabel,theme:ot.LABEL_THEME_LIGHT}),b.a.createElement(Pe.a.Spacer,null),this.renderBarChart(Qr.NegativeFeedbackBarChart)))),b.a.createElement(Pe.a.SpacerDouble,null),b.a.createElement(Ve.Group,null,b.a.createElement(m.a,{style:{flexDirection:"row"}},b.a.createElement(m.a,{style:{flex:1}},b.a.createElement(ot.Label,{data:{text:"Highest Rated Games",description:"The top ranked games based on the user feedback from the selected game(s) over the selected time period. Rating is the average rating and Count the number of ratings made for that game."},theme:ot.LABEL_THEME_SUBHEADING}),b.a.createElement(Pe.a.Spacer,null),b.a.createElement(Xe,{style:{width:"100%"}},b.a.createElement(ar.ConnectedDataTable,{kvsSelector:Y.kvsComponentSelector,dataKey:Qr.HighestRatedGameTable,dataStampKey:Qr.DataStamp,pageSize:10}))),b.a.createElement(Pe.a.SpacerDouble,null),b.a.createElement(m.a,{style:{flex:1}},b.a.createElement(ot.Label,{data:{text:"Lowest Rated Games",description:"The worst ranked games based on the user feedback from the selected carpark(s) over the selected time period. Rating is the average rating and Count the number of ratings made for that game."},theme:ot.LABEL_THEME_SUBHEADING}),b.a.createElement(Pe.a.Spacer,null),b.a.createElement(Xe,{style:{width:"100%"}},b.a.createElement(ar.ConnectedDataTable,{kvsSelector:Y.kvsComponentSelector,dataKey:Qr.LowestRatedGameTable,dataStampKey:Qr.DataStamp,pageSize:10}))))))}}]),t}(b.a.Component),rn=Object(A.b)((function(e){return{kdsData:e.kdsData,data:e.data,selectedApp:P.d.selectedApp(e)}}))(tn);!function(e){e.DailyBookingsRevenueByPlatform="PlatformScreen Daily Bookings Revenue By Platform"}(Jr||(Jr={})),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"}($r||($r={}));var nn=function(e){function t(){return i()(this,t),u()(this,p()(t).apply(this,arguments))}return h()(t,e),c()(t,[{key:"componentDidMount",value:function(){this.update()}},{key:"componentDidUpdate",value:function(e){Object(x.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",ge($r.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:q.a.Number,showLineOfBestFit:!1}));case 3:if(void 0===r){o.next=5;break}return o.abrupt("return",be($r.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:q.a.Dollars}));case 5:case"end":return o.stop()}}),null,this)}},{key:"render",value:function(){var e=this.props,t=e.dateScrub,r=e.lastImported,n=e.onScrubberEvent;return b.a.createElement(Ve.Group,null,b.a.createElement(Et,{dateScrub:t,label:r,onEvent:n},b.a.createElement(qt,{kvsSelector:Y.kvsComponentSelector,dataKey:$r.ScrubberGraph,theme:xt})))}}]),t}(b.a.PureComponent),an=r(49);function on(e,t,r,n){var a=[an.c({start:e,end:t},"date")];return n&&a.push(an.a(n)),a.push(an.b({fields:["userId",r],firstOutputs:["date",r]})),a.push(an.b({fields:[r],firstOutputs:["date",r],addCount:"value"})),a.push(an.f({outputs:["date","value"],projectOutputs:[{from:r,to:"group"},{from:"value",to:"count"}]})),$t.QueryService.tableDataRequest({database:je.a.dataService.database,collection:"platform_unique_users",operation:"aggregate",query:{options:{allowDiskUse:!0},pipeline:a}})}var sn=function(e){function t(){return i()(this,t),u()(this,p()(t).apply(this,arguments))}return h()(t,e),c()(t,[{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",on(e.startMoment,e.endMoment,this.props.field,this.props.filter).then((function(r){me(t.props.kvsComponentKey,r,e.startMoment,e.endMoment,{categoryCount:10,valueType:q.a.Number,csvDefinition:{headers:t.props.csvHeaders}},e.dataStamp)})));case 1:case"end":return r.stop()}}),null,this)}},{key:"render",value:function(){return b.a.createElement(Ve.Group,{style:{flex:1}},b.a.createElement(ot.Label,{data:{text:this.props.title,description:this.props.description},theme:ot.LABEL_THEME_SUBHEADING}),b.a.createElement(Pe.a.SpacerDouble,null),b.a.createElement(Xe,{style:{maxHeight:400},aspectRatio:1.5,calculateHeight:!0},b.a.createElement(nr.ConnectedPieChart,{kvsSelector:Y.kvsComponentSelector,dataKey:this.props.kvsComponentKey,dataStampKey:$r.DataStamp,legendTheme:Pt.c})))}}]),t}(b.a.PureComponent);var cn=function(e){function t(){return i()(this,t),u()(this,p()(t).apply(this,arguments))}return h()(t,e),c()(t,[{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",on(e.startMoment,e.endMoment,"mobileModel",this.props.filter).then((function(t){ve($r.MobileModelBarChart,t,e.startMoment,e.endMoment,{categoryCount:20,addOtherCategory:!0,calculation:le.Sum,sortBy:"value",invertValence:!1,csvDefinition:{headers:["Phone Model","Count"]}},e.dataStamp)})));case 1:case"end":return t.stop()}}),null,this)}},{key:"render",value:function(){var e=this.props.dateScrub;return b.a.createElement(Ve.Group,{style:{flex:1}},b.a.createElement(ot.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:ot.LABEL_THEME_SUBHEADING}),b.a.createElement(Pe.a.SpacerDouble,null),b.a.createElement(Xe,{style:{minHeight:500,flex:1}},b.a.createElement(ir.ConnectedBarChart,{kvsSelector:Y.kvsComponentSelector,dataKey:$r.MobileModelBarChart,dataStampKey:$r.DataStamp,scrubberStartOffset:e.scrubberStartOffset,scrubberEndOffset:e.scrubberEndOffset})))}}]),t}(b.a.PureComponent),ln=r(159),un=function(e){function t(e){var r;return i()(this,t),(r=u()(this,p()(t).call(this,e))).onScrubberEvent=function(e,t,n){if(n===tt.Changing||n===tt.Changed){var a=Object(zt.a)(e,t)+r.props.selectedApp.appId;r.props.dispatch(Y.KVSComponentActions.setDataStampData($r.DataStamp,a)),n===tt.Changed&&r.setState({dataSync:{startMoment:e,endMoment:t,dataStamp:a}})}},r.props.dispatch(Y.KVSComponentActions.clearComponentData()),r.state={dateScrub:ce({})},r}return h()(t,e),c()(t,[{key:"componentDidMount",value:function(){this.reloadData()}},{key:"componentDidUpdate",value:function(e){e.selectedApp.appId!==this.props.selectedApp.appId&&this.reloadData()}},{key:"reloadData",value:function(){var e=this,t=this.state.dateScrub;this.updateComponentData().then((function(){var r=vt(t);e.onScrubberEvent(r.startMoment,r.endMoment,tt.Changed)})).catch((function(t){e.props.dispatch(B.a.setError({title:"Error",message:t.message}))}))}},{key:"updateComponentData",value:function(){var e,t,r,n=this;return S.a.async((function(a){for(;;)switch(a.prev=a.next){case 0:return e=this.props.selectedApp,t=[],r={collectionKey:"summary_screen_unique_users",dateKey:"$date",valueKey:"$value",countKey:"$count",filter:{field:"app_id",values:[e.appId]}},t.push(ln.a.dailyValueFromParams(r).then((function(e){n.props.dispatch(Jt.Actions.setKDSData(Jr.DailyBookingsRevenueByPlatform,e))}))),a.abrupt("return",Promise.all(t));case 5:case"end":return a.stop()}}),null,this)}},{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,s=n.appVersionsIos,c=n.appVersionsAndroid,l=this.props.kdsData[Jr.DailyBookingsRevenueByPlatform],u=this.props.selectedApp,d="ios"===u.operatingSystem?s:c,p={field:"appId",values:[this.props.selectedApp.appId]};return b.a.createElement(Pe.a.Screen,{forceScrollbar:!0},b.a.createElement(nn,{dateScrub:t,dailyData:l,calendarEvents:{schoolHolidays:o,publicHolidays:i,appVersions:d},lastImported:a.label,onScrubberEvent:this.onScrubberEvent}),b.a.createElement(Pe.a.SpacerDouble,null),b.a.createElement(m.a,{style:{flexDirection:"row",width:"100%"}},b.a.createElement(sn,{dataSync:r,kvsComponentKey:$r.OSVersionPieChart,title:u.operatingSystem+" Version",description:"The breakdown of the operating system version of devices used to access the "+u.operatingSystem+" app over the selected time period.",field:"mobileOSVersion",filter:p}),b.a.createElement(Pe.a.SpacerDouble,null),b.a.createElement(sn,{dataSync:r,kvsComponentKey:$r.AppVersionPieChart,title:"App Version",description:"The breakdown of the "+u.operatingSystem+" app versions used over the selected time period.",field:"mobileModel",filter:p})),b.a.createElement(Pe.a.SpacerDouble,null),b.a.createElement(cn,{dateScrub:t,dataSync:r,description:"The breakdown of the mobile phone models used to access the "+u.operatingSystem+" app over the selected time period.",filter:p}))}}]),t}(b.a.Component),dn=Object(A.b)((function(e){return{data:e.data,kdsData:e.kdsData,selectedApp:P.d.selectedApp(e)}}))(un),pn=r(121),fn=r(124);function hn(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}k.a.defaultProps=function(e){for(var t=1;t0?e[0].last_import:void 0,r="...",n=I()().toISOString();void 0!==t&&(r="Last Imported: "+te.DateTime(t)),v.b.dispatch(De.DataActions.setLastImported({datetime:t,datetimeChecked:n,label:r}))})).catch((function(e){console.log("error",e),v.b.dispatch(B.a.setError({title:"Error",message:e.message}))}));case 2:case"end":return e.stop()}}))}},{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?b.a.createElement(m.a,{style:[bn.container,{alignItems:"center",justifyContent:"center"}]},b.a.createElement(y.a,{size:"large",color:T.a.grey})):o?b.a.createElement(m.a,{style:bn.container},b.a.createElement(m.a,{style:{flex:1,flexDirection:"row"}},b.a.createElement(xe.SideMenu,{title:je.a.name,logo:T.c.logo,menuItems:this._menuItems,version:je.a.version,user:this.props.user.userDetails}),b.a.createElement(m.a,{style:{flex:1}},b.a.createElement(Te.ScreenHeader,null,b.a.createElement(Be,{disabled:!this.props.app.appPickerEnabled}),b.a.createElement(Pe.a.SpacerDouble,null)),b.a.createElement(j.a,{style:{width:"100%"},showsVerticalScrollIndicator:T.d.isWeb,contentContainerStyle:{height:T.d.isWeb?"100%":void 0,flexGrow:T.d.isWeb?void 0:1}},this.renderSelectedPage())),b.a.createElement(_e.GlobalDialog,{globalMessage:r}))):b.a.createElement(m.a,{style:bn.container},b.a.createElement(We,null),b.a.createElement(_e.GlobalDialog,{globalMessage:r}))}}]),t}(b.a.Component),bn=D.a.create({container:{position:"absolute",left:0,right:0,top:0,bottom:0,backgroundColor:T.a.pageBackground}}),mn=Object(A.b)((function(e){return{app:e.app,global:e.global,menu:e.menu,user:e.user,data:e.data}}))(gn);r.d(t,"a",(function(){return yn}));var yn=function(e){function t(){var e,r;i()(this,t);for(var n=arguments.length,a=new Array(n),o=0;o