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gBAMlB,SAAS0D,IACd,OAAO1D,EAAAA,WAAiB+C,EAC1B,CACA,S,4DCZe,SAASW,IACtB,OAAO1D,EAAAA,WAAiB+C,EAAAA,EAC1B,C,kBCEO,SAASY,EAAShK,GACvB,OAAgB,MAATA,KAAmBiK,MAAMC,QAAQlK,IAA2B,IAAjBA,EAAMoF,OAC1D,CAQO,SAASmD,EAAS4B,GACvB,IAAIC,EAAMC,UAAUjF,OAAS,QAAsByD,IAAjBwB,UAAU,IAAmBA,UAAU,GACzE,OAAOF,IAAQH,EAASG,EAAInK,QAAwB,KAAdmK,EAAInK,OAAgBoK,GAAOJ,EAASG,EAAIG,eAAsC,KAArBH,EAAIG,aACrG,CAOO,SAASpC,EAAeiC,GAC7B,OAAOA,EAAII,cACb,C,4EC1Be,SAASC,EAAcC,GACpC,IAAIC,EAAaD,EAAKC,WAClBC,EAAcF,EAAKG,QAMnBC,GALOJ,EAAKlI,KACCkI,EAAKnK,MAGF+F,EAAAA,YAA4BwC,IAAf6B,GACAI,SAE7BlD,EAAkBvB,EAAAA,SAAesE,GACjCI,EAAanD,EAAgB,GAC7BoD,EAAWpD,EAAgB,GA0B/B,MAAO,CAxBKiD,EAAeH,EAAaK,EAmBX1E,EAAAA,aAAkB,SAAU4E,GAClDJ,GACHG,EAASC,EAEb,GAAG,IAEL,C","sources":["components/train-filter.js","../node_modules/@material-ui/core/esm/FormControl/FormControl.js","../node_modules/@material-ui/core/esm/FormControl/FormControlContext.js","../node_modules/@material-ui/core/esm/FormControl/useFormControl.js","../node_modules/@material-ui/core/esm/InputBase/utils.js","../node_modules/@material-ui/core/esm/utils/useControlled.js"],"sourcesContent":["import {filterTrainList, resetTrainFilter} from '../actions/main';\nimport {DISPLAYNAME, FILTERS} from '../utils/constants';\n\nimport Checkbox from '@material-ui/core/Checkbox';\nimport FormControl from '@material-ui/core/FormControl';\nimport FormControlLabel from '@material-ui/core/FormControlLabel';\nimport Grid from '@material-ui/core/Grid';\nimport Radio from '@material-ui/core/Radio';\nimport RadioGroup from '@material-ui/core/RadioGroup';\nimport {withStyles} from '@material-ui/core/styles';\nimport firebase from 'firebase/app';\nimport React, {Component, Fragment} from 'react';\nimport {connect} from 'react-redux';\nimport 'firebase/analytics';\n\nconst styles = () => ({\n root: {\n border: 'none',\n boxShadow: 'none',\n margin: '4px',\n padding: '2px',\n backgroundColor: '#fafafa',\n },\n expansionPanelSummaryContent: {\n display: 'block',\n margin: '4px 0 !important',\n },\n checkbox: {\n color: '#43a64e',\n '&$checked': {\n color: '#43a64e',\n },\n },\n checkBoxStyle: {\n width: '50px',\n },\n textField: {\n marginTop: 0,\n },\n paperStyle: {\n padding: '16px',\n },\n radio: {\n '&$checked': {\n color: '#43a64e',\n },\n },\n checked: {},\n});\n\nconst filterTime = ['05', '11', '17', '23'];\n\nclass TrainFilter extends Component {\n constructor(props) {\n super(props);\n this.state = {\n toStnList: [],\n fromStnList: [],\n };\n }\n\n handleOnClick = (type, value) => {\n firebase.analytics().logEvent('SearchFilters', {\n type: value,\n });\n\n this.props.filterTrainList({type: type, data: value});\n };\n\n render() {\n const DaysDifference =\n (new Date(\n this.props.match.params.doj.split('-').reverse().join('-')\n ).setHours(0, 0, 0) -\n new Date().setHours(0, 0, 0)) /\n (1000 * 3600 * 24);\n\n const tlr = this.props.trainListingReducer;\n const {classes} = this.props;\n\n const header = (\n <Grid container justifyContent=\"flex-start\" className=\"block\">\n <Grid item xs={6}>\n <div className=\"filter\">FILTERS</div>\n </Grid>\n <Grid\n item\n xs={6}\n onClick={() => {\n this.props.quotaChange('GN');\n this.props.resetTrainFilter();\n }}\n >\n <div className=\"reset\">RESET ALL</div>\n </Grid>\n </Grid>\n );\n\n const quota = (\n <Grid item xs={12} className=\"block\">\n <FormControl>\n <div className=\"block-label\">Quota</div>\n <RadioGroup\n aria-label=\"Quota\"\n name=\"Quota\"\n value={this.props.trainListingReducer.selectedQuota}\n onChange={(e) => this.props.quotaChange(e.target.value)}\n row\n >\n <Grid container justifyContent=\"flex-start\">\n {this.props.quotaList &&\n this.props.quotaList.map((q) => {\n return (\n <Fragment key={q}>\n {!(q === 'TQ' && DaysDifference > 2) && (\n <Grid xs={6} key={q} item>\n <FormControlLabel\n key={q}\n value={q}\n control={\n <Radio\n color=\"primary\"\n classes={{\n root: classes.radio,\n checked: classes.checked,\n }}\n />\n }\n label={\n <div style={{fontSize: '11px'}}>\n {DISPLAYNAME.QUOTA[q]}\n </div>\n }\n />\n </Grid>\n )}\n </Fragment>\n );\n })}\n </Grid>\n </RadioGroup>\n </FormControl>\n </Grid>\n );\n\n const orgStn = (\n <div className=\"block\">\n <div className=\"block-label\">Origin Station</div>\n <div className=\"types\">\n <Grid container justifyContent=\"flex-start\">\n {tlr.orgStnList &&\n tlr.orgStnList.map((s) => (\n <Grid xs={6} key={s} item>\n <FormControlLabel\n control={\n <Checkbox\n color=\"default\"\n checked={\n tlr.filterValues[FILTERS.FILTER_ORIGIN_STN].includes(\n s\n )\n ? true\n : false\n }\n classes={{checked: classes.checkbox}}\n onChange={() =>\n this.handleOnClick(FILTERS.FILTER_ORIGIN_STN, s)\n }\n value={s}\n />\n }\n label={s}\n />\n </Grid>\n ))}\n </Grid>\n </div>\n </div>\n );\n\n const destStn = (\n <div className=\"block\">\n <div className=\"block-label\">Destination Station</div>\n <div className=\"types\">\n <Grid container justifyContent=\"flex-start\">\n {tlr.destStnList &&\n tlr.destStnList.map((s) => (\n <Grid xs={6} key={s} item>\n <FormControlLabel\n key={s}\n classes={{\n label: this.props.classes.checkBoxStyle,\n }}\n control={\n <Checkbox\n color=\"default\"\n checked={\n tlr.filterValues[FILTERS.FILTER_DEST_STN].includes(s)\n ? true\n : false\n }\n classes={{checked: classes.checkbox}}\n onChange={() =>\n this.handleOnClick(FILTERS.FILTER_DEST_STN, s)\n }\n value={s}\n />\n }\n label={s}\n />\n </Grid>\n ))}\n </Grid>\n </div>\n </div>\n );\n\n const filterDepTime = (\n <div className=\"block\">\n <div className=\"block-label\" style={{marginBottom: '11px'}}>\n Departure Time\n </div>\n <div className=\"dep-time\">\n <Grid container justifyContent=\"flex-start\" className=\"types\">\n {filterTime.map((t, i) => {\n return (\n <Grid\n key={t}\n item\n xs={6}\n onClick={() =>\n this.handleOnClick(\n FILTERS.FILTER_DEPART_TIME,\n FILTERS[`TIME${filterTime[i]}_${filterTime[(i + 1) % 4]}`]\n )\n }\n >\n <span\n className={\n tlr.filterValues[FILTERS.FILTER_DEPART_TIME] ===\n FILTERS[`TIME${filterTime[i]}_${filterTime[(i + 1) % 4]}`]\n ? 'active'\n : 'normal'\n }\n >\n {`${filterTime[i]}:00 - ${filterTime[(i + 1) % 4]}:00`}\n </span>\n </Grid>\n );\n })}\n </Grid>\n </div>\n </div>\n );\n\n const filterArrTime = (\n <div className=\"block\">\n <div className=\"block-label\" style={{marginBottom: '11px'}}>\n Arrival Time\n </div>\n <div className=\"dep-time\">\n <Grid container justifyContent=\"center\" className=\"types\">\n {filterTime.map((t, i) => {\n return (\n <Grid\n key={t}\n item\n xs={6}\n onClick={() =>\n this.handleOnClick(\n FILTERS.FILTER_ARRIV_TIME,\n FILTERS[`TIME${filterTime[i]}_${filterTime[(i + 1) % 4]}`]\n )\n }\n >\n <span\n className={\n tlr.filterValues[FILTERS.FILTER_ARRIV_TIME] ===\n FILTERS[`TIME${filterTime[i]}_${filterTime[(i + 1) % 4]}`]\n ? 'active'\n : 'normal'\n }\n >\n {`${filterTime[i]}:00 - ${filterTime[(i + 1) % 4]}:00`}\n </span>\n </Grid>\n );\n })}\n </Grid>\n </div>\n </div>\n );\n\n const display = tlr.trains?.length > 0 && (\n <>\n {quota}\n {orgStn}\n {destStn}\n {filterArrTime}\n {filterDepTime}\n </>\n );\n\n return (\n <div className=\"train-filter\">\n {header}\n {display}\n </div>\n );\n }\n}\n\nconst mapStateToProps = (state) => {\n return {\n trainListingReducer: state.trainListingReducer,\n };\n};\n\nconst mapDispatchToProps = (dispatch) => {\n return {\n filterTrainList: (filter) => {\n dispatch(filterTrainList(filter));\n },\n resetTrainFilter: () => {\n dispatch(resetTrainFilter());\n },\n };\n};\n\nexport default connect(\n mapStateToProps,\n mapDispatchToProps\n)(withStyles(styles)(TrainFilter));\n","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/esm/objectWithoutProperties\";\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport clsx from 'clsx';\nimport { isFilled, isAdornedStart } from '../InputBase/utils';\nimport withStyles from '../styles/withStyles';\nimport capitalize from '../utils/capitalize';\nimport isMuiElement from '../utils/isMuiElement';\nimport FormControlContext from './FormControlContext';\nexport var styles = {\n /* Styles applied to the root element. */\n root: {\n display: 'inline-flex',\n flexDirection: 'column',\n position: 'relative',\n // Reset fieldset default style.\n minWidth: 0,\n padding: 0,\n margin: 0,\n border: 0,\n verticalAlign: 'top' // Fix alignment issue on Safari.\n\n },\n\n /* Styles applied to the root element if `margin=\"normal\"`. */\n marginNormal: {\n marginTop: 16,\n marginBottom: 8\n },\n\n /* Styles applied to the root element if `margin=\"dense\"`. */\n marginDense: {\n marginTop: 8,\n marginBottom: 4\n },\n\n /* Styles applied to the root element if `fullWidth={true}`. */\n fullWidth: {\n width: '100%'\n }\n};\n/**\n * Provides context such as filled/focused/error/required for form inputs.\n * Relying on the context provides high flexibility and ensures that the state always stays\n * consistent across the children of the `FormControl`.\n * This context is used by the following components:\n *\n * - FormLabel\n * - FormHelperText\n * - Input\n * - InputLabel\n *\n * You can find one composition example below and more going to [the demos](/components/text-fields/#components).\n *\n * ```jsx\n * <FormControl>\n * <InputLabel htmlFor=\"my-input\">Email address</InputLabel>\n * <Input id=\"my-input\" aria-describedby=\"my-helper-text\" />\n * <FormHelperText id=\"my-helper-text\">We'll never share your email.</FormHelperText>\n * </FormControl>\n * ```\n *\n * âš ï¸Only one input can be used within a FormControl.\n */\n\nvar FormControl = /*#__PURE__*/React.forwardRef(function FormControl(props, ref) {\n var children = props.children,\n classes = props.classes,\n className = props.className,\n _props$color = props.color,\n color = _props$color === void 0 ? 'primary' : _props$color,\n _props$component = props.component,\n Component = _props$component === void 0 ? 'div' : _props$component,\n _props$disabled = props.disabled,\n disabled = _props$disabled === void 0 ? false : _props$disabled,\n _props$error = props.error,\n error = _props$error === void 0 ? false : _props$error,\n _props$fullWidth = props.fullWidth,\n fullWidth = _props$fullWidth === void 0 ? false : _props$fullWidth,\n visuallyFocused = props.focused,\n _props$hiddenLabel = props.hiddenLabel,\n hiddenLabel = _props$hiddenLabel === void 0 ? false : _props$hiddenLabel,\n _props$margin = props.margin,\n margin = _props$margin === void 0 ? 'none' : _props$margin,\n _props$required = props.required,\n required = _props$required === void 0 ? false : _props$required,\n size = props.size,\n _props$variant = props.variant,\n variant = _props$variant === void 0 ? 'standard' : _props$variant,\n other = _objectWithoutProperties(props, [\"children\", \"classes\", \"className\", \"color\", \"component\", \"disabled\", \"error\", \"fullWidth\", \"focused\", \"hiddenLabel\", \"margin\", \"required\", \"size\", \"variant\"]);\n\n var _React$useState = React.useState(function () {\n // We need to iterate through the children and find the Input in order\n // to fully support server-side rendering.\n var initialAdornedStart = false;\n\n if (children) {\n React.Children.forEach(children, function (child) {\n if (!isMuiElement(child, ['Input', 'Select'])) {\n return;\n }\n\n var input = isMuiElement(child, ['Select']) ? child.props.input : child;\n\n if (input && isAdornedStart(input.props)) {\n initialAdornedStart = true;\n }\n });\n }\n\n return initialAdornedStart;\n }),\n adornedStart = _React$useState[0],\n setAdornedStart = _React$useState[1];\n\n var _React$useState2 = React.useState(function () {\n // We need to iterate through the children and find the Input in order\n // to fully support server-side rendering.\n var initialFilled = false;\n\n if (children) {\n React.Children.forEach(children, function (child) {\n if (!isMuiElement(child, ['Input', 'Select'])) {\n return;\n }\n\n if (isFilled(child.props, true)) {\n initialFilled = true;\n }\n });\n }\n\n return initialFilled;\n }),\n filled = _React$useState2[0],\n setFilled = _React$useState2[1];\n\n var _React$useState3 = React.useState(false),\n _focused = _React$useState3[0],\n setFocused = _React$useState3[1];\n\n var focused = visuallyFocused !== undefined ? visuallyFocused : _focused;\n\n if (disabled && focused) {\n setFocused(false);\n }\n\n var registerEffect;\n\n if (process.env.NODE_ENV !== 'production') {\n // eslint-disable-next-line react-hooks/rules-of-hooks\n var registeredInput = React.useRef(false);\n\n registerEffect = function registerEffect() {\n if (registeredInput.current) {\n console.error(['Material-UI: There are multiple InputBase components inside a FormControl.', 'This is not supported. It might cause infinite rendering loops.', 'Only use one InputBase.'].join('\\n'));\n }\n\n registeredInput.current = true;\n return function () {\n registeredInput.current = false;\n };\n };\n }\n\n var onFilled = React.useCallback(function () {\n setFilled(true);\n }, []);\n var onEmpty = React.useCallback(function () {\n setFilled(false);\n }, []);\n var childContext = {\n adornedStart: adornedStart,\n setAdornedStart: setAdornedStart,\n color: color,\n disabled: disabled,\n error: error,\n filled: filled,\n focused: focused,\n fullWidth: fullWidth,\n hiddenLabel: hiddenLabel,\n margin: (size === 'small' ? 'dense' : undefined) || margin,\n onBlur: function onBlur() {\n setFocused(false);\n },\n onEmpty: onEmpty,\n onFilled: onFilled,\n onFocus: function onFocus() {\n setFocused(true);\n },\n registerEffect: registerEffect,\n required: required,\n variant: variant\n };\n return /*#__PURE__*/React.createElement(FormControlContext.Provider, {\n value: childContext\n }, /*#__PURE__*/React.createElement(Component, _extends({\n className: clsx(classes.root, className, margin !== 'none' && classes[\"margin\".concat(capitalize(margin))], fullWidth && classes.fullWidth),\n ref: ref\n }, other), children));\n});\nprocess.env.NODE_ENV !== \"production\" ? FormControl.propTypes = {\n // ----------------------------- Warning --------------------------------\n // | These PropTypes are generated from the TypeScript type definitions |\n // | To update them edit the d.ts file and run \"yarn proptypes\" |\n // ----------------------------------------------------------------------\n\n /**\n * The contents of the form control.\n */\n children: PropTypes.node,\n\n /**\n * Override or extend the styles applied to the component.\n * See [CSS API](#css) below for more details.\n */\n classes: PropTypes.object,\n\n /**\n * @ignore\n */\n className: PropTypes.string,\n\n /**\n * The color of the component. It supports those theme colors that make sense for this component.\n */\n color: PropTypes.oneOf(['primary', 'secondary']),\n\n /**\n * The component used for the root node.\n * Either a string to use a HTML element or a component.\n */\n component: PropTypes\n /* @typescript-to-proptypes-ignore */\n .elementType,\n\n /**\n * If `true`, the label, input and helper text should be displayed in a disabled state.\n */\n disabled: PropTypes.bool,\n\n /**\n * If `true`, the label should be displayed in an error state.\n */\n error: PropTypes.bool,\n\n /**\n * If `true`, the component will be displayed in focused state.\n */\n focused: PropTypes.bool,\n\n /**\n * If `true`, the component will take up the full width of its container.\n */\n fullWidth: PropTypes.bool,\n\n /**\n * If `true`, the label will be hidden.\n * This is used to increase density for a `FilledInput`.\n * Be sure to add `aria-label` to the `input` element.\n */\n hiddenLabel: PropTypes.bool,\n\n /**\n * If `dense` or `normal`, will adjust vertical spacing of this and contained components.\n */\n margin: PropTypes.oneOf(['dense', 'none', 'normal']),\n\n /**\n * If `true`, the label will indicate that the input is required.\n */\n required: PropTypes.bool,\n\n /**\n * The size of the text field.\n */\n size: PropTypes.oneOf(['medium', 'small']),\n\n /**\n * The variant to use.\n */\n variant: PropTypes.oneOf(['filled', 'outlined', 'standard'])\n} : void 0;\nexport default withStyles(styles, {\n name: 'MuiFormControl'\n})(FormControl);","import * as React from 'react';\n/**\n * @ignore - internal component.\n */\n\nvar FormControlContext = React.createContext();\n\nif (process.env.NODE_ENV !== 'production') {\n FormControlContext.displayName = 'FormControlContext';\n}\n\nexport function useFormControl() {\n return React.useContext(FormControlContext);\n}\nexport default FormControlContext;","import * as React from 'react';\nimport FormControlContext from './FormControlContext';\nexport default function useFormControl() {\n return React.useContext(FormControlContext);\n}","// Supports determination of isControlled().\n// Controlled input accepts its current value as a prop.\n//\n// @see https://facebook.github.io/react/docs/forms.html#controlled-components\n// @param value\n// @returns {boolean} true if string (including '') or number (including zero)\nexport function hasValue(value) {\n return value != null && !(Array.isArray(value) && value.length === 0);\n} // Determine if field is empty or filled.\n// Response determines if label is presented above field or as placeholder.\n//\n// @param obj\n// @param SSR\n// @returns {boolean} False when not present or empty string.\n// True when any number or string with length.\n\nexport function isFilled(obj) {\n var SSR = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n return obj && (hasValue(obj.value) && obj.value !== '' || SSR && hasValue(obj.defaultValue) && obj.defaultValue !== '');\n} // Determine if an Input is adorned on start.\n// It's corresponding to the left with LTR.\n//\n// @param obj\n// @returns {boolean} False when no adornments.\n// True when adorned at the start.\n\nexport function isAdornedStart(obj) {\n return obj.startAdornment;\n}","/* eslint-disable react-hooks/rules-of-hooks, react-hooks/exhaustive-deps */\nimport * as React from 'react';\nexport default function useControlled(_ref) {\n var controlled = _ref.controlled,\n defaultProp = _ref.default,\n name = _ref.name,\n _ref$state = _ref.state,\n state = _ref$state === void 0 ? 'value' : _ref$state;\n\n var _React$useRef = React.useRef(controlled !== undefined),\n isControlled = _React$useRef.current;\n\n var _React$useState = React.useState(defaultProp),\n valueState = _React$useState[0],\n setValue = _React$useState[1];\n\n var value = isControlled ? controlled : valueState;\n\n if (process.env.NODE_ENV !== 'production') {\n React.useEffect(function () {\n if (isControlled !== (controlled !== undefined)) {\n console.error([\"Material-UI: A component is changing the \".concat(isControlled ? '' : 'un', \"controlled \").concat(state, \" state of \").concat(name, \" to be \").concat(isControlled ? 'un' : '', \"controlled.\"), 'Elements should not switch from uncontrolled to controlled (or vice versa).', \"Decide between using a controlled or uncontrolled \".concat(name, \" \") + 'element for the lifetime of the component.', \"The nature of the state is determined during the first render, it's considered controlled if the value is not `undefined`.\", 'More info: https://fb.me/react-controlled-components'].join('\\n'));\n }\n }, [controlled]);\n\n var _React$useRef2 = React.useRef(defaultProp),\n defaultValue = _React$useRef2.current;\n\n React.useEffect(function () {\n if (!isControlled && defaultValue !== defaultProp) {\n console.error([\"Material-UI: A component is changing the default \".concat(state, \" state of an uncontrolled \").concat(name, \" after being initialized. \") + \"To suppress this warning opt to use a controlled \".concat(name, \".\")].join('\\n'));\n }\n }, [JSON.stringify(defaultProp)]);\n }\n\n var setValueIfUncontrolled = React.useCallback(function (newValue) {\n if (!isControlled) {\n setValue(newValue);\n }\n }, []);\n return [value, setValueIfUncontrolled];\n}"],"names":["filterTime","TrainFilter","Component","constructor","props","super","handleOnClick","type","value","firebase","logEvent","this","filterTrainList","data","state","toStnList","fromStnList","render","_tlr$trains","DaysDifference","Date","match","params","doj","split","reverse","join","setHours","tlr","trainListingReducer","classes","header","_jsxs","Grid","container","justifyContent","className","children","_jsx","item","xs","onClick","quotaChange","resetTrainFilter","quota","FormControl","RadioGroup","name","selectedQuota","onChange","e","target","row","quotaList","map","q","Fragment","FormControlLabel","control","Radio","color","root","radio","checked","label","style","fontSize","DISPLAYNAME","QUOTA","orgStn","orgStnList","s","Checkbox","filterValues","FILTERS","FILTER_ORIGIN_STN","includes","checkbox","destStn","destStnList","checkBoxStyle","FILTER_DEST_STN","filterDepTime","marginBottom","t","i","FILTER_DEPART_TIME","concat","filterArrTime","FILTER_ARRIV_TIME","display","trains","length","_Fragment","connect","dispatch","filter","withStyles","styles","border","boxShadow","margin","padding","backgroundColor","expansionPanelSummaryContent","width","textField","marginTop","paperStyle","React","ref","_props$color","_props$component","component","_props$disabled","disabled","_props$error","error","_props$fullWidth","fullWidth","visuallyFocused","focused","_props$hiddenLabel","hiddenLabel","_props$margin","_props$required","required","size","_props$variant","variant","other","_objectWithoutProperties","_React$useState","initialAdornedStart","forEach","child","isMuiElement","input","isAdornedStart","adornedStart","setAdornedStart","_React$useState2","initialFilled","isFilled","filled","setFilled","_React$useState3","_focused","setFocused","undefined","onFilled","childContext","onBlur","onEmpty","onFocus","registerEffect","FormControlContext","Provider","_extends","clsx","capitalize","flexDirection","position","minWidth","verticalAlign","marginNormal","marginDense","useFormControl","hasValue","Array","isArray","obj","SSR","arguments","defaultValue","startAdornment","useControlled","_ref","controlled","defaultProp","default","isControlled","current","valueState","setValue","newValue"],"sourceRoot":""}