text: (window["webpackJsonp"] = window["webpackJsonp"] || []).push([[45],{
  
  /***/ "./src/modules/statistics/components/page.statistics.tsx":
  /*!***************************************************************!*\
    !*** ./src/modules/statistics/components/page.statistics.tsx ***!
    \***************************************************************/
  /*! exports provided: StatisticsPage */
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
  
  "use strict";
  eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"StatisticsPage\", function() { return StatisticsPage; });\n/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ \"./node_modules/tslib/tslib.es6.js\");\n/* harmony import */ var _common_components__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @common-components */ \"./src/common-components/index.ts\");\n/* harmony import */ var _core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @core */ \"./src/core/index.ts\");\n/* harmony import */ var _modules__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @modules */ \"./src/modules/index.ts\");\n/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @utils */ \"./src/utils/index.ts\");\n/* harmony import */ var mobx__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! mobx */ \"./node_modules/mobx/lib/mobx.module.js\");\n/* harmony import */ var mobx_react__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! mobx-react */ \"./node_modules/mobx-react/index.module.js\");\n/* harmony import */ var office_ui_fabric_react__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! office-ui-fabric-react */ \"./node_modules/office-ui-fabric-react/lib/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! react */ \"./node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_8__);\n\n\n\n\n\n\n\n\n\nlet StatisticsPage = class StatisticsPage extends react__WEBPACK_IMPORTED_MODULE_8__[\"Component\"] {\n    constructor() {\n        super(...arguments);\n        this.appointment = null;\n        this.charts = [\n            _modules__WEBPACK_IMPORTED_MODULE_3__[\"appointmentsByDateChart\"],\n            _modules__WEBPACK_IMPORTED_MODULE_3__[\"financesByDateChart\"],\n            _modules__WEBPACK_IMPORTED_MODULE_3__[\"treatmentsNumberChart\"],\n            _modules__WEBPACK_IMPORTED_MODULE_3__[\"mostAppliedTreatmentsChart\"],\n            _modules__WEBPACK_IMPORTED_MODULE_3__[\"genderPieChart\"],\n            _modules__WEBPACK_IMPORTED_MODULE_3__[\"treatmentsByGenderChart\"],\n            _modules__WEBPACK_IMPORTED_MODULE_3__[\"mostInvolvedTeethChart\"],\n            _modules__WEBPACK_IMPORTED_MODULE_3__[\"ageBarChart\"]\n        ];\n    }\n    render() {\n        return (react__WEBPACK_IMPORTED_MODULE_8__[\"createElement\"](\"div\", { className: \"sc-pg p-15 p-l-10 p-r-10\" },\n            react__WEBPACK_IMPORTED_MODULE_8__[\"createElement\"](_common_components__WEBPACK_IMPORTED_MODULE_1__[\"DataTableComponent\"], { maxItemsOnLoad: 20, className: \"appointments-data-table\", heads: [\n                    Object(_core__WEBPACK_IMPORTED_MODULE_2__[\"text\"])(\"Appointment\"),\n                    Object(_core__WEBPACK_IMPORTED_MODULE_2__[\"text\"])(\"Treatment\"),\n                    Object(_core__WEBPACK_IMPORTED_MODULE_2__[\"text\"])(\"Paid\"),\n                    Object(_core__WEBPACK_IMPORTED_MODULE_2__[\"text\"])(\"Outstanding\"),\n                    Object(_core__WEBPACK_IMPORTED_MODULE_2__[\"text\"])(\"Expenses\"),\n                    Object(_core__WEBPACK_IMPORTED_MODULE_2__[\"text\"])(\"Profits\")\n                ], rows: _modules__WEBPACK_IMPORTED_MODULE_3__[\"statistics\"].selectedAppointments.map(appointment => ({\n                    id: appointment._id,\n                    searchableString: appointment.searchableString,\n                    cells: [\n                        {\n                            dataValue: (appointment.patient || new _modules__WEBPACK_IMPORTED_MODULE_3__[\"Patient\"]()).name,\n                            component: (react__WEBPACK_IMPORTED_MODULE_8__[\"createElement\"](_common_components__WEBPACK_IMPORTED_MODULE_1__[\"ProfileComponent\"], { secondaryElement: react__WEBPACK_IMPORTED_MODULE_8__[\"createElement\"](\"span\", null,\n                                    Object(_utils__WEBPACK_IMPORTED_MODULE_4__[\"formatDate\"])(appointment.date, _modules__WEBPACK_IMPORTED_MODULE_3__[\"setting\"].getSetting(\"date_format\")),\n                                    \" \",\n                                    \"/\",\n                                    \" \",\n                                    appointment.operatingStaff.map(x => (react__WEBPACK_IMPORTED_MODULE_8__[\"createElement\"](\"i\", { key: x._id },\n                                        x.name,\n                                        \" \")))), name: (appointment.patient ||\n                                    new _modules__WEBPACK_IMPORTED_MODULE_3__[\"Patient\"]()).name, size: 3 })),\n                            onClick: () => {\n                                this.appointment = appointment;\n                            },\n                            className: \"no-label\"\n                        },\n                        {\n                            dataValue: appointment.treatmentID,\n                            component: (react__WEBPACK_IMPORTED_MODULE_8__[\"createElement\"](_common_components__WEBPACK_IMPORTED_MODULE_1__[\"ProfileSquaredComponent\"], { text: appointment.treatment\n                                    ? appointment.treatment.type\n                                    : \"\", subText: Object(_utils__WEBPACK_IMPORTED_MODULE_4__[\"formatDate\"])(appointment.date, _modules__WEBPACK_IMPORTED_MODULE_3__[\"setting\"].getSetting(\"date_format\")), size: 3, onClick: () => { } })),\n                            className: \"hidden-xs\"\n                        },\n                        {\n                            dataValue: appointment.paidAmount,\n                            component: (react__WEBPACK_IMPORTED_MODULE_8__[\"createElement\"](\"span\", null, _modules__WEBPACK_IMPORTED_MODULE_3__[\"setting\"].getSetting(\"currencySymbol\") +\n                                Object(_utils__WEBPACK_IMPORTED_MODULE_4__[\"round\"])(appointment.paidAmount).toString())),\n                            className: \"hidden-xs\"\n                        },\n                        {\n                            dataValue: appointment.outstandingAmount,\n                            component: (react__WEBPACK_IMPORTED_MODULE_8__[\"createElement\"](\"span\", null, _modules__WEBPACK_IMPORTED_MODULE_3__[\"setting\"].getSetting(\"currencySymbol\") +\n                                Object(_utils__WEBPACK_IMPORTED_MODULE_4__[\"round\"])(appointment.outstandingAmount).toString())),\n                            className: \"hidden-xs\"\n                        },\n                        {\n                            dataValue: appointment.expenses,\n                            component: (react__WEBPACK_IMPORTED_MODULE_8__[\"createElement\"](\"span\", null, _modules__WEBPACK_IMPORTED_MODULE_3__[\"setting\"].getSetting(\"currencySymbol\") +\n                                Object(_utils__WEBPACK_IMPORTED_MODULE_4__[\"round\"])(appointment.expenses).toString())),\n                            className: \"hidden-xs\"\n                        },\n                        {\n                            dataValue: appointment.profit,\n                            component: (react__WEBPACK_IMPORTED_MODULE_8__[\"createElement\"](\"span\", null, _modules__WEBPACK_IMPORTED_MODULE_3__[\"setting\"].getSetting(\"currencySymbol\") +\n                                Object(_utils__WEBPACK_IMPORTED_MODULE_4__[\"round\"])(appointment.profit).toString())),\n                            className: \"hidden-xs\"\n                        }\n                    ]\n                })), farItems: [\n                    {\n                        key: \"1\",\n                        onRender: () => {\n                            return (react__WEBPACK_IMPORTED_MODULE_8__[\"createElement\"](office_ui_fabric_react__WEBPACK_IMPORTED_MODULE_7__[\"Dropdown\"], { placeholder: Object(_core__WEBPACK_IMPORTED_MODULE_2__[\"text\"])(\"Filter by staff member\"), defaultValue: \"\", options: [\n                                    {\n                                        key: \"\",\n                                        text: Object(_core__WEBPACK_IMPORTED_MODULE_2__[\"text\"])(\"All members\")\n                                    }\n                                ].concat(_modules__WEBPACK_IMPORTED_MODULE_3__[\"staff\"].list.map(member => {\n                                    return {\n                                        key: member._id,\n                                        text: member.name\n                                    };\n                                })), onChange: (ev, member) => {\n                                    _modules__WEBPACK_IMPORTED_MODULE_3__[\"statistics\"].filterByMember = member.key.toString();\n                                } }));\n                        }\n                    }\n                ], hideSearch: true, commands: [\n                    {\n                        key: \"2\",\n                        onRender: () => {\n                            return (react__WEBPACK_IMPORTED_MODULE_8__[\"createElement\"](office_ui_fabric_react__WEBPACK_IMPORTED_MODULE_7__[\"DatePicker\"], { onSelectDate: date => {\n                                    if (date) {\n                                        _modules__WEBPACK_IMPORTED_MODULE_3__[\"statistics\"].startingDate = _modules__WEBPACK_IMPORTED_MODULE_3__[\"statistics\"].getDayStartingPoint(date.getTime());\n                                    }\n                                }, value: new Date(_modules__WEBPACK_IMPORTED_MODULE_3__[\"statistics\"].startingDate), formatDate: d => `${Object(_core__WEBPACK_IMPORTED_MODULE_2__[\"text\"])(\"From\")}: ${Object(_utils__WEBPACK_IMPORTED_MODULE_4__[\"formatDate\"])(d, _modules__WEBPACK_IMPORTED_MODULE_3__[\"setting\"].getSetting(\"date_format\"))}` }));\n                        }\n                    },\n                    {\n                        key: \"3\",\n                        onRender: () => {\n                            return (react__WEBPACK_IMPORTED_MODULE_8__[\"createElement\"](office_ui_fabric_react__WEBPACK_IMPORTED_MODULE_7__[\"DatePicker\"], { onSelectDate: date => {\n                                    if (date) {\n                                        _modules__WEBPACK_IMPORTED_MODULE_3__[\"statistics\"].endingDate = _modules__WEBPACK_IMPORTED_MODULE_3__[\"statistics\"].getDayStartingPoint(date.getTime());\n                                    }\n                                }, value: new Date(_modules__WEBPACK_IMPORTED_MODULE_3__[\"statistics\"].endingDate), formatDate: d => `${Object(_core__WEBPACK_IMPORTED_MODULE_2__[\"text\"])(\"Until\")}: ${Object(_utils__WEBPACK_IMPORTED_MODULE_4__[\"formatDate\"])(d, _modules__WEBPACK_IMPORTED_MODULE_3__[\"setting\"].getSetting(\"date_format\"))}` }));\n                        }\n                    }\n                ] }),\n            this.appointment ? (react__WEBPACK_IMPORTED_MODULE_8__[\"createElement\"](_common_components__WEBPACK_IMPORTED_MODULE_1__[\"AsyncComponent\"], { key: \"ae\", loader: () => tslib__WEBPACK_IMPORTED_MODULE_0__[\"__awaiter\"](this, void 0, void 0, function* () {\n                    const AppointmentEditorPanel = (yield __webpack_require__.e(/*! import() */ 2).then(__webpack_require__.bind(null, /*! ../../appointments/components/appointment-editor */ \"./src/modules/appointments/components/appointment-editor.tsx\")))\n                        .AppointmentEditorPanel;\n                    return (react__WEBPACK_IMPORTED_MODULE_8__[\"createElement\"](AppointmentEditorPanel, { appointment: this.appointment, onDismiss: () => (this.appointment = null), onDelete: () => (this.appointment = null) }));\n                }) })) : (\"\"),\n            react__WEBPACK_IMPORTED_MODULE_8__[\"createElement\"](\"div\", { className: \"container-fluid m-t-20 quick\" },\n                react__WEBPACK_IMPORTED_MODULE_8__[\"createElement\"](_common_components__WEBPACK_IMPORTED_MODULE_1__[\"SectionComponent\"], { title: Object(_core__WEBPACK_IMPORTED_MODULE_2__[\"text\"])(\"Quick stats\") },\n                    react__WEBPACK_IMPORTED_MODULE_8__[\"createElement\"](_common_components__WEBPACK_IMPORTED_MODULE_1__[\"Row\"], null,\n                        react__WEBPACK_IMPORTED_MODULE_8__[\"createElement\"](_common_components__WEBPACK_IMPORTED_MODULE_1__[\"Col\"], { sm: 6, xs: 12 },\n                            react__WEBPACK_IMPORTED_MODULE_8__[\"createElement\"](\"label\", null,\n                                Object(_core__WEBPACK_IMPORTED_MODULE_2__[\"text\"])(\"Appointments\"),\n                                \":\",\n                                \" \",\n                                react__WEBPACK_IMPORTED_MODULE_8__[\"createElement\"](_common_components__WEBPACK_IMPORTED_MODULE_1__[\"TagComponent\"], { text: Object(_utils__WEBPACK_IMPORTED_MODULE_4__[\"round\"])(_modules__WEBPACK_IMPORTED_MODULE_3__[\"statistics\"].selectedAppointments\n                                        .length).toString(), type: _common_components__WEBPACK_IMPORTED_MODULE_1__[\"TagType\"].primary }))),\n                        react__WEBPACK_IMPORTED_MODULE_8__[\"createElement\"](_common_components__WEBPACK_IMPORTED_MODULE_1__[\"Col\"], { sm: 6, xs: 12 },\n                            react__WEBPACK_IMPORTED_MODULE_8__[\"createElement\"](\"label\", null,\n                                Object(_core__WEBPACK_IMPORTED_MODULE_2__[\"text\"])(\"Payments\"),\n                                \":\",\n                                \" \",\n                                react__WEBPACK_IMPORTED_MODULE_8__[\"createElement\"](_common_components__WEBPACK_IMPORTED_MODULE_1__[\"TagComponent\"], { text: _modules__WEBPACK_IMPORTED_MODULE_3__[\"setting\"].getSetting(\"currencySymbol\") +\n                                        Object(_utils__WEBPACK_IMPORTED_MODULE_4__[\"round\"])(_modules__WEBPACK_IMPORTED_MODULE_3__[\"statistics\"].totalPayments).toString(), type: _common_components__WEBPACK_IMPORTED_MODULE_1__[\"TagType\"].warning }))),\n                        react__WEBPACK_IMPORTED_MODULE_8__[\"createElement\"](_common_components__WEBPACK_IMPORTED_MODULE_1__[\"Col\"], { sm: 6, xs: 12 },\n                            react__WEBPACK_IMPORTED_MODULE_8__[\"createElement\"](\"label\", null,\n                                Object(_core__WEBPACK_IMPORTED_MODULE_2__[\"text\"])(\"Expenses\"),\n                                \":\",\n                                \" \",\n                                react__WEBPACK_IMPORTED_MODULE_8__[\"createElement\"](_common_components__WEBPACK_IMPORTED_MODULE_1__[\"TagComponent\"], { text: _modules__WEBPACK_IMPORTED_MODULE_3__[\"setting\"].getSetting(\"currencySymbol\") +\n                                        Object(_utils__WEBPACK_IMPORTED_MODULE_4__[\"round\"])(_modules__WEBPACK_IMPORTED_MODULE_3__[\"statistics\"].totalExpenses).toString(), type: _common_components__WEBPACK_IMPORTED_MODULE_1__[\"TagType\"].danger }))),\n                        react__WEBPACK_IMPORTED_MODULE_8__[\"createElement\"](_common_components__WEBPACK_IMPORTED_MODULE_1__[\"Col\"], { sm: 6, xs: 12 },\n                            react__WEBPACK_IMPORTED_MODULE_8__[\"createElement\"](\"label\", null,\n                                Object(_core__WEBPACK_IMPORTED_MODULE_2__[\"text\"])(\"Profits\"),\n                                \":\",\n                                \" \",\n                                react__WEBPACK_IMPORTED_MODULE_8__[\"createElement\"](_common_components__WEBPACK_IMPORTED_MODULE_1__[\"TagComponent\"], { text: _modules__WEBPACK_IMPORTED_MODULE_3__[\"setting\"].getSetting(\"currencySymbol\") +\n                                        Object(_utils__WEBPACK_IMPORTED_MODULE_4__[\"round\"])(_modules__WEBPACK_IMPORTED_MODULE_3__[\"statistics\"].totalProfits).toString(), type: _common_components__WEBPACK_IMPORTED_MODULE_1__[\"TagType\"].success })))))),\n            react__WEBPACK_IMPORTED_MODULE_8__[\"createElement\"](\"div\", { className: \"charts container-fluid\" },\n                react__WEBPACK_IMPORTED_MODULE_8__[\"createElement\"](\"div\", { className: \"row\" }, this.charts.map((chart, index) => {\n                    return (react__WEBPACK_IMPORTED_MODULE_8__[\"createElement\"](\"div\", { key: index + chart.name, className: \"chart-wrapper \" +\n                            (chart.className ||\n                                \"col-xs-12 col-md-5 col-lg-4\") },\n                        react__WEBPACK_IMPORTED_MODULE_8__[\"createElement\"](_common_components__WEBPACK_IMPORTED_MODULE_1__[\"SectionComponent\"], { title: Object(_core__WEBPACK_IMPORTED_MODULE_2__[\"text\"])(chart.name) },\n                            react__WEBPACK_IMPORTED_MODULE_8__[\"createElement\"](chart.Component, null))));\n                })))));\n    }\n};\ntslib__WEBPACK_IMPORTED_MODULE_0__[\"__decorate\"]([\n    mobx__WEBPACK_IMPORTED_MODULE_5__[\"observable\"]\n], StatisticsPage.prototype, \"appointment\", void 0);\ntslib__WEBPACK_IMPORTED_MODULE_0__[\"__decorate\"]([\n    mobx__WEBPACK_IMPORTED_MODULE_5__[\"observable\"]\n], StatisticsPage.prototype, \"charts\", void 0);\nStatisticsPage = tslib__WEBPACK_IMPORTED_MODULE_0__[\"__decorate\"]([\n    mobx_react__WEBPACK_IMPORTED_MODULE_6__[\"observer\"]\n], StatisticsPage);\n\n\n\n//# sourceURL=webpack:///./src/modules/statistics/components/page.statistics.tsx?");
  
  /***/ })
  
  }]);