-
Notifications
You must be signed in to change notification settings - Fork 0
/
15-es5.143e8fba4a647b09846c.js
1 lines (1 loc) · 13.8 KB
/
15-es5.143e8fba4a647b09846c.js
1
!function(){function e(e){if(null==e)throw new TypeError("Cannot destructure undefined")}function t(e){return function(e){if(Array.isArray(e))return n(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return n(e,t);var i=Object.prototype.toString.call(e).slice(8,-1);"Object"===i&&e.constructor&&(i=e.constructor.name);if("Map"===i||"Set"===i)return Array.from(e);if("Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return n(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function n(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function a(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),e}function r(){var e=l(['\n mutation CreateEvents(\n $eventInsertObjects: [Event_insert_input!]! = [\n {\n EventSeries: { data: { eventSeriesDetails: "Sunday service (English)", eventSeriesName: "Sunday worship" } }\n Organiser: { data: { randomUUID: "b669fc76-3130-4c4e-a04e-49e9f067ea9c" } }\n }\n ]\n ) {\n insert_Event(objects: $eventInsertObjects) {\n affected_rows\n returning {\n eventName\n eventCapacity\n eventStartDateTime\n eventEndDateTime\n bookingAvailableStartDateTime\n bookingAvailableEndDateTime\n }\n }\n }\n']);return r=function(){return e},e}function c(){var e=l(["\n mutation CreateEvent($eventInsertObject: Event_insert_input! = {}) {\n insert_Event_one(object: $eventInsertObject) {\n randomUUID\n bookingAvailableStartDateTime\n bookingAvailableEndDateTime\n eventStartDateTime\n eventEndDateTime\n eventDateTimeRange\n bookingAvailabilityDateTimeRange\n eventName\n eventTopic\n eventCategory\n eventCapacity\n eventDescription\n eventMedium\n }\n }\n"]);return c=function(){return e},e}function s(){var e=l(['\n # Get all future events.\n # Default just in case dumb hasura behaviour doesn\'t return EventRooms but somehow returns Events depending on presence of comparison exp\n subscription GetAllEvents($eventEndDateTimeGreaterThanEqual: timestamptz = "2020-07-28") {\n Event(\n where: { eventEndDateTime: { _gte: $eventEndDateTimeGreaterThanEqual } }\n limit: 20\n order_by: { eventStartDateTime: asc, eventName: asc, bookingAvailableStartDateTime: asc }\n ) {\n eventName\n eventDescription\n eventCapacity\n eventStartDateTime\n eventEndDateTime\n bookingAvailableStartDateTime\n bookingAvailableEndDateTime\n randomUUID\n updated_at\n EventRooms {\n roomName\n eventRoomUUID\n eventRoomDetails\n }\n }\n }\n']);return s=function(){return e},e}function l(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}(window.webpackJsonp=window.webpackJsonp||[]).push([[15],{oirr:function(n,o,l){"use strict";l.r(o),l.d(o,"EventsPageModule",(function(){return $}));var v,u=l("UKGz"),b=l("SVse"),m=l("s7LF"),d=l("sZkV"),g=l("iInd"),f=l("mrSG"),h=l("LRne"),p=l("IzEk"),k=l("lJxs"),E=l("pLZG"),O=l("ZTNX"),D=l("IxO4"),y=l("8Y7J"),T=l("RXPq"),w=l("lTCR"),P=l.n(w),S=l("Ok9p"),j=l("nbgS"),I=P.a(s()),_=P.a(c()),A=P.a(r()),x=((v=function(){function e(t){i(this,e),this.apollo=t}return a(e,[{key:"getEvents",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Object(O.e)(),t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.apollo;return t.subscribe({query:I,fetchPolicy:"cache-first",variables:{eventEndDateTimeGreaterThanEqual:e}})}},{key:"getSeedEventInputObjects",value:function(){var e,n=Object(D.e)(b.o.Sunday,9,0),i=Object(D.e)(b.o.Sunday,10,30),o=Object(D.e)(b.o.Wednesday,0,0),a=Object(D.e)(b.o.Sunday,23,59,59,999),r=Object(D.d)(n,i,o,a).map((function(e){var t=e.eventStartEndDateTime,n=t.startDateTime,i=t.endDateTime,o=t.startEndDateTimeRangeTstzRangeText,a=e.bookingStartEndDateTime,r=a.startDateTime,c=a.endDateTime,s=a.startEndDateTimeRangeTstzRangeText;return[C("English hall","English hall for live stream and in-person services",r,c,s,n,i,o,"Sunday service",40,"Description of community event","Church"),C("Chinese hall","Chinese main hall for live stream and in-person services",r,c,s,n,i,o,"\u4e3b\u65e5\u5d07\u62dc",40,"Description of community event","Church")]}));return(e=[]).concat.apply(e,t(r))}},{key:"createEvents",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.apollo;return t.mutate({mutation:A,variables:{eventInsertObjects:e}})}},{key:"createEvent",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.apollo,t=new Date,n=new Date(t.getTime()-Object(D.b)(2)),i=new Date(t.getTime()+Object(D.b)(7)),o=new Date(t.getTime()+Object(D.b)(9)),a=new Date(t.getTime()+Object(D.b)(10)),r=(new Date(t.getTime()+Object(D.b)(10)),C("English hall","English hall for live stream and in-person services",n,i,Object(D.c)(n,i),o,a,Object(D.c)(o,a)));return e.mutate({mutation:_,variables:{eventInsertObject:r}})}}]),e}()).\u0275fac=function(e){return new(e||v)(y.Tb(j.b))},v.\u0275prov=y.Fb({token:v,factory:v.\u0275fac,providedIn:"root"}),v);function C(e,t,n,i,o,a,r,c){var s=arguments.length>8&&void 0!==arguments[8]?arguments[8]:"Sunday service",l=arguments.length>9&&void 0!==arguments[9]?arguments[9]:40,v=arguments.length>10&&void 0!==arguments[10]?arguments[10]:"Description of community event",u=arguments.length>11&&void 0!==arguments[11]?arguments[11]:"Church",b=arguments.length>12&&void 0!==arguments[12]?arguments[12]:"b669fc76-3130-4c4e-a04e-49e9f067ea9c";return{bookingAvailableStartDateTime:n,bookingAvailableEndDateTime:i,bookingAvailabilityDateTimeRange:o,eventStartDateTime:a,eventEndDateTime:r,eventDateTimeRange:c,eventName:s,eventTopic:"Topic",eventMedium:"In-person",eventCategory:u,eventCapacity:l,eventDescription:v,Organiser:{data:{randomUUID:b,organiserDetails:""},on_conflict:{constraint:S.g.Organiser_randomUUID_key,update_columns:[S.h.updated_at]}},EventRooms:{data:[{eventRoomDetails:t,Room:{data:{roomName:e,roomType:"Hall",roomCapacity:49,Venue:{data:{venueName:"Eight Mile Plains Chinese Methodist Church",randomUUID:"9cb826dc-fcf8-406e-8b01-f4eba15dfcc6"},on_conflict:{constraint:S.o.Venue_randomUUID_key,update_columns:[S.p.updated_at]}}},on_conflict:{constraint:S.k.Room_venueID_roomName_key,update_columns:[S.l.updated_at]}}}],on_conflict:{constraint:S.c.EventRoom_eventRoomID_eventID_roomID_venueID_roomName_event_key,update_columns:[S.d.updated_at]}}}}var R=l("t0hA"),K=l("Y+pZ"),U=l("L1O8");function N(e,t){1&e&&y.Kb(0,"ion-progress-bar",4)}function z(e,t){if(1&e){var n=y.Qb();y.Pb(0,"ion-item-sliding"),y.Pb(1,"ion-item-options"),y.Pb(2,"ion-item-option",5),y.Xb("click",(function(e){y.mc(n);var i=t.$implicit,o=y.bc();return o.clickNavViewAllBookingsForEventSwiper(e,i,o.router)})),y.rc(3,"Check "),y.Ob(),y.Ob(),y.Pb(4,"ion-item",6),y.Xb("click",(function(e){y.mc(n);var i=t.$implicit;return y.bc().clickEventItem(e,i)})),y.Pb(5,"ion-avatar",7),y.Kb(6,"img",8),y.Ob(),y.Pb(7,"ion-label",9),y.Pb(8,"h2"),y.rc(9),y.Ob(),y.Pb(10,"h3"),y.rc(11),y.Ob(),y.Pb(12,"p"),y.rc(13),y.cc(14,"date"),y.cc(15,"date"),y.Ob(),y.Ob(),y.Ob(),y.Ob()}if(2&e){var i=t.$implicit,o=y.bc();y.zb(4),y.ic("color",o.isBookingAvailableForEvent(i)?"":"light"),y.hc("button",o.isBookingAvailableForEvent(i)),y.zb(3),y.ic("color",o.isBookingAvailableForEvent(i)?"":"medium"),y.zb(2),y.sc(null==i?null:i.eventName),y.zb(2),y.sc(null==i||null==i.EventRooms[0]?null:i.EventRooms[0].roomName),y.zb(2),y.uc(" ",y.ec(14,7,i.eventStartDateTime,"EEEE',' dd MMM HH:mm"),"\u2013",y.ec(15,10,i.eventEndDateTime,"HH:mm")," ")}}function B(e,t){1&e&&(y.Pb(0,"div"),y.Pb(1,"div",10),y.Kb(2,"ion-skeleton-text",11),y.Kb(3,"ion-skeleton-text",12),y.Kb(4,"ion-skeleton-text",13),y.Kb(5,"ion-skeleton-text",14),y.Kb(6,"ion-skeleton-text",11),y.Ob(),y.Pb(7,"ion-list"),y.Pb(8,"ion-list-header"),y.Pb(9,"ion-label"),y.Kb(10,"ion-skeleton-text",15),y.Ob(),y.Ob(),y.Pb(11,"ion-item"),y.Pb(12,"ion-avatar",7),y.Kb(13,"ion-skeleton-text",12),y.Ob(),y.Pb(14,"ion-label"),y.Pb(15,"h3"),y.Kb(16,"ion-skeleton-text",16),y.Ob(),y.Pb(17,"p"),y.Kb(18,"ion-skeleton-text",17),y.Ob(),y.Pb(19,"p"),y.Kb(20,"ion-skeleton-text",11),y.Ob(),y.Ob(),y.Ob(),y.Pb(21,"ion-item"),y.Pb(22,"ion-thumbnail",7),y.Kb(23,"ion-skeleton-text",12),y.Ob(),y.Pb(24,"ion-label"),y.Pb(25,"h3"),y.Kb(26,"ion-skeleton-text",16),y.Ob(),y.Pb(27,"p"),y.Kb(28,"ion-skeleton-text",17),y.Ob(),y.Pb(29,"p"),y.Kb(30,"ion-skeleton-text",11),y.Ob(),y.Ob(),y.Ob(),y.Pb(31,"ion-item"),y.Kb(32,"ion-skeleton-text",18),y.Pb(33,"ion-label"),y.Pb(34,"h3"),y.Kb(35,"ion-skeleton-text",16),y.Ob(),y.Pb(36,"p"),y.Kb(37,"ion-skeleton-text",17),y.Ob(),y.Pb(38,"p"),y.Kb(39,"ion-skeleton-text",11),y.Ob(),y.Ob(),y.Ob(),y.Ob(),y.Ob())}function F(e){return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Date(e);return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:(new Date).getTime();return void 0!==e&&t>e.getTime()}(t)}(e.bookingAvailableStartDateTime)}var L,G,H,J=[{path:"",component:(L=function(){function t(e,n,o,a,r,c){i(this,t),this.router=e,this.pwaService=n,this.datePipe=o,this.toastController=a,this.eventService=r,this.bookingService=c,this.upcomingEvents=Object(h.a)([]),this.isLoading=!0}return a(t,[{key:"ngOnInit",value:function(){var e=this;this.upcomingEvents=this.getLatestEvents(),this.upcomingEvents.pipe(Object(p.a)(1)).subscribe((function(t){e.isLoading=!1}))}},{key:"getLatestEvents",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.eventService;return t.getEvents().pipe(Object(k.a)((function(t){e(t.data);var n=t.errors;if(!((null==n?void 0:n.length)>0))return console.log("%c EventsPage:: subscribeLatestEvents -> events",O.a),t.data.Event})),Object(E.a)((function(e){var t,n,i;return void 0!==e&&void 0!==(null===(t=e[0])||void 0===t?void 0:t.EventRooms)&&void 0!==(null===(i=null===(n=e[0])||void 0===n?void 0:n.EventRooms[0])||void 0===i?void 0:i.roomName)})))}},{key:"clickEventItem",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.router;if(F(t))this.navigateToBooking(t,n);else{var i=this.datePipe.transform(t.bookingAvailableStartDateTime,D.a);this.presentToast("Booking is currently unavailable for ".concat(t.eventName," <br />Please check back on ").concat(i)).then((function(e){})).catch((function(e){}))}}},{key:"clickNavViewAllBookingsForEventSwiper",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.router;console.log("EventsPage -> clickCheckAllBookingsSwiper -> touch",e),n.navigate(["event",""+t.randomUUID,"visitor-list"]).then((function(e){console.log("EventsPage -> clickCheckAllBookingsSwiper -> navigated",e)})).catch((function(e){console.log("EventsPage -> clickCheckAllBookingsSwiper -> error",e)}))}},{key:"navigateToBooking",value:function(e,t){t.navigate(["/booking"],{state:e}).then((function(e){})).catch((function(e){}))}},{key:"clickTestButton",value:function(e){this.seedEvents()}},{key:"seedEvents",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.eventService,t=e.getSeedEventInputObjects();e.createEvents(t).subscribe((function(e){}))}},{key:"isBookingAvailableForEvent",value:function(e){return void 0!==e&&F(e)}},{key:"presentToast",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.toastController;return Object(f.a)(this,void 0,void 0,regeneratorRuntime.mark((function n(){return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,t.create({message:e,duration:3500,animated:!0,translucent:!0});case 2:return n.abrupt("return",n.sent.present().then((function(){})));case 3:case"end":return n.stop()}}),n)})))}}]),t}(),L.\u0275fac=function(e){return new(e||L)(y.Jb(g.g),y.Jb(T.a),y.Jb(b.e),y.Jb(d.M),y.Jb(x),y.Jb(R.a))},L.\u0275cmp=y.Db({type:L,selectors:[["app-events"]],decls:10,vars:6,consts:[["pageTitle","COVIDSafe Events",3,"isRightAlignedEndButtonHidden"],["value","0.25","buffer","0.50",4,"ngIf"],[4,"ngFor","ngForOf"],[4,"ngIf"],["value","0.25","buffer","0.50"],["color","danger","button","",3,"click"],[3,"button","color","click"],["slot","start"],["src","/assets/images/emp-cmca-logo-small-172x172-placeholder.jpg","alt","Placeholder-image-church"],[3,"color"],[1,"ion-padding","custom-skeleton"],["animated","",2,"width","60%"],["animated",""],["animated","",2,"width","88%"],["animated","",2,"width","70%"],["animated","",2,"width","20%"],["animated","",2,"width","50%"],["animated","",2,"width","80%"],["animated","","slot","start",2,"width","27px","height","27px"]],template:function(e,t){1&e&&(y.Kb(0,"app-custom-header",0),y.Kb(1,"app-check-in-floating-button"),y.Pb(2,"ion-content"),y.Pb(3,"ion-list"),y.Pb(4,"ion-list-header"),y.rc(5,"Upcoming events"),y.Ob(),y.pc(6,N,1,0,"ion-progress-bar",1),y.pc(7,z,16,13,"ion-item-sliding",2),y.cc(8,"async"),y.Ob(),y.pc(9,B,40,0,"div",3),y.Ob()),2&e&&(y.hc("isRightAlignedEndButtonHidden",!0),y.zb(6),y.hc("ngIf",t.isLoading),y.zb(1),y.hc("ngForOf",y.dc(8,4,t.upcomingEvents)),y.zb(2),y.hc("ngIf",t.isLoading))},directives:[K.a,U.a,d.k,d.x,d.y,b.k,b.j,d.z,d.v,d.u,d.t,d.s,d.b,d.w,d.C,d.E],pipes:[b.b,b.e],styles:[""]}),L)}],M=((H=function e(){i(this,e)}).\u0275mod=y.Hb({type:H}),H.\u0275inj=y.Gb({factory:function(e){return new(e||H)},imports:[[g.i.forChild(J)],g.i]}),H),$=((G=function e(){i(this,e)}).\u0275mod=y.Hb({type:G}),G.\u0275inj=y.Gb({factory:function(e){return new(e||G)},imports:[[b.c,m.g,d.H,u.a,M]]}),G)}}])}();