{"version":3,"sources":["webpack:///./src/views/shared/InviteUser.vue?3b79","webpack:///./src/views/shared/InviteUser.vue","webpack:///./src/views/shared/InviteUser.vue?07a8","webpack:///./src/shared/components/InputError.vue?5099","webpack:///./src/shared/components/InputError.vue","webpack:///./src/shared/components/InputError.vue?cdcf"],"names":["_hoisted_1","class","_hoisted_2","_hoisted_3","_hoisted_4","_hoisted_5","_hoisted_6","key","_hoisted_7","_hoisted_8","_hoisted_9","_hoisted_10","_hoisted_11","render","_ctx","_cache","$props","$setup","$data","$options","_component_InputError","_resolveComponent","_component_Multiselect","_openBlock","_createElementBlock","this","invitationLink","_Fragment","_createElementVNode","_toDisplayString","$t","onClick","$event","copyUrl","onSubmit","submitForm","_withDirectives","_normalizeClass","error","v$","email","$error","type","placeholder","onBlur","$touch","_vModelText","_createBlock","$invalid","_createCommentVNode","driversOnly","_createVNode","modelValue","role","options","roles","label","valueProp","object","noOptionsText","isDriver","darkStore","darkstores","searchable","darkStoreSearchable","onOpen","onClose","shift","shifts","vehicle","vehicles","driverSearchable","closeModal","disabled","defineComponent","components","InputError","Multiselect","setup","useVuelidate","mounted","$store","dispatch","VehiclesActions","FETCH_VEHICLES_AVAILABLE","pageNumber","pageSize","isFree","DarkStoresActions","FETCH_DARKSTORES","data","validations","required","requiredIf","checkRequiredDriver","props","Boolean","default","methods","mytext","navigator","clipboard","writeText","alert","$emit","event","preventDefault","payload","user_email","role_id","id","Object","assign","dark_store_id","vehicle_id","shift_id","DriverActions","INVITE_DRIVER","then","link","catch","name","computed","getters","getRoles","value","watch","val","length","find","WorkShiftActions","FETCH_WORK_SHIFTS","darkstoreId","__exports__","_component_BaseIcon","BaseIcon","String"],"mappings":"0JAEMA,EAAa,CAAEC,MAAO,sBACtBC,EAAa,CAAED,MAAO,oDACtBE,EAAa,CAAEF,MAAO,8EACtBG,EAAa,CAAEH,MAAO,4DACtBI,EAAa,CAAEJ,MAAO,cACtBK,EAAa,CACjBC,IAAK,EACLN,MAAO,cAEHO,EAA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AAG,IAAHA,KAAKC,QAAUvG,KAAKyB,cACtBzB,KAAK4B,KAAO0E,EAAIE,MAAK,SAAC5E,GAAD,MAA6B,WAAdA,EAAKoE,UAG7CpE,KANK,SAMC0E,GACJtG,KAAK0C,MAAQ,KACb1C,KAAK4C,QAAU,KACf5C,KAAKoC,UAAY,KACbkE,GACFtG,KAAKwD,OAAOC,SAAZ,qBAAmC,CAACgD,OAAiBC,oBACnD,CAAE9C,WAAY,EAAGC,SAAU,KAAM8C,YAAaL,EAAIjB,MAIxDjD,UAhBK,SAgBMkE,GACTtG,KAAK0C,MAAQ,KACb1C,KAAK4C,QAAU,KACX0D,GACFtG,KAAKwD,OAAOC,SAAZ,qBAAmC,CAACgD,OAAiBC,oBACnD,CAAE9C,WAAY,EAAGC,SAAU,KAAM8C,YAAaL,EAAIjB,S,qBC1H5D,MAAMuB,EAA2B,IAAgB,EAAQ,CAAC,CAAC,SAASxH,KAErD,gB,kDCLTb,EAAa,CAAEC,MAAO,sFACtBC,EAAa,CAAED,MAAO,uBAEtB,SAAUY,EAAOC,EAAUC,EAAYC,EAAYC,EAAYC,EAAWC,GAC9E,IAAMmH,EAAsBjH,8BAAkB,YAE9C,OAAQE,yBAAcC,gCAAoB,MAAOxB,EAAY,CAC3D4B,gCAAoB,MAAO,KAAM,CAC/BuB,yBAAamF,EAAqB,CAChCrI,MAAO,eACPwH,KAAM,YAGV7F,gCAAoB,IAAK1B,EAAY2B,6BAAiBf,EAAKwB,OAAQ,K,gBCXxDoC,+BAAgB,CAC7B+C,KAAM,aACN9C,WAAY,CACV4D,uBAEFxC,MAAO,CACLzD,MAAO,CACLI,KAAM8F,OACN5C,UAAU,M,qBCPhB,MAAMyC,EAA2B,IAAgB,EAAQ,CAAC,CAAC,SAASxH,KAErD","file":"js/chunk-da64cba8.ebf66290.js","sourcesContent":["import { toDisplayString as _toDisplayString, createElementVNode as _createElementVNode, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, createCommentVNode as _createCommentVNode, vModelText as _vModelText, normalizeClass as _normalizeClass, withDirectives as _withDirectives, resolveComponent as _resolveComponent, createBlock as _createBlock, createVNode as _createVNode } from \"vue\"\n\nconst _hoisted_1 = { class: \"flex flex-wrap p-8\" }\nconst _hoisted_2 = { class: \"text-lg text-center w-full mb-4 text-darkPrimary\" }\nconst _hoisted_3 = { class: \"border border-l-2 bg-backgroundGray p-2 basis-20 flex-grow-0 flex-shrink-0\" }\nconst _hoisted_4 = { class: \"p-2 text text-darkPrimary text-sm text-ellipsis truncate\" }\nconst _hoisted_5 = { class: \"form-group\" }\nconst _hoisted_6 = {\n key: 0,\n class: \"form-group\"\n}\nconst _hoisted_7 = {\n key: 1,\n class: \"form-group\"\n}\nconst _hoisted_8 = {\n key: 2,\n class: \"form-group\"\n}\nconst _hoisted_9 = {\n key: 3,\n class: \"form-group\"\n}\nconst _hoisted_10 = { class: \"flex flex-wrap items-center justify-end w-full\" }\nconst _hoisted_11 = [\"disabled\"]\n\nexport function render(_ctx: any,_cache: any,$props: any,$setup: any,$data: any,$options: any) {\n const _component_InputError = _resolveComponent(\"InputError\")!\n const _component_Multiselect = _resolveComponent(\"Multiselect\")!\n\n return (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n (this.invitationLink)\n ? (_openBlock(), _createElementBlock(_Fragment, { key: 0 }, [\n _createElementVNode(\"p\", _hoisted_2, _toDisplayString(_ctx.$t('addDriver.invitationTitle')), 1),\n _createElementVNode(\"div\", {\n class: \"w-full border border-2 border-gray-200 rounded rounded-md flex items-center justify-start overflow-hidden cursor-pointer\",\n onClick: _cache[0] || (_cache[0] = ($event: any) => (_ctx.copyUrl(this.invitationLink)))\n }, [\n _createElementVNode(\"span\", _hoisted_3, _toDisplayString(_ctx.$t('addDriver.copyUrl')), 1),\n _createElementVNode(\"span\", _hoisted_4, _toDisplayString(this.invitationLink), 1)\n ])\n ], 64))\n : (_openBlock(), _createElementBlock(\"form\", {\n key: 1,\n onSubmit: _cache[12] || (_cache[12] = ($event: any) => (_ctx.submitForm($event))),\n class: \"w-full\"\n }, [\n _createElementVNode(\"div\", _hoisted_5, [\n _withDirectives(_createElementVNode(\"input\", {\n class: _normalizeClass([{error: _ctx.v$.email.$error}, \"h-42 form-control\"]),\n type: \"email\",\n placeholder: \" \",\n \"onUpdate:modelValue\": _cache[1] || (_cache[1] = ($event: any) => ((_ctx.email) = $event)),\n onBlur: _cache[2] || (_cache[2] = \n//@ts-ignore\n(...args) => (_ctx.v$.email.$touch && _ctx.v$.email.$touch(...args)))\n }, null, 34), [\n [_vModelText, _ctx.email]\n ]),\n _createElementVNode(\"label\", {\n class: _normalizeClass([{error: _ctx.v$.email.$error}, \"floating-label\"])\n }, _toDisplayString(_ctx.$t('addDriver.email')), 3),\n (_ctx.v$.email.$error)\n ? (_openBlock(), _createBlock(_component_InputError, {\n key: 0,\n error: _ctx.v$.email.email.$invalid ? _ctx.$t('validation.email') : _ctx.$t('validation.required')\n }, null, 8, [\"error\"]))\n : _createCommentVNode(\"\", true)\n ]),\n (!_ctx.driversOnly)\n ? (_openBlock(), _createElementBlock(\"div\", _hoisted_6, [\n _createVNode(_component_Multiselect, {\n modelValue: _ctx.role,\n \"onUpdate:modelValue\": _cache[3] || (_cache[3] = ($event: any) => ((_ctx.role) = $event)),\n options: _ctx.roles,\n label: \"value\",\n valueProp: \"id\",\n object: \"true\",\n noOptionsText: _ctx.$t('validation.noItemsToShow'),\n placeholder: _ctx.$t('placeholders.role')\n }, null, 8, [\"modelValue\", \"options\", \"noOptionsText\", \"placeholder\"]),\n (_ctx.v$.role.$error)\n ? (_openBlock(), _createBlock(_component_InputError, {\n key: 0,\n error: _ctx.$t('validation.required')\n }, null, 8, [\"error\"]))\n : _createCommentVNode(\"\", true)\n ]))\n : _createCommentVNode(\"\", true),\n (_ctx.isDriver)\n ? (_openBlock(), _createElementBlock(\"div\", _hoisted_7, [\n _createVNode(_component_Multiselect, {\n modelValue: _ctx.darkStore,\n \"onUpdate:modelValue\": _cache[4] || (_cache[4] = ($event: any) => ((_ctx.darkStore) = $event)),\n options: _ctx.darkstores,\n label: \"value\",\n valueProp: \"id\",\n object: \"true\",\n noOptionsText: _ctx.$t('validation.noItemsToShow'),\n placeholder: _ctx.$t('placeholders.darkstore'),\n searchable: _ctx.darkStoreSearchable,\n onOpen: _cache[5] || (_cache[5] = () => _ctx.darkStoreSearchable = true),\n onClose: _cache[6] || (_cache[6] = () => _ctx.darkStoreSearchable = false)\n }, null, 8, [\"modelValue\", \"options\", \"noOptionsText\", \"placeholder\", \"searchable\"]),\n (_ctx.v$.darkStore.$error)\n ? (_openBlock(), _createBlock(_component_InputError, {\n key: 0,\n error: _ctx.$t('validation.required')\n }, null, 8, [\"error\"]))\n : _createCommentVNode(\"\", true)\n ]))\n : _createCommentVNode(\"\", true),\n (_ctx.isDriver)\n ? (_openBlock(), _createElementBlock(\"div\", _hoisted_8, [\n _createVNode(_component_Multiselect, {\n modelValue: _ctx.shift,\n \"onUpdate:modelValue\": _cache[7] || (_cache[7] = ($event: any) => ((_ctx.shift) = $event)),\n options: _ctx.shifts,\n label: \"value\",\n valueProp: \"id\",\n object: \"true\",\n noOptionsText: _ctx.$t('validation.noItemsToShow'),\n placeholder: _ctx.$t('placeholders.shift')\n }, null, 8, [\"modelValue\", \"options\", \"noOptionsText\", \"placeholder\"]),\n (_ctx.v$.shift.$error)\n ? (_openBlock(), _createBlock(_component_InputError, {\n key: 0,\n error: _ctx.$t('validation.required')\n }, null, 8, [\"error\"]))\n : _createCommentVNode(\"\", true)\n ]))\n : _createCommentVNode(\"\", true),\n (_ctx.isDriver)\n ? (_openBlock(), _createElementBlock(\"div\", _hoisted_9, [\n _createVNode(_component_Multiselect, {\n modelValue: _ctx.vehicle,\n \"onUpdate:modelValue\": _cache[8] || (_cache[8] = ($event: any) => ((_ctx.vehicle) = $event)),\n options: _ctx.vehicles,\n label: \"value\",\n valueProp: \"id\",\n object: \"true\",\n noOptionsText: _ctx.$t('validation.noItemsToShow'),\n placeholder: _ctx.$t('placeholders.vehicle'),\n searchable: _ctx.driverSearchable,\n onOpen: _cache[9] || (_cache[9] = () => _ctx.driverSearchable = true),\n onClose: _cache[10] || (_cache[10] = () => _ctx.driverSearchable = false)\n }, null, 8, [\"modelValue\", \"options\", \"noOptionsText\", \"placeholder\", \"searchable\"]),\n (_ctx.v$.vehicle.$error)\n ? (_openBlock(), _createBlock(_component_InputError, {\n key: 0,\n error: _ctx.$t('validation.required')\n }, null, 8, [\"error\"]))\n : _createCommentVNode(\"\", true)\n ]))\n : _createCommentVNode(\"\", true),\n _createElementVNode(\"div\", _hoisted_10, [\n _createElementVNode(\"button\", {\n onClick: _cache[11] || (_cache[11] = \n//@ts-ignore\n(...args) => (_ctx.closeModal && _ctx.closeModal(...args))),\n class: \"secondary m-1 w-32 px-4 py-2\"\n }, _toDisplayString(_ctx.$t('buttons.close')), 1),\n _createElementVNode(\"button\", {\n type: \"submit\",\n class: \"primary m-1 w-32 px-4 py-2\",\n disabled: _ctx.v$.$invalid\n }, _toDisplayString(_ctx.$t('buttons.inviteUser')), 9, _hoisted_11)\n ])\n ], 32))\n ]))\n}","\nimport { defineComponent } from 'vue'\nimport useVuelidate from '@vuelidate/core'\nimport { required, requiredIf } from '@/customValidators'\nimport { VehiclesActions } from '@/store/modules/vehicles/actions'\nimport { VehicleInterface } from '@/shared/interfaces/vehicle.interface'\nimport { email } from '@vuelidate/validators'\nimport { DriverActions } from '@/store/modules/drivers/actions'\nimport { DarkStoresActions } from '@/store/modules/darkstores/actions'\nimport InputError from '@/shared/components/InputError.vue'\nimport { WorkShiftActions } from '@/store/modules/work-shifts/actions'\nimport Multiselect from '@vueform/multiselect'\n\nexport default defineComponent({\n components: { InputError, Multiselect },\n setup: () => ({ v$: useVuelidate() }),\n mounted () {\n this.$store.dispatch('getUserRoles')\n this.$store.dispatch(`vehicles/${[VehiclesActions.FETCH_VEHICLES_AVAILABLE]}`, { pageNumber: 1, pageSize: 9999, isFree: 1 })\n // this.$store.dispatch(`vehicles/${[VehiclesActions.FETCH_VEHICLES]}`, { pageNumber: 1, pageSize: 100, unAssigned: true })\n this.$store.dispatch(`darkstores/${[DarkStoresActions.FETCH_DARKSTORES]}`, { pageNumber: 1, pageSize: 9999 })\n // this.$store.dispatch(`workShifts/${[WorkShiftActions.FETCH_WORK_SHIFTS]}`)\n },\n data () {\n return {\n email: '',\n role: null as any,\n vehicle: null as any,\n shift: null as any,\n darkStore: null as any,\n invitationLink: null as any,\n driverSearchable: false,\n darkStoreSearchable: false\n }\n },\n validations: function () {\n return {\n email: { required, email },\n role: { required },\n vehicle: {\n required: requiredIf(() => this.checkRequiredDriver())\n },\n shift: {\n required: requiredIf(() => this.checkRequiredDriver())\n },\n darkStore: {\n required: requiredIf(() => this.checkRequiredDriver())\n }\n }\n },\n props: {\n driversOnly: {\n type: Boolean,\n default: false\n }\n },\n methods: {\n async copyUrl (mytext: string) {\n try {\n await navigator.clipboard.writeText(mytext)\n } catch ($e) {\n alert('Cannot copy')\n }\n },\n closeModal (): void {\n this.$emit('close')\n },\n async submitForm (event: any): Promise {\n event.preventDefault()\n const payload = {\n user_email: this.email,\n role_id: this.role.id\n }\n if (this.isDriver) {\n Object.assign(payload, { dark_store_id: this.darkStore.id, vehicle_id: this.vehicle.id, shift_id: this.shift.id })\n }\n await this.$store.dispatch(`drivers/${[DriverActions.INVITE_DRIVER]}`, payload).then((link: string) => {\n this.invitationLink = link\n // this.$emit('close')\n this.$emit('refresh')\n }).catch(() => {\n // const toast = useToast()\n // toast.error(err?.info?.message, { timeout: 3000 })\n })\n },\n checkRequiredDriver (): boolean {\n return this.role?.name === 'driver'\n }\n },\n computed: {\n roles (): VehicleInterface[] {\n return this.$store.getters.getRoles\n },\n vehicles (): VehicleInterface[] {\n return this.$store.getters['vehicles/getVehiclesWithShiftId']\n },\n isDriver (): boolean {\n return this.role && this.role.value === 'Driver'\n },\n darkstores (): any[] {\n return this.$store.getters['darkstores/getDarkStoresAsDictionary']\n },\n shifts (): any[] {\n return this.$store.getters['workShifts/getWorkShiftsForSelect']\n }\n },\n watch: {\n roles (val) {\n if (val?.length && this.driversOnly) {\n this.role = val.find((role: any) => role.name === 'driver')\n }\n },\n role (val) {\n this.shift = null\n this.vehicle = null\n this.darkStore = null\n if (val) {\n this.$store.dispatch(`workShifts/${[WorkShiftActions.FETCH_WORK_SHIFTS]}`,\n { pageNumber: 1, pageSize: 9999, darkstoreId: val.id }\n )\n }\n },\n darkStore (val) {\n this.shift = null\n this.vehicle = null\n if (val) {\n this.$store.dispatch(`workShifts/${[WorkShiftActions.FETCH_WORK_SHIFTS]}`,\n { pageNumber: 1, pageSize: 9999, darkstoreId: val.id }\n )\n }\n }\n // shift (val) {\n // this.vehicle = null\n // if (val) {\n // this.$store.dispatch(`vehicles/${[VehiclesActions.FETCH_VEHICLES_AVAILABLE]}`, { isAssigned: 0 })\n // }\n // }\n }\n})\n","import { render } from \"./InviteUser.vue?vue&type=template&id=5c4fcc94&ts=true\"\nimport script from \"./InviteUser.vue?vue&type=script&lang=ts\"\nexport * from \"./InviteUser.vue?vue&type=script&lang=ts\"\n\nimport exportComponent from \"/usr/src/app/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['render',render]])\n\nexport default __exports__","import { resolveComponent as _resolveComponent, createVNode as _createVNode, createElementVNode as _createElementVNode, toDisplayString as _toDisplayString, openBlock as _openBlock, createElementBlock as _createElementBlock } from \"vue\"\n\nconst _hoisted_1 = { class: \"flex items-center absolute start-0 top-42 text-textError text-start leading-3 pt-1\" }\nconst _hoisted_2 = { class: \"text-10px leading-3\" }\n\nexport function render(_ctx: any,_cache: any,$props: any,$setup: any,$data: any,$options: any) {\n const _component_BaseIcon = _resolveComponent(\"BaseIcon\")!\n\n return (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n _createElementVNode(\"div\", null, [\n _createVNode(_component_BaseIcon, {\n class: \"me-1 w-4 h-4\",\n name: \"alert\"\n })\n ]),\n _createElementVNode(\"p\", _hoisted_2, _toDisplayString(_ctx.error), 1)\n ]))\n}","\nimport { defineComponent } from 'vue'\nimport BaseIcon from '@/shared/components/base-icon/BaseIcon.vue'\n\nexport default defineComponent({\n name: 'InputError',\n components: {\n BaseIcon\n },\n props: {\n error: {\n type: String,\n required: true\n }\n }\n})\n","import { render } from \"./InputError.vue?vue&type=template&id=6a181c68&ts=true\"\nimport script from \"./InputError.vue?vue&type=script&lang=ts\"\nexport * from \"./InputError.vue?vue&type=script&lang=ts\"\n\nimport exportComponent from \"/usr/src/app/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['render',render]])\n\nexport default __exports__"],"sourceRoot":""}