webpackHotUpdate("index",{

/***/ "./src/backendService/polling.js":
/*!***************************************!*\
  !*** ./src/backendService/polling.js ***!
  \***************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* WEBPACK VAR INJECTION */(function(__react_refresh_utils__) {/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ "./node_modules/@babel/runtime/helpers/asyncToGenerator.js");
/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/regenerator */ "./node_modules/@babel/runtime/regenerator/index.js");
/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _tencent_tm_native_module__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @tencent/tm-native-module */ "./node_modules/@tencent/tm-native-module/src/index.js");
/* harmony import */ var _common_libs_PollingFactory__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../common/libs/PollingFactory */ "./src/common/libs/PollingFactory.js");
/* harmony import */ var _order_models_config__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../order/models/config */ "./src/order/models/config/index.js");
/* harmony import */ var _order_models_code__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../order/models/code */ "./src/order/models/code/index.js");
/* harmony import */ var _httpApi__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./httpApi */ "./src/backendService/httpApi.js");
/* harmony import */ var _common_libs_Log__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../common/libs/Log */ "./src/common/libs/Log.js");
/* harmony import */ var _dataCenter__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./dataCenter */ "./src/backendService/dataCenter.js");
/* harmony import */ var _common_libs_pushedMessageService__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../common/libs/pushedMessageService */ "./src/common/libs/pushedMessageService.js");
/* harmony import */ var _const__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./const */ "./src/backendService/const.js");
__webpack_require__.$Refresh$.runtime = __webpack_require__(/*! ./node_modules/react-refresh/runtime.js */ "./node_modules/react-refresh/runtime.js");



 // import { PollingFactory } from '@tencent/tm-util';








 // \u8ba2\u5355\u72b6\u6001\u7801

var SCHEDULING = _order_models_code__WEBPACK_IMPORTED_MODULE_5__["ORDER_STATUS"].SCHEDULING,
    DRIVER_MODIFY = _order_models_code__WEBPACK_IMPORTED_MODULE_5__["ORDER_STATUS"].DRIVER_MODIFY,
    DRIVER_ACCEPT = _order_models_code__WEBPACK_IMPORTED_MODULE_5__["ORDER_STATUS"].DRIVER_ACCEPT,
    DRIVER_ARRIVE = _order_models_code__WEBPACK_IMPORTED_MODULE_5__["ORDER_STATUS"].DRIVER_ARRIVE,
    TRIP_START = _order_models_code__WEBPACK_IMPORTED_MODULE_5__["ORDER_STATUS"].TRIP_START,
    TO_PAID = _order_models_code__WEBPACK_IMPORTED_MODULE_5__["ORDER_STATUS"].TO_PAID,
    ALREADY_PAID = _order_models_code__WEBPACK_IMPORTED_MODULE_5__["ORDER_STATUS"].ALREADY_PAID,
    PASSENGER_CANCEL = _order_models_code__WEBPACK_IMPORTED_MODULE_5__["ORDER_STATUS"].PASSENGER_CANCEL,
    DRIVER_CANCEL = _order_models_code__WEBPACK_IMPORTED_MODULE_5__["ORDER_STATUS"].DRIVER_CANCEL,
    SERVICE_CANCEL = _order_models_code__WEBPACK_IMPORTED_MODULE_5__["ORDER_STATUS"].SERVICE_CANCEL; // \u7ed3\u675f\u72b6\u6001\u91cd\u590d\u6b21\u6570

var finishCount = {
  [ALREADY_PAID]: 0,
  [PASSENGER_CANCEL]: 0,
  [DRIVER_CANCEL]: 0,
  [SERVICE_CANCEL]: 0
};
var tipsMap = {
  [SCHEDULING]: {
    textType: 'waitingForAnswer',
    appName: 'OrderDetail'
  },
  [DRIVER_MODIFY]: {
    textType: 'waitingForAnswer',
    appName: 'OrderDetail'
  },
  [DRIVER_ACCEPT]: {
    textType: 'waitingForDriver',
    appName: 'OrderDetail'
  },
  [DRIVER_ARRIVE]: {
    textType: 'waitingOnBoard',
    appName: 'OrderDetail'
  },
  [TRIP_START]: {
    textType: 'duringTrip',
    appName: 'OrderDetail'
  },
  [TO_PAID]: {
    textType: 'toBePaid',
    appName: 'OrderDetail'
  }
};
var preOrderStatus = 0; // \u65e7\u7684\u8ba2\u5355\u72b6\u6001

