{"version":3,"sources":["webpack:///./src/views/question/Question.vue?c817","webpack:///./src/views/question/components/QuestionForm.vue?f29f","webpack:///./src/views/question/components/QuestionForm.vue","webpack:///./src/views/question/components/QuestionForm.vue?c51c","webpack:///./src/views/question/Question.vue","webpack:///./src/views/question/Question.vue?382b"],"names":["_hoisted_1","class","render","_ctx","_cache","$props","$setup","$data","$options","_component_question_form","onFormSubmitted","$event","_hoisted_2","_hoisted_3","_hoisted_4","_hoisted_5","_hoisted_6","for","_hoisted_7","_hoisted_8","_hoisted_9","_hoisted_10","_hoisted_11","key","_hoisted_12","_component_product_image","_component_profile","_component_terms","_component_powered_by_okendo","_directive_analytics","onSubmit","submitQuestionForm","imageUrl","product","imageWidth","imageHeight","showPlaceholderIfEmpty","name","$t","questionBody","hasError","hasSubmitted","placeholder","questionPlaceholderText","id","maxlength","eventName","label","isSending","store","state","productName","this","order","reviewRequestId","subscriber","previewMode","profile","reviewerProfile","email","areFieldsValid","isPreviewMode","isQuestionFormValid","productId","questionData","question","subscriberId","body","author","trim","socialConnection","socialMediaType","avatarUrl","isTestQuestion","isTestMode","questionResponse","value","questionId","$emit","dispatch","type","alertData","content","status","components","Profile","PoweredByOkendo","ProductImage","Terms","emits","v","__exports__","$router","replace","path","query","$route","QuestionForm"],"mappings":"6IAEMA,EAAa,CAAEC,MAAO,UAEtB,SAAUC,EAAOC,EAAUC,EAAYC,EAAYC,EAAYC,EAAWC,GAC9E,IAAMC,EAA2B,eAAkB,iBAEnD,OAAQ,iBAAc,eAAoB,MAAOT,EAAY,CAC3D,eAAaS,EAA0B,CACrCC,gBAAiBN,EAAO,KAAOA,EAAO,GAAK,SAACO,GAAD,OAAkBR,EAAKO,wB,oICPlE,G,UAAa,CAAET,MAAO,6BACtBW,EAAa,CAAEX,MAAO,cACtBY,EAAa,CAAEZ,MAAO,oCACtBa,EAAa,CAAEb,MAAO,uEACtBc,EAAa,CAAEd,MAAO,wCACtBe,EAAa,CACjBf,MAAO,qBACPgB,IAAK,eAE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aACX6B,OAAQ,CACJ/B,KAAMqB,EAAgBrB,MAAQ,GAC9BsB,OAAQD,EAAgBC,OAAS,IAAIU,OACrCC,iBAAkBZ,EAAgBa,gBAClCC,UAAWd,EAAgB1B,UAE/ByC,eAAgBrB,KAAKsB,aA3BjC,oBAgCqD,eAAaV,GAhClE,iBAgC0BW,EAhC1B,EAgCgBV,SACR,eAAc,CACVnB,UAAW,4BACXC,MAAO,aACP6B,MAAOD,EAAiBE,aAG5BzB,KAAK0B,MAAM,iBAAiB,GAvCpC,sDA0CQ7B,EAAA,KAAM8B,SAAsB,CACxBC,KAAM,aACNC,UAAW,CACPC,QAAS9B,KAAKd,GAAG,qDACjB6C,OAAQ,UA9CxB,QAmDI/B,KAAKJ,WAAY,EAnDrB,2DAlCJ,8DAAwC,QAAnB,EAAU,gBAZ9B,eAAQ,CACLoC,WAAY,CACRC,UAAA,KACAC,kBAAA,KACAC,eAAA,KACAC,QAAA,MAEJC,MAAO,CACH,cAAiB,SAACC,GAAD,MAA6B,mBAANA,IAE5CzC,QAAA,QAEiB,W,qBCpBrB,MAAM0C,EAA2B,IAAgB,EAAQ,CAAC,CAAC,SAAS,KAErD,QCMM,EAArB,wQACsB,GADtB,gDAGI,WACI,eAAc,CAAE7C,UAAW,gBAJnC,6BAOI,WACIM,KAAKwC,QAAQC,QAAQ,CACjBC,KAAM,iBACNC,MAAO3C,KAAK4C,OAAOD,YAV/B,GAAsC,QAAjB,EAAQ,gBAN5B,eAAQ,CACLX,WAAY,CACRa,gBAEJhD,QAAA,QAEiB,WCRrB,MAAM,EAA2B,IAAgB,EAAQ,CAAC,CAAC,SAAS/C,KAErD","file":"js/question.672dedab.js","sourcesContent":["import { resolveComponent as _resolveComponent, createVNode as _createVNode, openBlock as _openBlock, createElementBlock as _createElementBlock } from \"vue\"\n\nconst _hoisted_1 = { class: \"c-main\" }\n\nexport function render(_ctx: any,_cache: any,$props: any,$setup: any,$data: any,$options: any) {\n const _component_question_form = _resolveComponent(\"question-form\")!\n\n return (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n _createVNode(_component_question_form, {\n onFormSubmitted: _cache[0] || (_cache[0] = ($event: any) => (_ctx.onFormSubmitted()))\n })\n ]))\n}","import { resolveComponent as _resolveComponent, createVNode as _createVNode, toDisplayString as _toDisplayString, createElementVNode as _createElementVNode, vModelText as _vModelText, normalizeClass as _normalizeClass, resolveDirective as _resolveDirective, withDirectives as _withDirectives, openBlock as _openBlock, createElementBlock as _createElementBlock, createCommentVNode as _createCommentVNode, withModifiers as _withModifiers } from \"vue\"\n\nconst _hoisted_1 = { class: \"u-marginBottomUI--xSmall\" }\nconst _hoisted_2 = { class: \"c-form-row\" }\nconst _hoisted_3 = { class: \"c-form-col u-marginLeftUI--small\" }\nconst _hoisted_4 = { class: \"u-fontWeight--bold u-marginBottomUI--xxSmall u-fontSize-vue--medium\" }\nconst _hoisted_5 = { class: \"c-form-row u-marginBottomUI--xxSmall\" }\nconst _hoisted_6 = {\n class: \"u-assistive-hidden\",\n for: \"description\"\n}\nconst _hoisted_7 = [\"aria-label\", \"placeholder\"]\nconst _hoisted_8 = { class: \"u-marginBottomUI--xxxLarge\" }\nconst _hoisted_9 = { class: \"c-form-row u-marginBottomUI--xSmall\" }\nconst _hoisted_10 = [\"aria-label\"]\nconst _hoisted_11 = {\n key: 0,\n class: \"c-loader c-loader--medium c-loader--buttonFontColor\"\n}\nconst _hoisted_12 = { key: 1 }\n\nexport function render(_ctx: any,_cache: any,$props: any,$setup: any,$data: any,$options: any) {\n const _component_product_image = _resolveComponent(\"product-image\")!\n const _component_profile = _resolveComponent(\"profile\")!\n const _component_terms = _resolveComponent(\"terms\")!\n const _component_powered_by_okendo = _resolveComponent(\"powered-by-okendo\")!\n const _directive_analytics = _resolveDirective(\"analytics\")!\n\n return (_openBlock(), _createElementBlock(\"form\", {\n onSubmit: _cache[1] || (_cache[1] = _withModifiers(\n//@ts-ignore\n(...args) => (_ctx.submitQuestionForm && _ctx.submitQuestionForm(...args)), [\"prevent\"]))\n }, [\n _createElementVNode(\"div\", _hoisted_1, [\n _createElementVNode(\"div\", _hoisted_2, [\n _createVNode(_component_product_image, {\n imageUrl: _ctx.product.imageUrl,\n imageWidth: 80,\n imageHeight: 80,\n showPlaceholderIfEmpty: true,\n class: \"c-form-col\"\n }, null, 8, [\"imageUrl\"]),\n _createElementVNode(\"div\", _hoisted_3, [\n _createElementVNode(\"div\", _hoisted_4, _toDisplayString(_ctx.product.name), 1)\n ])\n ])\n ]),\n _createElementVNode(\"div\", _hoisted_5, [\n _createElementVNode(\"label\", _hoisted_6, _toDisplayString(_ctx.$t('Question')), 1),\n _withDirectives(_createElementVNode(\"textarea\", {\n \"onUpdate:modelValue\": _cache[0] || (_cache[0] = ($event: any) => ((_ctx.questionBody) = $event)),\n \"aria-label\": _ctx.$t('Question'),\n class: _normalizeClass([{ hasError: !_ctx.questionBody && _ctx.hasSubmitted }, \"c-textarea c-input\"]),\n placeholder: _ctx.questionPlaceholderText,\n id: \"question\",\n maxlength: \"10000\"\n }, null, 10, _hoisted_7), [\n [_vModelText, _ctx.questionBody],\n [_directive_analytics, {\n eventName: 'change-question-body',\n label: 'bodyLength'\n }, \"change\"]\n ])\n ]),\n _createElementVNode(\"fieldset\", _hoisted_8, [\n _createVNode(_component_profile, { hasSubmitted: _ctx.hasSubmitted }, null, 8, [\"hasSubmitted\"])\n ]),\n _createVNode(_component_terms),\n _createElementVNode(\"div\", _hoisted_9, [\n _withDirectives(_createElementVNode(\"button\", {\n \"aria-label\": _ctx.$t('Submit'),\n class: \"c-button\"\n }, [\n (_ctx.isSending)\n ? (_openBlock(), _createElementBlock(\"div\", _hoisted_11))\n : (_openBlock(), _createElementBlock(\"span\", _hoisted_12, _toDisplayString(_ctx.$t('Agree & Submit')), 1))\n ], 8, _hoisted_10), [\n [_directive_analytics, { eventName: 'click-submit-question' }]\n ])\n ]),\n _createVNode(_component_powered_by_okendo)\n ], 32))\n}","\nimport { ProductRecorderView, ReviewsAPIPublic } from '@okendo/reviews-common';\nimport { Options, Vue } from 'vue-class-component';\n\nimport PoweredByOkendo from '@/shared-components/PoweredByOkendo.vue';\nimport ProductImage from '@/shared-components/ProductImage.vue';\nimport Profile from '@/shared-components/profile/Profile.vue';\nimport Terms from '@/shared-components/Terms.vue';\nimport store from '@/store';\nimport { StoreMethod } from '@/store/storeTypings';\nimport { postAnalytics, postQuestion } from '@/utils/api';\nimport { isEmailAddress, scrollToFirstErrorElement, validateRules } from '@/utils/validationUtil';\n\n@Options({\n components: {\n Profile,\n PoweredByOkendo,\n ProductImage,\n Terms\n },\n emits: {\n 'formSubmitted': (v: boolean) => typeof v === 'boolean'\n },\n store\n})\nexport default class ReviewForm extends Vue {\n hasSubmitted = false;\n isSending = false;\n questionBody = '';\n\n get product(): ProductRecorderView {\n return store.state.product.product;\n }\n\n get questionPlaceholderText(): string {\n const productName = this.product.name || 'this product';\n return this.$t('What would you like to know about {productName}?', { productName });\n }\n\n get isTestMode(): boolean {\n return store.state.order.reviewRequestId === 'test';\n }\n\n get isPreviewMode(): boolean {\n return store.state.subscriber.previewMode;\n }\n\n isQuestionFormValid(): boolean {\n const { reviewerProfile: { name, email } } = store.state.profile;\n\n const areFieldsValid: Record = {\n 'Please enter a Question': !!this.questionBody,\n 'Please enter your Name': !!name,\n 'Please enter your Email Address': isEmailAddress(email)\n };\n\n return validateRules(areFieldsValid);\n }\n\n async submitQuestionForm(): Promise {\n if (this.isSending || this.isPreviewMode) {\n return;\n }\n\n this.hasSubmitted = true;\n if (!this.isQuestionFormValid()) {\n scrollToFirstErrorElement();\n return;\n }\n\n this.isSending = true;\n\n const productId = this.product.productId;\n const { profile: { reviewerProfile } } = store.state;\n\n const questionData: ReviewsAPIPublic.Questions.Post.Request = {\n question: {\n subscriberId: store.state.subscriber.subscriberId,\n productId,\n body: this.questionBody,\n author: {\n name: reviewerProfile.name || '',\n email: (reviewerProfile.email || '').trim(),\n socialConnection: reviewerProfile.socialMediaType,\n avatarUrl: reviewerProfile.imageUrl\n },\n isTestQuestion: this.isTestMode\n }\n };\n\n try {\n const { question: questionResponse } = await postQuestion(questionData);\n postAnalytics({\n eventName: 'action-submitted-question',\n label: 'questionId',\n value: questionResponse.questionId\n });\n\n this.$emit('formSubmitted', true);\n }\n catch {\n store.dispatch({\n type: 'alert/SHOW',\n alertData: {\n content: this.$t('Question could not be submitted, please try again'),\n status: 'fail'\n }\n });\n }\n\n this.isSending = false;\n }\n}\n","import { render } from \"./QuestionForm.vue?vue&type=template&id=3e8b8441&ts=true\"\nimport script from \"./QuestionForm.vue?vue&type=script&lang=ts\"\nexport * from \"./QuestionForm.vue?vue&type=script&lang=ts\"\n\nimport exportComponent from \"C:\\\\Octopus\\\\Applications\\\\Prod\\\\okendo.reviews-recorder-vue\\\\0.2.0.1570\\\\node_modules\\\\@vue\\\\cli-service\\\\node_modules\\\\vue-loader-v16\\\\dist\\\\exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['render',render]])\n\nexport default __exports__","\nimport { Options, Vue } from 'vue-class-component';\n\nimport QuestionForm from './components/QuestionForm.vue';\nimport store from '@/store';\nimport { postAnalytics } from '@/utils/api';\n\n@Options({\n components: {\n QuestionForm\n },\n store\n})\nexport default class Question extends Vue {\n isFormSubmitted = false;\n\n mounted(): void {\n postAnalytics({ eventName: 'page-open' });\n }\n\n onFormSubmitted(): void {\n this.$router.replace({\n path: '/post-question',\n query: this.$route.query\n });\n }\n}\n","import { render } from \"./Question.vue?vue&type=template&id=753489f2&ts=true\"\nimport script from \"./Question.vue?vue&type=script&lang=ts\"\nexport * from \"./Question.vue?vue&type=script&lang=ts\"\n\nimport exportComponent from \"C:\\\\Octopus\\\\Applications\\\\Prod\\\\okendo.reviews-recorder-vue\\\\0.2.0.1570\\\\node_modules\\\\@vue\\\\cli-service\\\\node_modules\\\\vue-loader-v16\\\\dist\\\\exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['render',render]])\n\nexport default __exports__"],"sourceRoot":""}