{"version":3,"file":"app-ee44ed6e.9729664bca28a8e6916d.bundle.js","mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AACA;AACA;AAEA;AAMA;AACA;AAAA;AALA;AAMA;AACA;AACA;AANA;AAAA;AAAA;AAAA;AAAA;;;;;;;;;;;;;;;;ACRA;AAEA;AAKA;AAAA;AAJA;AACA;AAIA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;ACvBA;AACA;AACA;AACA;AACA;AAEA;AAoBA;AAAA;AAGA;AAAA;AAGA;AAAA;AAGA;AAAA;AACA;AAAA;AAGA;AAAA;AAGA;AAAA;AAGA;AAAA;AASA;AAAA;AAGA;AAAA;AAEA;AAAA;AAnDA;AACA;AAEA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAaA;AACA;AAAA;AAEA;AACA;AAAA;AAEA;AACA;AAAA;AAEA;AACA;AAAA;AAAA;AAGA;AACA;AAAA;AAEA;AACA;AAAA;AAEA;AACA;AAAA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AAEA;AACA;AAIA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAEA;AAEA;AACA;AAEA;AAEA;AACA;AAEA;AAEA;AACA;AAEA;AAEA;AACA;AACA;AAzOA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAaA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;;;;;;;;;ACnCA;AACA;AACA;AACA;;;;;;;;;;;ACHA;AACA;AACA;AACA","sources":["webpack://www.zeusteam.com/./src/resources/widgets/to-dos/widget-to-dos.js","webpack://www.zeusteam.com/./src/resources/widgets/widget-base.js","webpack://www.zeusteam.com/./src/resources/widgets/widget-settings.js","webpack://www.zeusteam.com/./src/resources/widgets/to-dos/widget-to-dos.html","webpack://www.zeusteam.com/./src/resources/widgets/widget-settings.html"],"sourcesContent":["import { bindable } from 'aurelia-framework';\r\nimport { Security } from 'common/security';\r\nimport { WidgetBase } from './../widget-base';\r\n\r\nexport class WidgetToDos extends WidgetBase {\r\n static inject = [Element, Security];\r\n security;\r\n\r\n @bindable settings;\r\n\r\n constructor(element, security) {\r\n super(element);\r\n this.security = security;\r\n }\r\n}\r\n","import moment from 'moment';\r\n\r\nexport class WidgetBase {\r\n _element;\r\n showSettings = false;\r\n showSettingsDrawer = false;\r\n\r\n constructor(element) {\r\n this._element = element;\r\n }\r\n\r\n toggleSettings() {\r\n this.showSettings = !this.showSettings;\r\n if (this.showSettings) {\r\n this.showSettingsDrawer = moment().format();\r\n } else {\r\n this.showSettingsDrawer = undefined;\r\n }\r\n }\r\n\r\n dispatchSettingsEvent(data, save = false) {\r\n this._element.dispatchEvent(new CustomEvent('settings', { bubbles: true, detail: { data, save } }));\r\n }\r\n}\r\n","import { bindable, observable, computedFrom } from 'aurelia-framework';\r\nimport { Security } from 'common/security';\r\nimport { Products } from 'services/products';\r\nimport { LOB, WIDGET, KPI, UNDERWRITING } from 'common/constants';\r\nimport { c } from 'common/common';\r\n\r\nexport class WidgetSettings {\r\n static inject = [Element, Security, Products];\r\n _security;\r\n _products;\r\n\r\n KPI = KPI;\r\n\r\n @bindable canEdit;\r\n @bindable displayChartOptions = false;\r\n @bindable settings;\r\n @bindable showGroupBy = false;\r\n @bindable showGroupByCarrier = true;\r\n @bindable showChartType = false;\r\n @bindable showWritingAgents = true;\r\n @bindable showRestrictView = false;\r\n @bindable showFriendlyName = false;\r\n @bindable forMetric;\r\n\r\n friendlyName;\r\n _defaultSync = true;\r\n @observable({ changeHandler: '_dispatch' }) sync;\r\n chartTypeOptions;\r\n _defaultChartType;\r\n @observable({ changeHandler: '_dispatch' }) chartType;\r\n viewOptions;\r\n _defaultView;\r\n @observable({ changeHandler: '_dispatch' }) view;\r\n groupByOptions;\r\n _defaultGroupBy;\r\n @observable({ changeHandler: '_dispatch' }) restrictToForMemberView = false;\r\n @observable({ changeHandler: '_dispatch'}) groupBy;\r\n periodOptions;\r\n _defaultPeriod;\r\n @observable({ changeHandler: '_dispatch' }) period;\r\n metricOptions;\r\n _defaultMetric;\r\n @observable({ changeHandler: '_metricChanged' }) metric;\r\n lineOfBusinessOptions;\r\n _defaultLinesOfBusiness;\r\n @observable({ changeHandler: '_linesOfBusinessChanged' }) linesOfBusiness;\r\n lifeProductTypeOptions;\r\n _defaultLifeProductTypes;\r\n lifeProductTypes;\r\n productUnderwritingOptions;\r\n _defaultProductUnderwritings;\r\n productUnderwritings;\r\n policyStatusOptions;\r\n _defaultPolicyStatus;\r\n @observable({ changeHandler: '_dispatch' }) policyStatus;\r\n premiumTypeOptions;\r\n _defaultPremiumType;\r\n @observable({ changeHandler: '_dispatch' }) premiumType;\r\n\r\n constructor(element, security, products) {\r\n this._element = element;\r\n this._security = security;\r\n this._products = products;\r\n\r\n this.chartTypeOptions = WIDGET.ChartType.all();\r\n this._defaultChartType = WIDGET.ChartType.default();\r\n this.viewOptions = WIDGET.View.all(security, true);\r\n this._defaultView = WIDGET.View.default();\r\n this.groupByOptions = WIDGET.GroupBy.all(security);\r\n this._defaultGroupBy = WIDGET.GroupBy.default();\r\n this.periodOptions = WIDGET.Period.all();\r\n this._defaultPeriod = WIDGET.Period.default();\r\n this.metricOptions = KPI.Metric.all();\r\n this._defaultMetric = KPI.Metric.default();\r\n this.lineOfBusinessOptions = LOB.all();\r\n this._defaultLinesOfBusiness = LOB.defaultLines();\r\n this.policyStatusOptions = WIDGET.PolicyStatusGroup.all();\r\n this._defaultPolicyStatus = WIDGET.PolicyStatusGroup.default();\r\n this.premiumTypeOptions = KPI.PremiumType.all();\r\n this._defaultPremiumType = KPI.PremiumType.default();\r\n }\r\n\r\n async bind() {\r\n if (!this.showGroupByCarrier) {\r\n const idx = this.groupByOptions.findIndex(x => x === WIDGET.GroupBy.Carrier);\r\n if (idx >= 0) this.groupByOptions.splice(idx, 1);\r\n }\r\n await this._load();\r\n this.settingsChanged();\r\n }\r\n\r\n async _load() {\r\n try {\r\n const productTypes = await this._products.typesByLOB();\r\n const lifeProductTypeOptions = productTypes.find(x => x.lineOfBusiness === LOB.Life).productTypes;\r\n this.lifeProductTypeOptions = [];\r\n lifeProductTypeOptions.forEach(o => {\r\n this.lifeProductTypeOptions.push({ key: o, checked: false });\r\n })\r\n this._defaultLifeProductTypes = lifeProductTypeOptions;\r\n this.productUnderwritingOptions = [];\r\n const productUnderwritings = UNDERWRITING.all();\r\n productUnderwritings.forEach(u => {\r\n this.productUnderwritingOptions.push({ key: u, checked: false });\r\n });\r\n this._defaultProductUnderwritings = productUnderwritings;\r\n } catch (err) {\r\n console.log(err);\r\n }\r\n }\r\n\r\n settingsChanged(newValue, oldValue) {\r\n if (this._initialized && oldValue && newValue && JSON.stringify(oldValue) === JSON.stringify(newValue)) return;\r\n try {\r\n this._initializingSettings = true;\r\n this.friendlyName = this.settings ? c.Helpers.decodeJsProperty(this.settings.friendlyName) || '' : '';\r\n this.sync = this.settings ? (this.settings.sync === true || this.settings.sync === false) ? this.settings.sync : this._defaultSync : this._defaultSync;\r\n this.chartType = this.settings ? this.settings.chartType || this._defaultChartType : this._defaultChartType;\r\n this.view = this.settings ? this.settings.view || this._defaultView : this._defaultView;\r\n this.restrictToForMemberViewMemberId = this.settings ? this.settings.restrictToForMemberViewMemberId || undefined : undefined;\r\n this.restrictToForMemberView = this.restrictToForMemberViewMemberId ? true : false;\r\n this.groupBy = this.settings ? this.settings.groupBy || this._defaultGroupBy : this._defaultGroupBy;\r\n this.period = this.settings ? this.settings.period || this._defaultPeriod : this._defaultPeriod;\r\n if (this.forMetric) {\r\n this.metric = this.forMetric;\r\n } else {\r\n this.metric = this.settings ? this.settings.metric || this._defaultMetric : this._defaultMetric;\r\n }\r\n this.linesOfBusiness = this.settings ? this.settings.linesOfBusiness || this._defaultLinesOfBusiness : this._defaultLinesOfBusiness;\r\n this.lifeProductTypes = this.settings ? this.settings.lifeProductTypes || this._defaultLifeProductTypes : this._defaultLifeProductTypes;\r\n if (this.lifeProductTypeOptions) {\r\n this.lifeProductTypeOptions.forEach(o => {\r\n o.checked = this.lifeProductTypes.includes(o.key);\r\n });\r\n }\r\n this.productUnderwritings = this.settings ? this.settings.productUnderwritings || this._defaultProductUnderwritings : this._defaultProductUnderwritings;\r\n if (this.productUnderwritingOptions) {\r\n this.productUnderwritingOptions.forEach(o => {\r\n o.checked = this.productUnderwritings.includes(o.key);\r\n });\r\n }\r\n this.policyStatus = this.settings ? this.settings.policyStatus || this._defaultPolicyStatus : this._defaultPolicyStatus;\r\n this.premiumType = this.settings ? this.settings.premiumType || this._defaultPremiumType : this._defaultPremiumType;\r\n this._initializingSettings = false;\r\n this._dispatch();\r\n } catch (err) {\r\n console.log(err);\r\n } finally {\r\n this._initialized = true;\r\n }\r\n }\r\n\r\n _metricChanged() {\r\n this._initializingSettings = true;\r\n if (KPI.requiresPolicyStatus(this.metric) && !this.policyStatus) this.policyStatus = this._defaultPolicyStatus;\r\n if (KPI.requiresLineOfBusiness(this.metric) && (!this.linesOfBusiness || !this.linesOfBusiness.length)) this.linesOfBusiness = this._defaultLinesOfBusiness;\r\n if (KPI.requiresPremiumType(this.metric) && !this.premiumType) this.premiumType = this._defaultPremiumType;\r\n this._initializingSettings = false;\r\n this._dispatch();\r\n }\r\n\r\n onFriendlyNameBlur() {\r\n if (this._initializingSettings) return;\r\n this._dispatch();\r\n }\r\n\r\n _linesOfBusinessChanged() {\r\n if (this.linesOfBusiness.includes(LOB.Life)) {\r\n this.displayLifeProductTypes = true; \r\n } else {\r\n this.displayLifeProductTypes = false;\r\n }\r\n this._dispatch();\r\n }\r\n\r\n lifeProductTypeSelected(productType) {\r\n const idx = this.lifeProductTypes.findIndex(x => x === productType.key);\r\n if (productType.checked) {\r\n if (idx < 0) this.lifeProductTypes.push(productType.key);\r\n } else {\r\n if (idx >= 0) this.lifeProductTypes.splice(idx, 1);\r\n }\r\n this._dispatch();\r\n }\r\n\r\n productUnderwritingSelected(underwriting) {\r\n const idx = this.productUnderwritings.findIndex(x => x === underwriting.key);\r\n if (underwriting.checked) {\r\n if (idx < 0) this.productUnderwritings.push(underwriting.key);\r\n } else {\r\n if (idx >= 0) this.productUnderwritings.splice(idx, 1);\r\n }\r\n this._dispatch();\r\n }\r\n\r\n _dispatch() {\r\n if (this._initializingSettings) return;\r\n const data = {\r\n friendlyName: this.friendlyName ? c.Helpers.encodeJsProperty(this.friendlyName) : '',\r\n sync: (this.sync === true || this.sync === false) ? this.sync : this._defaultSync,\r\n chartType: this.chartType || this._defaultChartType,\r\n view: this.view || this._defaultView,\r\n restrictToForMemberViewMemberId: this.restrictToForMemberViewMemberId,\r\n groupBy: this.groupBy || this._defaultGroupBy,\r\n period: this.period || this._defaultPeriod,\r\n metric: this.metric || this._defaultMetric,\r\n linesOfBusiness: this.linesOfBusiness || this._defaultLinesOfBusiness,\r\n lifeProductTypes: this.lifeProductTypes || this._defaultLifeProductTypes,\r\n productUnderwritings: this.productUnderwritings || this._defaultProductUnderwritings,\r\n policyStatus: this.policyStatus || this._defaultPolicyStatus,\r\n premiumType: this.premiumType || this._defaultPremiumType,\r\n };\r\n if (!KPI.requiresPolicyStatus(data.metric)) data.policyStatus = null;\r\n if (!KPI.requiresLineOfBusiness(data.metric)) data.linesOfBusiness = null;\r\n if (!KPI.requiresPremiumType(data.metric)) data.premiumType = null;\r\n if (this.canEdit === true && this.showRestrictView === true && this.restrictToForMemberView === true) data.restrictToForMemberViewMemberId = this._security.authenticatedMemberId;\r\n else if (this.canEdit === true && this.showRestrictView === true && !this.restrictForMemberView) data.restrictToForMemberViewMemberId = null;\r\n if (this._dispatchTimeout) window.clearTimeout(this._dispatchTimeout);\r\n this._dispatchTimeout = window.setTimeout(() => {\r\n this._dispatchEvent(data);\r\n }, 500);\r\n }\r\n\r\n _dispatchEvent(data) {\r\n this._element.dispatchEvent(new CustomEvent('changed', { bubbles: true, detail: { data, save: this._initialized } }));\r\n }\r\n\r\n @computedFrom('showRestrictView', 'view')\r\n get showRestrictViewOption() {\r\n return this.showRestrictView && (this.view === WIDGET.View.Agency || this.view === WIDGET.View.Downline);\r\n }\r\n\r\n @computedFrom('metric')\r\n get showPolicyStatus() {\r\n return KPI.requiresPolicyStatus(this.metric);\r\n }\r\n\r\n @computedFrom('metric')\r\n get showLinesOfBusiness() {\r\n return KPI.requiresLineOfBusiness(this.metric);\r\n }\r\n\r\n @computedFrom('metric')\r\n get showPremiumType() {\r\n return KPI.requiresPremiumType(this.metric);\r\n }\r\n}\r\n","// Module\nvar code = \"\";\n// Exports\nexport default code;","// Module\nvar code = \"\\r\\n\";\n// Exports\nexport default code;"],"names":[],"sourceRoot":""}