{"version":3,"sources":["webpack:///../WCC.UI/App/components/statistics/survey/factories/questionSections.ts","webpack:///../WCC.UI/App/components/statistics/survey/model.ts","webpack:///../WCC.UI/App/components/statistics/survey/models/questionChoice.ts","webpack:///../WCC.UI/App/components/statistics/survey/models/questionSection.ts","webpack:///../WCC.UI/App/components/statistics/survey/page.html?b546","webpack:///../WCC.UI/App/components/statistics/survey/page.scss?ad85","webpack:///../WCC.UI/App/components/statistics/survey/page.ts","webpack:///../WCC.UI/App/components/statistics/survey/question.html?1281","webpack:///../WCC.UI/App/components/statistics/survey/question.scss?a84c","webpack:///../WCC.UI/App/components/statistics/survey/question.ts","webpack:///../WCC.UI/App/components/statistics/survey/questionChoice.html?4e39","webpack:///../WCC.UI/App/components/statistics/survey/questionChoice.scss?77b6","webpack:///../WCC.UI/App/components/statistics/survey/questionChoice.ts","webpack:///../WCC.UI/App/components/statistics/survey/questionSection.html?d021","webpack:///../WCC.UI/App/components/statistics/survey/questionSection.scss?2355","webpack:///../WCC.UI/App/components/statistics/survey/questionSection.ts","webpack:///../WCC.UI/App/components/statistics/survey/survey.html?b9dd","webpack:///../WCC.UI/App/components/statistics/survey/survey.scss?3f51","webpack:///../WCC.UI/App/components/statistics/survey/survey.ts","webpack:///../WCC.UI/App/webpack/runtime/htmlExposer.js","webpack:///../WCC.UI/App/components/statistics/survey/page.scss","webpack:///../WCC.UI/App/components/statistics/survey/question.scss","webpack:///../WCC.UI/App/components/statistics/survey/questionChoice.scss","webpack:///../WCC.UI/App/components/statistics/survey/questionSection.scss","webpack:///../WCC.UI/App/components/statistics/survey/survey.scss","webpack:///../WCC.UI/App/components/statistics/survey/page.html","webpack:///../WCC.UI/App/components/statistics/survey/question.html","webpack:///../WCC.UI/App/components/statistics/survey/questionChoice.html","webpack:///../WCC.UI/App/components/statistics/survey/questionSection.html","webpack:///../WCC.UI/App/components/statistics/survey/survey.html"],"names":["roundToOneDecimal","number","Math","round","reduceAnswers","answers","reducer","reduce","result","answer","questionChoiceId","SurveyStatisticsQuestionSectionsFactory","constructor","buildSections","question","statQuestion","SurveyStatisticsChoiceQuestion","this","buildChoiceSections","SurveyStatisticsBlankQuestion","buildBlankSections","SurveyStatisticsRankQuestion","buildRankSections","SurveyStatisticsQuestionSection","surveyQuestion","surveyStatQuestion","value","a","rank","totalVotes","respondentsCount","sortBy","getChoicesSortFunc","blankOptionId","_question$blankOption","_question$blankOption2","blankOptions","find","o","optionId","sortOrder","title","labels","AverageRank","scoremode","_","chain","groupBy","average","g","k","parseFloat","group","forEach","ranks","currentRank","length","TimesRankedAsFirst","timesSelectedAsTop","rankAnswersByField","TimesRankedAsLast","hidden","all","undefined","timesSelectedAsLast","_a$timesSelectedAsLas","_a$timesSelectedAsLas2","_a$timesSelectedAsLas3","choiceRatingType","choicesOptions","pluck","getAnswerChoice","choices","ch","choiceId","enums","ProfileQuestionChoicesRatingTypes","RatingScale","usesSlider","getAnswerOrder","_getAnswerChoice$orde","_getAnswerChoice2","order","isAllNumeric","_getAnswerTitle","_getAnswerChoice","text","extractValue","total","r","error","statAnswer","findKey","instance","SurveyStatisticsModel","config","isSpecialItem","isSurveyStatistics","ready","ko","observable","topicId","TopicId","unwrap","filterData","FilterData","default","theme","Theme","reset","SurveyStatisticsQuestionChoice","flattenComputed","defaultSortFunc","_config$sortBy","q","sortedAnswers","sortByFunc","buildValuesFunc","buildRanksFunc","values","pureComputed","map","choice","blank","toString","toFixed","cTitle","_ref","_choice$text","_choice","_blank","t","isHidden","content","expose","__esModule","api","module","i","options","exports","locals","SurveyStatisticsPageVM","info","surveyPage","surveyStatPage","surveyQuestions","p","questions","choiceQuestions","concat","blankQuestions","rankQuestions","questionId","_ko$unwrap","applyBindingsToNode","element","__decorate","injectable","__param","inject","wccModules","componentConfig","componentInfo","sectionsFactory","SurveyStatisticsQuestionVM","mapNotNull","tagsParser","processCustomTags","descriptionForStatistics","statisticsTitle","averageScore","sq","hasAverageScore","isNotNull","sections","strictComputed","filter","s","components","preload","SurveyStatisticsQuestionChoiceVM","SurveyStatisticsQuestionSectionVM","section","hasTitle","registerLocal","require","SurveyStatisticsVM","model","storage","effects","statManager","get","SurveyStatisticsManager","stat","m","statPages","pages","statReady","survey","SurveyManager","surveyPages","surveyReady","pagesConfigs","statPage","page","pageId","loading","not","register","attachTo","is","Model","system","SystemHelpers","html","getTemplatesAndResources","node","document","head","appendChild","___CSS_LOADER_API_IMPORT___","push"],"mappings":"4KAGA,6VAQA,SAASA,EAAkBC,GACvB,OAAOC,KAAKC,MAAe,GAATF,GAAe,GAGrC,SAASG,EAAwDC,EAAmBC,GAChF,OAAOD,EAAQE,OAAO,CAACC,EAAQC,KAC3BD,EAAOC,EAAOC,oBAAsBJ,EAAQG,GAErCD,GACW,IAGZ,MAAOG,EAGjBC,eAEAC,cAAcC,EAA0BC,GACpC,OAAIA,aAAwBC,IACjBC,KAAKC,oBAAoBJ,EAAUC,GACrCA,aAAwBI,IACtBF,KAAKG,mBAAmBN,EAAUC,GACpCA,aAAwBM,IACtBJ,KAAKK,kBAAkBR,EAAUC,GAEjC,GAGPG,oBAAoBJ,EAA0BC,GAClD,MAAO,CACH,IAAIQ,IAAgC,CAChCC,eAAgBV,EAChBW,mBAAoBV,EAEpBW,MAAOrB,GAAWD,EAAcC,EAASsB,GAAKA,EAAED,SAEhDE,KAAMvB,IACF,MACMwB,GADmBd,EAAae,oBACE,GAAK,IAE7C,OAAOzB,EAAQE,OAAO,CAACC,EAAQC,KAC3BD,EAAOC,EAAOC,oBAAsBR,KAAKC,MAAMM,EAAOiB,QAAUG,EAAa,IAAM,GAE5ErB,GACW,KAG1BuB,OAAQd,KAAKe,mBAAmBlB,EAAUC,MAK9CK,mBAAmBN,EAA0BC,GACjD,MAAO,CACH,IAAIQ,IAAgC,CAChCC,eAAgBV,EAChBW,mBAAoBV,EAEpBW,MAAOrB,GAAWD,EAAcC,EAASsB,GAAKA,EAAED,SAEhDE,KAAMvB,IACF,MACMwB,GADmBd,EAAae,oBACE,GAAK,IAE7C,OAAOzB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AAUA,G,+KCJjBA,EADkC,EAAQ,wDAChCiF,EAA4B,IAE9BC,KAAK,CAACrF,EAAOC,EAAI,yjCAA4jC,KAErlCD,EAAOG,QAAUA,G,gLCJjBA,EADkC,EAAQ,wDAChCiF,EAA4B,IAE9BC,KAAK,CAACrF,EAAOC,EAAI,0QAA2Q,KAEpSD,EAAOG,QAAUA,G,uKCJjBA,EADkC,EAAQ,wDAChCiF,EAA4B,IAE9BC,KAAK,CAACrF,EAAOC,EAAI,sZAAuZ,KAEhbD,EAAOG,QAAUA,G,qHCHjBH,EAAOG,QAFI,uP,yHCEXH,EAAOG,QAFI,y+B,+HCEXH,EAAOG,QAFI,iiC,gICEXH,EAAOG,QAFI,mb,uHCEXH,EAAOG,QAFI","file":"107.df615045476eea579186.js","sourcesContent":["import { Func } from 'interfaces/func';\r\nimport SurveyStatisticsQuestionAnswer from 'models/statistics/survey/questions/answer';\r\nimport SurveyStatisticsChoiceQuestionAnswer from 'models/statistics/survey/questions/choiceAnswer';\r\nimport SurveyStatisticsChoiceQuestion from 'models/statistics/survey/questions/choiceQuestion';\r\nimport SurveyStatisticsQuestion from 'models/statistics/survey/questions/question';\r\nimport SurveyStatisticsRankQuestionAnswer from 'models/statistics/survey/questions/rankAnswer';\r\nimport SurveyStatisticsRankQuestion from 'models/statistics/survey/questions/rankQuestion';\r\nimport SurveyQuestion from 'models/survey/question';\r\nimport SurveyStatisticsQuestionSection from '../models/questionSection';\r\nimport SurveyStatisticsBlankQuestion from \"../../../../models/statistics/survey/questions/blankQuestion\";\r\n\r\nfunction roundToOneDecimal(number: number) {\r\n return Math.round(number * 10) / 10;\r\n}\r\n\r\nfunction reduceAnswers(answers: Array, reducer: Func) {\r\n return answers.reduce((result, answer) => {\r\n result[answer.questionChoiceId()] = reducer(answer);\r\n\r\n return result;\r\n }, >{});\r\n}\r\n\r\nexport default class SurveyStatisticsQuestionSectionsFactory {\r\n static instance = new SurveyStatisticsQuestionSectionsFactory();\r\n\r\n constructor() { }\r\n\r\n buildSections(question: SurveyQuestion, statQuestion: SurveyStatisticsQuestion): Array {\r\n if (statQuestion instanceof SurveyStatisticsChoiceQuestion)\r\n return this.buildChoiceSections(question, statQuestion);\r\n else if (statQuestion instanceof SurveyStatisticsBlankQuestion)\r\n return this.buildBlankSections(question, statQuestion);\r\n else if (statQuestion instanceof SurveyStatisticsRankQuestion)\r\n return this.buildRankSections(question, statQuestion);\r\n else\r\n return [];\r\n }\r\n\r\n private buildChoiceSections(question: SurveyQuestion, statQuestion: SurveyStatisticsChoiceQuestion) {\r\n return [\r\n new SurveyStatisticsQuestionSection({\r\n surveyQuestion: question,\r\n surveyStatQuestion: statQuestion,\r\n\r\n value: answers => reduceAnswers(answers, a => a.value()),\r\n\r\n rank: answers => {\r\n const respondentsCount = statQuestion.respondentsCount();\r\n const totalVotes = (respondentsCount || 1) / 100;\r\n\r\n return answers.reduce((result, answer) => {\r\n result[answer.questionChoiceId()] = Math.round(answer.value() / totalVotes * 10) / 10;\r\n\r\n return result;\r\n }, >{});\r\n },\r\n\r\n sortBy: this.getChoicesSortFunc(question, statQuestion)\r\n })\r\n ]\r\n }\r\n\r\n private buildBlankSections(question: SurveyQuestion, statQuestion: SurveyStatisticsBlankQuestion) {\r\n return [\r\n new SurveyStatisticsQuestionSection({\r\n surveyQuestion: question,\r\n surveyStatQuestion: statQuestion,\r\n\r\n value: answers => reduceAnswers(answers, a => a.value()),\r\n\r\n rank: answers => {\r\n const respondentsCount = statQuestion.respondentsCount();\r\n const totalVotes = (respondentsCount || 1) / 100;\r\n\r\n return answers.reduce((result, answer) => {\r\n result[answer.blankOptionId()] = Math.round(answer.value() / totalVotes * 10) / 10;\r\n\r\n return result;\r\n }, >{});\r\n },\r\n\r\n sortBy: answer => question.blankOptions().find(o => o.optionId() == answer.questionChoiceId())?.sortOrder() ?? 0\r\n })\r\n ]\r\n }\r\n\r\n private buildRankSections(question: SurveyQuestion, statQuestion: SurveyStatisticsRankQuestion) {\r\n return [\r\n new SurveyStatisticsQuestionSection({\r\n title: labels.AverageRank,\r\n scoremode: true,\r\n\r\n surveyQuestion: question,\r\n surveyStatQuestion: statQuestion,\r\n\r\n value: answers => {\r\n return _.chain(answers)\r\n .groupBy(answer => roundToOneDecimal(answer.average()))\r\n .sortBy((g, k) => parseFloat(k))\r\n .reduce((result, group) => {\r\n group.forEach(answer => {\r\n result.ranks[answer.questionChoiceId()] = result.currentRank;\r\n });\r\n\r\n result.currentRank += group.length;\r\n\r\n return result;\r\n }, { ranks: >{}, currentRank: 1 }).value().ranks;\r\n },\r\n\r\n rank: answers => reduceAnswers(answers, a => roundToOneDecimal(a.average())),\r\n\r\n sortBy: a => a.average()\r\n }),\r\n\r\n new SurveyStatisticsQuestionSection({\r\n title: labels.TimesRankedAsFirst,\r\n\r\n surveyQuestion: question,\r\n surveyStatQuestion: statQuestion,\r\n\r\n value: answers => reduceAnswers(answers, a => a.timesSelectedAsTop()),\r\n rank: answers => this.rankAnswersByField(answers, a => a.timesSelectedAsTop()),\r\n sortBy: a => -a.timesSelectedAsTop()\r\n }),\r\n\r\n new SurveyStatisticsQuestionSection({\r\n title: labels.TimesRankedAsLast,\r\n hidden: statQuestion.answers.all(a => a.timesSelectedAsLast() == undefined),\r\n\r\n surveyQuestion: question,\r\n surveyStatQuestion: statQuestion,\r\n\r\n value: answers => reduceAnswers(answers, a => a.timesSelectedAsLast() ?? 0),\r\n rank: answers => this.rankAnswersByField(answers, a => a.timesSelectedAsLast() ?? 0),\r\n sortBy: a => -(a.timesSelectedAsLast() ?? 0)\r\n })\r\n ];\r\n }\r\n\r\n private getChoicesSortFunc(question: SurveyQuestion, statQuestion: SurveyStatisticsChoiceQuestion): Func {\r\n const choiceRatingType = question.choicesOptions.pluck(o => o.choiceRatingType);\r\n\r\n const getAnswerChoice = (answer: SurveyStatisticsChoiceQuestionAnswer) => question.choices().find(ch => ch.choiceId() == answer.questionChoiceId());\r\n const getAnswerTitle = (answer: SurveyStatisticsChoiceQuestionAnswer) => getAnswerChoice(answer)?.text()\r\n const getAnswerOrder = (answer: SurveyStatisticsChoiceQuestionAnswer) => getAnswerChoice(answer)?.order() ?? -1;\r\n\r\n if (choiceRatingType() == enums.ProfileQuestionChoicesRatingTypes.RatingScale.value || question.usesSlider())\r\n return a => getAnswerOrder(a);\r\n else if (statQuestion.isAllNumeric())\r\n return a => parseFloat(getAnswerTitle(a) ?? '')\r\n else\r\n return a => -a.value();\r\n }\r\n\r\n private rankAnswersByField(answers: Array, extractValue: Func) {\r\n var result = >{};\r\n\r\n if (answers.length > 0) {\r\n const total = answers.reduce((r, a) => r + extractValue(a), 0) || 1;\r\n\r\n let error = 100;\r\n\r\n result = answers.reduce((result, statAnswer) => {\r\n const rank = Math.round(extractValue(statAnswer) / total * 1000) / 10;\r\n\r\n result[statAnswer.questionChoiceId()] = rank;\r\n error -= rank;\r\n\r\n return result;\r\n }, >{});\r\n\r\n if (error < 100) {\r\n const choiceId = _(result).findKey(value => value > 0);\r\n\r\n if (choiceId != undefined)\r\n result[choiceId] += error;\r\n }\r\n }\r\n\r\n return result;\r\n }\r\n}","import { Observable, SubscribableOrNullableValue } from 'knockout';\r\n\r\nexport interface SurveyStatisticsConfig {\r\n TopicId?: SubscribableOrNullableValue\r\n FilterData?: any\r\n Theme?: string\r\n}\r\n\r\nexport default class SurveyStatisticsModel {\r\n isSpecialItem = true;\r\n isSurveyStatistics = true;\r\n\r\n ready = ko.observable(false);\r\n\r\n topicId: Observable\r\n filterData: Observable\r\n theme: Observable\r\n\r\n constructor(config: SurveyStatisticsConfig = {}) {\r\n this.topicId = ko.observable(config.TopicId).unwrap();\r\n this.filterData = ko.observable(config.FilterData).default(null);\r\n\r\n this.theme = ko.observable(config.Theme).default('classic');\r\n }\r\n\r\n reset() {\r\n this.ready(false);\r\n }\r\n}","import { Subscribable, SubscribableOrNullableValue } from 'knockout';\r\n\r\ninterface SurveyStatisticsQuestionChoiceConfig {\r\n questionChoiceId: SubscribableOrNullableValue\r\n title: SubscribableOrNullableValue\r\n value: SubscribableOrNullableValue\r\n rank: SubscribableOrNullableValue\r\n scoremode: SubscribableOrNullableValue\r\n}\r\n\r\nexport default class SurveyStatisticsQuestionChoice {\r\n questionChoiceId: Subscribable\r\n title: Subscribable\r\n value: Subscribable\r\n rank: Subscribable\r\n scoremode: Subscribable\r\n\r\n constructor(config: SurveyStatisticsQuestionChoiceConfig) {\r\n this.questionChoiceId = ko.flattenComputed(config.questionChoiceId);\r\n this.title = ko.flattenComputed(config.title);\r\n this.value = ko.flattenComputed(config.value);\r\n this.rank = ko.flattenComputed(config.rank);\r\n\r\n this.scoremode = ko.flattenComputed(config.scoremode, false);\r\n }\r\n}","import { Func } from 'interfaces/func';\r\nimport { Subscribable, SubscribableOrNullableValue } from 'knockout';\r\nimport SurveyStatisticsQuestionAnswer from 'models/statistics/survey/questions/answer';\r\nimport SurveyStatisticsQuestion from 'models/statistics/survey/questions/question';\r\nimport SurveyQuestion from 'models/survey/question';\r\nimport SurveyStatisticsQuestionChoice from './questionChoice';\r\n\r\nconst defaultSortFunc = () => 1;\r\n\r\ninterface SurveyStatisticsQuestionSectionConfig {\r\n title?: SubscribableOrNullableValue\r\n hidden?: SubscribableOrNullableValue\r\n scoremode?: SubscribableOrNullableValue\r\n\r\n surveyQuestion: SubscribableOrNullableValue\r\n surveyStatQuestion: SubscribableOrNullableValue>\r\n\r\n value: Func, [answers: Array]>\r\n rank: Func, [answers: Array]>\r\n sortBy?: Func\r\n}\r\n\r\nexport default class SurveyStatisticsQuestionSection {\r\n title: Subscribable\r\n choices: Subscribable>\r\n\r\n isHidden: Subscribable\r\n\r\n constructor(config: SurveyStatisticsQuestionSectionConfig) {\r\n const surveyQuestion = ko.flattenComputed(config.surveyQuestion);\r\n const surveyStatQuestion = ko.flattenComputed(config.surveyStatQuestion);\r\n\r\n const choices = surveyQuestion.pluck(q => q.choices, []);\r\n const blankOptions = surveyQuestion.pluck(q => q.blankOptions, []);\r\n\r\n const answers = surveyStatQuestion.pluck(q => q.answers, []);\r\n const sortedAnswers = answers.sortBy(a => sortByFunc(a));\r\n\r\n const sortByFunc = config.sortBy ?? defaultSortFunc;\r\n const buildValuesFunc = config.value;\r\n const buildRanksFunc = config.rank;\r\n\r\n const values = ko.pureComputed(() => buildValuesFunc(sortedAnswers()));\r\n const ranks = ko.pureComputed(() => buildRanksFunc(sortedAnswers()));\r\n\r\n this.title = ko.flattenComputed(config.title); \r\n\r\n this.choices = sortedAnswers.map(answer => {\r\n const choice = choices.find(ch => ch.choiceId() == answer.questionChoiceId());\r\n const blank = blankOptions.find(ch => ch.optionId() == answer.questionChoiceId());\r\n const value = ko.pureComputed(() => values()[answer.questionChoiceId()].toString());\r\n const rank = ko.pureComputed(() => ranks()[answer.questionChoiceId()].toFixed(1));\r\n \r\n const cTitle = ko.pureComputed(() => choice()?.text() ?? blank()?.text() ?? '');\r\n \r\n return new SurveyStatisticsQuestionChoice({\r\n questionChoiceId: answer.questionChoiceId,\r\n title: cTitle.pluck(t => t),//choice.pluck(ch => ch.text()) ?? blank.pluck(b => b.text()) ?? '',\r\n value: value,\r\n rank: rank,\r\n scoremode: config.scoremode\r\n });\r\n });\r\n\r\n this.isHidden = ko.flattenComputed(config.hidden, false);\r\n }\r\n}","define([\n \"!!../../../../node_modules/html-loader/dist/cjs.js??ref--26-1!./page.html\", \n \"!../../../webpack/runtime/htmlExposer.js\"], function (content, expose) {\n content = content.__esModule ? content.default : content;\n expose(content);\n return content;\n });","var api = require(\"!../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js\");\n var content = require(\"!!../../../../node_modules/css-loader/dist/cjs.js!../../../../node_modules/sass-loader/dist/cjs.js!./page.scss\");\n\n content = content.__esModule ? content.default : content;\n\n if (typeof content === 'string') {\n content = [[module.id, content, '']];\n }\n\nvar options = {};\n\noptions.insert = \"head\";\noptions.singleton = false;\n\nvar update = api(content, options);\n\n\n\nmodule.exports = content.locals || {};","import { wccModules } from 'enums/wccModules';\r\nimport { inject, injectable } from 'inversify';\r\nimport { Subscribable, SubscribableOrNullableValue } from 'knockout';\r\nimport SurveyStatisticsPage from 'models/statistics/survey/page';\r\nimport SurveyStatisticsQuestion from 'models/statistics/survey/questions/question';\r\nimport SurveyPage from 'models/survey/page';\r\nimport './page.html';\r\nimport './page.scss';\r\nimport { SurveyStatisticsQuestionVMConfig } from './question';\r\n\r\nexport interface SurveyStatisticsPageVMConfig {\r\n surveyPage: SubscribableOrNullableValue\r\n surveyStatPage: SubscribableOrNullableValue\r\n}\r\n\r\n@injectable()\r\nexport default class SurveyStatisticsPageVM {\r\n questions: Subscribable>\r\n\r\n constructor(\r\n @inject(wccModules.componentConfig) config: SurveyStatisticsPageVMConfig,\r\n @inject(wccModules.componentInfo) info: ko.components.ComponentInfo\r\n ) {\r\n const surveyPage = ko.flattenComputed(config.surveyPage);\r\n const surveyStatPage = ko.flattenComputed(config.surveyStatPage);\r\n\r\n const surveyQuestions = surveyPage.pluck(p => p.questions, []);\r\n const surveyStatQuestions = surveyStatPage.pluck(p => \r\n (>p.choiceQuestions())\r\n .concat(>p.blankQuestions())\r\n .concat(>p.rankQuestions()), []);\r\n\r\n const questions = surveyStatQuestions.map(statQuestion => ({\r\n surveyQuestion: surveyQuestions.find(q => q.questionId() == statQuestion.questionId()),\r\n surveyStatQuestion: statQuestion\r\n }));\r\n\r\n this.questions = questions.sortBy(q => ko.unwrap(q.surveyQuestion)?.order());\r\n\r\n ko.applyBindingsToNode(info.element, {\r\n 'css': {\r\n 'survey-statistics__page': true\r\n }\r\n });\r\n }\r\n}","define([\n \"!!../../../../node_modules/html-loader/dist/cjs.js??ref--26-1!./question.html\", \n \"!../../../webpack/runtime/htmlExposer.js\"], function (content, expose) {\n content = content.__esModule ? content.default : content;\n expose(content);\n return content;\n });","var api = require(\"!../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js\");\n var content = require(\"!!../../../../node_modules/css-loader/dist/cjs.js!../../../../node_modules/sass-loader/dist/cjs.js!./question.scss\");\n\n content = content.__esModule ? content.default : content;\n\n if (typeof content === 'string') {\n content = [[module.id, content, '']];\n }\n\nvar options = {};\n\noptions.insert = \"head\";\noptions.singleton = false;\n\nvar update = api(content, options);\n\n\n\nmodule.exports = content.locals || {};","import { wccModules } from 'enums/wccModules';\r\nimport { inject, injectable } from 'inversify';\r\nimport {PureComputed, Subscribable, SubscribableOrNullableValue} from 'knockout';\r\nimport tagsParser from 'managers/tagsParser';\r\nimport SurveyStatisticsQuestion from 'models/statistics/survey/questions/question';\r\nimport SurveyQuestion from 'models/survey/question';\r\nimport SurveyStatisticsQuestionSectionsFactory from './factories/questionSections';\r\nimport SurveyStatisticsQuestionSection from './models/questionSection';\r\nimport './question.html';\r\nimport './question.scss';\r\n\r\nconst sectionsFactory = SurveyStatisticsQuestionSectionsFactory.instance;\r\n\r\nexport interface SurveyStatisticsQuestionVMConfig {\r\n surveyQuestion: SubscribableOrNullableValue\r\n surveyStatQuestion: SubscribableOrNullableValue\r\n}\r\n\r\n@injectable()\r\nexport default class SurveyStatisticsQuestionVM {\r\n labels = labels;\r\n\r\n title: Subscribable\r\n descriptionForStatistics: Subscribable\r\n statisticsTitle: PureComputed\r\n \r\n averageScore: Subscribable\r\n\r\n hasAverageScore: Subscribable\r\n\r\n sections: Subscribable>\r\n\r\n constructor(\r\n @inject(wccModules.componentConfig) config: SurveyStatisticsQuestionVMConfig,\r\n @inject(wccModules.componentInfo) info: ko.components.ComponentInfo\r\n ) {\r\n const surveyQuestion = ko.flattenComputed(config.surveyQuestion);\r\n const surveyStatQuestion = ko.flattenComputed(config.surveyStatQuestion);\r\n\r\n this.title = surveyQuestion.pluck(q => q.title).mapNotNull(title => tagsParser.processCustomTags(title, []));\r\n this.descriptionForStatistics = surveyStatQuestion.pluck(q => q.descriptionForStatistics).mapNotNull(title => tagsParser.processCustomTags(title, []));\r\n this.statisticsTitle = ko.pureComputed(() => this.descriptionForStatistics() || this.title());\r\n \r\n this.averageScore = surveyStatQuestion.pluck(sq => sq.averageScore);\r\n\r\n this.hasAverageScore = this.averageScore.isNotNull();\r\n\r\n const sections = ko.strictComputed((surveyQuestion, surveyStatQuestion) => {\r\n if (surveyQuestion != undefined && surveyStatQuestion != undefined)\r\n return sectionsFactory.buildSections(surveyQuestion, surveyStatQuestion);\r\n\r\n return [];\r\n }, [surveyQuestion, surveyStatQuestion]);\r\n\r\n this.sections = sections.filter(s => !s.isHidden());\r\n\r\n ko.applyBindingsToNode(info.element, {\r\n 'css': {\r\n 'survey-statistics__question': true\r\n }\r\n });\r\n }\r\n}","define([\n \"!!../../../../node_modules/html-loader/dist/cjs.js??ref--26-1!./questionChoice.html\", \n \"!../../../webpack/runtime/htmlExposer.js\"], function (content, expose) {\n content = content.__esModule ? content.default : content;\n expose(content);\n return content;\n });","var api = require(\"!../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js\");\n var content = require(\"!!../../../../node_modules/css-loader/dist/cjs.js!../../../../node_modules/sass-loader/dist/cjs.js!./questionChoice.scss\");\n\n content = content.__esModule ? content.default : content;\n\n if (typeof content === 'string') {\n content = [[module.id, content, '']];\n }\n\nvar options = {};\n\noptions.insert = \"head\";\noptions.singleton = false;\n\nvar update = api(content, options);\n\n\n\nmodule.exports = content.locals || {};","import { wccModules } from 'enums/wccModules';\r\nimport { inject, injectable } from 'inversify';\r\nimport { Subscribable } from 'knockout';\r\nimport SurveyStatisticsQuestionChoice from './models/questionChoice';\r\nimport './questionChoice.html';\r\nimport './questionChoice.scss';\r\n\r\ncomponents.preload('wcc-content');\r\n\r\ninterface SurveyStatisticsQuestionChoiceVMConfig {\r\n choice: SurveyStatisticsQuestionChoice\r\n}\r\n\r\n@injectable()\r\nexport default class SurveyStatisticsQuestionChoiceVM {\r\n title: Subscribable\r\n value: Subscribable\r\n rank: Subscribable\r\n\r\n scoremode: Subscribable\r\n\r\n constructor(\r\n @inject(wccModules.componentConfig) { choice }: SurveyStatisticsQuestionChoiceVMConfig,\r\n @inject(wccModules.componentInfo) info: ko.components.ComponentInfo\r\n ) {\r\n this.title = choice.title;\r\n this.value = choice.value;\r\n this.rank = choice.rank;\r\n\r\n this.scoremode = choice.scoremode;\r\n\r\n ko.applyBindingsToNode(info.element, {\r\n 'survey-statistics__question__choice': true\r\n });\r\n }\r\n}","define([\n \"!!../../../../node_modules/html-loader/dist/cjs.js??ref--26-1!./questionSection.html\", \n \"!../../../webpack/runtime/htmlExposer.js\"], function (content, expose) {\n content = content.__esModule ? content.default : content;\n expose(content);\n return content;\n });","var api = require(\"!../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js\");\n var content = require(\"!!../../../../node_modules/css-loader/dist/cjs.js!../../../../node_modules/sass-loader/dist/cjs.js!./questionSection.scss\");\n\n content = content.__esModule ? content.default : content;\n\n if (typeof content === 'string') {\n content = [[module.id, content, '']];\n }\n\nvar options = {};\n\noptions.insert = \"head\";\noptions.singleton = false;\n\nvar update = api(content, options);\n\n\n\nmodule.exports = content.locals || {};","import { wccModules } from 'enums/wccModules';\r\nimport { inject, injectable } from 'inversify';\r\nimport { Subscribable } from 'knockout';\r\nimport SurveyStatisticsQuestionChoice from './models/questionChoice';\r\nimport SurveyStatisticsQuestionSection from './models/questionSection';\r\nimport './questionSection.html';\r\nimport './questionSection.scss';\r\n\r\ninterface SurveyStatisticsQuestionSectionVMConfig {\r\n section: SurveyStatisticsQuestionSection\r\n}\r\n\r\n@injectable()\r\nexport default class SurveyStatisticsQuestionSectionVM {\r\n title: Subscribable\r\n choices: Subscribable>\r\n\r\n hasTitle: Subscribable\r\n\r\n constructor(\r\n @inject(wccModules.componentConfig) { section }: SurveyStatisticsQuestionSectionVMConfig,\r\n @inject(wccModules.componentInfo) info: ko.components.ComponentInfo\r\n ) {\r\n this.title = section.title;\r\n this.choices = section.choices;\r\n\r\n this.hasTitle = this.title.isNotNull();\r\n\r\n ko.applyBindingsToNode(info.element, {\r\n 'css': {\r\n 'survey-statistics__question__section': true\r\n }\r\n });\r\n }\r\n}","define([\n \"!!../../../../node_modules/html-loader/dist/cjs.js??ref--26-1!./survey.html\", \n \"!../../../webpack/runtime/htmlExposer.js\"], function (content, expose) {\n content = content.__esModule ? content.default : content;\n expose(content);\n return content;\n });","var api = require(\"!../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js\");\n var content = require(\"!!../../../../node_modules/css-loader/dist/cjs.js!../../../../node_modules/sass-loader/dist/cjs.js!./survey.scss\");\n\n content = content.__esModule ? content.default : content;\n\n if (typeof content === 'string') {\n content = [[module.id, content, '']];\n }\n\nvar options = {};\n\noptions.insert = \"head\";\noptions.singleton = false;\n\nvar update = api(content, options);\n\n\n\nmodule.exports = content.locals || {};","import { wccModules } from 'enums/wccModules';\r\nimport { inject, injectable } from 'inversify';\r\nimport { Subscribable } from 'knockout';\r\nimport SurveyStatisticsManager from 'managers/statistics/survey';\r\nimport { IWCCStorageManager } from 'managers/iStorage';\r\nimport { SurveyManager } from 'managers/topic/survey';\r\nimport { EffectsContainer } from 'mixins/withEffects';\r\nimport SurveyStatisticsModel from './model';\r\nimport { SurveyStatisticsPageVMConfig } from './page';\r\nimport './survey.html';\r\nimport './survey.scss';\r\n\r\ncomponents\r\n .registerLocal('survey-statistics-page', () => require('./page'))\r\n .registerLocal('survey-statistics-question', () => require('./question'))\r\n .registerLocal('survey-statistics-question-section', () => require('./questionSection'))\r\n .registerLocal('survey-statistics-question-choice', () => require('./questionChoice'));\r\n\r\n@injectable()\r\nexport default class SurveyStatisticsVM {\r\n static Model = SurveyStatisticsModel\r\n\r\n labels = labels;\r\n\r\n pagesConfigs: Subscribable>\r\n\r\n ready: Subscribable\r\n loading: Subscribable\r\n\r\n constructor(\r\n @inject(wccModules.componentConfig) model: SurveyStatisticsModel,\r\n @inject(wccModules.componentInfo) info: ko.components.ComponentInfo,\r\n @inject(wccModules.storage) storage: IWCCStorageManager,\r\n @inject(wccModules.effects) effects: EffectsContainer\r\n ) {\r\n const statManager = storage.get(SurveyStatisticsManager, { topicId: model.topicId });\r\n const stat = statManager.pluck(m => m.stat);\r\n const statPages = stat.pluck(m => m.pages, []);\r\n const statReady = stat.isNotNull();\r\n\r\n const surveyManager = storage.get(SurveyManager, { topicId: model.topicId });\r\n const survey = surveyManager.pluck(m => m.survey);\r\n const surveyPages = survey.pluck(s => s.pages);\r\n const surveyReady = survey.isNotNull();\r\n\r\n this.pagesConfigs = statPages.map(statPage => ({\r\n surveyPage: surveyPages.find(page => page.pageId() == statPage.pageId()),\r\n surveyStatPage: statPage\r\n }));\r\n\r\n this.ready = ko.pureComputed(() => statReady() && surveyReady());\r\n this.loading = this.ready.not();\r\n\r\n const theme = model.theme;\r\n\r\n effects.register([\r\n model.ready.attachTo(this.ready),\r\n\r\n () => () => model.reset()\r\n ]);\r\n\r\n effects.register((statManager, filterData) => {\r\n if (statManager != undefined)\r\n statManager.filterData(filterData);\r\n }, [statManager, model.filterData]);\r\n\r\n ko.applyBindingsToNode(info.element, {\r\n 'css': {\r\n 'survey-statistics': true,\r\n 'survey-statistics--classic': theme.is(function (theme) { return theme === 'classic' }),\r\n 'survey-statistics--dark': theme.is(function (theme) { return theme === 'dark' }),\r\n 'survey-statistics--light': theme.is(function (theme) { return theme === 'light' })\r\n }\r\n });\r\n } \r\n}","define(function () {\r\n const system = require('helpers/system').SystemHelpers;\r\n\r\n return function (html) {\r\n system.getTemplatesAndResources(html)\r\n .forEach(function (node) { document.head.appendChild(node) });\r\n }\r\n});","// Imports\nvar ___CSS_LOADER_API_IMPORT___ = require(\"../../../../node_modules/css-loader/dist/runtime/api.js\");\nexports = ___CSS_LOADER_API_IMPORT___(false);\n// Module\nexports.push([module.id, \".survey-statistics__page{display:block}\", \"\"]);\n// Exports\nmodule.exports = exports;\n","// Imports\nvar ___CSS_LOADER_API_IMPORT___ = require(\"../../../../node_modules/css-loader/dist/runtime/api.js\");\nexports = ___CSS_LOADER_API_IMPORT___(false);\n// Module\nexports.push([module.id, \".survey-statistics__question{display:block;margin-bottom:20px}.survey-statistics__question:last-child{margin-bottom:0}.survey-statistics__question__title{font-weight:bold;margin-bottom:15px}.survey-statistics__question__body{margin-left:10px}.survey-statistics__question__average-score{margin-top:15px}.survey-statistics__question__average-score__title{font-weight:bold}\", \"\"]);\n// Exports\nmodule.exports = exports;\n","// Imports\nvar ___CSS_LOADER_API_IMPORT___ = require(\"../../../../node_modules/css-loader/dist/runtime/api.js\");\nexports = ___CSS_LOADER_API_IMPORT___(false);\n// Module\nexports.push([module.id, \".survey-statistics__question__choice{font-size:12px;display:block;margin-bottom:2px}.survey-statistics__question__choice__body{display:table;width:100%}.survey-statistics__question__choice__title{display:table-cell;vertical-align:top;padding:0 10px}.survey-statistics__question__choice__title__content{display:inline-block}.survey-statistics__question__choice__value{display:table-cell;vertical-align:top;text-align:center;width:25px}.survey-statistics__question__choice__value__content{display:inline-block}.survey-statistics__question__choice__rank{display:table-cell;vertical-align:top;padding:0 5px;width:60px}.survey-statistics__question__choice__rank__content{display:block;background-color:#5ca2dd;color:#fff;padding:1px 4px;border-radius:4px;text-align:right}.survey-statistics__question__choice__rank__content:after{content:\\\"%\\\"}.survey-statistics__question__choice__rank--score .survey-statistics__question__choice__rank__content{text-align:center}.survey-statistics__question__choice__rank--score .survey-statistics__question__choice__rank__content:after{content:none}\", \"\"]);\n// Exports\nmodule.exports = exports;\n","// Imports\nvar ___CSS_LOADER_API_IMPORT___ = require(\"../../../../node_modules/css-loader/dist/runtime/api.js\");\nexports = ___CSS_LOADER_API_IMPORT___(false);\n// Module\nexports.push([module.id, \".survey-statistics__question__section{display:block;margin-bottom:15px}.survey-statistics__question__section:last-child{margin-bottom:0}.survey-statistics__question__section__title{font-size:13px;margin-bottom:10px;color:#216096;font-size:15.4px;font-weight:bold}\", \"\"]);\n// Exports\nmodule.exports = exports;\n","// Imports\nvar ___CSS_LOADER_API_IMPORT___ = require(\"../../../../node_modules/css-loader/dist/runtime/api.js\");\nexports = ___CSS_LOADER_API_IMPORT___(false);\n// Module\nexports.push([module.id, \".survey-statistics{position:relative;display:block;padding:10px}.survey-statistics--classic{background-color:#fff;color:#262626;border:5px solid #216096}.survey-statistics--classic .survey-statistics__question__choice__title__content{color:#535353}.survey-statistics--light{background-color:#fff;color:#262626}.survey-statistics--light .survey-statistics__question__choice__title__content{color:#535353}\", \"\"]);\n// Exports\nmodule.exports = exports;\n","// Module\nvar code = \"\";\n// Exports\nmodule.exports = code;","// Module\nvar code = \"\";\n// Exports\nmodule.exports = code;","// Module\nvar code = \"\";\n// Exports\nmodule.exports = code;","// Module\nvar code = \"\";\n// Exports\nmodule.exports = code;","// Module\nvar code = \"\";\n// Exports\nmodule.exports = code;"],"sourceRoot":""}