{"version":3,"sources":["webpack:///./node_modules/@glittr/frontend-core/src/plugins/validation/queryBuilder.ts","webpack:///./node_modules/@glittr/frontend-core/src/views/pages/_admin/createUser.vue?859d","webpack:///./node_modules/@glittr/frontend-core/src/views/pages/_admin/createUser.vue?82c1","webpack:///./node_modules/@glittr/frontend-core/src/views/pages/_admin/createUser.vue?6725","webpack:///./node_modules/@glittr/frontend-core/src/views/pages/_admin/createUser.vue","webpack:///./node_modules/@glittr/frontend-core/src/services/generated/types/model/resource/UserRegisterRequestModel.ts","webpack:///./node_modules/@glittr/frontend-core/src/services/viewModel/resource/UserRegisterRequestViewModel.ts"],"names":["queryBuilder","deepSetProperty","schema","property","value","setRequired","propertyPath","split","currentNode","nodes","forEach","prop","i","properties","type","push","lastNode","length","lastProp","required","constValues","propValues","propsRequired","Object","keys","key","const","if","this","ifNot","not","thenRequired","propNames","then","thenValue","elseRequired","else","elseValue","computedRequired","computedProps","filteredValue","sameAs","isObject","pattern","$validation","REF_PREFIX","nestedProps","render","_vm","_h","$createElement","_c","_self","attrs","staticClass","_v","_s","$t","model","newUserModel","callback","$$v","$set","expression","passwordValidationMessage","linkError","on","createUser","staticRenderFns","extend","auth","role","layout","$auth","isInRole","_hostadmin","data","undefined","UserRegisterRequestViewModel","id","methods","minLength","$config","values","password","passwordRepeat","$service","api","core","users","registerHostadmin","$router","replace","catch","error","component","dto","email","userName","userLanguage","userCulture","isGdprConsentAccepted","registrationKey","transformFromQuery","queries","validationPatterns"],"mappings":"0MAUMA,EAAe,CACnBC,gBAAA,SAAgBC,EAAqBC,EAAkBC,EAA4BC,G,WAAA,IAAAA,OAAA,GACjF,IAAMC,EAAeH,EAASI,MAAM,KAChCC,EAAoB,OAANN,QAAM,IAANA,IAAU,GACtBO,EAAQ,GACdH,EAAaI,SAAQ,SAACC,EAAMC,G,UAC1BJ,EAAYK,WAAmC,QAAtB,EAAAL,EAAYK,kBAAU,QAAI,GACnDL,EAAYM,KAAuB,QAAhB,EAAAN,EAAYM,Y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,QAAI,EAAG1C,OAAQ,e,EAGhH,OAX0D,oBAW1D,EAXA,CAA0D,G","file":"js/chunk-09849480.fcd00dfd.js","sourcesContent":["import Vue from 'vue';\r\nimport _ from '../../utils';\r\nimport { IJSONSchema } from './IJSONSchema';\r\n\r\ntype PropertiesOptions = Omit & {\r\n required?: boolean,\r\n sameAs?: string\r\n properties?: Record,\r\n};\r\n\r\nconst queryBuilder = {\r\n deepSetProperty(schema: IJSONSchema, property: string, value: Record, setRequired: boolean = false) {\r\n const propertyPath = property.split('.');\r\n let currentNode = schema ?? {};\r\n const nodes = [] as IJSONSchema[];\r\n propertyPath.forEach((prop, i) => {\r\n currentNode.properties = currentNode.properties ?? {};\r\n currentNode.type = currentNode.type ?? 'object';\r\n currentNode.properties[prop] = currentNode.properties[prop] ?? {};\r\n nodes.push(currentNode);\r\n currentNode = currentNode.properties[prop] as IJSONSchema;\r\n });\r\n const lastNode = nodes[nodes.length - 1];\r\n const lastProp = propertyPath[propertyPath.length - 1];\r\n if (setRequired) {\r\n lastNode.required = [...(lastNode.required ?? []), lastProp];\r\n }\r\n if (value) {\r\n lastNode.properties![lastProp] = { ...lastNode.properties![lastProp] as {}, ...value };\r\n }\r\n },\r\n constValues(propValues: Record, propsRequired: boolean = false) {\r\n const schema: IJSONSchema = {};\r\n Object.keys(propValues).forEach((key) => {\r\n this.deepSetProperty(schema, key, { const: propValues[key] }, propsRequired);\r\n });\r\n return schema;\r\n },\r\n if(propValues: Record, propsRequired: boolean = true) {\r\n const properties = this.constValues(propValues, propsRequired);\r\n return { if: properties };\r\n },\r\n ifNot(propValues: Record, propsRequired: boolean = true) {\r\n const properties = this.constValues(propValues, propsRequired);\r\n return { if: { not: properties } };\r\n },\r\n thenRequired(propNames: string[]) {\r\n return { then: { required: propNames } };\r\n },\r\n thenValue(propValues: Record, propsRequired: boolean = false) {\r\n const properties = this.constValues(propValues, propsRequired);\r\n return { then: properties };\r\n },\r\n elseRequired(propNames: string[]) {\r\n return { else: { required: propNames } };\r\n },\r\n elseValue(propValues: Record, propsRequired: boolean = false) {\r\n const properties = this.constValues(propValues, propsRequired);\r\n return { else: properties };\r\n },\r\n\r\n properties(properties: Record) {\r\n const computedRequired = [] as string[];\r\n Object.keys(properties).forEach((key) => {\r\n if (properties[key].required) {\r\n computedRequired.push(key);\r\n }\r\n });\r\n const computedProps = {} as NonNullable;\r\n Object.keys(properties).forEach((key) => {\r\n if (properties[key].type === 'object') {\r\n const nestedProps = properties[key].properties;\r\n computedProps[key] = this.properties(nestedProps as Record);\r\n return;\r\n }\r\n const { required, ...filteredValue } = properties[key];\r\n // In nested cases this has already been converted above, so casting to any here\r\n computedProps[key] = filteredValue as any;\r\n if (filteredValue.sameAs && _.isObject(computedProps[key])) {\r\n (computedProps[key] as IJSONSchema).pattern = `${Vue.$validation.REF_PREFIX}${filteredValue.sameAs}`;\r\n }\r\n });\r\n return {\r\n type: 'object' as IJSONSchema['type'],\r\n required: computedRequired as IJSONSchema['required'],\r\n properties: computedProps as IJSONSchema['properties'],\r\n };\r\n },\r\n};\r\n\r\nexport default queryBuilder;\r\n","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('p-container',[_c('p-card',[_c('p-row',{attrs:{\"column\":\"\"}},[_c('p-col',[_c('h2',{staticClass:\"mb-4\"},[_vm._v(\" \"+_vm._s(_vm.$t('core.page.user.page.newEntry'))+\" \")]),_c('p-text-field',{staticClass:\"ix-7\",attrs:{\"label\":_vm.$t('core.page.registration.label.userName'),\"required\":\"\"},model:{value:(_vm.newUserModel.userName),callback:function ($$v) {_vm.$set(_vm.newUserModel, \"userName\", $$v)},expression:\"newUserModel.userName\"}}),_c('p-text-field',{staticClass:\"ix-7\",attrs:{\"type\":\"email\",\"label\":_vm.$t('core.page.registration.label.userEmail'),\"required\":\"\"},model:{value:(_vm.newUserModel.email),callback:function ($$v) {_vm.$set(_vm.newUserModel, \"email\", $$v)},expression:\"newUserModel.email\"}}),_c('p-text-field',{staticClass:\"ix-7\",attrs:{\"type\":\"password\",\"errors\":_vm.passwordValidationMessage,\"label\":_vm.$t('core.page.registration.label.userPassword'),\"required\":\"\"},model:{value:(_vm.newUserModel.password),callback:function ($$v) {_vm.$set(_vm.newUserModel, \"password\", $$v)},expression:\"newUserModel.password\"}}),_c('p-checkbox',{staticClass:\"ix-7\",attrs:{\"label\":_vm.$t('core.page.user.page.userConsentsToGdpr')},model:{value:(_vm.newUserModel.isGdprConsentAccepted),callback:function ($$v) {_vm.$set(_vm.newUserModel, \"isGdprConsentAccepted\", $$v)},expression:\"newUserModel.isGdprConsentAccepted\"}})],1),_c('p-row',{attrs:{\"xs12\":\"\"}},[_c('p-row',{attrs:{\"column\":\"\"}},[_c('div',[_c('p-request-alert',{model:{value:(_vm.linkError),callback:function ($$v) {_vm.linkError=$$v},expression:\"linkError\"}})],1),_c('p-alert',{staticClass:\"mt-4\",attrs:{\"dismissable\":false,\"type\":\"error\"},model:{value:(_vm.passwordValidationMessage),callback:function ($$v) {_vm.passwordValidationMessage=$$v},expression:\"passwordValidationMessage\"}},[_vm._v(\" \"+_vm._s(_vm.passwordValidationMessage)+\" \")]),_c('div',[_c('p-button',{on:{\"click\":_vm.createUser}},[_vm._v(\" \"+_vm._s(_vm.$t('core.page.user.action.createUser'))+\" \")])],1)],1)],1)],1)],1)],1)}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nimport Vue from 'vue';\nimport UserRegisterRequestViewModel from '../../../services/viewModel/resource/UserRegisterRequestViewModel';\n\nexport default Vue.extend({\n auth: true,\n role: ['admin', 'hostadmin'],\n layout: {\n 'layout-hostadmin': Vue.$auth.isInRole('hostadmin'),\n _hostadmin: Vue.$auth.isInRole('hostadmin'),\n 'layout-admin': Vue.$auth.isInRole('admin'),\n },\n data: () => ({\n passwordValidationMessage: undefined as string | undefined,\n newUserModel: new UserRegisterRequestViewModel(),\n linkError: undefined as string | undefined,\n id: undefined as number | undefined,\n }),\n methods: {\n async createUser() {\n this.passwordValidationMessage = undefined;\n const minLength = this.$config.values['auth-min-password-length'] ?? 0;\n if (!this.newUserModel?.password || this.newUserModel?.password?.length < minLength) {\n this.passwordValidationMessage = this.$t('core.validation.minLength', minLength);\n return;\n }\n // A hostadmin does not need to verify\n // Just show clear text and keep it simple\n this.newUserModel.passwordRepeat = this.newUserModel.password;\n this.$service.api.core.users.registerHostadmin(this.newUserModel)\n .then((id) => {\n Vue.$router.replace(`/_admin/users/${id}`);\n })\n .catch((error: any) => {\n this.linkError = error;\n });\n },\n },\n});\n","import mod from \"-!../../../../../../cache-loader/dist/cjs.js??ref--14-0!../../../../../../thread-loader/dist/cjs.js!../../../../../../babel-loader/lib/index.js!../../../../../../@vue/cli-plugin-typescript/node_modules/ts-loader/index.js??ref--14-3!../../../../../../cache-loader/dist/cjs.js??ref--1-0!../../../../../../vue-loader/lib/index.js??vue-loader-options!./createUser.vue?vue&type=script&lang=ts&\"; export default mod; export * from \"-!../../../../../../cache-loader/dist/cjs.js??ref--14-0!../../../../../../thread-loader/dist/cjs.js!../../../../../../babel-loader/lib/index.js!../../../../../../@vue/cli-plugin-typescript/node_modules/ts-loader/index.js??ref--14-3!../../../../../../cache-loader/dist/cjs.js??ref--1-0!../../../../../../vue-loader/lib/index.js??vue-loader-options!./createUser.vue?vue&type=script&lang=ts&\"","import { render, staticRenderFns } from \"./createUser.vue?vue&type=template&id=66fcc8de&\"\nimport script from \"./createUser.vue?vue&type=script&lang=ts&\"\nexport * from \"./createUser.vue?vue&type=script&lang=ts&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../../../../vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\nexport default component.exports","// ╭────────────────────────────────────────────────────────────────────────────────────╮\r\n// ┊ This file was automatically generated\r\n// ┊ Please do not modify manually\r\n// ┊ ©gl it 2022 - http://www.gl-it.ch\r\n// ╰────────────────────────────────────────────────────────────────────────────────────╯\r\n\r\nimport BaseModel from '../../../../../plugins/servicelayer/serviceTypes/baseModel';\r\nimport UserRegisterRequestDTO from '../../dto/resource/UserRegisterRequestDTO';\r\n\r\nexport default abstract class UserRegisterRequestModel extends BaseModel {\r\n /**\r\n * @type {email}\r\n */\r\n get email() { return this.dto.email; }\r\n set email(value) { this.dto.email = value; }\r\n /**\r\n */\r\n get userName() { return this.dto.userName; }\r\n set userName(value) { this.dto.userName = value; }\r\n /**\r\n */\r\n get password() { return this.dto.password; }\r\n set password(value) { this.dto.password = value; }\r\n /**\r\n */\r\n get userLanguage() { return this.dto.userLanguage; }\r\n set userLanguage(value) { this.dto.userLanguage = value; }\r\n /**\r\n */\r\n get userCulture() { return this.dto.userCulture; }\r\n set userCulture(value) { this.dto.userCulture = value; }\r\n /**\r\n */\r\n get isGdprConsentAccepted() { return this.dto.isGdprConsentAccepted; }\r\n set isGdprConsentAccepted(value) { this.dto.isGdprConsentAccepted = value; }\r\n /**\r\n */\r\n get registrationKey() { return this.dto.registrationKey; }\r\n set registrationKey(value) { this.dto.registrationKey = value; }\r\n\r\n protected transformFromQuery(queries: Record): void {\r\n let value: any;\r\n this.dto.email = queries.email;\r\n this.dto.userName = queries.userName;\r\n this.dto.password = queries.password;\r\n this.dto.userLanguage = queries.userLanguage;\r\n this.dto.userCulture = queries.userCulture;\r\n value = queries.isGdprConsentAccepted === 'true' ? true : queries.isGdprConsentAccepted;\r\n value = queries.isGdprConsentAccepted === 'false' ? false : undefined;\r\n this.dto.isGdprConsentAccepted = value;\r\n this.dto.registrationKey = queries.registrationKey;\r\n }\r\n}\r\n","import Vue from 'vue';\r\nimport { IJSONSchema } from '../../../plugins/validation/IJSONSchema';\r\nimport queryBuilder from '../../../plugins/validation/queryBuilder';\r\nimport validationPatterns from '../../../plugins/validation/validationPatterns';\r\nimport UserRegisterRequestModel from '../../generated/types/model/resource/UserRegisterRequestModel';\r\n\r\nexport default class UserRegisterRequestViewModel extends UserRegisterRequestModel {\r\n passwordRepeat?: string;\r\n\r\n schema = {\r\n ...queryBuilder.properties({\r\n email: { required: true, pattern: validationPatterns.email },\r\n userName: { required: true, minLength: Vue.$config.values['auth-min-username-length'] ?? 0 },\r\n password: { required: true, minLength: Vue.$config.values['auth-min-password-length'] ?? 0 },\r\n passwordRepeat: { required: true, minLength: Vue.$config.values['auth-min-password-length'] ?? 0, sameAs: 'password' },\r\n }),\r\n } as IJSONSchema;\r\n}\r\n"],"sourceRoot":""}