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oBI,iBAC3BxB,EAAKe,SAASC,gBAAgBC,cAAgB,MAGhDjB,EAAK0B,QAAQhB,aAAaV,EAAKe,SAAUf,EAAK2B,MAChD,EACF,qUAvC+BC,CAAA,EADhC,EAAAuD,EAAArD,eAAc,4BACF0C,GAAb,CAA0CY,EAAApD,olBCA1CwF,EAAA,SAAAzH,GAAA,SAAAyH,+gBACUxH,EAAAyH,kBAAmB,GA4B7B,QA7B8BpH,EAAAmH,EAAAzH,GAGtByH,EAAAlH,UAAAC,KAAN,wtCAGE,GAFAR,EAAAO,UAAMC,KAAIC,KAAAC,MAENA,KAAKM,SAAS2G,mBAAmBzE,OAAS,MAC5C,IAAwBT,2SAAAY,CAAA3C,KAAKM,SAAS2G,oBAAkBnF,EAAAC,EAAAc,QAAAf,EAAAgB,KAAAhB,EAAAC,EAAAc,OACtB,wBADvBqE,EAASpF,EAAAiB,OACJoE,gBACZnH,KAAKgH,iBAAgD,QAA7BE,EAAUE,0ZAM1CL,EAAAlH,UAAAI,aAAA,SAAaC,GAAb,IAAAX,EAAAS,UAAa,IAAAE,IAAAA,GAAA,GACXF,KAAKI,UAAUC,UAAU,WACvBf,EAAAO,UAAMI,aAAYF,KAAAR,EAACW,GAEnBX,EAAK0B,QAAQhB,aAAaV,EAAKe,SAAUf,EAAK2B,MAChD,EACF,EAEA6F,EAAAlH,UAAAwH,SAAA,SAAS/G,EAAUgH,GAAnB,IAAA/H,EAAAS,KACEA,KAAKI,UAAUC,UAAU,WACvBC,EAAS+D,eAAiBiD,EAC1B/H,EAAKU,cACP,EACF,qUA5BmBkB,CAAA,EADpB,EAAAuD,EAAArD,eAAc,aACF0F,GAAb,CAA8BpC,EAAApD","sources":["webpack://iadviser/./src/components/qce/components/debug.html","webpack://iadviser/./src/components/qce/components/decimal-format-free-text.html","webpack://iadviser/./src/components/qce/components/decimal-format.html","webpack://iadviser/./src/components/qce/components/dropdown-with-currency.html","webpack://iadviser/./src/components/qce/components/dropdown-with-dropdown.html","webpack://iadviser/./src/components/qce/components/dropdown-with-free-text.html","webpack://iadviser/./src/components/qce/components/dropdown.html","webpack://iadviser/./src/components/qce/components/decimal-format-free-text.ts","webpack://iadviser/./src/components/qce/components/decimal-format.ts","webpack://iadviser/./src/components/qce/components/decorators/calculate-source-questions.ts","webpack://iadviser/./src/components/qce/components/dropdown-with-currency.ts","webpack://iadviser/./src/components/qce/components/dropdown-with-dropdown.ts","webpack://iadviser/./src/components/qce/components/dropdown-with-free-text.ts","webpack://iadviser/./src/components/qce/components/dropdown.ts"],"sourcesContent":["// Module\nvar code = \"\\r\\n \\r\\n Debug: \\r\\n \\r\\n \\r\\n QCE View Mode: ${context.viewMode}\\r\\n \\r\\n\\r\\n \\r\\n \\r\\n Question ID: ${question.questionId}\\r\\n Display Type ID: ${question.displayTypeId}\\r\\n Display Type: ${question.displayType}\\r\\n Answer Length: ${question.answerLength}\\r\\n Response Value: ${question.currentResponse.responseValue}\\r\\n Mandatory on Quote: ${question.mandatoryOnQuoteFlag}\\r\\n Mandatory on Policy: ${question.mandatoryOnPolicyFlag}\\r\\n Question Read Only: ${question.readOnlyFlag}\\r\\n Disabled by Flow: ${question.disabledByQuestionFlowFlag}\\r\\n \\r\\n \\r\\n\";\n// Exports\nexport default code;","// Module\nvar code = \"\\r\\n \\r\\n \\r\\n\\r\\n \\r\\n\\r\\n \\r\\n \\r\\n\\r\\n or\\r\\n\\r\\n \\r\\n \\r\\n\";\n// Exports\nexport default code;","// Module\nvar code = \"\\r\\n \\r\\n \\r\\n\\r\\n \\r\\n\";\n// Exports\nexport default code;","// Module\nvar code = \"\\r\\n \\r\\n \\r\\n\\r\\n \\r\\n\\r\\n \\r\\n \\r\\n ${answer.answerText}\\r\\n \\r\\n \\r\\n\\r\\n or\\r\\n\\r\\n \\r\\n\\r\\n \\r\\n\";\n// Exports\nexport default code;","// Module\nvar code = \"\\r\\n \\r\\n \\r\\n\\r\\n \\r\\n\\r\\n \\r\\n \\r\\n Town\\r\\n \\r\\n \\r\\n ${region.externalSystemRegionName}\\r\\n \\r\\n \\r\\n\\r\\n \\r\\n Suburb\\r\\n \\r\\n \\r\\n ${suburb.externalSystemSuburbName}\\r\\n \\r\\n \\r\\n \\r\\n\\r\\n\";\n// Exports\nexport default code;","// Module\nvar code = \"\\r\\n \\r\\n \\r\\n\\r\\n \\r\\n\\r\\n \\r\\n \\r\\n ${answer.answerText}\\r\\n \\r\\n \\r\\n\\r\\n or\\r\\n\\r\\n \\r\\n \\r\\n\";\n// Exports\nexport default code;","// Module\nvar code = \"\\r\\n \\r\\n \\r\\n\\r\\n \\r\\n \\r\\n ${answer.answerText}\\r\\n \\r\\n\\r\\n \\r\\n ${answer.answerText}\\r\\n \\r\\n\\r\\n\";\n// Exports\nexport default code;","import { generateHtmlIdGuid } from 'resources/utilities/insecure-guid';\r\nimport { ComponentBase } from './component-base';\r\nimport { customElement } from 'aurelia-framework';\r\n\r\nconst inputMaskOptions = {\r\n alias: 'decimal',\r\n autoUnmask: true\r\n};\r\n\r\n@customElement('decimal-format-free-text')\r\nexport class DecimalFormatText extends ComponentBase {\r\n public id = generateHtmlIdGuid();\r\n public iaInput: HTMLInputElement;\r\n private inputMaskOptions = { ...inputMaskOptions };\r\n\r\n bind() {\r\n super.bind();\r\n }\r\n\r\n fieldChanged(isInput = false, type = 'freeText') { \r\n this.taskQueue.queueTask(() => { \r\n if (!this.question.currentResponse.responseValue || this.question.currentResponse.responseValue.toString().trim() === '') {\r\n // Set current workflow item to be NoResponse type\r\n this.currentWorkflowItem = this.question.questionFlow.find(f => f.responseTypeId === -1);\r\n } else {\r\n if (type === 'decimal') {\r\n // We have a user entered value, set the response type to Currency\r\n this.currentWorkflowItem = this.question.questionFlow.find(f => f.responseTypeId === 600000004);\r\n } else if (type === 'freeText') {\r\n // We have a user entered value, set the response type to FreeText\r\n this.currentWorkflowItem = this.question.questionFlow.find(f => f.responseTypeId === 600000005);\r\n }\r\n }\r\n\r\n this.question.currentResponse.responseType = this.currentWorkflowItem.responseType;\r\n this.question.currentResponse.responseTypeId = this.currentWorkflowItem.responseTypeId;\r\n\r\n this.context.fieldChanged(this.question, this.group);\r\n });\r\n }\r\n}\r\n","import { generateHtmlIdGuid } from 'resources/utilities/insecure-guid';\r\nimport { ComponentBase } from './component-base';\r\nimport { customElement } from 'aurelia-framework';\r\n\r\nconst inputMaskOptions = {\r\n alias: 'decimal',\r\n autoUnmask: true\r\n};\r\n\r\n@customElement('decimal-format')\r\nexport class DecimalFormat extends ComponentBase {\r\n public id = generateHtmlIdGuid();\r\n public iaInput: HTMLInputElement;\r\n private inputMaskOptions = { ...inputMaskOptions };\r\n\r\n bind() {\r\n super.bind();\r\n }\r\n\r\n fieldChanged(isInput = false) { \r\n this.taskQueue.queueTask(() => {\r\n super.fieldChanged(isInput);\r\n\r\n this.question.currentResponse.responseType = this.currentWorkflowItem.responseType;\r\n this.question.currentResponse.responseTypeId = this.currentWorkflowItem.responseTypeId;\r\n this.question.currentResponse.responseValue = this.iaInput.inputmask.unmaskedvalue();\r\n\r\n this.context.fieldChanged(this.question, this.group);\r\n });\r\n }\r\n}\r\n","export function calculateSourceQuestions() {\r\n return function (target: any) {\r\n target.prototype.calculateSourceQuestions = function () {\r\n // recalculate calculated questions across all groups\r\n this.context?.model?.groups.forEach((group) => {\r\n if (group && group.questions) {\r\n group.questions = group.questions.map((question) => {\r\n const allowedDecmials = [600000020, 5, 14];\r\n const allowDollarSign = [600000030, 600000031, 1, 16, 600000021, 600000020];\r\n\r\n // This is a source calculated field, there will be one or more ID's to calculate from\r\n if (question.sourceCalculatedQuestions && question.sourceCalculatedQuestions.length) {\r\n let calculatedTotal = 0;\r\n let calculatedAtLeastOnce = false;\r\n\r\n // Loop over all questions\r\n for (const id of question.sourceCalculatedQuestions) {\r\n const foundQuestion = this.context.findQuestionByIdInModel(id);\r\n\r\n // Do we have a source question, a value and it hasn't been disabled? It gets factored into the calculation\r\n if (\r\n foundQuestion &&\r\n !foundQuestion.disabledByQuestionFlowFlag &&\r\n foundQuestion.currentResponse.responseValue !== null\r\n ) {\r\n // Filter the current value of anything potentially user entered that cannot be calculated\r\n let responseValue = foundQuestion.currentResponse.responseValue\r\n .toString()\r\n .replace(/,/g, ' ')\r\n .replace(/\\s/g, '');\r\n\r\n // Strip out dollar sign\r\n if (allowDollarSign.includes(question.displayTypeId)) {\r\n responseValue = responseValue.replace('$', '');\r\n }\r\n\r\n // If the length of this equals two, it's a decimal value\r\n const splitAtCents = responseValue.split('.');\r\n\r\n // We have a value, and it's a decimal\r\n if (responseValue && splitAtCents.length > 1) {\r\n if (!allowedDecmials.includes(question.displayTypeId)) {\r\n continue;\r\n }\r\n\r\n // Decimals provided are greater than allowed two\r\n if (splitAtCents[1].length > 2) {\r\n continue;\r\n }\r\n }\r\n\r\n // Value contains non-numeric values, skip\r\n if (\r\n !responseValue.match(/^[0-9]*$/gm) &&\r\n !responseValue.includes('.') &&\r\n !responseValue.includes('-')\r\n ) {\r\n continue;\r\n }\r\n\r\n // Parse the value\r\n const possibleAmount = allowedDecmials.includes(question.displayTypeId)\r\n ? parseFloat(responseValue)\r\n : parseInt(responseValue);\r\n\r\n // Is it a number? Add it to the running total\r\n if (!isNaN(possibleAmount)) {\r\n calculatedTotal += possibleAmount;\r\n calculatedAtLeastOnce = true;\r\n }\r\n }\r\n }\r\n\r\n if (calculatedTotal === 0 && !calculatedAtLeastOnce) {\r\n question.currentResponse.responseValue = null;\r\n question.currentResponse.responsePresent = false;\r\n question.currentResponse.responseTypeId = -1;\r\n } else {\r\n question.currentResponse.responseValue = allowedDecmials.includes(question.displayTypeId)\r\n ? calculatedTotal.toFixed(2)\r\n : calculatedTotal.toFixed(0);\r\n question.currentResponse.responsePresent = true;\r\n question.currentResponse.responseTypeId = 600000001;\r\n }\r\n }\r\n\r\n return question;\r\n });\r\n }\r\n });\r\n };\r\n };\r\n}\r\n","import { ComponentBase } from './component-base';\r\nimport { customElement } from 'aurelia-framework';\r\n\r\n@customElement('dropdown-with-currency')\r\nexport class DropdownWithCurrency extends ComponentBase {\r\n // private inputMaskOptions: any = {\r\n // alias: 'currency',\r\n // digits: 0,\r\n // max: '999999999',\r\n // clearMaskOnLostFocus: true,\r\n // autoUnmask: true\r\n // };\r\n\r\n private inputMaskOptions: any = {\r\n decimalPlaces : 0,\r\n minimumValue : '-999999999999',\r\n maximumValue : '999999999999',\r\n emptyInputBehavior: 'focus'\r\n };\r\n\r\n bind() {\r\n super.bind();\r\n\r\n // Decimal\r\n if (this.question.displayTypeId === 600000031) {\r\n // this.inputMaskOptions.digits = 2;\r\n // this.inputMaskOptions.max = '999999999.99';\r\n\r\n this.inputMaskOptions.decimalPlaces = 2;\r\n this.inputMaskOptions.minimumValue = '-999999999.99'\r\n this.inputMaskOptions.maximumValue = '999999999.99'\r\n }\r\n }\r\n\r\n fieldChanged(isInput = false) {\r\n this.taskQueue.queueTask(() => {\r\n super.fieldChanged(isInput);\r\n\r\n // If it's not an input, it's a dropdown\r\n if (isInput) {\r\n // We have no currently user entered value, it's empty\r\n if (!this.questionHasValidCurrentResponse()) {\r\n // Set current workflow item to be NoResponse type\r\n this.currentWorkflowItem = this.question.questionFlow.find(f => f.responseTypeId === -1);\r\n } else {\r\n // We have a user entered value, set the response type to Currency\r\n this.currentWorkflowItem = this.question.questionFlow.find(f => f.responseTypeId === 600000002);\r\n }\r\n\r\n this.question.currentResponse.responseType = this.currentWorkflowItem.responseType;\r\n this.question.currentResponse.responseTypeId = this.currentWorkflowItem.responseTypeId;\r\n } else {\r\n if (this.question.currentResponse && this.question._selectedValue) {\r\n const answerOption = this.question.answerOptions.find(a => a.answerId === this.question._selectedValue.answerId);\r\n\r\n const responseValue = answerOption.answerText.toString()\r\n .replace(/,/g, ' ').replace('$', '').replace(/\\s/g, '');\r\n\r\n if (responseValue) {\r\n this.question.currentResponse.responseValue = responseValue;\r\n } else {\r\n this.question.currentResponse.responsePresent = false;\r\n this.question.currentResponse.responseTypeId = -1;\r\n this.question.currentResponse.responseValue = null;\r\n }\r\n } else {\r\n this.question.currentResponse.responsePresent = false;\r\n this.question.currentResponse.responseTypeId = -1;\r\n this.question.currentResponse.responseValue = null;\r\n }\r\n }\r\n\r\n if (!this.question.currentResponse.responseValue || this.question.currentResponse.responseValue.toString().trim() === '') {\r\n this.currentWorkflowItem = this.question.questionFlow.find(f => f.responseTypeId === -1);\r\n }\r\n\r\n this.calculateSourceQuestions();\r\n\r\n this.context.fieldChanged(this.question, this.group);\r\n });\r\n }\r\n}\r\n","import { ComponentBase } from './component-base';\r\nimport { customElement } from 'aurelia-framework';\r\nimport { environment } from 'environment';\r\n\r\n// DisplayTypeId 610000070\r\n\r\n@customElement('dropdown-with-dropdown')\r\nexport class DropdownWithDropdown extends ComponentBase {\r\n private isLoading = false;\r\n private regionTypes = [];\r\n private suburbTypes = [];\r\n\r\n async bind() {\r\n super.bind();\r\n\r\n const endpoint = environment.refData.externalSystemRegions;\r\n const uri = endpoint.uri();\r\n const result = await this.http.fetch(uri, { method: endpoint.method });\r\n if (result.ok) {\r\n this.regionTypes = await result.json();\r\n }\r\n\r\n if (this.question) {\r\n const currentValue = this.question.currentResponse.responseValue;\r\n\r\n if (currentValue) {\r\n const regionSuburb = currentValue.split('|');\r\n const region = regionSuburb[0];\r\n const suburb = regionSuburb[1];\r\n\r\n if(region){\r\n const regionFound = this.regionTypes.find((x) => x.externalSystemRegionName === region);\r\n this.question._selectedRegion = regionFound;\r\n\r\n if(regionFound){\r\n await this.getSuburbTypes(regionFound.externalSystemRegionId);\r\n\r\n if(this.suburbTypes.length){\r\n const foundSuburb = this.suburbTypes.find((x) => x.externalSystemSuburbName === suburb);\r\n if(foundSuburb){\r\n this.question._selectedSuburb = foundSuburb;\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n\r\n async regionTypeChanged(){\r\n this.taskQueue.queueTask(async () => {\r\n this.suburbTypes = [];\r\n this.question._selectedSuburb = null;\r\n\r\n if(this.question._selectedRegion){\r\n this.isLoading = true;\r\n await this.getSuburbTypes(this.question._selectedRegion.externalSystemRegionId)\r\n this.isLoading = false;\r\n }\r\n\r\n this.fieldChanged();\r\n })\r\n }\r\n\r\n suburbTypeChanged() {\r\n this.taskQueue.queueTask(() => {\r\n\r\n if (this.question._selectedSuburb) {\r\n this.question.currentResponse.responseValue = `${this.question._selectedRegion.externalSystemRegionName}|${this.question._selectedSuburb.externalSystemSuburbName}`\r\n }\r\n\r\n this.fieldChanged();\r\n });\r\n }\r\n\r\n fieldChanged() {\r\n this.taskQueue.queueTask(() => {\r\n\r\n if (this.question._selectedSuburb) {\r\n const currentWorkflowItem = this.question.questionFlow.find(q => q.responseTypeId === 600000001);\r\n\r\n this.question.currentResponse.responsePresent = true;\r\n this.question.currentResponse = { ...this.question.currentResponse, ...currentWorkflowItem };\r\n } else {\r\n const currentWorkflowItem = this.question.questionFlow.find(q => q.responseTypeId === -1);\r\n\r\n this.question.currentResponse.responsePresent = false;\r\n this.question.currentResponse = { ...this.question.currentResponse, ...currentWorkflowItem };\r\n }\r\n\r\n this.context.fieldChanged(this.question, this.group);\r\n });\r\n }\r\n\r\n async getSuburbTypes(externalSystemRegionId){\r\n const endpoint = environment.refData.externalSystemSuburbs;\r\n const uri = endpoint.uri([externalSystemRegionId]);\r\n const result = await this.http.fetch(uri, { method: endpoint.method });\r\n if (result.ok) {\r\n this.suburbTypes = await result.json();\r\n }\r\n }\r\n}\r\n","import { ComponentBase } from './component-base';\r\nimport { customElement } from 'aurelia-framework';\r\n\r\n@customElement('dropdown-with-free-text')\r\nexport class DropdownWithCurrency extends ComponentBase {\r\n\r\n bind() {\r\n super.bind();\r\n\r\n // The current value is a dropdown selection\r\n // so we want to remove the response value (which is user entered)\r\n if (this.currentWorkflowItem && this.currentWorkflowItem.responseTypeId === 600000000) {\r\n this.question.currentResponse.responseValue = null;\r\n }\r\n }\r\n\r\n fieldChanged(isInput = false) { \r\n this.taskQueue.queueTask(() => {\r\n super.fieldChanged(isInput);\r\n\r\n // If it's not an input, it's a dropdown\r\n if (isInput) {\r\n // We have no currently user entered value, it's empty\r\n if (!this.question.currentResponse.responseValue || this.question.currentResponse.responseValue.toString().trim() === '') {\r\n // Set current workflow item to be NoResponse type\r\n this.currentWorkflowItem = this.question.questionFlow.find(f => f.responseTypeId === -1);\r\n } else {\r\n // We have a user entered value, set the response type to FreeText\r\n this.currentWorkflowItem = this.question.questionFlow.find(f => f.responseTypeId === 600000005);\r\n }\r\n\r\n this.question.currentResponse.responseType = this.currentWorkflowItem.responseType;\r\n this.question.currentResponse.responseTypeId = this.currentWorkflowItem.responseTypeId;\r\n }\r\n\r\n // The current value is a dropdown selection\r\n // so we want to remove the response value (which is user entered)\r\n if (this.currentWorkflowItem.responseTypeId === 600000000) {\r\n this.question.currentResponse.responseValue = null;\r\n }\r\n\r\n this.context.fieldChanged(this.question, this.group);\r\n });\r\n }\r\n}\r\n","import { ComponentBase } from './component-base';\r\nimport { customElement } from 'aurelia-framework';\r\n\r\n@customElement('dropdown')\r\nexport class Dropdown extends ComponentBase {\r\n private displayAsButtons = false;\r\n\r\n async bind() {\r\n super.bind();\r\n\r\n if (this.question.questionAttributes.length > 0) {\r\n for (const attribute of this.question.questionAttributes) {\r\n if (attribute.attributeName === 'Display as Buttons') {\r\n this.displayAsButtons = attribute.attributeValue === 'Yes';\r\n }\r\n }\r\n }\r\n }\r\n\r\n fieldChanged(isInput = false) {\r\n this.taskQueue.queueTask(() => {\r\n super.fieldChanged(isInput);\r\n\r\n this.context.fieldChanged(this.question, this.group);\r\n });\r\n }\r\n\r\n btnClick(question, answer) {\r\n this.taskQueue.queueTask(() => {\r\n question._selectedValue = answer;\r\n this.fieldChanged();\r\n });\r\n }\r\n}\r\n"],"names":["__webpack_exports__","inputMaskOptions","alias","autoUnmask","DecimalFormatText","_super","_this","id","resources_utilities_insecure_guid__WEBPACK_IMPORTED_MODULE_0__","Tk","__assign","__extends","prototype","bind","call","this","fieldChanged","isInput","type","taskQueue","queueTask","question","currentResponse","responseValue","toString","trim","currentWorkflowItem","questionFlow","find","f","responseTypeId","responseType","context","group","__decorate","aurelia_framework__WEBPACK_IMPORTED_MODULE_2__","customElement","_component_base__WEBPACK_IMPORTED_MODULE_1__","x","DecimalFormat","iaInput","inputmask","unmaskedvalue","calculateSourceQuestions","target","_b","_a","model","groups","forEach","questions","map","allowedDecmials","allowDollarSign","sourceCalculatedQuestions","length","calculatedTotal","calculatedAtLeastOnce","__values","_c","next","done","value","foundQuestion","findQuestionByIdInModel","disabledByQuestionFlowFlag","replace","includes","displayTypeId","splitAtCents","split","match","possibleAmount","parseFloat","parseInt","isNaN","toFixed","responsePresent","DropdownWithCurrency","decimalPlaces","minimumValue","maximumValue","emptyInputBehavior","questionHasValidCurrentResponse","_selectedValue","answerOptions","a","answerId","answerText","aurelia_framework__WEBPACK_IMPORTED_MODULE_1__","_component_base__WEBPACK_IMPORTED_MODULE_0__","DropdownWithDropdown","isLoading","regionTypes","suburbTypes","endpoint","environment__WEBPACK_IMPORTED_MODULE_2__","c","refData","externalSystemRegions","uri","http","fetch","method","result","sent","ok","json","currentValue","regionSuburb","region_1","suburb_1","regionFound","externalSystemRegionName","_selectedRegion","getSuburbTypes","externalSystemRegionId","foundSuburb","externalSystemSuburbName","_selectedSuburb","regionTypeChanged","__awaiter","suburbTypeChanged","concat","q","externalSystemSuburbs","Dropdown","displayAsButtons","questionAttributes","attribute","attributeName","attributeValue","btnClick","answer"],"sourceRoot":""}