var lastOrderStatusUpdateTimeMap = {};
/* harmony default export */ __webpack_exports__["default"] = ({
  /**
   * \u5f00\u59cb\u8f6e\u8be2\u8ba2\u5355
   */
  startPollingOrderStatus(params) {
    var _this = this;

    return _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.mark(function _callee3() {
      var orderId, pollingDuration, _params$pollingBackup, pollingBackupDuration, requestOrderId, duration, aliveMessagePolling, httpPolling;

      return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee3$(_context3) {
        while (1) {
          switch (_context3.prev = _context3.next) {
            case 0:
              orderId = params.orderId, pollingDuration = params.pollingDuration, _params$pollingBackup = params.pollingBackupDuration, pollingBackupDuration = _params$pollingBackup === void 0 ? 30000 : _params$pollingBackup;
              requestOrderId = orderId;
              duration = 2000;

              if (pollingDuration && pollingDuration > 0) {
                duration = pollingDuration;
              }

              _common_libs_Log__WEBPACK_IMPORTED_MODULE_7__["default"].info('startPollingOrderStatus', params);

              aliveMessagePolling = /*#__PURE__*/function () {
                var _ref = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.mark(function _callee() {
                  var config;
                  return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee$(_context) {
                    while (1) {
                      switch (_context.prev = _context.next) {
                        case 0:
                          _context.next = 2;
                          return _common_libs_pushedMessageService__WEBPACK_IMPORTED_MODULE_9__["default"].init();

                        case 2:
                          _common_libs_Log__WEBPACK_IMPORTED_MODULE_7__["default"].log('pushedMessageService.init(); success');
                          _context.next = 5;
                          return _order_models_config__WEBPACK_IMPORTED_MODULE_4__["default"].get();

                        case 5:
                          config = _context.sent;

                          if (config.showBackendPollingToast) {
                            _tencent_tm_native_module__WEBPACK_IMPORTED_MODULE_2__["TMToastModule"].showTips("\u957F\u8FDE\u63A5\uFF0C\u5DF2\u542F\u52A8".concat(orderId));
                          }

                          _common_libs_Log__WEBPACK_IMPORTED_MODULE_7__["default"].info("\u957F\u8FDE\u63A5\uFF0C\u5DF2\u542F\u52A8".concat(orderId));
                          _common_libs_pushedMessageService__WEBPACK_IMPORTED_MODULE_9__["default"].addListener('taxi', _const__WEBPACK_IMPORTED_MODULE_10__["PUSHED_MESSAGE_CONTENT_TYPE"].ORDER_STATUS, function (_ref2) {
                            var orderStatusInfo = _ref2.orderStatusInfo;
                            var orderId = orderStatusInfo.orderId,
                                orderStatus = orderStatusInfo.orderStatus,
                                statusUpdateTime = orderStatusInfo.statusUpdateTime;

                            if (requestOrderId !== orderId) {
                              _common_libs_Log__WEBPACK_IMPORTED_MODULE_7__["default"].info('pushedMessageService callback', 'requestOrderId !== orderId');
                              return;
                            }

                            _this.onReceiveOrderStatus(orderId, orderStatus, statusUpdateTime, params);
                          });

                          _this._getOrderStatus(params);

                        case 10:
                        case "end":
                          return _context.stop();
                      }
                    }
                  }, _callee);
                }));

                return function aliveMessagePolling() {
                  return _ref.apply(this, arguments);
                };
              }();

              httpPolling = /*#__PURE__*/function () {
                var _ref3 = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.mark(function _callee2(pollDuration) {
                  var config;
                  return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee2$(_context2) {
                    while (1) {
                      switch (_context2.prev = _context2.next) {
                        case 0:
                          _context2.next = 2;
                          return _order_models_config__WEBPACK_IMPORTED_MODULE_4__["default"].get();

                        case 2:
                          config = _context2.sent;

                          if (config.showBackendPollingToast) {
                            _tencent_tm_native_module__WEBPACK_IMPORTED_MODULE_2__["TMToastModule"].showTips("\u65E7\u8F6E\u8BE2\uFF0C\u5DF2\u542F\u52A8".concat(orderId));
                          }

                          _common_libs_Log__WEBPACK_IMPORTED_MODULE_7__["default"].info("\u65E7\u8F6E\u8BE2\uFF0C\u5DF2\u542F\u52A8".concat(orderId)); // \u521b\u5efa\u8ba2\u5355\u8f6e\u8be2\u5668

                          _this.orderStatusPoller = new _common_libs_PollingFactory__WEBPACK_IMPORTED_MODULE_3__["default"]({
                            duration: pollDuration ? pollDuration : duration,
                            description: 'taxi backend service',
                            stopMoment: function stopMoment() {
                              // \u7ed3\u675f\u72b6\u6001\u91cd\u590d\u4e09\u6b21\uff0c\u505c\u6b62\u8f6e\u8be2
                              if (finishCount[ALREADY_PAID] === 3 || finishCount[PASSENGER_CANCEL] === 3 || finishCount[DRIVER_CANCEL] === 3 || finishCount[SERVICE_CANCEL] === 3) {
                                _this.dispatchMsg('orderStatusPollingFinished');

                                _this.reset({
                                  resetOrderStatus: true
                                });

                                return true;
                              }

                              return false;
                            }
                          });

                          _this.orderStatusPoller.setRunner(_this._getOrderStatus.bind(_this, params));

                          _this.orderStatusPoller.start();

                        case 8:
                        case "end":
                          return _context2.stop();
                      }
                    }
                  }, _callee2);
                }));

                return function httpPolling(_x) {
                  return _ref3.apply(this, arguments);
                };
              }();

              if (!(params && params.pollingMode === 'http')) {
                _context3.next = 12;
                break;
              }

              _context3.next = 10;
              return httpPolling();

            case 10:
              _context3.next = 37;
              break;

            case 12:
              if (!(params && params.pollingMode === 'alive')) {
                _context3.next = 24;
                break;
              }

              _context3.prev = 13;
              _context3.next = 16;
              return aliveMessagePolling();

            case 16:
              _context3.next = 22;
              break;

            case 18:
              _context3.prev = 18;
              _context3.t0 = _context3["catch"](13);
              _common_libs_Log__WEBPACK_IMPORTED_MODULE_7__["default"].log('pushedMessageService.init(); error');
              _common_libs_Log__WEBPACK_IMPORTED_MODULE_7__["default"].error(_context3.t0);

            case 22:
              _context3.next = 37;
              break;

            case 24:
              _context3.prev = 24;
              _context3.next = 27;
              return aliveMessagePolling();

            case 27:
              _context3.next = 29;
              return httpPolling(pollingBackupDuration);

            case 29:
              _context3.next = 37;
              break;

            case 31:
              _context3.prev = 31;
              _context3.t1 = _context3["catch"](24);
              _common_libs_Log__WEBPACK_IMPORTED_MODULE_7__["default"].log('pushedMessageService.init(); error, try old way');
              _common_libs_Log__WEBPACK_IMPORTED_MODULE_7__["default"].error(_context3.t1);
              _context3.next = 37;
              return httpPolling();

            case 37:
            case "end":
              return _context3.stop();
          }
        }
      }, _callee3, null, [[13, 18], [24, 31]]);
    }))();
  },

  /**
   * \u91cd\u7f6e\u8f6e\u8be2\u76f8\u5173\u6570\u636e
   */
  reset() {
    var _ref4 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
        _ref4$resetOrderStatu = _ref4.resetOrderStatus,
        resetOrderStatus = _ref4$resetOrderStatu === void 0 ? true : _ref4$resetOrderStatu;

    if (resetOrderStatus) {
      preOrderStatus = 0;
    }

    for (var key in finishCount) {
      finishCount[key] = 0;
    }

    _common_libs_pushedMessageService__WEBPACK_IMPORTED_MODULE_9__["default"].removeListener('taxi', _const__WEBPACK_IMPORTED_MODULE_10__["PUSHED_MESSAGE_CONTENT_TYPE"].ORDER_STATUS);
  },

  /**
   * \u4e3b\u52a8\u505c\u6b62\u8f6e\u8be2
   */
  stopPollingByEvent(_ref5) {
    var _ref5$resetOrderStatu = _ref5.resetOrderStatus,
        resetOrderStatus = _ref5$resetOrderStatu === void 0 ? false : _ref5$resetOrderStatu;
    this.orderStatusPoller && this.orderStatusPoller.stop();
    this.reset({
      resetOrderStatus
    });
  },

  orderStatusUpdateCheck(orderId, orderStatus, statusUpdateTime) {
    var lastTime = lastOrderStatusUpdateTimeMap[orderId];

    if (lastTime && lastTime.statusUpdateTime > statusUpdateTime) {
      _common_libs_Log__WEBPACK_IMPORTED_MODULE_7__["default"].info('lastOrderStatusUpdateTimeMap[orderId]', lastOrderStatusUpdateTimeMap[orderId]);
      return false;
    }

    lastOrderStatusUpdateTimeMap[orderId] = {
      orderStatus,
      statusUpdateTime
    };
    return true;
  },

  onReceiveOrderStatus(orderId, orderStatus, statusUpdateTime, params) {
    var _this2 = this;

    return _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.mark(function _callee4() {
      var tipsText, userIdBeforeHttp, orderTipText, appName, actionUrl, userInfo, _ref6, _ref6$userId, userId;

      return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee4$(_context4) {
        while (1) {
          switch (_context4.prev = _context4.next) {
            case 0:
              _common_libs_Log__WEBPACK_IMPORTED_MODULE_7__["default"].info('backend onReceiveOrderStatus', orderId, orderStatus, statusUpdateTime, {
                fileName: 'polling',
                functionName: '_getOrderStatus'
              });
              tipsText = params.tipsText, userIdBeforeHttp = params.currentUserId;

              if (orderStatus) {
                _context4.next = 4;
                break;
              }

              return _context4.abrupt("return");

            case 4:
              if (_this2.orderStatusUpdateCheck(orderId, orderStatus, statusUpdateTime)) {
                _context4.next = 7;
                break;
              }

              _common_libs_Log__WEBPACK_IMPORTED_MODULE_7__["default"].info('status or statusUpdateTime invalid', orderId, orderStatus, statusUpdateTime);
              return _context4.abrupt("return");

            case 7:
              // \u8ba2\u5355\u72b6\u6001\u662f\u7ed3\u675f\u72b6\u6001\uff0c\u5373\u5df2\u652f\u4ed8/\u4e58\u5ba2\u53d6\u6d88-\u4e58\u5ba2\u53d6\u6d88\u8ba2\u5355/\u53f8\u673a\u53d6\u6d88-\u53f8\u673a\u53d6\u6d88\u8ba2\u5355\u4e14\u2f46\u6539\u6d3e/\u7cfb\u7edf(\u5ba2\u670d)\u53d6\u6d88-\u670d\u52a1\u5546\u6216\u5ba2\u670d\u53d6\u6d88\u8ba2\u5355
              if ([ALREADY_PAID, PASSENGER_CANCEL, DRIVER_CANCEL, SERVICE_CANCEL].includes(orderStatus)) {
                finishCount[orderStatus]++;
              }

              orderTipText = '';
              appName = '';
              actionUrl = '';

              if (tipsMap[orderStatus]) {
                orderTipText = tipsText[tipsMap[orderStatus].textType].text; // const orderTipIcon = tipsText[tipsMap[orderStatus].textType].icon;

                appName = tipsMap[orderStatus].appName;
                actionUrl = "qqmap://map/mippy?moduleName=taxi&from=TencentMapHomeBanner&appName=".concat(appName, "&orderId=").concat(orderId, "&orderStatus=").concat(orderStatus, "&animationType=right&disableGestureBack=true&keepui=1");
              }

              _common_libs_Log__WEBPACK_IMPORTED_MODULE_7__["default"].log('polling orderTipText', orderTipText, {
                fileName: 'polling',
                functionName: '_getOrderStatus'
              });
              _common_libs_Log__WEBPACK_IMPORTED_MODULE_7__["default"].log('polling actionUrl', actionUrl, {
                fileName: 'polling',
                functionName: '_getOrderStatus'
              }); // \u8ba2\u5355\u72b6\u6001\u53d1\u751f\u53d8\u5316

              if (!(preOrderStatus !== orderStatus)) {
                _context4.next = 27;
                break;
              }

              _context4.next = 17;
              return _dataCenter__WEBPACK_IMPORTED_MODULE_8__["default"].get('userInfo');

            case 17:
              userInfo = _context4.sent;
              _ref6 = userInfo || {}, _ref6$userId = _ref6.userId, userId = _ref6$userId === void 0 ? '' : _ref6$userId;
              _tencent_tm_native_module__WEBPACK_IMPORTED_MODULE_2__["TMReportModule"].report('taxi_backend_service_polling_userid_before_and after_http', {
                data: "currentUserId: ".concat(userId, ", httpUserId: ").concat(userIdBeforeHttp)
              });
              _common_libs_Log__WEBPACK_IMPORTED_MODULE_7__["default"].info('[currentUserId and httpUserId]: ', "currentUserId: ".concat(userId, ", httpUserId: ").concat(userIdBeforeHttp), {
                fileName: 'TaxiBackendService',
                functionName: '_getOrderStatus'
              }); // \u672a\u767b\u5f55\u6216\u8005\u767b\u5f55\u7684\u8d26\u53f7\u4e0e\u4e0a\u4e00\u6b21\u53d1\u9001http\u8bf7\u6c42\u7684\u8d26\u53f7\u4e0d\u540c\uff0c\u5219\u4e0d\u4f5c\u5904\u7406\u3002

              if (!(!userId || userId !== userIdBeforeHttp)) {
                _context4.next = 23;
                break;
              }

              return _context4.abrupt("return");

            case 23:
              _tencent_tm_native_module__WEBPACK_IMPORTED_MODULE_2__["TMReportModule"].report('taxi_backend_service_polling_status_changed', {
                data: "".concat(orderId, ": ").concat(preOrderStatus, "=>").concat(orderStatus)
              });
              _common_libs_Log__WEBPACK_IMPORTED_MODULE_7__["default"].info('polling OrderStatus changed', "".concat(orderId, ": ").concat(preOrderStatus, "=>").concat(orderStatus), {
                fileName: 'polling',
                functionName: '_getOrderStatus'
              });

              if ([ALREADY_PAID, PASSENGER_CANCEL, DRIVER_CANCEL, SERVICE_CANCEL].includes(orderStatus)) {
                _this2.dispatchMsg('orderStatusDidUpdate', {
                  status: 'taxiFinished',
                  msg: orderTipText,
                  actionUrl,
                  orderStatus,
                  orderId,
                  statusUpdateTime
                });
              } else {
                _this2.dispatchMsg('orderStatusDidUpdate', {
                  status: 'taxiPolling',
                  msg: orderTipText,
                  actionUrl,
                  orderStatus,
                  orderId,
                  statusUpdateTime
                });
              }

              preOrderStatus = orderStatus;

            case 27:
            case "end":
              return _context4.stop();
          }
        }
      }, _callee4);
    }))();
  },

  /**
   * \u67e5\u8be2\u8ba2\u5355\u72b6\u6001, \u5e76\u53d1\u9001\u5e7f\u64ad
   */
  _getOrderStatus() {
    var _arguments = arguments,
        _this3 = this;

    return _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.mark(function _callee5() {
      var params, orderId, res, _res$data, _orderId, orderStatus, statusUpdateTime;

      return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee5$(_context5) {
        while (1) {
          switch (_context5.prev = _context5.next) {
            case 0:
              params = _arguments.length > 0 && _arguments[0] !== undefined ? _arguments[0] : {};
              orderId = params.orderId;
              _context5.prev = 2;
              _common_libs_Log__WEBPACK_IMPORTED_MODULE_7__["default"].info('polling orderId', orderId, {
                fileName: 'polling',
                functionName: '_getOrderStatus'
              }); // \u67e5\u8be2\u8ba2\u5355\u72b6\u6001

              _context5.next = 6;
              return _httpApi__WEBPACK_IMPORTED_MODULE_6__["default"].repeatRequestWrapper(_httpApi__WEBPACK_IMPORTED_MODULE_6__["default"].getOrderStatus, {
                orderId
              });

            case 6:
              res = _context5.sent;

              if (!(res && res.code === 0)) {
                _context5.next = 15;
                break;
              }

              _res$data = res.data;
              _res$data = _res$data === void 0 ? {} : _res$data;
              _orderId = _res$data.orderId, orderStatus = _res$data.orderStatus, statusUpdateTime = _res$data.statusUpdateTime;
              _context5.next = 13;
              return _this3.onReceiveOrderStatus(_orderId, orderStatus, statusUpdateTime, params);

            case 13:
              _context5.next = 18;
              break;

            case 15:
              _tencent_tm_native_module__WEBPACK_IMPORTED_MODULE_2__["TMReportModule"].report('taxi_backend_service_polling_status_ajax_error', {
                res: JSON.stringify(res)
              });
              _common_libs_Log__WEBPACK_IMPORTED_MODULE_7__["default"].error('Ajax Error', res, {
                fileName: 'polling',
                functionName: '_getOrderStatus'
              });
              throw "[Ajax Error]".concat(JSON.stringify(res));

            case 18:
              _context5.next = 24;
              break;

            case 20:
              _context5.prev = 20;
              _context5.t0 = _context5["catch"](2);
              _tencent_tm_native_module__WEBPACK_IMPORTED_MODULE_2__["TMReportModule"].report('taxi_backend_service_polling_status_error', {
                error: JSON.stringify(_context5.t0)
              });
              _common_libs_Log__WEBPACK_IMPORTED_MODULE_7__["default"].error('polling getOrderStatus error', _context5.t0, {
                fileName: 'polling',
                functionName: '_getOrderStatus'
              });

            case 24:
            case "end":
              return _context5.stop();
          }
        }
      }, _callee5, null, [[2, 20]]);
    }))();
  },

  dispatchMsg() {
    var _arguments2 = arguments;
    return _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.mark(function _callee6() {
      var eventName, options, config, res;
      return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee6$(_context6) {
        while (1) {
          switch (_context6.prev = _context6.next) {
            case 0:
              eventName = _arguments2.length > 0 && _arguments2[0] !== undefined ? _arguments2[0] : '';
              options = _arguments2.length > 1 && _arguments2[1] !== undefined ? _arguments2[1] : {};
              _context6.next = 4;
              return _order_models_config__WEBPACK_IMPORTED_MODULE_4__["default"].get();

            case 4:
              config = _context6.sent;
              _context6.prev = 5;
              _context6.next = 8;
              return _tencent_tm_native_module__WEBPACK_IMPORTED_MODULE_2__["TMCrossDispatcherModule"].emit(eventName, options);

            case 8:
              res = _context6.sent;

              if (res && res.code === 0) {
                _common_libs_Log__WEBPACK_IMPORTED_MODULE_7__["default"].log('polling status dispatch', res, {
                  fileName: 'polling',
                  functionName: 'dispatchMsg'
                });

                if (config.showBackendPollingToast) {// TMToastModule.showTips(`\u4e8b\u4ef6\u5206\u53d1\u6210\u529f: ${eventName} ${options.orderStatus ? options.orderStatus : ''}`);
                }
              } else {
                _tencent_tm_native_module__WEBPACK_IMPORTED_MODULE_2__["TMReportModule"].report('taxi_backend_service_status_dispatch_error', {
                  res: JSON.stringify(res)
                });
                _common_libs_Log__WEBPACK_IMPORTED_MODULE_7__["default"].error('polling status dispatch error', res, {
                  fileName: 'polling',
                  functionName: 'dispatchMsg'
                });

                if (config.showBackendPollingToast) {// TMToastModule.showTips('\u4e8b\u4ef6\u5206\u53d1\u5931\u8d25');
                }
              }

              _context6.next = 17;
              break;

            case 12:
              _context6.prev = 12;
              _context6.t0 = _context6["catch"](5);
              _tencent_tm_native_module__WEBPACK_IMPORTED_MODULE_2__["TMReportModule"].report('taxi_backend_service_status_dispatch_error', {
                error: JSON.stringify(_context6.t0)
              });
              _common_libs_Log__WEBPACK_IMPORTED_MODULE_7__["default"].log('polling status dispatch catch error', _context6.t0, {
                fileName: 'polling',
                functionName: 'dispatchMsg'
              });

              if (config.showBackendPollingToast) {// TMToastModule.showTips(`\u4e8b\u4ef6\u5206\u53d1\u5931\u8d25error: ${JSON.stringify(error)}`);
              }

            case 17:
            case "end":
              return _context6.stop();
          }
        }
      }, _callee6, null, [[5, 12]]);
    }))();
  }

});

