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,EAAAA,cAAcC,EAAAA,EAAAA,oBAAoB,SAAUjC,EAAY,EACvDM,EAAAA,EAAAA,oBAAoB,MAAO,CACzB8B,KAAKL,EAAAA,EAAAA,OAAOZ,GACZkB,KAAKN,EAAAA,EAAAA,OAAOX,GACZnB,MAAO,gDACN,KAAM,EAAGC,IACZI,EAAAA,EAAAA,oBAAoB,MAAOH,GAAYmC,EAAAA,EAAAA,kBAAiBP,EAAAA,EAAAA,OAAOX,IAAY,OAE7EmB,EAAAA,EAAAA,oBAAoB,IAAI,IAC5BjC,EAAAA,EAAAA,oBAAoB,MAAOF,EAAY,CACrCC,GACAC,EAAAA,EAAAA,oBAAoB,OAAQ,CAC1BL,MAAO,KACPuC,UAAWC,oBAAmBV,EAAAA,EAAAA,OAAOd,KACpC,KAAM,EAAGV,IACZD,EAAAA,EAAAA,oBAAoB,KAAM,CACxBkC,UAAWC,oBAAmBV,EAAAA,EAAAA,OAAOb,KACpC,KAAM,EAAGV,IACZkC,EAAAA,EAAAA,YAAYb,EAAKc,OAAQ,iBAG7BJ,EAAAA,EAAAA,oBAAoB,IAAI,EAAK,CAEnC,IC9EA,MAAMK,EAAc,EAEpB,O","sources":["webpack://beliefnet-frontend/./src/stores/PersonalityQuiz.ts","webpack://beliefnet-frontend/./src/components/quiz/personality/Result.vue?960c","webpack://beliefnet-frontend/./src/components/quiz/personality/Result.vue"],"sourcesContent":["import { defineStore } from 'pinia';\n\nexport const usePersonalityQuizStore = defineStore('PersonalityQuiz', {\n state: () => {\n return {\n correctAnswer: [] as number[],\n weight: [] as number[],\n answerTypeQuiz: false\n };\n },\n getters: {\n total: (state) => state.weight.reduce((a, b) => a + b),\n getNumberOfCorrectAnswers(state) {\n let count = 0;\n\n // count the number of correct answers\n state.weight.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 isAnswerTypeQuiz: (state) => state.answerTypeQuiz,\n canShowUserResult(state) {\n // only show if there aren't any -1s in the user answer array\n return state.weight.filter((val) => val === -1).length === 0;\n },\n numberOfQuestions: (state) => state.weight.length,\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.weight = Array(numberOfQuestions).fill(-1);\n this.correctAnswer = Array(numberOfQuestions).fill(-1);\n this.answerTypeQuiz = false;\n },\n setAnswerTypeQuiz() {\n this.answerTypeQuiz = true;\n },\n setCorrectAnswer(question: number, answer: number) {\n this.correctAnswer[question] = answer;\n },\n setUserAnswer(question: number, answer: number) {\n this.weight[question] = answer;\n }\n }\n});\n","import { defineComponent as _defineComponent } from 'vue'\nimport { unref as _unref, createElementVNode as _createElementVNode, toDisplayString as _toDisplayString, openBlock as _openBlock, createElementBlock as _createElementBlock, createCommentVNode as _createCommentVNode, renderSlot as _renderSlot } from \"vue\"\n\nconst _hoisted_1 = { key: 0 }\nconst _hoisted_2 = {\n key: 0,\n class: \"image-container\"\n}\nconst _hoisted_3 = [\"src\", \"alt\"]\nconst _hoisted_4 = { class: \"img-attribution\" }\nconst _hoisted_5 = { class: \"text-center\" }\nconst _hoisted_6 = /*#__PURE__*/_createElementVNode(\"div\", { class: \"result-title\" }, \"Your result is:\", -1)\nconst _hoisted_7 = [\"innerHTML\"]\nconst _hoisted_8 = [\"innerHTML\"]\n\nimport { toRefs } from 'vue';\nimport { useLogger } from 'vue-logger-plugin';\nimport { usePersonalityQuizStore } from '../../../stores/PersonalityQuiz';\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},\n setup(__props) {\n\nconst props = __props;\n\n\n\n// get back prop values\nconst { minScore, maxScore, resultId, title, message, imageUrl, imageAlt } = toRefs(props);\n\n// user logger\nconst logger = useLogger();\n\n// get the trivia quiz store\nconst personalityStore = usePersonalityQuizStore();\nlogger.debug('result id has min and max scores set', resultId?.value, minScore?.value, maxScore?.value);\n\nreturn (_ctx: any,_cache: any) => {\n return (\n _unref(personalityStore).canShowUserResult &&\n (\n (!_unref(personalityStore).isAnswerTypeQuiz && _unref(personalityStore).total >= _unref(minScore) && _unref(personalityStore).total <= _unref(maxScore)) ||\n (_unref(personalityStore).isAnswerTypeQuiz && _unref(personalityStore).getNumberOfCorrectAnswers >= _unref(minScore) && _unref(personalityStore).getNumberOfCorrectAnswers <= _unref(maxScore))\n )\n )\n ? (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n (_unref(imageUrl)?.value?.length > 0)\n ? (_openBlock(), _createElementBlock(\"figure\", _hoisted_2, [\n _createElementVNode(\"img\", {\n src: _unref(imageUrl),\n alt: _unref(imageAlt),\n class: \"img-responsive image-decoration center-block\"\n }, null, 8, _hoisted_3),\n _createElementVNode(\"div\", _hoisted_4, _toDisplayString(_unref(imageAlt)), 1)\n ]))\n : _createCommentVNode(\"\", true),\n _createElementVNode(\"div\", _hoisted_5, [\n _hoisted_6,\n _createElementVNode(\"span\", {\n class: \"h2\",\n innerHTML: decodeURIComponent(_unref(title))\n }, null, 8, _hoisted_7),\n _createElementVNode(\"h5\", {\n innerHTML: decodeURIComponent(_unref(message))\n }, null, 8, _hoisted_8),\n _renderSlot(_ctx.$slots, \"default\")\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":["usePersonalityQuizStore","defineStore","state","correctAnswer","weight","answerTypeQuiz","getters","total","reduce","a","b","getNumberOfCorrectAnswers","count","forEach","answer","index","length","isAnswerTypeQuiz","canShowUserResult","filter","val","numberOfQuestions","nextQuestion","currentQuestion","this","actions","reset","Array","fill","setAnswerTypeQuiz","setCorrectAnswer","question","setUserAnswer","_hoisted_1","key","_hoisted_2","class","_hoisted_3","_hoisted_4","_hoisted_5","_hoisted_6","_createElementVNode","_hoisted_7","_hoisted_8","_defineComponent","__name","props","minScore","Number","maxScore","resultId","String","title","message","imageUrl","imageAlt","setup","__props","toRefs","logger","useLogger","personalityStore","debug","value","_ctx","_cache","_unref","_openBlock","_createElementBlock","_b","_a","src","alt","_toDisplayString","_createCommentVNode","innerHTML","decodeURIComponent","_renderSlot","$slots","__exports__"],"sourceRoot":""}