{"version":3,"sources":["webpack:///./src/commoncomponents/inviteLink/InviteLink.vue?af59","webpack:///./src/commoncomponents/inviteLink/InviteLink.ts","webpack:///./src/commoncomponents/inviteLink/InviteLink.vue?187c","webpack:///./src/commoncomponents/inviteLink/InviteLink.vue?6ab2","webpack:///./src/commoncomponents/inviteLink/InviteLink.vue","webpack:///./src/commoncomponents/inviteLink/InviteLink.less?8a33"],"names":["ContactType","render","_vm","this","_h","$createElement","_c","_self","staticClass","attrs","contactGuid","on","$event","handleClick","_v","_e","staticRenderFns","shouldDisplay","featureEnabled","value","getAccountDataValue","data","undefined","design","JSON","parse","getCookie","accountId","commonEntry","accountById","appSetting","pickup","phoneNumber","contactType","EMERGENCY_CONTACT","inviteEmContact","invitePickupContact","scholarGuid","emContactGuid","then","response","status","RESPONSE_200","notification","closeAll","message","pos","timeout","accountDetail","validator","Object","keys","includes","deep","immediate","component"],"mappings":"kJAAA,ICOYA,EDPRC,EAAS,WAAa,IAAIC,EAAIC,KAASC,EAAGF,EAAIG,eAAmBC,EAAGJ,EAAIK,MAAMD,IAAIF,EAAG,OAAQF,EAAiB,cAAEI,EAAG,OAAO,CAACE,YAAY,cAAcC,MAAM,CAAC,IAAMP,EAAIQ,aAAaC,GAAG,CAAC,MAAQ,SAASC,GAAQ,OAAOV,EAAIW,iBAAiB,CAACX,EAAIY,GAAG,0BAA0BZ,EAAIa,MAClRC,EAAkB,G,0LCMtB,SAAYhB,GACV,2CACA,4CAFF,CAAYA,MAAW,KAMvB,IAAqB,EAArB,YADA,iD,+DAEE,EAAAiB,eAAyB,EACzB,EAAAC,gBAA0B,EAH5B,EACA,oFA0BmBC,GACf,IAAMC,EAAsBD,EAAME,KAClC,QAA4BC,IAAxBF,EAAmC,CAErC,IAAMG,EAAcC,KAAKC,MAAM,OAAcC,UAAU,kBAAoB,IACrEC,EAAYJ,EAAOI,UACzBC,EAAA,KAAYC,YAAYF,QAEhBP,EAAoBU,WAAWC,SACvC5B,KAAKe,gBAAiB,EACtBf,KAAKc,eAAgB,KApC3B,gCAyCId,KAAKc,gBAAkBd,KAAK6B,aAAe7B,KAAKe,iBAzCpD,oCA6CQf,KAAK8B,cAAgBjC,EAAYkC,kBACnC/B,KAAKgC,gBAAgBhC,KAAKO,aAG1BP,KAAKiC,oBAAoBjC,KAAKO,YAAaP,KAAKkC,eAjDtD,0CAqDsBC,EAAuBD,GACzC,eAAuBC,EAAeD,GAAaE,MAAK,SAACC,GACnDA,EAASC,QAAU,OAAUC,cAC/B,IAAMC,aAAaC,WACnB,IAAMD,aAAa,CACjBE,QAAS,2BACTJ,OAAQ,UACRK,IAAK,aACLC,QAAS,QAIX,IAAMJ,aAAaC,WACnB,IAAMD,aAAa,CACjBE,QAAS,gCACTJ,OAAQ,UACRK,IAAK,aACLC,QAAS,YAtEnB,sCA4EkBT,GACd,eAAuBA,GAAeC,MAAK,SAACC,GACtCA,EAASC,QAAU,OAAUC,cAC/B,IAAMC,aAAaC,WACnB,IAAMD,aAAa,CACjBE,QAAS,2BACTJ,OAAQ,UACRK,IAAK,aACLC,QAAS,QAIX,IAAMJ,aAAaC,WACnB,IAAMD,aAAa,CACjBE,QAAS,gCACTJ,OAAQ,UACRK,IAAK,aACLC,QAAS,YA7FnB,kCAsBI,OAAOnB,EAAA,KAAYoB,kBAtBvB,GAAwC,QAUpC,QAND,eAAK,CACJC,UAAW,SAAU9B,GAEnB,OAAO+B,OAAOC,KAAKnD,GAAaoD,SAASjC,O,kCAM3C,QADD,kB,kCAIC,QADD,kB,kCAIC,QADD,kB,kCAQD,QADC,eAAM,cAAe,CAAEkC,MAAM,EAAMC,WAAW,K,+BAa9C,MAtCkB,EAAU,QAD9B,eAAU,KACU,WCCN,ICdwY,I,wBCQnZC,EAAY,eACd,EACAtD,EACAe,GACA,EACA,KACA,WACA,MAIa,aAAAuC,E,2CCnBf,yBAAsc,EAAG","file":"js/chunk-4bc71e84.514cd63b.js","sourcesContent":["var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return (_vm.shouldDisplay)?_c('span',{staticClass:\"invite-link\",attrs:{\"alt\":_vm.contactGuid},on:{\"click\":function($event){return _vm.handleClick()}}},[_vm._v(\" Invite to Platform \")]):_vm._e()}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","import APP_CONST from '@/constants/AppConst';\nimport { inviteAuthorizedPickup, inviteEmergencyContact } from '@/services/userService/users-api';\nimport APP_UTILITIES from '@/utilities/commonFunctions';\nimport UIkit from 'uikit';\nimport { Component, Prop, Vue, Watch } from 'vue-property-decorator';\nimport commonEntry from '@/store/modules/commonEntry';\n\nexport enum ContactType {\n EMERGENCY_CONTACT = 'EMERGENCY_CONTACT',\n AUTHORIZED_PICKUP = 'AUTHORIZED_PICKUP',\n}\n\n@Component({})\nexport default class InviteLink extends Vue {\n shouldDisplay: Boolean = true;\n featureEnabled: Boolean = true;\n\n @Prop({\n validator: function (value) {\n // Value must be a contact type\n return Object.keys(ContactType).includes(value);\n },\n })\n contactType!: string;\n\n @Prop()\n scholarGuid!: string;\n\n @Prop()\n phoneNumber!: string;\n\n @Prop()\n contactGuid!: string;\n\n get accountData() {\n return commonEntry.accountDetail;\n }\n\n @Watch('accountData', { deep: true, immediate: true })\n accountDataWatch(value: any) {\n const getAccountDataValue = value.data;\n if (getAccountDataValue === undefined) {\n //If there is no data in accountDetail we need to fetch, this should not happen in the normal flow.\n const design: any = JSON.parse(APP_UTILITIES.getCookie('accountDesign') || '');\n const accountId = design.accountId;\n commonEntry.accountById(accountId);\n }\n else if (!getAccountDataValue.appSetting.pickup) {\n this.featureEnabled = false;\n this.shouldDisplay = false;\n }\n }\n\n created() {\n this.shouldDisplay = !!this.phoneNumber && this.featureEnabled;\n }\n\n handleClick() {\n if (this.contactType === ContactType.EMERGENCY_CONTACT) {\n this.inviteEmContact(this.contactGuid);\n }\n else {\n this.invitePickupContact(this.contactGuid, this.scholarGuid);\n }\n }\n\n invitePickupContact(emContactGuid: string, scholarGuid: string) {\n inviteAuthorizedPickup(emContactGuid, scholarGuid).then((response: any) => {\n if (response.status == APP_CONST.RESPONSE_200) {\n UIkit.notification.closeAll();\n UIkit.notification({\n message: 'Invite Sent Successfully',\n status: 'success',\n pos: 'top-center',\n timeout: 5000,\n });\n }\n else {\n UIkit.notification.closeAll();\n UIkit.notification({\n message: 'User has already been invited',\n status: 'warning',\n pos: 'top-center',\n timeout: 5000,\n });\n }\n });\n }\n\n inviteEmContact(emContactGuid: string) {\n inviteEmergencyContact(emContactGuid).then((response: any) => {\n if (response.status == APP_CONST.RESPONSE_200) {\n UIkit.notification.closeAll();\n UIkit.notification({\n message: 'Invite Sent Successfully',\n status: 'success',\n pos: 'top-center',\n timeout: 5000,\n });\n }\n else {\n UIkit.notification.closeAll();\n UIkit.notification({\n message: 'User has already been invited',\n status: 'warning',\n pos: 'top-center',\n timeout: 5000,\n });\n }\n });\n }\n}\n","\n\n\n\n\n\n\n\n\n\n\n\nimport InviteLink from './InviteLink';\n\nexport default InviteLink;\n","import mod from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/ts-loader/index.js??ref--13-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./InviteLink.vue?vue&type=script&lang=ts&\"; export default mod; export * from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/ts-loader/index.js??ref--13-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./InviteLink.vue?vue&type=script&lang=ts&\"","import { render, staticRenderFns } from \"./InviteLink.vue?vue&type=template&id=07300c25&scoped=true&\"\nimport script from \"./InviteLink.vue?vue&type=script&lang=ts&\"\nexport * from \"./InviteLink.vue?vue&type=script&lang=ts&\"\nimport style0 from \"./InviteLink.less?vue&type=style&index=0&id=07300c25&lang=less&scoped=true&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n \"07300c25\",\n null\n \n)\n\nexport default component.exports","import mod from \"-!../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--10-oneOf-1-0!../../../node_modules/css-loader/dist/cjs.js??ref--10-oneOf-1-1!../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../node_modules/postcss-loader/src/index.js??ref--10-oneOf-1-2!../../../node_modules/less-loader/dist/cjs.js??ref--10-oneOf-1-3!./InviteLink.less?vue&type=style&index=0&id=07300c25&lang=less&scoped=true&\"; export default mod; export * from \"-!../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--10-oneOf-1-0!../../../node_modules/css-loader/dist/cjs.js??ref--10-oneOf-1-1!../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../node_modules/postcss-loader/src/index.js??ref--10-oneOf-1-2!../../../node_modules/less-loader/dist/cjs.js??ref--10-oneOf-1-3!./InviteLink.less?vue&type=style&index=0&id=07300c25&lang=less&scoped=true&\""],"sourceRoot":""}