{"version":3,"sources":["webpack:///./src/website/views/auth/Registration.vue?52bf","webpack:///./src/website/views/auth/Registration.vue","webpack:///./src/website/views/auth/Registration.vue?42a9","webpack:///./src/website/views/auth/Registration.vue?1495","webpack:///./node_modules/core-js/modules/es6.regexp.search.js","webpack:///./node_modules/core-js/modules/es6.function.name.js","webpack:///./node_modules/core-js/modules/_same-value.js","webpack:///./src/website/services/AuthService.ts"],"names":["render","_vm","this","_h","$createElement","_c","_self","staticClass","_m","on","$event","preventDefault","onSubmit","attrs","_v","directives","name","rawName","value","user","expression","class","errors","has","domProps","target","composing","$set","_s","first","_e","ref","any","submitted","registrationWithGoogle","registrationWithFacebook","staticStyle","staticRenderFns","generateRandomString","length","Math","random","toString","substring","clientId","redirectUri","scope","responseType","state","googleAuthUrl","encodeURIComponent","window","location","href","queryParams","URLSearchParams","search","authorizationCode","get","exchangeAuthorizationCode","AuthService","googleLogin","code","isLogIn","then","response","data","isAuthorized","AuthUser","setToken","$router","push","path","AlertService","sendMessage","message","catch","error","dict","custom","firstName","required","phone","numeric","min","max","password","$validator","localize","validate","valid","registration","result","status","$store","dispatch","userId","id","verifycode","securityVerification","messageType","add","field","msg","appId","fbAsyncInit","initializeFacebookSDK","loadFacebookSDK","FB","init","cookie","xfbml","version","attemptLogin","d","s","getElementById","js","createElement","src","fjs","getElementsByTagName","parentNode","insertBefore","document","login","authResponse","getUserInfo","accessToken","api","fields","email","authenticateUser","facebookLogin","components","component","anObject","sameValue","regExpExec","defined","SEARCH","$search","maybeCallNative","regexp","O","fn","undefined","call","RegExp","String","res","done","rx","S","previousLastIndex","lastIndex","index","dP","f","FProto","Function","prototype","nameRE","NAME","configurable","match","e","module","exports","Object","is","x","y","post","JSON","stringify","register","verify","ReSendCode","reSendCode","resetPasswordVerify","setPasswordGuest","resetPassword","phoneOrEmail","test"],"mappings":"yHAAA,IAAIA,EAAS,WAAa,IAAIC,EAAIC,KAASC,EAAGF,EAAIG,eAAmBC,EAAGJ,EAAIK,MAAMD,I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AnBa,SAmBI/F,EAAkBpB,GACjC,OAAO,OAAY2G,KAAZ,UACF,OAAQQ,iBADN,qBACmC/F,GACxCwF,KAAKC,UAAU7G,KAGnBoH,cAzBa,SAyBCC,GACZ,OAAO,OAAY7H,IACjB,OAAQ4H,cAAgB,iBAAmBC,IAG/CC,KA9Ba,WA+BX,OAAO,OAAY9H,IAAI,kBAGxBG,YAlCY,SAkCAK,GACX,OAAO,OAAY2G,KAAK,OAAQhH,YAAaK,IAMhDmE,cAzCc,SAyCAnE,GACb,OAAO,OAAY2G,KAAK,OAAQxC,cAAenE","file":"js/chunk-dbbece48.9bcd924e.js","sourcesContent":["var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:\"container-fluid\"},[_c('div',{staticClass:\"row py-4 justify-content-center\"},[_c('div',{staticClass:\"col-10 col-sm-10 col-md-8 col-xl-4 mb-5\"},[_c('div',{staticClass:\"card\"},[_vm._m(0),_c('div',{staticClass:\"card-body py-4\"},[_c('form',{on:{\"submit\":function($event){$event.preventDefault();return _vm.onSubmit($event)}}},[_c('div',{staticClass:\"row mb-3\"},[_c('div',{staticClass:\"col-12\"},[_c('div',{staticClass:\"form-group\"},[_c('label',{staticClass:\"h6 font-weight-bold mb-2\",attrs:{\"for\":\"\"}},[_vm._v(\"Full Name\")]),_c('input',{directives:[{name:\"model\",rawName:\"v-model\",value:(_vm.user.firstName),expression:\"user.firstName\"},{name:\"validate\",rawName:\"v-validate\",value:('required'),expression:\"'required'\"}],staticClass:\"form-control\",class:_vm.errors.has('firstName') ? 'is-invalid' : '',attrs:{\"type\":\"text\",\"name\":\"firstName\",\"placeholder\":\"Full Name\"},domProps:{\"value\":(_vm.user.firstName)},on:{\"input\":function($event){if($event.target.composing){ return; }_vm.$set(_vm.user, \"firstName\", $event.target.value)}}}),(_vm.errors.has('firstName'))?_c('span',{staticClass:\"text-danger\"},[_vm._v(\" \"+_vm._s(_vm.errors.first(\"firstName\"))+\" \")]):_vm._e()])]),_c('div',{staticClass:\"col-12\"},[_c('div',{staticClass:\"form-group\"},[_c('label',{staticClass:\"h6 font-weight-bold mb-2\",attrs:{\"for\":\"\"}},[_vm._v(\"Phone\")]),_c('input',{directives:[{name:\"model\",rawName:\"v-model\",value:(_vm.user.phone),expression:\"user.phone\"},{name:\"validate\",rawName:\"v-validate\",value:('required|numeric|min:11|max:11'),expression:\"'required|numeric|min:11|max:11'\"}],staticClass:\"form-control phone\",class:_vm.errors.has('phone') ? 'is-invalid' : '',attrs:{\"type\":\"tel\",\"maxlength\":\"11\",\"placeholder\":\"Phone\",\"name\":\"phone\"},domProps:{\"value\":(_vm.user.phone)},on:{\"input\":function($event){if($event.target.composing){ return; }_vm.$set(_vm.user, \"phone\", $event.target.value)}}}),(_vm.errors.has('phone'))?_c('span',{staticClass:\"text-danger\"},[_vm._v(\" \"+_vm._s(_vm.errors.first(\"phone\"))+\" \")]):_vm._e()])]),_c('div',{staticClass:\"col-12\"},[_c('div',{staticClass:\"form-group\"},[_c('label',{staticClass:\"h6 font-weight-bold mb-2\",attrs:{\"for\":\"\"}},[_vm._v(\"Password\")]),_c('input',{directives:[{name:\"model\",rawName:\"v-model\",value:(_vm.user.password),expression:\"user.password\"},{name:\"validate\",rawName:\"v-validate\",value:('required|min:6'),expression:\"'required|min:6'\"}],ref:\"password\",staticClass:\"form-control\",class:_vm.errors.has('password') ? 'is-invalid' : '',attrs:{\"type\":\"password\",\"name\":\"password\",\"placeholder\":\"Password\"},domProps:{\"value\":(_vm.user.password)},on:{\"input\":function($event){if($event.target.composing){ return; }_vm.$set(_vm.user, \"password\", $event.target.value)}}}),(_vm.errors.has('password'))?_c('span',{staticClass:\"text-danger\"},[_vm._v(\" \"+_vm._s(_vm.errors.first(\"password\"))+\" \")]):_vm._e()])])]),_c('div',{staticClass:\"d-flex align-items-center\"},[_c('div',[_c('input',{staticClass:\"btn btn-secondary\",attrs:{\"type\":\"submit\",\"disabled\":_vm.errors.any() || _vm.submitted,\"value\":\"Next Step\"}})]),_c('div',{staticClass:\"ml-auto\"},[_c('router-link',{staticClass:\"ml-2\",attrs:{\"to\":\"/login\"}},[_vm._v(\"Back to Login Page\")])],1)]),_vm._m(1),_c('div',{staticClass:\"d-flex justify-content-center mb-3\"},[_c('button',{staticClass:\"btn btn-google mx-2\",attrs:{\"type\":\"button\"},on:{\"click\":_vm.registrationWithGoogle}},[_c('i',{staticClass:\"fab fa-google\"}),_vm._v(\" Continue with Google \")]),_c('button',{staticClass:\"btn btn-facebook mx-2\",attrs:{\"type\":\"button\"},on:{\"click\":_vm.registrationWithFacebook}},[_c('i',{staticClass:\"fab fa-facebook-f\"}),_vm._v(\" Continue with Facebook \")]),_c('div',{staticStyle:{\"display\":\"none\"},attrs:{\"id\":\"g_id_onload\"}})]),_c('div',{staticClass:\"mt-2\"},[_vm._v(\" By Creating an account, you agree to BDDOT's \"),_c('router-link',{staticClass:\"font-weight-bold\",attrs:{\"to\":\"/terms-conditions\",\"target\":\"_blank\"}},[_vm._v(\"Terms of use\")]),_vm._v(\" and \"),_c('router-link',{staticClass:\"font-weight-bold\",attrs:{\"to\":\"privacy-policy\",\"target\":\"_blank\"}},[_vm._v(\"Privacy Policy\")]),_vm._v(\". \")],1)])])])])])])}\nvar staticRenderFns = [function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:\"card-header\"},[_c('h4',{staticClass:\"text-uppercase playBold\"},[_vm._v(\"Register\")])])},function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:\"text-center my-4\"},[_c('span',{staticClass:\"divider-text font-weight-bold\"},[_vm._v(\"OR\")])])}]\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\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\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\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\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\r\nimport { Component, Vue } from \"vue-property-decorator\";\r\nimport { RegViewModel } from \"../../models/RegViewModel\";\r\nimport AuthService from \"../../services/AuthService\";\r\nimport AlertService from \"../../../common-app/service/AlertService\";\r\nimport AuthUser from \"../../../global-config/AuthUser\";\r\n\r\n@Component({\r\n components:{},\r\n})\r\nexport default class Registration extends Vue {\r\n public submitted: boolean = false;\r\n public user: RegViewModel = {} as RegViewModel;\r\n\r\n registrationWithGoogle() {\r\n const generateRandomString = (length: number) => {\r\n return Math.random().toString(36).substring(2, length + 2);\r\n };\r\n \r\n const clientId='329868347963-vqohivsqlsa8vl3ieen8tjl2el8fb5uo.apps.googleusercontent.com';\r\n //const clientId = '1065902859762-o13g9dm9hsu01bh18ldugrtv4284o0iv.apps.googleusercontent.com'; // Replace with your actual client ID\r\n const redirectUri = 'https://bddot.com/Registration'; // Ensure this matches the console\r\n const scope = 'openid profile email';\r\n const responseType = 'code';\r\n const accessType = 'offline'; // To request a refresh token\r\n const state = generateRandomString(16); // Optional, but good for CSRF protection\r\n\r\n // Construct the Google authorization URL\r\n const googleAuthUrl = `https://accounts.google.com/o/oauth2/v2/auth?response_type=${responseType}&client_id=${clientId}&redirect_uri=${encodeURIComponent(redirectUri)}&scope=${encodeURIComponent(scope)}&state=${state}`;\r\n// Redirect to the Google authorization URL\r\nwindow.location.href = googleAuthUrl;\r\n \r\n }\r\n mounted() {\r\n // Extract query parameters from the URL after redirection from Google\r\n const queryParams = new URLSearchParams(window.location.search);\r\n\r\n // Get the authorization code\r\n const authorizationCode = queryParams.get('code');\r\n if (authorizationCode) {\r\n // Send the code to your backend for further processing (e.g., exchanging for a token)\r\n this.exchangeAuthorizationCode(authorizationCode);\r\n } else {\r\n //console.error('Authorization code not found in URL');\r\n }\r\n }\r\n \r\n\r\n exchangeAuthorizationCode(authorizationCode: string) {\r\n //console.log(\"Code :\"+authorizationCode);\r\n \r\n // Call the backend API to exchange the authorization code for a token\r\n AuthService.googleLogin({ code: authorizationCode,isLogIn: false })\r\n .then(response => {\r\n this.submitted = true;\r\n // Check if the response is valid and user is authorized\r\n //console.log(\"response :\"+response;\r\n //console.log(\"response data :\"+response.data);\r\n //console.log(\"token :\"+response.data.token);\r\n \r\n if (response && response.data && response.data.isAuthorized) {\r\n \r\n // console.log(\"Registration successful!\", response.data);\r\n // Set the authentication token for the user\r\n AuthUser.setToken(response.data);\r\n // Redirect to the user home page after successful login\r\n this.$router.push({ path: \"user\" }); // Change to \"home\" if that's the desired route\r\n } \r\n else {\r\n // Log authorization failure and notify the user\r\n // console.warn('Authorization failed. Please check the response.', response.data);\r\n AlertService.sendMessage(response.data.message || 'Authorization failed. Please try again.');\r\n }\r\n })\r\n .catch(error => {\r\n // Handle any errors that occur during the API call\r\n // console.error(\"Registration failed\"+error);\r\n AlertService.sendMessage(\"Registration failed. Please try again.\");\r\n });\r\n}\r\n\r\n created() {\r\n const dict = {\r\n custom: {\r\n firstName: {\r\n required: \"Your full name is required.\",\r\n },\r\n phone: {\r\n required: \"The phone is required.\",\r\n numeric: \"The phone number can only contain numeric characters.\",\r\n min: \"The phone number must be at least 11 characters.\",\r\n max: \"Phone number cannot be more than 11 characters.\",\r\n },\r\n password: {\r\n required: \"A password is required.\",\r\n min: \"The password must be at least 6 characters.\",\r\n },\r\n },\r\n };\r\n\r\n this.$validator.localize(\"en\", dict);\r\n }\r\n\r\n onSubmit() {\r\n this.$validator.validate().then((valid: any) => {\r\n if (valid) {\r\n this.submitted = true;\r\n AuthService.registration(this.user)\r\n .then((response) => {\r\n let result = response.data as any;\r\n if (result.status) {\r\n //console.log(result.result.securityVerification.code);\r\n this.$store.dispatch(\"addVerify\", {\r\n userId: result.result.user.id,\r\n verifycode: result.result.securityVerification.code,\r\n });\r\n this.$router.push({ path: \"registration-verify\" });\r\n } else {\r\n this.submitted = false;\r\n if (result.messageType == \"unique\") {\r\n this.$validator.errors.add({\r\n field: \"phone\",\r\n msg: result.message,\r\n });\r\n } else {\r\n AlertService.sendMessage(result.message);\r\n }\r\n }\r\n })\r\n .catch(() => {\r\n this.submitted = false;\r\n });\r\n }\r\n });\r\n }\r\n\r\n public registrationWithFacebook() {\r\n // console.log('Facebook registration triggered');\r\n const appId = '521579997304433'; // Your Facebook App ID\r\n //const appId = '3299349813528395'; \r\n\r\n // Initialize the Facebook SDK\r\n window.fbAsyncInit = () => {\r\n this.initializeFacebookSDK(appId);\r\n };\r\n\r\n // Load the Facebook SDK asynchronously\r\n this.loadFacebookSDK();\r\n}\r\n\r\nprivate initializeFacebookSDK(appId: string) {\r\n window.FB.init({\r\n appId: appId,\r\n cookie: true,\r\n xfbml: true,\r\n version: 'v12.0', // The Graph API version\r\n });\r\n\r\n // Attempt to log the user in\r\n this.attemptLogin();\r\n}\r\n\r\nprivate loadFacebookSDK() {\r\n (function (d: Document, s: string, id: string) {\r\n if (d.getElementById(id)) return; // Prevent loading the SDK multiple times\r\n\r\n const js = d.createElement(s) as HTMLScriptElement;\r\n js.id = id;\r\n js.src = \"https://connect.facebook.net/en_US/sdk.js\"; // SDK source\r\n\r\n const fjs = d.getElementsByTagName(s)[0];\r\n if (fjs && fjs.parentNode) { // Check if parentNode is not null\r\n fjs.parentNode.insertBefore(js, fjs);\r\n }\r\n }(document, 'script', 'facebook-jssdk'));\r\n}\r\n\r\nprivate attemptLogin() {\r\n window.FB.login((response: { status: string; authResponse?: { accessToken: string; }; }) => {\r\n // console.log(\"response :\"+response);\r\n // console.log(\"response AuthResponse :\"+response.authResponse);\r\n // console.log(\"response status :\"+response.status);\r\n if (response.status === 'connected' && response.authResponse) {\r\n // User is logged in, fetch their info\r\n this.getUserInfo(response.authResponse.accessToken);\r\n } else {\r\n // console.error('User cancelled login or did not fully authorize.');\r\n AlertService.sendMessage('Login cancelled or failed. Please try again.');\r\n }\r\n }, { scope: 'email' }); // Request permission to access email\r\n}\r\n\r\nprivate getUserInfo(accessToken: string) {\r\n window.FB.api('/me', { fields: 'name,email' }, (user: { name: string; email: string; }) => {\r\n if (user && user.email) {\r\n // console.log('User Info:', user); // Log the user info\r\n this.submitted=true;\r\n // Attempt to log the user in on your backend\r\n this.authenticateUser(accessToken, user);\r\n } else {\r\n // console.error('Failed to fetch user information.');\r\n AlertService.sendMessage('Failed to fetch user information. Please try again.');\r\n }\r\n });\r\n}\r\n\r\nprivate authenticateUser(accessToken: string, user: { name: string; email: string }) {\r\n AuthService.facebookLogin({\r\n accessToken,\r\n name: user.name,\r\n email: user.email\r\n })\r\n .then((response: { data: { isAuthorized: boolean; }; }) => {\r\n if (response.data.isAuthorized) {\r\n // Store the token and navigate to the user page\r\n \r\n AuthUser.setToken(response.data);\r\n this.$router.push({ path: \"user\" });\r\n } else {\r\n // Handle the case where authorization failed\r\n AlertService.sendMessage('Authorization failed. Please try again.');\r\n }\r\n })\r\n .catch((error: any) => {\r\n //console.error('Facebook login error:', error); // Log any errors\r\n AlertService.sendMessage('An error occurred during login. Please try again.');\r\n });\r\n}\r\n\r\n\r\n};\r\n","import mod from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--14-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/ts-loader/index.js??ref--14-3!../../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./Registration.vue?vue&type=script&lang=ts&\"; export default mod; export * from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--14-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/ts-loader/index.js??ref--14-3!../../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./Registration.vue?vue&type=script&lang=ts&\"","import { render, staticRenderFns } from \"./Registration.vue?vue&type=template&id=b5b1ba36&\"\nimport script from \"./Registration.vue?vue&type=script&lang=ts&\"\nexport * from \"./Registration.vue?vue&type=script&lang=ts&\"\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 null,\n null\n \n)\n\nexport default component.exports","'use strict';\n\nvar anObject = require('./_an-object');\nvar sameValue = require('./_same-value');\nvar regExpExec = require('./_regexp-exec-abstract');\n\n// @@search logic\nrequire('./_fix-re-wks')('search', 1, function (defined, SEARCH, $search, maybeCallNative) {\n return [\n // `String.prototype.search` method\n // https://tc39.github.io/ecma262/#sec-string.prototype.search\n function search(regexp) {\n var O = defined(this);\n var fn = regexp == undefined ? undefined : regexp[SEARCH];\n return fn !== undefined ? fn.call(regexp, O) : new RegExp(regexp)[SEARCH](String(O));\n },\n // `RegExp.prototype[@@search]` method\n // https://tc39.github.io/ecma262/#sec-regexp.prototype-@@search\n function (regexp) {\n var res = maybeCallNative($search, regexp, this);\n if (res.done) return res.value;\n var rx = anObject(regexp);\n var S = String(this);\n var previousLastIndex = rx.lastIndex;\n if (!sameValue(previousLastIndex, 0)) rx.lastIndex = 0;\n var result = regExpExec(rx, S);\n if (!sameValue(rx.lastIndex, previousLastIndex)) rx.lastIndex = previousLastIndex;\n return result === null ? -1 : result.index;\n }\n ];\n});\n","var dP = require('./_object-dp').f;\nvar FProto = Function.prototype;\nvar nameRE = /^\\s*function ([^ (]*)/;\nvar NAME = 'name';\n\n// 19.2.4.2 name\nNAME in FProto || require('./_descriptors') && dP(FProto, NAME, {\n configurable: true,\n get: function () {\n try {\n return ('' + this).match(nameRE)[1];\n } catch (e) {\n return '';\n }\n }\n});\n","// 7.2.9 SameValue(x, y)\nmodule.exports = Object.is || function is(x, y) {\n // eslint-disable-next-line no-self-compare\n return x === y ? x !== 0 || 1 / x === 1 / y : x != x && y != y;\n};\n","import { UnAuthAxios } from \"../../global-config/HttpConfig\";\r\nimport { LoginViewModel } from \"../models/LoginViewModel\";\r\nimport { RegViewModel } from \"../models/RegViewModel\";\r\nimport { ApiURIs } from \"../../global-config/ApiList\";\r\n// Define a type for the Google login response\r\ninterface GoogleLoginResponse {\r\n isAuthorized: boolean;\r\n token?: string; // Optional token if applicable\r\n message?: string; // Optional message for error handling\r\n}\r\nexport default {\r\n login(user: LoginViewModel) {\r\n return UnAuthAxios.post(ApiURIs.login, JSON.stringify(user));\r\n },\r\n registration(user: RegViewModel) {\r\n return UnAuthAxios.post(ApiURIs.register, JSON.stringify(user));\r\n },\r\n verify(data: any) {\r\n return UnAuthAxios.post(ApiURIs.verify, JSON.stringify(data));\r\n },\r\n ReSendCode(data: any) {\r\n return UnAuthAxios.post(ApiURIs.reSendCode, JSON.stringify(data));\r\n },\r\n resetPasswordVerify(password: string, data: any) {\r\n return UnAuthAxios.post(\r\n `${ApiURIs.resetPasswordVerify}?password=${password}`,\r\n JSON.stringify(data)\r\n );\r\n },\r\n setPasswordGuest(password: string, data: any) {\r\n return UnAuthAxios.post(\r\n `${ApiURIs.setPasswordGuest}?password=${password}`,\r\n JSON.stringify(data)\r\n );\r\n },\r\n resetPassword(phoneOrEmail: string) {\r\n return UnAuthAxios.get(\r\n ApiURIs.resetPassword + \"?phoneOrEmail=\" + phoneOrEmail\r\n );\r\n },\r\n test() {\r\n return UnAuthAxios.get(\"api/user/test\");\r\n },\r\n // Google login method\r\n googleLogin(data: { code: string,isLogIn:boolean }) {\r\n return UnAuthAxios.post(ApiURIs.googleLogin, data); \r\n},\r\n\r\n\r\n // Facebook login method\r\n\r\n facebookLogin(data: { accessToken: string; name: string; email: string }) {\r\n return UnAuthAxios.post(ApiURIs.facebookLogin, data);\r\n}\r\n\r\n\r\n};\r\n\r\n\r\n"],"sourceRoot":""}