(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-7f44697d"],{"169a":function(t,e,s){"use strict";s("368e");var i=s("480e"),a=s("4ad4"),n=s("b848"),r=s("75eb"),o=s("e707"),l=s("e4d3"),c=s("21be"),h=s("a293"),d=s("58df"),u=s("d9bd"),v=s("80d2");const p=Object(d["a"])(n["a"],r["a"],o["a"],l["a"],c["a"],a["a"]);e["a"]=p.extend({name:"v-dialog",directives:{ClickOutside:h["a"]},props:{dark:Boolean,disabled:Boolean,fullscreen:Boolean,light:Boolean,maxWidth:[String,Number],noClickAnimation:Boolean,origin:{type:String,default:"center center"},persistent:Boolean,retainFocus:{type:Boolean,default:!0},scrollable:Boolean,transition:{type:[String,Boolean],default:"dialog-transition"},width:[String,Number]},data(){return{activatedBy:null,animate:!1,animateTimeout:-1,stackMinZIndex:200,previousActiveElement:null}},computed:{classes(){return{[("v-dialog "+this.contentClass).trim()]:!0,"v-dialog--active":this.isActive,"v-dialog--persistent":this.persistent,"v-dialog--fullscreen":this.fullscreen,"v-dialog--scrollable":this.scrollable,"v-dialog--animated":this.animate}},contentClasses(){return{"v-dialog__content":!0,"v-dialog__content--active":this.isActive}},hasActivator(){return Boolean(!!this.$slots.activator||!!this.$scopedSlots.activator)}},watch:{isActive(t){var e;t?(this.show(),this.hideScroll()):(this.removeOverlay(),this.unbind(),null===(e=this.previousActiveElement)||void 0===e||e.focus())},fullscreen(t){this.isActive&&(t?(this.hideScroll(),this.removeOverlay(!1)):(this.showScroll(),this.genOverlay()))}},created(){this.$attrs.hasOwnProperty("full-width")&&Object(u["e"])("full-width",this)},beforeMount(){this.$nextTick(()=>{this.isBooted=this.isActive,this.isActive&&this.show()})},beforeDestroy(){"undefined"!==typeof window&&this.unbind()},methods:{animateClick(){this.animate=!1,this.$nextTick(()=>{this.animate=!0,window.clearTimeout(this.animateTimeout),this.animateTimeout=window.setTimeout(()=>this.animate=!1,150)})},closeConditional(t){const e=t.target;return!(this._isDestroyed||!this.isActive||this.$refs.content.contains(e)||this.overlay&&e&&!this.overlay.$el.contains(e))&&this.activeZIndex>=this.getMaxZIndex()},hideScroll(){this.fullscreen?document.documentElement.classList.add("overflow-y-hidden"):o["a"].options.methods.hideScroll.call(this)},show(){!this.fullscreen&&!this.hideOverlay&&this.genOverlay(),this.$nextTick(()=>{this.$nextTick(()=>{var t,e;(null===(t=this.$refs.dialog)||void 0===t?void 0:t.contains(document.activeElement))||(this.previousActiveElement=document.activeElement,null===(e=this.$refs.dialog)||void 0===e||e.focus()),this.bind()})})},bind(){window.addEventListener("focusin",this.onFocusin)},unbind(){window.removeEventListener("focusin",this.onFocusin)},onClickOutside(t){this.$emit("click:outside",t),this.persistent?this.noClickAnimation||this.animateClick():this.isActive=!1},onKeydown(t){if(t.keyCode===v["y"].esc&&!this.getOpenDependents().length)if(this.persistent)this.noClickAnimation||this.animateClick();else{this.isActive=!1;const t=this.getActivator();this.$nextTick(()=>t&&t.focus())}this.$emit("keydown",t)},onFocusin(t){if(!t||!this.retainFocus)return;const e=t.target;if(e&&this.$refs.dialog&&![document,this.$refs.dialog].includes(e)&&!this.$refs.dialog.contains(e)&&this.activeZIndex>=this.getMaxZIndex()&&!this.getOpenDependentElements().some(t=>t.contains(e))){const t=this.$refs.dialog.querySelectorAll('button, [href], input:not([type="hidden"]), select, textarea, [tabindex]:not([tabindex="-1"])'),e=[...t].find(t=>!t.hasAttribute("disabled")&&!t.matches('[tabindex="-1"]'));e&&e.focus()}},genContent(){return this.showLazyContent(()=>[this.$createElement(i["a"],{props:{root:!0,light:this.light,dark:this.dark}},[this.$createElement("div",{class:this.contentClasses,attrs:{role:"dialog","aria-modal":this.hideOverlay?void 0:"true",...this.getScopeIdAttrs()},on:{keydown:this.onKeydown},style:{zIndex:this.activeZIndex},ref:"content"},[this.genTransition()])])])},genTransition(){const t=this.genInnerContent();return this.transition?this.$createElement("transition",{props:{name:this.transition,origin:this.origin,appear:!0}},[t]):t},genInnerContent(){const t={class:this.classes,attrs:{tabindex:this.isActive?0:void 0},ref:"dialog",directives:[{name:"click-outside",value:{handler:this.onClickOutside,closeConditional:this.closeConditional,include:this.getOpenDependentElements}},{name:"show",value:this.isActive}],style:{transformOrigin:this.origin}};return this.fullscreen||(t.style={...t.style,maxWidth:Object(v["h"])(this.maxWidth),width:Object(v["h"])(this.width)}),this.$createElement("div",t,this.getContentSlot())}},render(t){return t("div",{staticClass:"v-dialog__container",class:{"v-dialog__container--attached":""===this.attach||!0===this.attach||"attach"===this.attach}},[this.genActivator(),this.genContent()])}})},"2a7f":function(t,e,s){"use strict";s.d(e,"a",(function(){return r})),s.d(e,"b",(function(){return n}));var i=s("71d9"),a=s("80d2");const n=Object(a["j"])("v-toolbar__title"),r=Object(a["j"])("v-toolbar__items");i["a"]},"2bc5":function(t,e,s){"use strict";s("14d9"),s("abd3");var i=s("1c87"),a=s("58df"),n=Object(a["a"])(i["a"]).extend({name:"v-breadcrumbs-item",props:{activeClass:{type:String,default:"v-breadcrumbs__item--disabled"},ripple:{type:[Boolean,Object],default:!1}},computed:{classes(){return{"v-breadcrumbs__item":!0,[this.activeClass]:this.disabled}}},render(t){const{tag:e,data:s}=this.generateRouteLink();return t("li",[t(e,{...s,attrs:{...s.attrs,"aria-current":this.isActive&&this.isLink?"page":void 0}},this.$slots.default)])}}),r=s("80d2"),o=Object(r["j"])("v-breadcrumbs__divider","li"),l=s("7560");e["a"]=Object(a["a"])(l["a"]).extend({name:"v-breadcrumbs",props:{divider:{type:String,default:"/"},items:{type:Array,default:()=>[]},large:Boolean},computed:{classes(){return{"v-breadcrumbs--large":this.large,...this.themeClasses}}},methods:{genDivider(){return this.$createElement(o,this.$slots.divider?this.$slots.divider:this.divider)},genItems(){const t=[],e=!!this.$scopedSlots.item,s=[];for(let i=0;i<this.items.length;i++){const a=this.items[i];s.push(a.text),e?t.push(this.$scopedSlots.item({item:a})):t.push(this.$createElement(n,{key:s.join("."),props:a},[a.text])),i<this.items.length-1&&t.push(this.genDivider())}return t}},render(t){const e=this.$slots.default||this.genItems();return t("ul",{staticClass:"v-breadcrumbs",class:this.classes},e)}})},"337e":function(t,e,s){"use strict";var i=s("ade3"),a=s("585f"),n=s("f6b8"),r=s("4a1f"),o=s.n(r),l=s("d7c2");const c=o.a.current(),h=Object.freeze({DRAFT:1,ONBOARDING:2,ACTIVE:3,COMPLETED:4});class d{constructor(t,e,s){Object(i["a"])(this,"EventStatus",h),this.context=t,this.service=n["a"],this.tenant=c,this.event=e,this.race=s||null,this.newLayout=!window.$cookies.isKey("newlayout")||"true"===window.$cookies.get("newlayout")}isDevelopment(){return!1}isPublished(){return this.event&&this.event.published}showAdvancedEventOptions(){return!this.hideAdvancedEventOptions()}hideAdvancedEventOptions(){return this.hasMeta("cfg.template.id")&&!(this.hasPaidSupportPlan()||this.hasMeta("cfg.template.unlocked_at"))}showAdvancedLeaderboardOptions(){return!this.hideAdvancedLeaderboardOptions()}hideAdvancedLeaderboardOptions(){return this.hasMeta("cfg.template.id")&&!(this.hasPaidSupportPlan()||this.hasMeta("cfg.template.unlocked_at"))}isFreePlan(){return!!this.event&&"FREE"===this.event.license}isBasicPlan(){return!!this.event&&("FREE"===this.event.license||"BASIC"===this.event.license)}isProPlan(){return!!this.event&&("cofi"!==c.id||"PRO"===this.event.license||this.isEnterprisePlan())}isEnterprisePlan(){return!!this.event&&"ENTERPRISE"===this.event.license}hasPaidSupportPlan(){if(this.event&&"wmm"===c.id)return!0;if(!this.event||"cofi"!==c.id)return!1;var t=this.getMeta("invoiced.support_plan");return null!=t&&"self-service"!=t}getSupportPlan(){return this.getMetaStringValue("invoiced.support_plan")||"self-service"}hasApp(){return!!this.event&&("cofi"===c.id||this.event.app_bundle_id)}hasDeeplinking(){return!!this.event&&("cofi"===c.id||this.event.meta&&this.event.meta.some(t=>"firebase.link_domain"===t.key||"branch.link_domain"===t.key))}hasMeta(t){return!!this.event&&(this.event.meta&&this.event.meta.some(e=>e.key===t))}getMeta(t){return this.event&&this.event.meta&&this.event.meta.find(e=>e.key===t)}getMetaStringValue(t){var e=this.getMeta(t);return e&&e.val_str}getMetaIntValue(t){var e=this.getMeta(t);return e&&e.val_int}supportsGeoFence(){return!(!this.event||!this.race)&&"EXTERNAL"!==this.race.type}supportsCourseMap(){return!(!this.event||!this.race)&&("EXTERNAL"!==this.race.type&&("DISTANCE"==this.race.scoring||"ELEVATION"==this.race.scoring||"TRACK"==this.race.scoring||"CUSTOM"==this.race.scoring||"STEPS"==this.race.scoring||"TIME"==this.race.scoring))}supportsBadges(){return!(!this.event||!this.race)&&"EXTERNAL"!==this.race.type}supportsSplits(){return!(!this.event||!this.race)&&"EXTERNAL"===this.race.type}supportsResultsUpload(){return!(!this.event||!this.race)&&("EXTERNAL"===this.race.type||"HYBRID"===this.race.type)}promoteResultsUpload(){return!!this.event&&("RESULTS"===this.event.type||"HYBRID"===this.event.type)}isCustomActivityTypeChallenge(){return this.race&&this.race.activity_types&&1==this.race.activity_types.length&&"CUSTOM"==this.race.activity_types[0]}registrationUrl(){return"https://"+location.host+this.context.$router.resolve({name:"eventReg",params:{id:this.event.id}}).href}gettingStartedUrl(){return"https://"+location.host+this.context.$router.resolve({name:"eventGettingStarted",params:{id:this.event.id}}).href}gettingStartedChinaUrl(t){return"https://"+location.host+this.context.$router.resolve({name:"eventGettingStartedChina",params:{id:this.event.id},query:{code:t}}).href}currentStatus(){return this.event?this.event.published?this.context.$helpers.isFutureEvent(this.event)?h.ONBOARDING:this.context.$helpers.isActiveEvent(this.event)?h.ACTIVE:h.COMPLETED:h.DRAFT:null}hasFullAccess(){return this.hasRole("FULL_ACCESS")}hasConfigEditRole(){return this.hasRole(["FULL_ACCESS","CONFIG_RW"])}hasRole(t){return Array.isArray(t)?!(!this.event||!this.event.my_roles)&&this.event.my_roles.some(e=>t.includes(e)):this.event&&this.event.my_roles&&this.event.my_roles.includes(t)}async refresh(){if(!this.event)return!1;const t=this.event&&this.event.id,e=this.race&&this.race.id;var s=await n["a"].get(t);return this.event=s.data,this.race=this.event&&this.event.races&&e?this.event.races.find(t=>t.id==e):null,await a["a"].$emit("eventmanager-refresh",this),!0}async requestSave(){console.log("save requested"),a["a"].$emit("eventmanager-request-save")}async save(){if(!this.event)return!1;try{var t=await n["a"].put(this.event);this.context.$helpers.toastResponse(this.context,{status:"OK"},"Event saved successfully.");const e=this.race&&this.race.id;return this.event=t.data,this.race=this.event&&this.event.races&&e?this.event.races.find(t=>t.id==e):null,await a["a"].$emit("eventmanager-refresh",this),!0}catch(e){console.log("Error in saving",e,e.response),e.response&&e.response.data&&(this.error=e.response.data.msg,this.context.$helpers.toastResponse(this.context,e.response.data,"")),this.refresh()}return!1}getValueForDisplay(t){return this.context.$helpers.getValueForDisplay(this.context.$options,this.race,{score_value:t},this.event)}goalDistanceUnitType(){return null==this.race||"CALORIES"!=this.race.scoring&&"STEPS"!=this.race.scoring&&"TILES"!=this.race.scoring&&"TIME"!=this.race.scoring&&"STAIRS"!=this.race.scoring&&"BADGES"!=this.race.scoring&&"CUSTOM"!=this.race.scoring?null==this.race||"ELEVATION"!=this.race.scoring&&"ELEVATION_LOSS"!=this.race.scoring?l["a"].UnitType.DISTANCE:l["a"].UnitType.ELEVATION:l["a"].UnitType.NUMBER}goalDistanceMultiplier(){return"TIME"==this.race.scoring?3600:1}goalLabel(){return this.race&&null!=this.race.scoring&&"RESULT"!=this.race.scoring&&"TRACK"!=this.race.scoring?"DISTANCE"==this.race.scoring?`Distance goal (in ${this.unitTypeDisplay()})`:"STEPS"==this.race.scoring?"Step goal":"ELEVATION"==this.race.scoring||"ELEVATION_LOSS"==this.race.scoring?`Elevation goal (in ${this.unitTypeDisplay()})`:"CALORIES"==this.race.scoring?"Total calorie goal (in kcal)":"TIME"==this.race.scoring?"Time goal (in hours)":"BADGES"==this.race.scoring?"Total badges to earn":"STAIRS"==this.race.scoring?"Total number of stairs goal":"CUSTOM"==this.race.scoring?`Total ${this.race.custom||"score"} goal`:null:`Goal distance (in ${this.unitTypeDisplay()})`}unitTypeDisplay(){return null==this.race||"ELEVATION"!=this.race.scoring&&"ELEVATION_LOSS"!=this.race.scoring?null==this.event||"METRIC"==this.event.unit?"km":"mi":null==this.event||"METRIC"==this.event.unit?"m":"ft"}}e["a"]=d},"368e":function(t,e,s){},"56b8":function(t,e,s){"use strict";s.r(e);var i=function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("div",[s("v-breadcrumbs",{attrs:{items:t.breadcrumbItems}}),t.group?s("v-card",[s("v-card-title",{staticClass:"headline"},[t._v("Permissions for "+t._s(t.group.name))]),s("v-card-text",[s("p",[t._v(" By default only event (co-)admins have access to reports. You can optionally grant reporting access for a team to others. ")]),s("p",[t._v(" Persons with this permission will be able to download Excel reports for all leaderboards within this event, but only have access to data of members of this team. ")]),t.reportPageUrl?s("p"):t._e(),s("div",[t._v("Share this url with the group admins so they can download the reports for this group:")]),s("v-text-field",{attrs:{readonly:""},scopedSlots:t._u([{key:"append",fn:function(){return[s("v-btn",{attrs:{text:""},on:{click:function(e){t.$helpers.copyToClipboard(t.reportPageUrl,t.$toast),t.showQrCode=!1}}},[t._v("Copy")])]},proxy:!0}],null,!1,1651027577),model:{value:t.reportPageUrl,callback:function(e){t.reportPageUrl=e},expression:"reportPageUrl"}}),s("p")],1),s("v-data-table",{attrs:{headers:t.headers,items:t.permissions,"sort-by":"name","items-per-page":25,"hide-default-footer":""},scopedSlots:t._u([{key:"top",fn:function(){return[s("v-toolbar",{staticClass:"mx-4",attrs:{flat:"",color:"white"}},[s("v-toolbar-title",{staticClass:"ml-0 subtitle"},[t._v("Permissions")]),s("v-spacer"),s("v-btn",{staticClass:"mb-2",attrs:{color:"accent",disabled:!t.eventUtil.isProPlan()},on:{click:function(e){t.showAddUserDialog=!0}}},[t._v("Add")])],1)]},proxy:!0},{key:"item.roles",fn:function(e){var s=e.item;return[t._v(" "+t._s(s.roles.map((function(e){return t.$helpers.displayText(t.siteData.roles,e)})).join(", "))+" ")]}},{key:"item.actions",fn:function(e){var i=e.item;return[s("v-icon",{staticClass:"mr-4",attrs:{small:""},on:{click:function(e){return t.editPermissions(i)}}},[t._v(" fa-pencil ")]),s("v-icon",{staticClass:"mr-4",attrs:{small:""},on:{click:function(e){return t.deletePermissions(i.name,i.id)}}},[t._v(" fa-trash ")])]}},{key:"no-data",fn:function(){return[s("i",[t._v("No extra permissions granted, only you will have access to this organization.")])]},proxy:!0}],null,!1,3221150314)})],1):t._e(),s("v-dialog",{model:{value:t.showAddUserDialog,callback:function(e){t.showAddUserDialog=e},expression:"showAddUserDialog"}},[s("v-card",[s("v-card-title",[t._v("Add an admin")]),s("v-card-text",[t._v(" Add a reporting user to this group. This user will have access to reporting data of all users of this group. ")]),s("v-card-text",[t._v(" You need to have the Profile ID of the user you want to add. The user can find this (and send to you) from the Edit Profile screen in the app or website when they are logged in. ")]),s("v-card-text",[s("v-text-field",{attrs:{label:"Profile ID","persistent-hint":"",hint:"The user can find this on their Edit Profile screen",required:"",autofocus:""},model:{value:t.profileId,callback:function(e){t.profileId=e},expression:"profileId"}})],1),s("v-card-text",[s("v-btn",{attrs:{color:"primary",disabled:!t.profileId},on:{click:t.addPermissions}},[t._v("Save")])],1)],1)],1)],1)},a=[],n=s("2f62"),r=s("755e"),o=s("f6b8"),l=s("585f"),c=s("3b3f"),h=s("337e"),d=s("4a1f"),u=s.n(d);const v=u.a.current();var p={name:"TeamPermissions",components:{},props:{event:Object},data(){return{siteData:c,tenant:v,group:null,showAddUserDialog:!1,permissions:[],profileId:null,selectedRoles:["REPORTING"],headers:[{text:"Name",align:"start",sortable:!0,filterable:!0,value:"name"},{text:"Roles",align:"start",sortable:!0,filterable:!0,value:"roles"},{text:"Actions",align:"start",sortable:!1,filterable:!1,value:"actions"}]}},async mounted(){await this.getData(),l["a"].$on("login-state-change",async t=>{await this.getData()})},methods:{async getGroup(t){this.group=(await r["a"].get(t)).data,this.permissions=(await o["a"].getTeamPermissions(this.$route.params.id,t)).data.data||[]},async addPermissions(){if(this.profileId&&this.selectedRoles&&this.selectedRoles.length){const t=(await o["a"].addTeamPermissions(this.$route.params.id,this.group.id,this.profileId,this.selectedRoles)).data;await this.getData(),this.showAddUserDialog=!1,this.$helpers.toastResponse(this,t,"Permission added successfully.")}},async editPermissions(t){this.profileId=t.id,this.selectedRoles=t.roles,this.showAddUserDialog=!0},async deletePermissions(t,e){if(confirm(`Are you sure you want to remove access by ${t}?`)){const t=(await o["a"].deleteTeamPermissions(this.event.id,this.group.id,e)).data;await this.getData(),this.$helpers.toastResponse(this,t,"Permission revoked successfully.")}},async getData(){this.user&&await this.getGroup(this.$route.params.groupId)}},computed:{reportPageUrl(){return this.event&&this.group&&v.homeUrl.slice(0,-1)+this.$router.resolve({name:"profileGroupsEventReports",params:{id:this.group.id,eventId:this.event.id}}).href},breadcrumbItems(){return this.event&&this.group?[{text:"Event Manager",exact:!0,to:{name:"eventmanager"}},{text:this.event.name,exact:!0,to:{name:"eventmanagerView",params:{id:this.event.id}}},{text:"Teams",exact:!0,to:{name:"eventmanagerTeams",params:{id:this.event.id}}},{text:this.group.name,disabled:!0},{text:"Permissions",disabled:!0}]:[]},eventUtil(){return new h["a"](this,this.event)},...Object(n["b"])({user:"user"})}},g=p,m=s("2877"),f=s("6544"),b=s.n(f),y=s("2bc5"),E=s("8336"),T=s("b0af"),A=s("99d9"),w=s("8fea"),S=s("169a"),_=s("132d"),x=s("2fa4"),C=s("8654"),O=s("71d9"),$=s("2a7f"),I=Object(m["a"])(g,i,a,!1,null,null,null);e["default"]=I.exports;b()(I,{VBreadcrumbs:y["a"],VBtn:E["a"],VCard:T["a"],VCardText:A["c"],VCardTitle:A["d"],VDataTable:w["a"],VDialog:S["a"],VIcon:_["a"],VSpacer:x["a"],VTextField:C["a"],VToolbar:O["a"],VToolbarTitle:$["b"]})},"755e":function(t,e,s){"use strict";var i=s("dde5"),a=s("4360");s("b383");e["a"]={getConfig(){return{headers:{authorization:"Bearer "+a["a"].getters.jwtToken}}},get(t){return i["a"].http.get("/v1.0/profile/groups/"+t,this.getConfig())},list(t,e){return i["a"].http.post(`/v1.0/groups/list?type=${t||""}&limit=${e||""}`,{},this.getConfig())},getGroupsInEvent(t,e){return i["a"].http.get(`/v1.0/groups/events/${t}/groups?category=${e||""}`,this.getConfig())}}},"99d9":function(t,e,s){"use strict";s.d(e,"a",(function(){return n})),s.d(e,"b",(function(){return r})),s.d(e,"c",(function(){return o})),s.d(e,"d",(function(){return l}));var i=s("b0af"),a=s("80d2");const n=Object(a["j"])("v-card__actions"),r=Object(a["j"])("v-card__subtitle"),o=Object(a["j"])("v-card__text"),l=Object(a["j"])("v-card__title");i["a"]},abd3:function(t,e,s){},afdd:function(t,e,s){"use strict";var i=s("8336");e["a"]=i["a"]}}]);
//# sourceMappingURL=chunk-7f44697d.0322b51b.js.map