{"version":3,"sources":["webpack:///./node_modules/eslint-loader/index.js"],"names":["state","polls_store","PollMixin","form_valid_val","this","val","$emit","current_poll","form","validate","questions","required_questions","filter","q","is_required","all_questions","has_invalid_required","some","grid_list","length","item","row_id","col_id","answers","a","answer","has_any_filled","Vue","__decorate","Ref","Component","components"],"mappings":"iOAQQA,EAAUC,OAAVD,MAMaE,EAAS,wDAA9B,iD,0BAIE,EAAAC,gBAAiB,EAJnB,EAA8B,+CAM5B,WACE,OAAOC,KAAKD,gBAPc,IAU5B,SAAeE,GACbD,KAAKD,eAAiBE,EACtBD,KAAKE,MAAM,QAASD,KAZM,wBAe5B,WACE,OAAOL,EAAMO,eAhBa,oBAmB5B,WACMH,KAAKI,KAAKC,aACZL,KAAKE,MAAM,UACXF,KAAKE,MAAM,SAAS,MAtBI,qBA0B5B,WACMF,KAAKI,KAAKC,YACZL,KAAKE,MAAM,aA5Ba,qBAgC5B,WACE,OAAON,EAAMU,YAjCa,8BAoC5B,WACE,IAAMC,EAAqBP,KAAKM,UAAUE,QAAO,SAACC,GAAD,OAAOA,EAAEC,eACpDC,EAAgBX,KAAKM,UAErBM,EAAuBL,EAAmBM,MAAK,SAACJ,GAAD,iBAC1B,KAAxB,UAAAA,EAAEK,iBAAF,eAAaC,UAAb,UAA6BN,EAAEK,iBAA/B,aAA6B,EAAaD,MAAK,SAACG,GAAD,OAAWA,EAAKC,SAAWD,EAAKE,cAC1E,UAACT,EAAEU,eAAH,OAAC,EAAWJ,SAAUN,EAAEU,QAAQN,MAAK,SAACO,GAAD,MAAoB,KAAbA,EAAEC,QAA8B,OAAbD,EAAEC,aAEzE,GAAIT,EACF,OAAO,EAGT,IAAMU,EAAiBX,EAAcE,MAAK,SAACJ,GAAD,eACvC,UAAAA,EAAEK,iBAAF,eAAaC,SAAUN,EAAEK,UAAUD,MAAK,SAACG,GAAD,OAAUA,EAAKC,QAAUD,EAAKE,YACjE,UAAAT,EAAEU,eAAF,eAAWJ,SAAUN,EAAEU,QAAQN,MAAK,SAACO,GAAD,MAAoB,KAAbA,EAAEC,QAA8B,OAAbD,EAAEC,aAExE,OAAQC,IApDkB,mBAuD5B,WACEtB,KAAKE,MAAM,aAxDe,GAASqB,QAErCC,gBADCC,kBACD,2BAFmB3B,EAAS,gBAJ7B4B,eAAU,CACTC,WAAY,MAGO7B","file":"js/home1116.2e3341c4.js","sourcesContent":["import {\n Component,\n Ref,\n Vue,\n} from 'vue-property-decorator';\nimport { VForm } from '@/types';\nimport { polls_store } from '@/store';\n\nconst { state } = polls_store;\n\n@Component({\n components: {\n },\n})\nexport default class PollMixin extends Vue {\n @Ref()\n readonly form!: VForm;\n\n form_valid_val = false;\n\n get form_valid() {\n return this.form_valid_val;\n }\n\n set form_valid(val: boolean) {\n this.form_valid_val = val;\n this.$emit('valid', val);\n }\n\n get current_poll() {\n return state.current_poll;\n }\n\n submit() {\n if (this.form.validate()) {\n this.$emit('submit');\n this.$emit('valid', true);\n }\n }\n\n go_back() {\n if (this.form.validate()) {\n this.$emit('go_back');\n }\n }\n\n get questions() {\n return state.questions;\n }\n\n get is_button_disabled() {\n const required_questions = this.questions.filter((q) => q.is_required);\n const all_questions = this.questions;\n\n const has_invalid_required = required_questions.some((q) =>\n (q.grid_list?.length === 0 || q.grid_list?.some((item) => !item.row_id || !item.col_id))\n || (!q.answers?.length || q.answers.some((a) => a.answer === '' || a.answer === null)));\n\n if (has_invalid_required) {\n return true;\n }\n\n const has_any_filled = all_questions.some((q) =>\n (q.grid_list?.length && q.grid_list.some((item) => item.row_id && item.col_id))\n || (q.answers?.length && q.answers.some((a) => a.answer !== '' && a.answer !== null)));\n\n return !has_any_filled;\n }\n\n close() {\n this.$emit('close');\n }\n}\n"],"sourceRoot":""}