\n\t\n}\n\nexport default CardSummaryStage;\n","function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\nimport React from \"react\";\n\nvar _ref2 =\n/*#__PURE__*/\nReact.createElement(\"path\", {\n d: \"M275.372 3.95126C273.029 1.48343 269.816 0.00195312 266.487 0.00195312H67.1461C30.3625 0.00195312 0 30.2436 0 67.0233V443.978C0 480.761 30.3625 511.003 67.1461 511.003H337.703C374.487 511.003 404.849 480.761 404.849 443.978V144.661C404.849 141.452 403.368 138.368 401.27 136.021L275.372 3.95126ZM278.951 43.573L363.255 132.072H308.452C292.159 132.072 278.951 118.988 278.951 102.696V43.573ZM337.703 486.317H67.1461C44.0662 486.317 24.6861 467.186 24.6861 443.978V67.0233C24.6861 43.9434 43.9414 24.6881 67.1461 24.6881H254.265V102.696C254.265 132.688 278.46 156.758 308.452 156.758H380.163V443.978C380.163 467.186 360.908 486.317 337.703 486.317Z\",\n fill: \"#C4C4C4\"\n});\n\nvar _ref3 =\n/*#__PURE__*/\nReact.createElement(\"path\", {\n d: \"M193.414 356.839C195.761 359.307 198.969 360.789 202.424 360.789C205.882 360.789 209.09 359.307 211.433 356.839L283.765 279.202C288.455 274.263 288.084 266.364 283.149 261.799C278.209 257.109 270.31 257.475 265.745 262.415L214.767 317.093V182.31C214.767 175.518 209.211 169.967 202.424 169.967C195.636 169.967 190.081 175.518 190.081 182.31V317.093L139.227 262.415C134.537 257.479 126.759 257.109 121.823 261.799C116.888 266.489 116.517 274.267 121.207 279.202L193.414 356.839Z\",\n fill: \"#C4C4C4\"\n});\n\nvar _ref4 =\n/*#__PURE__*/\nReact.createElement(\"path\", {\n fillRule: \"evenodd\",\n clipRule: \"evenodd\",\n d: \"M88.161 412.307C88.1238 411.876 88.1049 411.44 88.1049 411V384.5C88.1049 377.596 93.7013 372 100.605 372C107.508 372 113.105 377.596 113.105 384.5V401H292.105V384.5C292.105 377.596 297.701 372 304.605 372C311.508 372 317.105 377.596 317.105 384.5V411C317.105 413.82 316.327 416.457 314.974 418.711C313.014 423.003 308.715 426 303.761 426H302.105H292.105H113.105H103.105H100.449C93.661 426 88.1049 420.374 88.1049 413.5C88.1049 413.098 88.1239 412.7 88.161 412.307Z\",\n fill: \"#C4C4C4\"\n});\n\nvar SvgDownload = function SvgDownload(_ref) {\n var svgRef = _ref.svgRef,\n title = _ref.title,\n props = _objectWithoutProperties(_ref, [\"svgRef\", \"title\"]);\n\n return React.createElement(\"svg\", _extends({\n width: 405,\n height: 512,\n viewBox: \"0 0 405 512\",\n fill: \"none\",\n ref: svgRef\n }, props), title ? React.createElement(\"title\", null, title) : null, _ref2, _ref3, _ref4);\n};\n\nvar ForwardRef = React.forwardRef(function (props, ref) {\n return React.createElement(SvgDownload, _extends({\n svgRef: ref\n }, props));\n});\nexport default __webpack_public_path__ + \"static/media/download.f0981e4b.svg\";\nexport { ForwardRef as ReactComponent };","import * as React from 'react';\nimport Notification from 'antd/lib/notification';\nimport { ReactComponent as Icon } from '../Assets/images/download.svg';\nimport './Download.scss';\nimport ServiceReport from '../Services/ServiceReport';\nimport Message from 'antd/lib/message';\n\nexport interface IDownloadProps {\n\tidProducer: string;\n\tidUser: number;\n}\n\nlet isDownload = false;\nconst Download = (props: IDownloadProps) => {\n\tconst onDownload = () => {\n\t\tif (isDownload) {\n\t\t\tNotification.warning({\n\t\t\t\tdescription: \"Existe un descarga en curso\",\n\t\t\t\tmessage: \"Notificación\"\n\t\t\t})\n\t\t\treturn;\n\t\t}\n\t\tconst cancel = Message.loading('Espere unos minutos estamos generando el Excel', 0);\n\t\tconst service = new ServiceReport();\n\t\tisDownload = true;\n\t\tservice\n\t\t\t.downloadExcel(props.idUser, props.idProducer)\n\t\t\t.then( blob => {\n\t\t\t\tif (!blob) {\n\t\t\t\t\tNotification.error({\n\t\t\t\t\t\tdescription: 'Error descargando archivo',\n\t\t\t\t\t\tmessage: 'Archivo Excel'\n\t\t\t\t\t});\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tisDownload = false;\n\t\t\t\tcancel();\n\t\t\t\tvar url = URL.createObjectURL(blob);\n\t\t\t\tvar a = document.createElement('a');\n\t\t\t\ta.href = url;\n\t\t\t\ta.download = \"data.xlsx\";\n\t\t\t\tdocument.body.appendChild(a); // we need to append the element to the dom -> otherwise it will not work in firefox\n\t\t\t\ta.click();\n\t\t\t\ta.remove(); //afterwards we remove the element again\n\t\t\t\tNotification.success({\n\t\t\t\t\tdescription: \"Documento Generado Exitosamente\",\n\t\t\t\t\tmessage: \"Archivo Excel\"\n\t\t\t\t})\n\t\t\t})\n\t\t\t.catch(e => {\n\t\t\t\tisDownload = false;\n\t\t\t\tNotification.error({\n\t\t\t\t\tdescription: e,\n\t\t\t\t\tmessage: \"Archivo Excel\"\n\t\t\t\t})\n\t\t\t})\n\t}\n\treturn (
\n\t\t
\n\t\t\tDescargar Excel\n\t\t
\n\t\t
\n\t\t\t\n\t\t
\n\t
);\n}\n\nexport default Download;\n","import * as React from 'react';\nimport { connect } from 'react-redux';\nimport { IStateApp } from '../../Reducers';\nimport { createActionFetchFaenas } from '../../Actions/Session/Actions';\nimport { ISessionState } from '../../Reducers/Session';\nimport Box from '../../Components/Box';\nimport { Producer, Summary, StageProducer } from '../../Models/Report';\nimport Row from 'antd/lib/row';\nimport Col from 'antd/lib/col';\nimport Skeleton from 'antd/lib/skeleton';\nimport PieChart from '../../Components/PieChart';\nimport Popper from '../../Components/Popper';\nimport PopperTitle from '../../Components/PopperTitle';\nimport './Home.scss';\nimport CardSummaryStage from '../../Components/CardSummaryStage';\nimport Download from '../../Components/Download';\n\nexport interface IHomeProps extends ISessionState {\n\tonFaenas: (id: number) => void;\n\tloadingDashboard: boolean;\n\tproducers: Producer[];\n\tstageProducer: StageProducer[];\n}\n\nclass Home extends React.Component {\n\tcomponentWillMount() {\n\t\tif (this.props.account) {\n\t\t\tconst id = this.props.account.id;\n\t\t\tthis.props.onFaenas(id);\n\t\t}\n\t}\n\n\trender() {\n\t\treturn
\n\t\t\t\t
Tus Faenas Asignadas
\n\t\t\t\t
\n\t\t\t\t\tEmbarcaciones de cobre en Puerto Angamos\n\t\t\t\t
\n}\n\nexport default BarSummary;\n","\nclass EventUtils {\n\tprivate static lastTimeOut: any;\n\tprivate static counter: number = 0;\n\tpublic static debounce(func: () => void, wait: number) {\n\t\tif (this.lastTimeOut) {\n\t\t\tclearTimeout(this.lastTimeOut)\n\t\t}\n\t\tconst handler = () => {\n\t\t\tthis.counter++;\n\t\t\tfunc();\n\t\t}\n\t\tthis.lastTimeOut = setTimeout(handler, wait + 100);\n\t\treturn this.lastTimeOut;\n\t}\n}\n\nexport default EventUtils;\n","function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\nimport React from \"react\";\n\nvar _ref2 =\n/*#__PURE__*/\nReact.createElement(\"g\", null, React.createElement(\"g\", {\n id: \"Layer_1_21_\"\n}, React.createElement(\"path\", {\n d: \"M518.288,545.7l-85.425-155.55c24.225-3.825,42.074-25.5,42.074-49.726v-229.5C474.937,49.725,425.212,0,364.012,0 h-145.35c-61.2,0-112.2,49.725-112.2,112.2v228.225c0,25.5,17.85,45.9,42.075,49.726L64.387,545.7 c-6.375,12.75-2.55,28.05,10.2,34.425c3.825,2.55,7.65,2.55,11.475,2.55c8.925,0,17.85-5.1,21.675-12.75l7.65-12.75h351.9 l7.649,12.75c5.101,8.925,12.75,12.75,21.676,12.75c3.824,0,7.649-1.274,11.475-2.55C520.837,573.75,524.663,558.45,518.288,545.7 z M398.437,430.95h-214.2l21.675-39.525h170.85L398.437,430.95z M394.613,345.525c-20.4,0-36.976-16.575-36.976-36.976 c0-20.4,16.575-36.975,36.976-36.975c20.399,0,36.975,16.575,36.975,36.975C431.587,327.675,415.012,345.525,394.613,345.525z M151.087,126.225c0-39.525,31.875-71.4,70.125-71.4h138.975c38.25,0,71.4,31.875,71.4,71.4v61.2 c0,14.025-11.475,24.225-25.5,24.225h-229.5c-14.025,0-24.225-11.475-24.225-24.225L151.087,126.225L151.087,126.225z M188.062,270.3c20.4,0,36.975,16.575,36.975,36.976c0,20.399-16.575,36.975-36.975,36.975s-36.975-16.575-36.975-36.975 C151.087,286.875,167.663,270.3,188.062,270.3z M135.788,518.925l28.05-49.725h255l28.05,49.725H135.788z\"\n})));\n\nvar _ref3 =\n/*#__PURE__*/\nReact.createElement(\"g\", null);\n\nvar _ref4 =\n/*#__PURE__*/\nReact.createElement(\"g\", null);\n\nvar _ref5 =\n/*#__PURE__*/\nReact.createElement(\"g\", null);\n\nvar _ref6 =\n/*#__PURE__*/\nReact.createElement(\"g\", null);\n\nvar _ref7 =\n/*#__PURE__*/\nReact.createElement(\"g\", null);\n\nvar _ref8 =\n/*#__PURE__*/\nReact.createElement(\"g\", null);\n\nvar _ref9 =\n/*#__PURE__*/\nReact.createElement(\"g\", null);\n\nvar _ref10 =\n/*#__PURE__*/\nReact.createElement(\"g\", null);\n\nvar _ref11 =\n/*#__PURE__*/\nReact.createElement(\"g\", null);\n\nvar _ref12 =\n/*#__PURE__*/\nReact.createElement(\"g\", null);\n\nvar _ref13 =\n/*#__PURE__*/\nReact.createElement(\"g\", null);\n\nvar _ref14 =\n/*#__PURE__*/\nReact.createElement(\"g\", null);\n\nvar _ref15 =\n/*#__PURE__*/\nReact.createElement(\"g\", null);\n\nvar _ref16 =\n/*#__PURE__*/\nReact.createElement(\"g\", null);\n\nvar _ref17 =\n/*#__PURE__*/\nReact.createElement(\"g\", null);\n\nvar SvgTrain = function SvgTrain(_ref) {\n var svgRef = _ref.svgRef,\n title = _ref.title,\n props = _objectWithoutProperties(_ref, [\"svgRef\", \"title\"]);\n\n return React.createElement(\"svg\", _extends({\n id: \"Capa_1\",\n x: \"0px\",\n y: \"0px\",\n width: \"582.675px\",\n height: \"582.675px\",\n viewBox: \"0 0 582.675 582.675\",\n style: {\n enableBackground: \"new 0 0 582.675 582.675\"\n },\n xmlSpace: \"preserve\",\n ref: svgRef\n }, props), title ? React.createElement(\"title\", null, title) : null, _ref2, _ref3, _ref4, _ref5, _ref6, _ref7, _ref8, _ref9, _ref10, _ref11, _ref12, _ref13, _ref14, _ref15, _ref16, _ref17);\n};\n\nvar ForwardRef = React.forwardRef(function (props, ref) {\n return React.createElement(SvgTrain, _extends({\n svgRef: ref\n }, props));\n});\nexport default __webpack_public_path__ + \"static/media/train.f1bdd893.svg\";\nexport { ForwardRef as ReactComponent };","function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\nimport React from \"react\";\n\nvar _ref2 =\n/*#__PURE__*/\nReact.createElement(\"g\", null, React.createElement(\"path\", {\n d: \"M612,327.56v-21.606c0-10.533-4.213-20.628-11.701-28.037L484.107,162.958c-7.384-7.306-17.352-11.403-27.739-11.403 h-58.622v-21.988c0-16.336-13.243-29.58-29.58-29.58H29.58C13.243,99.987,0,113.23,0,129.567V327.56H612z M432.551,190.303 c0-2.563,2.071-4.634,4.635-4.634h21.396c1.184,0,2.366,0.494,3.253,1.282l91.006,86.865c3.057,2.86,0.986,7.987-3.154,7.987 h-112.5c-2.563,0-4.635-2.07-4.635-4.634V190.303z M612,343.903v65.486c0,16.336-13.243,29.578-29.579,29.578h-31.65 c-5.719-39.242-39.539-69.412-80.357-69.412c-40.721,0-74.54,30.17-80.259,69.412h-160.42 c-5.718-39.242-39.538-69.412-80.259-69.412c-40.721,0-74.541,30.17-80.259,69.412H29.58C13.243,438.968,0,425.726,0,409.39 v-65.486H612z M470.456,389.313c-33.883,0-61.351,27.467-61.351,61.35s27.469,61.35,61.351,61.35s61.35-27.467,61.35-61.35 S504.339,389.313,470.456,389.313z M470.456,481.339c-16.941,0-30.675-13.734-30.675-30.676s13.732-30.674,30.675-30.674 c16.941,0,30.676,13.732,30.676,30.674S487.397,481.339,470.456,481.339z M149.464,389.313c-33.883,0-61.35,27.467-61.35,61.35 s27.468,61.35,61.35,61.35s61.35-27.467,61.35-61.35S183.346,389.313,149.464,389.313z M149.464,481.339 c-16.941,0-30.676-13.734-30.676-30.676s13.734-30.674,30.676-30.674c16.941,0,30.675,13.732,30.675,30.674 S166.405,481.339,149.464,481.339z\"\n}));\n\nvar _ref3 =\n/*#__PURE__*/\nReact.createElement(\"g\", null);\n\nvar _ref4 =\n/*#__PURE__*/\nReact.createElement(\"g\", null);\n\nvar _ref5 =\n/*#__PURE__*/\nReact.createElement(\"g\", null);\n\nvar _ref6 =\n/*#__PURE__*/\nReact.createElement(\"g\", null);\n\nvar _ref7 =\n/*#__PURE__*/\nReact.createElement(\"g\", null);\n\nvar _ref8 =\n/*#__PURE__*/\nReact.createElement(\"g\", null);\n\nvar _ref9 =\n/*#__PURE__*/\nReact.createElement(\"g\", null);\n\nvar _ref10 =\n/*#__PURE__*/\nReact.createElement(\"g\", null);\n\nvar _ref11 =\n/*#__PURE__*/\nReact.createElement(\"g\", null);\n\nvar _ref12 =\n/*#__PURE__*/\nReact.createElement(\"g\", null);\n\nvar _ref13 =\n/*#__PURE__*/\nReact.createElement(\"g\", null);\n\nvar _ref14 =\n/*#__PURE__*/\nReact.createElement(\"g\", null);\n\nvar _ref15 =\n/*#__PURE__*/\nReact.createElement(\"g\", null);\n\nvar _ref16 =\n/*#__PURE__*/\nReact.createElement(\"g\", null);\n\nvar _ref17 =\n/*#__PURE__*/\nReact.createElement(\"g\", null);\n\nvar SvgVehicle = function SvgVehicle(_ref) {\n var svgRef = _ref.svgRef,\n title = _ref.title,\n props = _objectWithoutProperties(_ref, [\"svgRef\", \"title\"]);\n\n return React.createElement(\"svg\", _extends({\n id: \"Capa_1\",\n x: \"0px\",\n y: \"0px\",\n width: \"612px\",\n height: \"612px\",\n viewBox: \"0 0 612 612\",\n style: {\n enableBackground: \"new 0 0 612 612\"\n },\n xmlSpace: \"preserve\",\n ref: svgRef\n }, props), title ? React.createElement(\"title\", null, title) : null, _ref2, _ref3, _ref4, _ref5, _ref6, _ref7, _ref8, _ref9, _ref10, _ref11, _ref12, _ref13, _ref14, _ref15, _ref16, _ref17);\n};\n\nvar ForwardRef = React.forwardRef(function (props, ref) {\n return React.createElement(SvgVehicle, _extends({\n svgRef: ref\n }, props));\n});\nexport default __webpack_public_path__ + \"static/media/vehicle.d095e01f.svg\";\nexport { ForwardRef as ReactComponent };","import * as React from 'react';\nimport Icon from 'antd/lib/icon';\nimport './IconSearch.scss';\n\nconst IconSearch = () =>
\n\t\n
\n\nexport default IconSearch;\n","import * as React from 'react';\nimport Card from 'antd/lib/card';\nimport { ICardHistoryItem, ICardData, getScheme } from '../Models/Report';\nimport List from 'antd/lib/list';\nimport Row from 'antd/lib/row';\nimport Col from 'antd/lib/col';\nimport './History.scss';\nimport Search from 'antd/lib/input/Search';\nimport EventUtils from '../Utils/EventUtils';\nimport { EReport } from '../Actions/Report/Actions';\nimport { ReactElement } from 'react';\nimport { ReactComponent as Train } from '../Assets/images/train.svg';\nimport { ReactComponent as Vehicle } from '../Assets/images/vehicle.svg';\nimport IconSearch from './IconSearch';\n\nexport interface IHistoryProps {\n\tdata: ICardData[];\n\treport: string;\n\treportType: EReport;\n\ticon?: ReactElement;\n}\n\nexport interface ICardHistoryItemProps {\n\tdata: ICardHistoryItem;\n\ticon?: any;\n}\n\nexport const CardHistoryItem = (props: ICardHistoryItemProps) => (\n\t
\n\t\t\t} loading={false} data={qualities} titleGraph={`Calidad del cobre total en ${branch ? branch.name : ''}`} titleItem=\"Calidad del cobre según faena\" />\n\t\t
\n\t\t{props.loading && }\n\t\t
\n\t\t\t\n\t\t
\n\t\t
\n\t\t\t\n\t\t
\n\t
\n}\n\nexport default SummaryBranch;\n","import * as React from 'react';\nimport { IStateApp } from '../Reducers';\nimport { connect } from 'react-redux';\nimport { createActionFetchFaenas } from '../Actions/Session/Actions';\nimport FilterReport from '../Components/FilterReport';\nimport Wait from '../Assets/images/wait.svg';\nimport './ReportSummary.scss';\nimport { Producer, Branch, Summary } from '../Models/Report';\nimport { createActionSetProducer, EReport, createActionClearData, createActionSetBranch, createActionRequestAnounced } from '../Actions/Report/Actions';\nimport { IReportState } from '../Reducers/Report';\nimport CardSummary from '../Components/CardSummary';\nimport { getColorQuality } from '../Models/Colors';\nimport { IAccount } from '../Models/Account';\nimport Loading from './Loading';\nimport SummaryBranch from './SummaryBranch';\nimport { capitalize } from '../Utils/StrUtil';\nimport Box from '../Components/Box';\nimport Emply from 'antd/lib/empty';\n\nexport interface IHeaderSummaryProps {\n\tname: string;\n\tmessage: string;\n}\n\nconst HeaderSummary =(props: IHeaderSummaryProps) => (
)\n}\n\n\nexport default ListAccount;\n","import { ActionsAccount } from './Types';\nimport ServiceAccount from '../../Services/ServiceAccount';\nimport { IPageOptions } from '../../Models/Common';\nimport { IAccountForm } from '../../Models/Account';\nimport { Producer } from '../../Models/Report';\nimport { createActionChecking } from '../Session/Actions';\nimport { EStatusRequest } from '../../Reducers/Session';\n\nconst service = new ServiceAccount();\n\nconst actionRequest = {\n\ttype: ActionsAccount.REQUEST_ACCOUNT\n};\n\nexport const createActionFetchAccount = (id: number) => {\n\treturn (dispatch: any) => {\n\t\tdispatch(actionRequest);\n\t\tservice\n\t\t\t.fetch(id)\n\t\t\t.then(async r => {\n\t\t\t\tif (!r.ok) {\n\t\t\t\t\tdispatch({\n\t\t\t\t\t\ttype: ActionsAccount.ERROR_ACCOUNT,\n\t\t\t\t\t\tpayload: await r.json()\n\t\t\t\t\t});\n\t\t\t\t\tdispatch(actionRequest);\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\tconst account = await r.json();\n\t\t\t\tconst branchs = await (await service.getBranch(account.id)).json();\n\t\t\t\tconst first = branchs || branchs.length > 0 ? branchs[0] : undefined;\n\t\t\t\tif (!first || 'Status' in first) {\n\t\t\t\t\taccount.producers = [];\n\t\t\t\t\taccount.producersList = [];\n\t\t\t\t} else {\n\t\t\t\t\taccount.producers = Producer.transform(\n\t\t\t\t\t\tbranchs,\n\t\t\t\t\t\t-1,\n\t\t\t\t\t\t() => {},\n\t\t\t\t\t\tundefined,\n\t\t\t\t\t\tfalse\n\t\t\t\t\t);\n\t\t\t\t\taccount.producersList = branchs;\n\t\t\t\t}\n\t\t\t\tdispatch({\n\t\t\t\t\ttype: ActionsAccount.FETCH_ACCOUNT,\n\t\t\t\t\tpayload: account\n\t\t\t\t});\n\t\t\t\tdispatch(actionRequest);\n\t\t\t})\n\t\t\t.catch(e => {\n\t\t\t\tdispatch(actionRequest);\n\t\t\t\tdispatch({\n\t\t\t\t\ttype: ActionsAccount.ERROR_ACCOUNT,\n\t\t\t\t\tpayload: e.toString()\n\t\t\t\t});\n\t\t\t});\n\t};\n};\n\nexport const createActionfetchAccounts = (\n\toptions: IPageOptions,\n\tidProfile?: number,\n\tsearch?: string,\n\torder?: string\n) => {\n\treturn (dispatch: any) => {\n\t\tdispatch(actionRequest);\n\t\tservice\n\t\t\t.fetchPage(\n\t\t\t\toptions.page,\n\t\t\t\toptions.size,\n\t\t\t\tidProfile,\n\t\t\t\torder,\n\t\t\t\tundefined,\n\t\t\t\tsearch\n\t\t\t)\n\t\t\t.then(async r => {\n\t\t\t\tif (r.status === 403) {\n\t\t\t\t\tdispatch(actionRequest);\n\t\t\t\t\tdispatch(createActionChecking());\n\t\t\t\t} else {\n\t\t\t\t\tconst res = await r.json();\n\t\t\t\t\tif (!r.ok) {\n\t\t\t\t\t\tdispatch({\n\t\t\t\t\t\t\ttype: ActionsAccount.ERROR_ACCOUNT,\n\t\t\t\t\t\t\tpayload: res\n\t\t\t\t\t\t});\n\t\t\t\t\t} else {\n\t\t\t\t\t\tdispatch({\n\t\t\t\t\t\t\ttype: ActionsAccount.FETCH_ACCOUNTS,\n\t\t\t\t\t\t\tpayload: res\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t\tdispatch(actionRequest);\n\t\t\t\t}\n\t\t\t})\n\t\t\t.catch(e => {\n\t\t\t\tdispatch(actionRequest);\n\t\t\t\tdispatch({\n\t\t\t\t\ttype: ActionsAccount.ERROR_ACCOUNT,\n\t\t\t\t\tpayload: e.toString()\n\t\t\t\t});\n\t\t\t});\n\t};\n};\n\nexport const createActionCleanAccount = () => ({\n\ttype: ActionsAccount.CLEAN_CURRENT_ACCOUNT\n});\n\nexport const createActionCleanAccountStatus = () => ({\n\ttype: ActionsAccount.CLEAN_STATUS_ACCOUNT\n});\n\nexport const createActionStatusAccount = (status: EStatusRequest) => ({\n\ttype: ActionsAccount.STATUS_REQUEST_ACCOUNT,\n\tpayload: status\n});\n\nexport const createActionCreateAccount = (data: IAccountForm, id?: number) => {\n\treturn (dispatch: any, state: any) => {\n\t\tdispatch(actionRequest);\n\t\tdispatch(createActionStatusAccount(EStatusRequest.PROCESS));\n\t\tconst fetch = !id ? service.create(data) : service.edit(data, id);\n\t\tfetch\n\t\t\t.then(async r => {\n\t\t\t\tif (r.ok) {\n\t\t\t\t\tconst res = await r.json();\n\t\t\t\t\tdispatch({\n\t\t\t\t\t\ttype: ActionsAccount.CREATE_ACCOUNT,\n\t\t\t\t\t\tpayload: res\n\t\t\t\t\t});\n\t\t\t\t\tdispatch(actionRequest);\n\t\t\t\t\tdispatch(createActionStatusAccount(EStatusRequest.COMPLETE));\n\t\t\t\t\tdispatch(createActionfetchAccounts({ page: 0, size: 5 }));\n\t\t\t\t} else {\n\t\t\t\t\tconst res = await r.json();\n\t\t\t\t\tdispatch(actionRequest);\n\t\t\t\t\tdispatch({\n\t\t\t\t\t\ttype: ActionsAccount.ERROR_ACCOUNT,\n\t\t\t\t\t\tpayload: res\n\t\t\t\t\t});\n\t\t\t\t\tdispatch(createActionStatusAccount(EStatusRequest.FAIL));\n\t\t\t\t}\n\t\t\t})\n\t\t\t.catch(e => {\n\t\t\t\tdispatch(actionRequest);\n\t\t\t\tdispatch({\n\t\t\t\t\ttype: ActionsAccount.ERROR_ACCOUNT,\n\t\t\t\t\tpayload: e.toString()\n\t\t\t\t});\n\t\t\t\tdispatch(createActionStatusAccount(EStatusRequest.FAIL));\n\t\t\t});\n\t};\n};\n\nexport const createActionDelete = (id: number) => {\n\treturn (dispatch: any) => {\n\t\tdispatch(actionRequest);\n\t\tservice\n\t\t\t.delete(id)\n\t\t\t.then(async res => {\n\t\t\t\tif (res.ok) {\n\t\t\t\t\tdispatch({\n\t\t\t\t\t\ttype: ActionsAccount.DELETE_ACCOUNT,\n\t\t\t\t\t\tpayload: id\n\t\t\t\t\t});\n\t\t\t\t\tdispatch(createActionfetchAccounts({ page: 0, size: 5 }));\n\t\t\t\t} else {\n\t\t\t\t\tdispatch({\n\t\t\t\t\t\ttype: ActionsAccount.ERROR_ACCOUNT,\n\t\t\t\t\t\tpayload: 'Error borrando'\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\tdispatch(actionRequest);\n\t\t\t})\n\t\t\t.catch(e => {\n\t\t\t\tdispatch(actionRequest);\n\t\t\t\tdispatch({\n\t\t\t\t\ttype: ActionsAccount.ERROR_ACCOUNT,\n\t\t\t\t\tpayload: e.toString()\n\t\t\t\t});\n\t\t\t\tdispatch({\n\t\t\t\t\ttype: ActionsAccount.STATUS_REQUEST_ACCOUNT,\n\t\t\t\t\tpayload: EStatusRequest.FAIL\n\t\t\t\t});\n\t\t\t});\n\t};\n};\n","import { ActionsProducer } from './Types';\nimport ServiceProducer from '../../Services/ServiceProducer';\nimport { Producer, IFaena } from '../../Models/Report';\n\nconst service = new ServiceProducer();\n\nexport const createActionRequestProducer = () => ({\n\ttype: ActionsProducer.REQUEST_PRODUCER\n})\n\n\nexport const createActionFetchProducer = () => {\n\treturn (dispatch: any) => {\n\t\tdispatch(createActionRequestProducer())\n\t\tservice.fetch()\n\t\t.then(async r => {\n\t\t\tconst res: IFaena[] = await r.json();\n\t\t\tconst producers = Producer.transform(res, -1, undefined as any, undefined, false);\n\t\t\tdispatch({\n\t\t\t\ttype: ActionsProducer.FETCH_PRODUCERS,\n\t\t\t\tpayload: producers\n\t\t\t})\n\t\t\tdispatch(createActionRequestProducer())\n\t\t})\n\t\t.catch( e => {\n\n\t\t})\n\t}\n}\n","import Service from './Service';\n\nexport default class ServiceProducer extends Service {\n\tpublic fetch() {\n\t\treturn this.wrapper.get(`report/producers`);\n\t}\n}\n","import * as React from 'react';\nimport { Switch, Route, withRouter, RouteComponentProps } from 'react-router-dom';\nimport FormAccount from './FormAccount';\nimport ListAccount from './ListAccount';\nimport { connect } from 'react-redux';\nimport { IStateApp } from '../../Reducers/index';\nimport { IPageOptions } from '../../Models/Common';\nimport { createActionCleanAccountStatus, createActionfetchAccounts, createActionFetchAccount, createActionCreateAccount, createActionCleanAccount, createActionDelete, createActionStatusAccount } from '../../Actions/Account/Actions';\nimport { IAccountState } from '../../Reducers/Account/index';\nimport { createActionFetchProducer } from '../../Actions/Producer/Actions';\nimport { Producer } from '../../Models/Report';\nimport { createActionFetchProfiles } from '../../Actions/Profile/Actions';\nimport { IProfile } from '../../Models/Security';\nimport { IAccountForm } from '../../Models/Account';\nimport Loading from '../../Components/Loading';\nimport { EStatusRequest } from '../../Reducers/Session';\n\nexport interface IAccountContainerProps extends IAccountState, RouteComponentProps {\n\tonFetchAccountPage: (option: IPageOptions, idProfile?: number, search?: string, order?: string) => void;\n\tonCreateAccount: (data: IAccountForm, id?: number) => void;\n\tonFetchAccount: (id: number) => void\n\tonFetchProducers: () => void;\n\tonFetchProfiles: () => void;\n\tonCleanCurrent: () => void;\n\tonCleanStatus: () => void;\n\tonDeleteAccount: (id: number) => void;\n\tproducers: Producer[];\n\tprofiles: IProfile[];\n\tsetStatusRequest: (status: EStatusRequest) => void;\n}\n\nclass AccountContainer extends React.Component {\n\tprivate id?: number;\n\tprivate request: boolean = false;\n\n\tcomponentDidMount() {\n\t\tthis.props.onFetchAccountPage({ page: 0, size: 5 })\n\t\tthis.props.onFetchProducers();\n\t\tthis.props.onFetchProfiles();\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t {\n\t\t\t\tthis.id = undefined;\n\t\t\t\treturn ;\n\t\t\t}} />\n\t\t\t {\n\t\t\t\tconst args = props.match.params as any;\n\t\t\t\tif ((!this.props.current || this.props.current.id !== parseInt(args.id, 10)) || this.props.profiles.length === 0) {\n\t\t\t\t\tif (!this.request) {\n\t\t\t\t\t\tthis.request = true;\n\t\t\t\t\t\tthis.props.onFetchAccount(args.id);\n\t\t\t\t\t}\n\t\t\t\t\treturn ;\n\t\t\t\t}\n\t\t\t\tthis.request = false;\n\t\t\t\treturn ;\n\t\t\t}} />\n\t\t\t {\n\t\t\t\t\tthis.request = false;\n\t\t\t\t\tthis.id = undefined;\n\t\t\t\t\treturn }\n\t\t\t\t\t} />\n\t\t)\n\t}\n\n\tprivate onClean() {\n\t\tthis.props.onCleanStatus();\n\t\tthis.props.onCleanCurrent();\n\t}\n\n\tprivate onSave(data: IAccountForm, id?: number) {\n\t\tthis.props.onCreateAccount(data, id);\n\t}\n}\n\nconst mapProps = (state: IStateApp) => ({...state.account, producers: state.producer.producers, profiles: state.profile.page.data });\n\nconst mapActions = (dispatch: any) => ({\n\tonFetchAccountPage: (options: IPageOptions, idProfile?: number, search?: string, order?: string) => dispatch(createActionfetchAccounts(options, idProfile, search, order)),\n\tonFetchAccount: (id: number) => dispatch(createActionFetchAccount(id)),\n\tonFetchProducers: () => dispatch(createActionFetchProducer()),\n\tonFetchProfiles: () => dispatch(createActionFetchProfiles({ page: 0, size: 100 })),\n\tonCreateAccount: (data: IAccountForm, id?: number) => dispatch(createActionCreateAccount(data, id)),\n\tonCleanCurrent: () => dispatch(createActionCleanAccount()),\n\tonCleanStatus: () => dispatch(createActionCleanAccountStatus()),\n\tsetStatusRequest: (status: EStatusRequest) => dispatch(createActionStatusAccount(status)),\n\tonDeleteAccount: (id: number) => dispatch(createActionDelete(id))\n})\n\nexport default connect(mapProps, mapActions)(withRouter(AccountContainer) as any);\n","import React from 'react';\nimport { Provider } from 'react-redux';\nimport Routes from './Containers';\nimport Store from './Store';\nimport Layout from './Components/Layout';\nimport './App.css';\nimport { IRoute } from './Containers';\nimport Home from './Containers/Home';\nimport AnnouncedShipment from './Containers/AnnouncedShipment';\nimport Stacking from './Containers/Stacking';\nimport Consolidate from './Containers/Consolidate';\nimport BreakBulk from './Containers/BreakBulk';\nimport Bath from './Containers/Bath';\nimport Yard from './Containers/Yard';\nimport AccountContainer from './Containers/Account';\n\nconst routes: IRoute[] = [\n\t{\n\t\tname: 'home',\n\t\tpath: '/',\n\t\tcomponent: ,\n\t\texact: true\n\t},\n\t{\n\t\tname: 'announcedshipment',\n\t\tpath: '/carga-anunciada',\n\t\tcomponent: \n\t},\n\t{\n\t\tname: 'stacking',\n\t\tpath: '/stacking',\n\t\tcomponent: \n\t},\n\t{\n\t\tname: 'consolidate',\n\t\tpath: '/consolidado',\n\t\tcomponent: \n\t},\n\t{\n\t\tname: 'breakbulk',\n\t\tpath: '/break-bulk',\n\t\tcomponent: \n\t},\n\t{\n\t\tname: 'cobreloteado',\n\t\tpath: '/cobre-loteado',\n\t\tcomponent: \n\t},\n\t{\n\t\tname: 'cobrealmacenado',\n\t\tpath: '/cobre-almacenado',\n\t\tcomponent: \n\t},\n\t{\n\t\tname: 'var',\n\t\tpath: '/administration',\n\t\tcomponent: \n\t}\n];\n\nconst App: React.FC = () => {\n\treturn (\n\t\t\n\t\t\t\n\t\t\n\t\n\t);\n}\n\nexport default App;\n","// This optional code is used to register a service worker.\n// register() is not called by default.\n\n// This lets the app load faster on subsequent visits in production, and gives\n// it offline capabilities. However, it also means that developers (and users)\n// will only see deployed updates on subsequent visits to a page, after all the\n// existing tabs open on the page have been closed, since previously cached\n// resources are updated in the background.\n\n// To learn more about the benefits of this model and instructions on how to\n// opt-in, read https://bit.ly/CRA-PWA\n\nconst isLocalhost = Boolean(\n window.location.hostname === 'localhost' ||\n // [::1] is the IPv6 localhost address.\n window.location.hostname === '[::1]' ||\n // 127.0.0.1/8 is considered localhost for IPv4.\n window.location.hostname.match(\n /^127(?:\\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/\n )\n);\n\ntype Config = {\n onSuccess?: (registration: ServiceWorkerRegistration) => void;\n onUpdate?: (registration: ServiceWorkerRegistration) => void;\n};\n\nexport function register(config?: Config) {\n if (process.env.NODE_ENV === 'production' && 'serviceWorker' in navigator) {\n // The URL constructor is available in all browsers that support SW.\n const publicUrl = new URL(\n (process as { env: { [key: string]: string } }).env.PUBLIC_URL,\n window.location.href\n );\n if (publicUrl.origin !== window.location.origin) {\n // Our service worker won't work if PUBLIC_URL is on a different origin\n // from what our page is served on. This might happen if a CDN is used to\n // serve Assets; see https://github.com/facebook/create-react-app/issues/2374\n return;\n }\n\n window.addEventListener('load', () => {\n const swUrl = `${process.env.PUBLIC_URL}/service-worker.js`;\n\n if (isLocalhost) {\n // This is running on localhost. Let's check if a service worker still exists or not.\n checkValidServiceWorker(swUrl, config);\n\n // Add some additional logging to localhost, pointing developers to the\n // service worker/PWA documentation.\n navigator.serviceWorker.ready.then(() => {\n console.log(\n 'This web app is being served cache-first by a service ' +\n 'worker. To learn more, visit https://bit.ly/CRA-PWA'\n );\n });\n } else {\n // Is not localhost. Just register service worker\n registerValidSW(swUrl, config);\n }\n });\n }\n}\n\nfunction registerValidSW(swUrl: string, config?: Config) {\n navigator.serviceWorker\n .register(swUrl)\n .then(registration => {\n registration.onupdatefound = () => {\n const installingWorker = registration.installing;\n if (installingWorker == null) {\n return;\n }\n installingWorker.onstatechange = () => {\n if (installingWorker.state === 'installed') {\n if (navigator.serviceWorker.controller) {\n // At this point, the updated precached content has been fetched,\n // but the previous service worker will still serve the older\n // content until all client tabs are closed.\n console.log(\n 'New content is available and will be used when all ' +\n 'tabs for this page are closed. See https://bit.ly/CRA-PWA.'\n );\n\n // Execute callback\n if (config && config.onUpdate) {\n config.onUpdate(registration);\n }\n } else {\n // At this point, everything has been precached.\n // It's the perfect time to display a\n // \"Content is cached for offline use.\" message.\n console.log('Content is cached for offline use.');\n\n // Execute callback\n if (config && config.onSuccess) {\n config.onSuccess(registration);\n }\n }\n }\n };\n };\n })\n .catch(error => {\n console.error('Error during service worker registration:', error);\n });\n}\n\nfunction checkValidServiceWorker(swUrl: string, config?: Config) {\n // Check if the service worker can be found. If it can't reload the page.\n fetch(swUrl)\n .then(response => {\n // Ensure service worker exists, and that we really are getting a JS file.\n const contentType = response.headers.get('content-type');\n if (\n response.status === 404 ||\n (contentType != null && contentType.indexOf('javascript') === -1)\n ) {\n // No service worker found. Probably a different app. Reload the page.\n navigator.serviceWorker.ready.then(registration => {\n registration.unregister().then(() => {\n window.location.reload();\n });\n });\n } else {\n // Service worker found. Proceed as normal.\n registerValidSW(swUrl, config);\n }\n })\n .catch(() => {\n console.log(\n 'No internet connection found. App is running in offline mode.'\n );\n });\n}\n\nexport function unregister() {\n if ('serviceWorker' in navigator) {\n navigator.serviceWorker.ready.then(registration => {\n registration.unregister();\n });\n }\n}\n","import React from 'react';\nimport ReactDOM from 'react-dom';\nimport './index.css';\nimport App from './App';\nimport * as serviceWorker from './serviceWorker';\n\nReactDOM.render(, document.getElementById('root'));\n\n// If you want your app to work offline and load faster, you can change\n// unregister() to register() below. Note this comes with some pitfalls.\n// Learn more about service workers: https://bit.ly/CRA-PWA\nserviceWorker.unregister();\n"],"sourceRoot":""}