var $ReactRefreshModuleId$ = __webpack_require__.$Refresh$.moduleId;
var $ReactRefreshCurrentExports$ = __react_refresh_utils__.getModuleExports(
	$ReactRefreshModuleId$
);

function $ReactRefreshModuleRuntime$(exports) {
	if (true) {
		var errorOverlay;
		if (true) {
			errorOverlay = false;
		}
		var testMode;
		if (typeof __react_refresh_test__ !== 'undefined') {
			testMode = __react_refresh_test__;
		}
		return __react_refresh_utils__.executeRuntime(
			exports,
			$ReactRefreshModuleId$,
			module.hot,
			errorOverlay,
			testMode
		);
	}
}

if (typeof Promise !== 'undefined' && $ReactRefreshCurrentExports$ instanceof Promise) {
	$ReactRefreshCurrentExports$.then($ReactRefreshModuleRuntime$);
} else {
	$ReactRefreshModuleRuntime$($ReactRefreshCurrentExports$);
}
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@hippy/hippy-react-refresh-webpack-plugin/lib/runtime/RefreshUtils.js */ "./node_modules/@hippy/hippy-react-refresh-webpack-plugin/lib/runtime/RefreshUtils.js")))

/***/ })

})
//# sourceMappingURL=index.73ecd93d68389eac48c6.hot-update.js.map