(window.webpackJsonp=window.webpackJsonp||[]).push([[4,29,72,108,139,160,164],{339:function(e,t,n){e.exports=function(){"use strict";return function(e,t,n){var r=t.prototype,s=r.format;n.en.ordinal=function(e){var t=["th","st","nd","rd"],n=e%100;return"["+e+(t[(n-20)%10]||t[n]||t[0])+"]"},r.format=function(e){var t=this,n=this.$locale(),r=this.$utils(),a=(e||"YYYY-MM-DDTHH:mm:ssZ").replace(/\[([^\]]+)]|Q|wo|ww|w|WW|W|zzz|z|gggg|GGGG|Do|X|x|k{1,2}|S/g,(function(e){switch(e){case"Q":return Math.ceil((t.$M+1)/3);case"Do":return n.ordinal(t.$D);case"gggg":return t.weekYear();case"GGGG":return t.isoWeekYear();case"wo":return n.ordinal(t.week(),"W");case"w":case"ww":return r.s(t.week(),"w"===e?1:2,"0");case"W":case"WW":return r.s(t.isoWeek(),"W"===e?1:2,"0");case"k":case"kk":return r.s(String(0===t.$H?24:t.$H),"k"===e?1:2,"0");case"X":return Math.floor(t.$d.getTime()/1e3);case"x":return t.$d.getTime();case"z":return"["+t.offsetName()+"]";case"zzz":return"["+t.offsetName("long")+"]";default:return e}}));return s.bind(this)(a)}}}()},340:function(e,t,n){e.exports=function(){"use strict";return function(e,t,n){e=e||{};var r=t.prototype,o={future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function i(e,t,n,o){return r.fromToBase(e,t,n,o)}n.en.relativeTime=o,r.fromToBase=function(t,r,i,l,u){for(var c,a,s,m=i.$locale().relativeTime||o,d=e.thresholds||[{l:"s",r:44,d:"second"},{l:"m",r:89},{l:"mm",r:44,d:"minute"},{l:"h",r:89},{l:"hh",r:21,d:"hour"},{l:"d",r:35},{l:"dd",r:25,d:"day"},{l:"M",r:45},{l:"MM",r:10,d:"month"},{l:"y",r:17},{l:"yy",d:"year"}],f=d.length,v=0;v0,p<=h.r||!h.r){p<=1&&v>0&&(h=d[v-1]);var _=m[h.l];u&&(p=u(""+p)),a="string"==typeof _?_.replace("%d",p):_(p,r,h.l,s);break}}if(r)return a;var y=s?m.future:m.past;return"function"==typeof y?y(a):y.replace("%s",a)},r.to=function(e,t){return i(e,t,this,!0)},r.from=function(e,t){return i(e,t,this)};var l=function(e){return e.$u?n.utc():n()};r.toNow=function(e){return this.to(l(this),e)},r.fromNow=function(e){return this.from(l(this),e)}}}()},341:function(e,t,n){"use strict";var r=n(69),o=n.n(r),l=n(339),c=n(340);o.a.extend(l),o.a.extend(c),t.a={methods:{formatDateToFriendly:function(e){return o()(e).format("Do MMMM YYYY")},formatTimestampToFriendly:function(e){return o()(e).format("Do MMMM YYYY [at] HH:mm")},relativeTimeFromNow:function(e){return o()().to(o()(e))},relativeTimeComparison:function(e,t){return console.log(e,t),o()(e).from(o()(t),!0)}}}},349:function(e,t,n){"use strict";var r=n(61),o=n.n(r);t.a={methods:{axiosClientToken:function(e){return this.$axios.create({headers:{"Content-Type":"application/json",Accept:"application/json","X-CSRFToken":o.a.get("csrftoken"),"X-AM-TOKEN":e},withCredentials:!0})},axiosClient:function(){return void 0===this.urlToken?this.$axios:this.$axios.create({headers:{"Content-Type":"application/json",Accept:"application/json","X-CSRFToken":o.a.get("csrftoken"),"X-AM-TOKEN":this.urlToken},withCredentials:!0})}},computed:{urlToken:function(){return this.$route.query.token}}}},363:function(e,t,n){var content=n(395);content.__esModule&&(content=content.default),"string"==typeof content&&(content=[[e.i,content,""]]),content.locals&&(e.exports=content.locals);(0,n(35).default)("4ebd4f09",content,!0,{sourceMap:!1})},367:function(e,t,n){"use strict";n.r(t);n(56),n(241),n(18),n(36),n(42);var r={filters:{addFullStop:function(e){return e.match("[.!]$")?e:"".concat(e,".")}},props:{deniedMessage:{type:String,default:"You do not have the correct permissions.",required:!1},showWarningOnDenied:{type:Boolean,default:!0,required:!1},requiredPermissions:{type:Array}},computed:{userPermissions:function(){return this.$store.state.auth.active.permissions},aggregate:function(){return this.$store.state.auth.active.aggregate},userCanAccess:function(){var e=this;if(this.requiredPermissions.filter((function(e){return!1===e})).length>0)return!1;var t=this.aggregate.type;return!("group"!==t||!this.userPermissions.includes("local-group-admin"))||(!("region"!==t||!this.userPermissions.includes("region-admin"))||(!("national"!==t||!this.userPermissions.includes("national-admin"))||0===this.requiredPermissions.filter((function(e){return"boolean"!=typeof e})).filter((function(t){return!e.userPermissions.includes(t)})).length))}}},o=n(2),component=Object(o.a)(r,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("section",[e.userCanAccess?[e._t("default")]:e.showWarningOnDenied?n("b-message",{attrs:{type:"is-warning"}},[e._v("\n "+e._s(e._f("addFullStop")(e.deniedMessage))+"\n ")]):e._e()],2)}),[],!1,null,null,null);t.default=component.exports},368:function(e,t,n){"use strict";n.r(t);var r={props:{status:String},computed:{tagColour:function(){return"Not Started"===this.status||"Incomplete"===this.status?"is-danger":"Errors"===this.status||"Review Required"===this.status?"is-warning":"Complete"===this.status?"is-success":"is-danger is-light"}}},o=n(2),component=Object(o.a)(r,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("section",[n("b-tag",{attrs:{type:e.tagColour}},[e._v("\n "+e._s(e.status)+"\n ")])],1)}),[],!1,null,null,null);t.default=component.exports},369:function(e,t,n){"use strict";n.r(t);n(25);var r=n(148),o=n(349),l={mixins:[r.a,o.a],props:{members:{type:Array},forms:{type:Array},token:{type:String,required:!1,default:function(){return null}}},computed:{downloadEnabled:function(){return"other"!==this.emailPref||this.email1.length>5&&this.email1===this.email2}},data:function(){return{fileFormat:"pdf",emailPref:"me",email1:"",email2:"",saveToStorage:!1}},methods:{createDownload:function(){var e=this,t=this.$axios;null!==this.token&&(t=this.axiosClientToken(this.token)),t.post("forms/download",{forms:this.forms,members:this.members.map((function(e){return e.member.id})),output:this.fileFormat,emailPref:this.emailPref,recipientEmail:this.email1,saveToStorage:this.saveToStorage}).then((function(t){var n="",r="the files will be emailed to you";""!==e.email1&&"other"===e.emailPref&&(r="the files will be emailed to ".concat(e.email1)),n=null===t.data.storage&&t.data.email?"We have recieved your request, ".concat(r):null!==t.data.storage&&!1===t.data.email?"We have recieved your request, the files will be saved in your storage area":null!==t.data.storage&&t.data.email?"We have recieved your request, ".concat(r," and saved in your storage area"):"Something unexpected happened, please contact support",e.$buefy.snackbar.open({duration:1e4,message:n,type:"is-success",actionText:null===t.data.storage?"OK":"Open Folder",onAction:function(){null!==t.data.storage&&e.$router.push({name:"storage-id",params:{id:t.data.storage}})}}),e.$parent.close()}))}}},c=n(2),component=Object(c.a)(l,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"modal-card"},[n("header",{staticClass:"modal-card-head"},[n("p",{staticClass:"modal-card-title"},[e._v("\n Download Responses\n ")]),e._v(" "),n("button",{staticClass:"delete",attrs:{type:"button"},on:{click:function(t){return e.$emit("close")}}})]),e._v(" "),n("section",{staticClass:"modal-card-body"},[n("section",[n("p",[e._v("Please choose your download format.")]),e._v(" "),e._m(0),e._v(" "),n("div",{staticClass:"block"},[n("b-radio",{attrs:{name:"format","native-value":"txt"},model:{value:e.fileFormat,callback:function(t){e.fileFormat=t},expression:"fileFormat"}},[e._v("\n Text File (.txt)\n ")]),e._v(" "),n("b-radio",{attrs:{name:"format","native-value":"pdf"},model:{value:e.fileFormat,callback:function(t){e.fileFormat=t},expression:"fileFormat"}},[e._v("\n PDF (.pdf)\n ")])],1)]),e._v(" "),n("section",{staticClass:"pt-2"},[n("p",[e._v("Please choose your email preference.")]),e._v(" "),n("div",{staticClass:"block"},[n("b-field",[n("b-radio",{attrs:{name:"emailpref","native-value":"me"},model:{value:e.emailPref,callback:function(t){e.emailPref=t},expression:"emailPref"}},[e._v("\n Email me the responses\n ")])],1),e._v(" "),n("b-field",["Guardian"!==e.profileType?n("b-radio",{attrs:{name:"emailpref","native-value":"none"},model:{value:e.emailPref,callback:function(t){e.emailPref=t},expression:"emailPref"}},[e._v("\n Do not send an email with the responses attached\n ")]):e._e()],1),e._v(" "),n("b-field",[n("b-radio",{attrs:{name:"emailpref","native-value":"other"},model:{value:e.emailPref,callback:function(t){e.emailPref=t},expression:"emailPref"}},[e._v("\n Email someone else the responses\n ")])],1),e._v(" "),"other"===e.emailPref?n("section",[n("b-field",{attrs:{label:"Email"}},[n("b-input",{attrs:{type:"email"},model:{value:e.email1,callback:function(t){e.email1=t},expression:"email1"}})],1),e._v(" "),n("b-field",{attrs:{label:"Re-enter Email"}},[n("b-input",{attrs:{type:"email"},model:{value:e.email2,callback:function(t){e.email2=t},expression:"email2"}})],1)],1):e._e()],1)]),e._v(" "),"Guardian"!==e.profileType?n("section",{staticClass:"pt-2"},[n("p",[e._v("Check the checkbox below if you'd also like the forms to be saved in Athlete Manager's storage.")]),e._v(" "),n("div",{staticClass:"block"},[n("b-field",[n("b-checkbox",{model:{value:e.saveToStorage,callback:function(t){e.saveToStorage=t},expression:"saveToStorage"}},[e._v("Save to storage")])],1)],1)]):e._e()]),e._v(" "),n("footer",{staticClass:"modal-card-foot"},[n("b-button",{attrs:{label:"Close"},on:{click:function(t){return e.$emit("close")}}}),e._v(" "),n("b-button",{attrs:{label:"Download",disabled:!1===e.downloadEnabled,type:e.downloadEnabled?"is-primary":"is-warning"},on:{click:function(t){return e.createDownload()}}})],1)])}),[function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("p",{staticClass:"pb-1"},[n("small",[e._v("Text files are smaller in size but harder to read than PDFs. Use text files if you have a poor connection.")])])}],!1,null,null,null);t.default=component.exports},375:function(e,t,n){"use strict";n.r(t);n(24);var r=n(404),o=n(69),l=n.n(o),c=n(341),m=n(406),d=n(504),f=n(153),v=n(349),h=n(596),_={mixins:[c.a,d.a,v.a],components:{KeyMemberWarningInformation:m.default,RoomIdentifier:f.default,MemberContactInfo:h.default,MemberFormsTable:r.default},props:{event:{type:Object},token:{type:String,required:!1},member:{type:Object},getParams:{type:Object,required:!1,default:function(){return{}}}},computed:{birthday:function(){var e=this.member.dob;if(null==e)return"Not Entered";var t=l()(new Date).diff(e,"years");return"".concat(t," years old")},memberType:function(){return"".concat(this.member.type.toLowerCase(),"s")}},data:function(){return{activeTab:0,extraMemberDetails:null,forms:null}},mounted:function(){var e=this;this.$nextTick((function(){e.axiosClientToken(e.token).get("members/".concat(e.memberType,"/").concat(e.member.amMemberId,"/forms")).then((function(t){e.forms=t.data})),e.$axios.get("events/upcoming/".concat(e.event.id,"/members/").concat(e.member.id),{params:e.getParams}).then((function(t){e.extraMemberDetails=t.data}))}))}},y=n(2),component=Object(y.a)(_,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"modal-card"},[n("header",{staticClass:"modal-card-head"},[n("p",{staticClass:"modal-card-title"},[e._v("\n "+e._s(e.member.name.first)+" "+e._s(e.member.name.last)+"\n ")]),e._v(" "),n("button",{staticClass:"delete",attrs:{type:"button"},on:{click:function(t){return e.$emit("close")}}})]),e._v(" "),n("section",{staticClass:"modal-card-body p-1"},[n("b-tabs",{model:{value:e.activeTab,callback:function(t){e.activeTab=t},expression:"activeTab"}},[n("b-tab-item",{attrs:{label:"Overview"}},[n("key-member-warning-information",{attrs:{member:e.member}}),e._v(" "),n("section",{staticClass:"pt-2"},[n("b-icon",{attrs:{icon:"cake-variant",size:"is-small"}}),e._v(" "),null!==e.member.dob?n("span",[e._v("\n "+e._s(e.member.name.first)+" is "+e._s(e.birthday)+" (born "+e._s(e.formatDateToFriendly(e.member.dob))+").\n ")]):n("span",[e._v("\n No birthday information has been entered for "+e._s(e.member.name.first)+"\n ")])],1),e._v(" "),n("section",{staticClass:"pt-2"},[n("b-icon",{attrs:{icon:"food-fork-drink",size:"is-small"}}),e._v(" "),""===e.member.personal.dietary?[e._v("\n No dietary information has been provided for "+e._s(e.member.name.first)+".\n ")]:[e._v("\n Dietary information: "+e._s(e.member.personal.dietary)+"\n ")]],2),e._v(" "),e.event.roomRequirement?n("section",{staticClass:"pt-2"},[null!==e.extraMemberDetails?[!1===e.event.flexibleRooms?[n("b-icon",{attrs:{icon:"bed",size:"is-small"}}),e._v(" "),1===e.extraMemberDetails.rooms.length&&e.roomHasIdentifier(e.extraMemberDetails.rooms[0])?[e._v("\n "+e._s(e.member.name.first)+" is in "),n("b",[n("room-identifier",{attrs:{room:e.extraMemberDetails.rooms[0]}})],1),e._v(".\n ")]:1===e.extraMemberDetails.rooms.length&&!1===e.roomHasIdentifier(e.extraMemberDetails.rooms[0])?[e._v("\n "+e._s(e.member.name.first)+" is in room "),n("b",[e._v(e._s(e.extraMemberDetails.rooms[0].name))]),e._v(" (there is no room identifier)\n ")]:[e._v("\n No room information for "+e._s(e.member.name.first)+" has been provided.\n ")]]:e._e()]:[e._v("\n Loading...\n ")]],2):e._e()],1),e._v(" "),n("b-tab-item",{attrs:{label:"Contact"}},[n("member-contact-info",{attrs:{token:e.token,event:e.event,member:e.member,"get-params":e.getParams}})],1),e._v(" "),n("b-tab-item",{attrs:{label:"Forms"}},[null!==e.forms?[n("member-forms-table",{attrs:{"user-forms":e.forms,type:e.memberType,token:e.token,"specific-user-id":e.member.amMemberId}})]:n("p",[e._v("\n Loading...\n ")])],2)],1)],1),e._v(" "),n("footer",{staticClass:"modal-card-foot"},[n("b-button",{attrs:{label:"Close"},on:{click:function(t){return e.$emit("close")}}})],1)])}),[],!1,null,null,null);t.default=component.exports},394:function(e,t,n){"use strict";n(363)},395:function(e,t,n){var r=n(34)(!1);r.push([e.i,".text-block[data-v-f894acdc]{white-space:pre-line}",""]),e.exports=r},404:function(e,t,n){"use strict";n.r(t);n(24),n(25);var r=n(367),o=n(368),l=n(369),c={mixins:[n(148).a],components:{FormStatusTag:o.default,PermissionsRequired:r.default},props:{token:{type:String,required:!1,default:function(){return null}},type:{type:String,required:!1,default:function(){return"unstated"}},userForms:{type:Array,required:!1,default:function(){return null}},specificUserId:{type:String,required:!1,default:function(){return null}}},data:function(){return{forms:[]}},computed:{queryParams:function(){return null!==this.token?{type:this.type,token:this.token}:{type:this.type}},userID:function(){return null!==this.specificUserId?this.specificUserId:this.$route.params.id}},mounted:function(){var e=this;this.$nextTick((function(){null===e.userForms?e.$axios.get("members/".concat(e.type,"/").concat(e.$route.params.id,"/forms")).then((function(t){e.forms=t.data}),(function(e){console.log(e)})):e.forms=e.userForms}))},methods:{showDownloadModal:function(){this.$buefy.modal.open({parent:this,component:l.default,hasModalCard:!0,props:{forms:this.forms.map((function(e){return e.id})),members:[{member:{id:null===this.specificUserId?this.$route.params.id:this.specificUserId}}],token:this.token}})}}},m=n(2),component=Object(m.a)(c,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("section",[n("b-table",{attrs:{data:e.forms,bordered:!1,striped:!0,hoverable:!0,loading:!1,"mobile-cards":!0},scopedSlots:e._u([{key:"empty",fn:function(){return[n("p",{staticClass:"has-text-centered"},[e._v("\n No forms to show\n ")])]},proxy:!0}])},[n("b-table-column",{attrs:{field:"name",label:"Form"},scopedSlots:e._u([{key:"default",fn:function(t){return[n("nuxt-link",{attrs:{to:{name:"forms-complete-form-version-member",params:{form:t.row.id,member:e.userID,version:t.row.version},query:e.queryParams},target:null===e.token?"_self":"_blank"}},[e._v("\n "+e._s(t.row.name)+"\n ")])]}}])}),e._v(" "),n("b-table-column",{attrs:{field:"status",label:"Status"},scopedSlots:e._u([{key:"default",fn:function(e){return[n("form-status-tag",{attrs:{status:e.row.status}})]}}])})],1),e._v(" "),n("div",{staticClass:"pt-2"},["Guardian"===e.profileType||null!==e.token?[n("b-button",{attrs:{"icon-left":"cloud-download-outline",disabled:null===e.forms||0===e.forms.length,size:"is-small"},on:{click:function(t){return e.showDownloadModal()}}},[e._v("\n Download Responses\n ")])]:[n("permissions-required",{attrs:{"required-permissions":["form-view-sensitive"],"denied-message":"You do not have the correct permission to download form responses. You need the permission to view sensitive forms."}},[n("b-button",{attrs:{"icon-left":"cloud-download-outline",disabled:null===e.forms||0===e.forms.length,size:"is-small"},on:{click:function(t){return e.showDownloadModal()}}},[e._v("\n Download Responses\n ")])],1)]],2)],1)}),[],!1,null,null,null);t.default=component.exports},406:function(e,t,n){"use strict";n.r(t);var r={props:{member:{type:Object}},computed:{medicalMessageHeading:function(){return""!==this.member.personal.allergies&&""!==this.member.personal.medical?"Allergies and Medical Information":""!==this.member.personal.allergies?"Allergies Information":"Medical Information"}}},o=(n(394),n(2)),component=Object(o.a)(r,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("section",[""!==e.member.personal.allergies||""!==e.member.personal.medical?n("b-message",{attrs:{title:e.medicalMessageHeading,type:"is-warning","aria-close-label":"Close message"}},[""!==e.member.personal.allergies?n("div",{staticClass:"content"},[n("div",[n("b",[e._v("Allergies")])]),e._v(" "),n("div",{staticClass:"pl-3"},[n("span",{staticClass:"text-block"},[e._v(e._s(e.member.personal.allergies))])])]):e._e(),e._v(" "),""!==e.member.personal.medical?n("div",{staticClass:"content"},[n("div",[n("b",[e._v("Medical")])]),e._v(" "),n("div",{staticClass:"pl-3"},[n("span",{staticClass:"text-block"},[e._v(e._s(e.member.personal.medical))])])]):e._e()]):e._e()],1)}),[],!1,null,"f894acdc",null);t.default=component.exports},504:function(e,t,n){"use strict";t.a={methods:{roomHasIdentifier:function(e){return""!==e.identifier||null!==e.number}}}},596:function(e,t,n){"use strict";n.r(t);var r=n(353),o=n(414),l={mixins:[n(349).a],components:{CommonContactInformationOverview:r.default,CommonEmergencyContactInformationOverview:o.default},props:{token:{type:String,required:!1},event:{type:Object},member:{type:Object}},data:function(){return{contactInfo:null,emergencyContactInfo:null,buttonPressed:!1}},methods:{getContactInfo:function(){var e=this;this.buttonPressed=!0,this.axiosClientToken(this.token).get("contact/members/".concat(this.member.amMemberId)).then((function(t){e.contactInfo=t.data})),this.axiosClientToken(this.token).get("contact/members/emergency/".concat(this.member.amMemberId)).then((function(t){e.emergencyContactInfo=t.data}))}}},c=n(2),component=Object(c.a)(l,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("section",[e.buttonPressed?[n("h2",{staticClass:"is-size-4"},[e._v("\n "+e._s(e.member.name.first)+"'s Contact Details\n ")]),e._v(" "),null!==e.contactInfo?[n("common-contact-information-overview",{attrs:{"show-unverified-warning":!1,"immutable-contact":e.contactInfo}})]:n("p",[e._v("\n Loading...\n ")]),e._v(" "),n("hr"),e._v(" "),null!==e.emergencyContactInfo&&e.emergencyContactInfo.length>0?[n("common-emergency-contact-information-overview",{attrs:{"show-management-buttons":!1,"emergency-contacts":e.emergencyContactInfo}})]:null!==e.emergencyContactInfo&&0==e.emergencyContactInfo.length?[n("h2",{staticClass:"is-size-4"},[e._v("\n "+e._s(e.member.name.first)+"'s Emergency Contacts\n ")]),e._v("\n No emergency contacts have been specified for "+e._s(e.member.name.first)+".\n ")]:null===e.emergencyContactInfo?[n("h2",{staticClass:"is-size-4"},[e._v("\n "+e._s(e.member.name.first)+"'s Emergency Contacts\n ")]),e._v("\n Loading...\n ")]:e._e()]:[e.member.am?[n("b-button",{attrs:{size:"is-medium",type:"is-primary","icon-left":"eye",disabled:e.buttonPressed,expanded:""},on:{click:e.getContactInfo}},[e._v("\n "+e._s(e.buttonPressed?"Loading "+e.member.name.first+"'s Contact":"View "+e.member.name.first+"'s Contact Information")+"\n ")]),e._v(" "),n("p",{staticClass:"pt-2"},[e._v("\n Viewing the contact information will create an audit record that needs to be resolved at a later date.\n ")])]:n("p",[e._v("\n Cannot request the contact information of non-AM members.\n ")])]],2)}),[],!1,null,null,null);t.default=component.exports}}]);