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oBAAoB,MAAOF,EAAY,CACrCC,GACAC,EAAAA,EAAAA,oBAAoB,OAAQC,EAAY,EACtCI,EAAAA,EAAAA,iBAAiB,mBACjBL,EAAAA,EAAAA,oBAAoB,SAAU,KAAM,EAClCA,EAAAA,EAAAA,oBAAoB,OAAQE,GAAY6C,EAAAA,EAAAA,kBAAiBV,EAAAA,EAAAA,OAAOP,GAAa1D,2BAA4B,IACzGiC,EAAAA,EAAAA,iBAAiB,aACjBL,EAAAA,EAAAA,oBAAoB,OAAQG,GAAa4C,EAAAA,EAAAA,kBAAiBV,EAAAA,EAAAA,OAAOP,GAAalD,mBAAoB,MAEpGyB,EAAAA,EAAAA,iBAAiB,4BAEnBD,QAGJ4C,EAAAA,EAAAA,oBAAoB,IAAI,EAAK,CAErC,IC9GA,MAAMC,EAAc,EAEpB,O","sources":["webpack://beliefnet-frontend/./src/stores/Quiz.ts","webpack://beliefnet-frontend/./src/stores/TriviaQuiz.ts","webpack://beliefnet-frontend/./src/components/quiz/trivia/Result.vue?55a4","webpack://beliefnet-frontend/./src/components/quiz/trivia/Result.vue"],"sourcesContent":["import { defineStore } from 'pinia';\n\nexport const useQuizStore = defineStore('QuizStore', {\n state: () => {\n return {\n emailSent: false,\n emailSent2: false\n };\n },\n getters: {\n isEmailSent: (state) => state.emailSent,\n isEmailSent2: (state) => state.emailSent2\n },\n actions: {\n setEmailSent(sent: boolean) {\n this.emailSent = sent;\n },\n setEmailSent2(sent: boolean) {\n this.emailSent2 = sent;\n }\n }\n});\n","import { defineStore } from 'pinia';\n\nexport const useTriviaQuizStore = defineStore('TriviaQuiz', {\n state: () => {\n return {\n correctAnswer: [] as number[],\n userAnswer: [] as number[]\n };\n },\n getters: {\n getNumberOfCorrectAnswers(state) {\n let count = 0;\n\n // count the number of correct answers\n state.userAnswer.forEach((answer, index) => {\n if (index + 1 <= state.correctAnswer.length) {\n if (answer == state.correctAnswer[index]) {\n count++;\n }\n }\n });\n\n return count;\n },\n getUserAnswer(state) {\n return (question: number) => state.userAnswer[question];\n },\n numberOfQuestions: (state) => state.correctAnswer.length,\n canShowUserResult(state) {\n // only show if there aren't any -1s in the user answer array\n return state.userAnswer.filter((val) => val === -1).length === 0;\n },\n nextQuestion() {\n return (currentQuestion: number) => {\n const nextQuestion = ++currentQuestion;\n if (nextQuestion < this.numberOfQuestions) {\n return nextQuestion;\n }\n\n return -1;\n };\n }\n },\n actions: {\n reset(numberOfQuestions: number) {\n this.correctAnswer = Array(numberOfQuestions).fill(-1);\n this.userAnswer = Array(numberOfQuestions).fill(-1);\n },\n setCorrectAnswer(question: number, answer: number) {\n this.correctAnswer[question] = answer;\n },\n setUserAnswer(question: number, answer: number) {\n this.userAnswer[question] = answer;\n }\n }\n});\n","import { defineComponent as _defineComponent } from 'vue'\nimport { unref as _unref, resolveComponent as _resolveComponent, createVNode as _createVNode, openBlock as _openBlock, createElementBlock as _createElementBlock, createCommentVNode as _createCommentVNode, createElementVNode as _createElementVNode, toDisplayString as _toDisplayString, createTextVNode as _createTextVNode } from \"vue\"\n\nconst _hoisted_1 = { key: 0 }\nconst _hoisted_2 = { key: 1 }\nconst _hoisted_3 = {\n key: 0,\n class: \"image-container\"\n}\nconst _hoisted_4 = [\"src\", \"alt\"]\nconst _hoisted_5 = { class: \"img-attribution\" }\nconst _hoisted_6 = { class: \"text-center\" }\nconst _hoisted_7 = /*#__PURE__*/_createElementVNode(\"div\", { class: \"result-title\" }, \"Your result is:\", -1)\nconst _hoisted_8 = { class: \"h2\" }\nconst _hoisted_9 = { class: \"score\" }\nconst _hoisted_10 = { class: \"total\" }\nconst _hoisted_11 = /*#__PURE__*/_createElementVNode(\"p\", { class: \"add-top-margin\" }, [\n /*#__PURE__*/_createTextVNode(\" For more quizzes and trivia, please \"),\n /*#__PURE__*/_createElementVNode(\"a\", { href: \"//www.beliefnet.com/entertainment/quizzes.aspx\" }, \"click here.\")\n], -1)\n\nimport { useQuizStore } from '@/stores/Quiz';\nimport { toRefs } from 'vue';\nimport { useLogger } from 'vue-logger-plugin';\nimport { useTriviaQuizStore } from '../../../stores/TriviaQuiz';\n\n// Incoming props\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'Result',\n props: {\n minScore: Number,\n maxScore: Number,\n resultId: String,\n title: String,\n message: String,\n imageUrl: String,\n imageAlt: String,\n captureEmail: Boolean,\n listId: Number,\n sourceDesc: String,\n newsletterName: String\n},\n setup(__props) {\n\nconst props = __props;\n\n\n\n// get back prop values\nconst { minScore, maxScore, resultId, title, message, imageUrl, imageAlt, listId, sourceDesc, newsletterName } = toRefs(props);\n\n// user logger\nconst logger = useLogger();\n\n// quiz sotre\nconst quizStore = useQuizStore();\n// get the trivia quiz store\nconst triviaStore = useTriviaQuizStore();\nlogger.debug('result id has min and max scores set', resultId?.value, minScore?.value, maxScore?.value);\n\nreturn (_ctx: any,_cache: any) => {\n const _component_rad_quiz_newsletter = _resolveComponent(\"rad-quiz-newsletter\")!\n\n return (\n __props.captureEmail && _unref(quizStore).isEmailSent2 == false && \n _unref(triviaStore).canShowUserResult &&\n _unref(triviaStore).getNumberOfCorrectAnswers >= _unref(minScore) &&\n _unref(triviaStore).getNumberOfCorrectAnswers <= _unref(maxScore)\n )\n ? (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n _createVNode(_component_rad_quiz_newsletter, {\n \"list-id\": _unref(listId),\n \"source-desc\": _unref(sourceDesc),\n partners: true,\n \"newsletter-name\": _unref(newsletterName),\n header: \"Enter your email address to see your result.\",\n \"button-text\": \"Get results\",\n \"result-sent\": true\n }, null, 8, [\"list-id\", \"source-desc\", \"newsletter-name\"])\n ]))\n : (\n _unref(triviaStore).canShowUserResult &&\n _unref(triviaStore).getNumberOfCorrectAnswers >= _unref(minScore) &&\n _unref(triviaStore).getNumberOfCorrectAnswers <= _unref(maxScore)\n )\n ? (_openBlock(), _createElementBlock(\"div\", _hoisted_2, [\n (_unref(imageUrl)?.value?.length > 0)\n ? (_openBlock(), _createElementBlock(\"figure\", _hoisted_3, [\n _createElementVNode(\"img\", {\n src: _unref(imageUrl),\n alt: _unref(imageAlt),\n class: \"img-responsive image-decoration center-block\"\n }, null, 8, _hoisted_4),\n _createElementVNode(\"div\", _hoisted_5, _toDisplayString(_unref(imageAlt)), 1)\n ]))\n : _createCommentVNode(\"\", true),\n _createElementVNode(\"div\", _hoisted_6, [\n _hoisted_7,\n _createElementVNode(\"span\", _hoisted_8, [\n _createTextVNode(\" You answered \"),\n _createElementVNode(\"strong\", null, [\n _createElementVNode(\"span\", _hoisted_9, _toDisplayString(_unref(triviaStore).getNumberOfCorrectAnswers), 1),\n _createTextVNode(\" out of \"),\n _createElementVNode(\"span\", _hoisted_10, _toDisplayString(_unref(triviaStore).numberOfQuestions), 1)\n ]),\n _createTextVNode(\" questions correctly. \")\n ]),\n _hoisted_11\n ])\n ]))\n : _createCommentVNode(\"\", true)\n}\n}\n\n})","import script from \"./Result.vue?vue&type=script&setup=true&lang=ts\"\nexport * from \"./Result.vue?vue&type=script&setup=true&lang=ts\"\n\nconst __exports__ = script;\n\nexport default __exports__"],"names":["useQuizStore","defineStore","state","emailSent","emailSent2","getters","isEmailSent","isEmailSent2","actions","setEmailSent","sent","this","setEmailSent2","useTriviaQuizStore","correctAnswer","userAnswer","getNumberOfCorrectAnswers","count","forEach","answer","index","length","getUserAnswer","question","numberOfQuestions","canShowUserResult","filter","val","nextQuestion","currentQuestion","reset","Array","fill","setCorrectAnswer","setUserAnswer","_hoisted_1","key","_hoisted_2","_hoisted_3","class","_hoisted_4","_hoisted_5","_hoisted_6","_hoisted_7","_createElementVNode","_hoisted_8","_hoisted_9","_hoisted_10","_hoisted_11","_createTextVNode","href","_defineComponent","__name","props","minScore","Number","maxScore","resultId","String","title","message","imageUrl","imageAlt","captureEmail","Boolean","listId","sourceDesc","newsletterName","setup","__props","toRefs","logger","useLogger","quizStore","triviaStore","debug","value","_ctx","_cache","_component_rad_quiz_newsletter","_resolveComponent","_unref","_openBlock","_createElementBlock","_createVNode","partners","header","_b","_a","src","alt","_toDisplayString","_createCommentVNode","__exports__"],"sourceRoot":""}