text: 'use strict';
  
  function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
  
  var ReactReconciler = _interopDefault(require('react-reconciler'));
  var scheduler = require('scheduler');
  var React = require('react');
  
  function _typeof(obj) {
    "@babel/helpers - typeof";
  
    if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
      _typeof = function (obj) {
        return typeof obj;
      };
    } else {
      _typeof = function (obj) {
        return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
      };
    }
  
    return _typeof(obj);
  }
  
  function _classCallCheck(instance, Constructor) {
    if (!(instance instanceof Constructor)) {
      throw new TypeError("Cannot call a class as a function");
    }
  }
  
  function _defineProperties(target, props) {
    for (var i = 0; i < props.length; i++) {
      var descriptor = props[i];
      descriptor.enumerable = descriptor.enumerable || false;
      descriptor.configurable = true;
      if ("value" in descriptor) descriptor.writable = true;
      Object.defineProperty(target, descriptor.key, descriptor);
    }
  }
  
  function _createClass(Constructor, protoProps, staticProps) {
    if (protoProps) _defineProperties(Constructor.prototype, protoProps);
    if (staticProps) _defineProperties(Constructor, staticProps);
    return Constructor;
  }
  
  function _inherits(subClass, superClass) {
    if (typeof superClass !== "function" && superClass !== null) {
      throw new TypeError("Super expression must either be null or a function");
    }
  
    subClass.prototype = Object.create(superClass && superClass.prototype, {
      constructor: {
        value: subClass,
        writable: true,
        configurable: true
      }
    });
    if (superClass) _setPrototypeOf(subClass, superClass);
  }
  
  function _getPrototypeOf(o) {
    _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
      return o.__proto__ || Object.getPrototypeOf(o);
    };
    return _getPrototypeOf(o);
  }
  
  function _setPrototypeOf(o, p) {
    _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
      o.__proto__ = p;
      return o;
    };
  
    return _setPrototypeOf(o, p);
  }
  
  function _isNativeReflectConstruct() {
    if (typeof Reflect === "undefined" || !Reflect.construct) return false;
    if (Reflect.construct.sham) return false;
    if (typeof Proxy === "function") return true;
  
    try {
      Date.prototype.toString.call(Reflect.construct(Date, [], function () {}));
      return true;
    } catch (e) {
      return false;
    }
  }
  
  function _assertThisInitialized(self) {
    if (self === void 0) {
      throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
    }
  
    return self;
  }
  
  function _possibleConstructorReturn(self, call) {
    if (call && (typeof call === "object" || typeof call === "function")) {
      return call;
    }
  
    return _assertThisInitialized(self);
  }
  
  function _createSuper(Derived) {
    return function () {
      var Super = _getPrototypeOf(Derived),
          result;
  
      if (_isNativeReflectConstruct()) {
        var NewTarget = _getPrototypeOf(this).constructor;
  
        result = Reflect.construct(Super, arguments, NewTarget);
      } else {
        result = Super.apply(this, arguments);
      }
  
      return _possibleConstructorReturn(this, result);
    };
  }
  
  var REMAX_METHOD = '$$REMAX_METHOD';
  var TYPE_TEXT = 'plain-text';
  
  var instanceId = 0;
  function generate() {
    var id = instanceId;
    instanceId += 1;
    return id;
  }
  
  // https://github.com/facebook/react/blob/master/packages/react-dom/src/shared/CSSProperty.js
  
  /**
   * CSS properties which accept numbers but are not in units of "px".
   */
  var isUnitlessNumber = {
    animationIterationCount: true,
    borderImageOutset: true,
    borderImageSlice: true,
    borderImageWidth: true,
    boxFlex: true,
    boxFlexGroup: true,
    boxOrdinalGroup: true,
    columnCount: true,
    columns: true,
    flex: true,
    flexGrow: true,
    flexPositive: true,
    flexShrink: true,
    flexNegative: true,
    flexOrder: true,
    gridArea: true,
    gridRow: true,
    gridRowEnd: true,
    gridRowSpan: true,
    gridRowStart: true,
    gridColumn: true,
    gridColumnEnd: true,
    gridColumnSpan: true,
    gridColumnStart: true,
    fontWeight: true,
    lineClamp: true,
    lineHeight: true,
    opacity: true,
    order: true,
    orphans: true,
    tabSize: true,
    widows: true,
    zIndex: true,
    zoom: true,
    // SVG-related properties
    fillOpacity: true,
    floodOpacity: true,
    stopOpacity: true,
    strokeDasharray: true,
    strokeDashoffset: true,
    strokeMiterlimit: true,
    strokeOpacity: true,
    strokeWidth: true
  };
  /**
   * @param {string} prefix vendor-specific prefix, eg: Webkit
   * @param {string} key style name, eg: transitionDuration
   * @return {string} style name prefixed with `prefix`, properly camelCased, eg:
   * WebkitTransitionDuration
   */
  
  function prefixKey(prefix, key) {
    return prefix + key.charAt(0).toUpperCase() + key.substring(1);
  }
  /**
   * Support style names that may come passed in prefixed by adding permutations
   * of vendor prefixes.
   */
  
  
  var prefixes = ['Webkit', 'ms', 'Moz', 'O'];
  
  var _loop_1 = function _loop_1(prop) {
    prefixes.forEach(function (prefix) {
      isUnitlessNumber[prefixKey(prefix, prop)] = isUnitlessNumber[prop];
    });
  };
  
  for (var prop in isUnitlessNumber) {
    _loop_1(prop);
  }
  
  var __read = undefined && undefined.__read || function (o, n) {
    var m = typeof Symbol === "function" && o[Symbol.iterator];
    if (!m) return o;
    var i = m.call(o),
        r,
        ar = [],
        e;
  
    try {
      while ((n === void 0 || n-- > 0) && !(r = i.next()).done) {
        ar.push(r.value);
      }
    } catch (error) {
      e = {
        error: error
      };
    } finally {
      try {
        if (r && !r.done && (m = i["return"])) m.call(i);
      } finally {
        if (e) throw e.error;
      }
    }
  
    return ar;
  };
  
  var __spread = undefined && undefined.__spread || function () {
    for (var ar = [], i = 0; i < arguments.length; i++) {
      ar = ar.concat(__read(arguments[i]));
    }
  
    return ar;
  };
  var vendorPrefixes = ['webkit', 'moz', 'ms', 'o'];
  
  var transformReactStyleKey = function transformReactStyleKey(key) {
    // css3 var
    if (key === null || key === void 0 ? void 0 : key.startsWith('--')) {
      return key;
    }
  
    var styleValue = key.replace(/\.?([A-Z]+)/g, function (_x, y) {
      return '-' + y.toLowerCase();
    }); // vendor prefix
  
    if (styleValue === null || styleValue === void 0 ? void 0 : styleValue.startsWith('-')) {
      var firstWord_1 = styleValue.split('-').filter(function (s) {
        return s;
      })[0];
      styleValue = styleValue.replace(/^-/, '');
  
      if (vendorPrefixes.find(function (prefix) {
        return prefix === firstWord_1;
      })) {
        styleValue = '-' + styleValue;
      }
    }
  
    return styleValue;
  };
  
  var transformPx = function transformPx(value) {
    if (typeof value !== 'string') {
      return value;
    }
  
    return value.replace(/\b(\d+(\.\d+)?)px\b/g, function (match, x) {
      var targetUnit = 'rpx';
      var size = Number(x);
      return size % 1 === 0 ? size + targetUnit : size.toFixed(2) + targetUnit;
    });
  };
  
  var plainStyle = function plainStyle(style) {
    return Object.keys(style).reduce(function (acc, key) {
      var value = style[key];
  
      if (!Number.isNaN(Number(value)) && !isUnitlessNumber[key]) {
        value = value + 'rpx';
      }
  
      return __spread(acc, [transformReactStyleKey(key) + ":" + ( transformPx(value) ) + ";"]);
    }, []).join('');
  };
  
  var __assign = undefined && undefined.__assign || function () {
    __assign = Object.assign || function (t) {
      for (var s, i = 1, n = arguments.length; i < n; i++) {
        s = arguments[i];
  
        for (var p in s) {
          if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
        }
      }
  
      return t;
    };
  
    return __assign.apply(this, arguments);
  };
  var hostComponents = {
    "ad": {
      "alias": {
        "unitId": "unit-id",
        "adIntervals": "ad-intervals",
        "onLoad": "bindload",
        "onError": "binderror",
        "onClose": "bindclose",
        "animation": "animation"
      }
    },
    "audio": {
      "alias": {
        "id": "id",
        "className": "class",
        "style": "style",
        "src": "src",
        "loop": "loop",
        "controls": "controls",
        "poster": "poster",
        "name": "name",
        "author": "author",
        "onError": "binderror",
        "onPlay": "bindplay",
        "onPause": "bindpause",
        "onTimeUpdate": "bindtimeupdate",
        "onEnded": "bindended",
        "animation": "animation"
      }
    },
    "button": {
      "alias": {
        "className": "class",
        "id": "id",
        "style": "style",
        "type": "type",
        "plain": "plain",
        "disabled": "disabled",
        "loading": "loading",
        "formType": "form-type",
        "openType": "open-type",
        "hoverClass": "hover-class",
        "hoverClassName": "hover-class",
        "hoverStopPropagation": "hover-stop-propagation",
        "hoverStartTime": "hover-start-time",
        "hoverStayTime": "hover-stay-time",
        "lang": "lang",
        "sessionFrom": "session-from",
        "sendMessageTitle": "send-message-title",
        "sendMessagePath": "send-message-path",
        "sendMessageImg": "send-message-img",
        "size": "size",
        "appParameter": "app-parameter",
        "showMessageCard": "show-message-card",
        "onGetUserInfo": "bindgetuserinfo",
        "onContact": "bindcontact",
        "onGetPhoneNumber": "bindgetphonenumber",
        "onError": "binderror",
        "onOpenSetting": "bindopensetting",
        "onLaunchApp": "bindlaunchapp",
        "onTap": "bindtap",
        "onClick": "bindtap",
        "animation": "animation"
      }
    },
    "camera": {
      "alias": {
        "id": "id",
        "className": "class",
        "style": "style",
        "mode": "mode",
        "devicePosition": "device-position",
        "flash": "flash",
        "frameSize": "frame-size",
        "onStop": "bindstop",
        "onError": "binderror",
        "onInitDone": "bindinitdone",
        "onScanCode": "bindscancode",
        "animation": "animation"
      }
    },
    "canvas": {
      "alias": {
        "id": "id",
        "style": "style",
        "className": "class",
        "width": "width",
        "height": "height",
        "disableScroll": "disable-scroll",
        "type": "type",
        "canvasId": "canvas-id",
        "onTouchStart": "bindtouchstart",
        "onTouchMove": "bindtouchmove",
        "onTouchEnd": "bindtouchend",
        "onTouchCancel": "bindtouchcancel",
        "onLongTap": "bindlongtap",
        "onLongClick": "bindlongtap",
        "onTap": "bindtap",
        "onClick": "bindtap",
        "onError": "binderror",
        "animation": "animation"
      }
    },
    "checkbox-group": {
      "alias": {
        "id": "id",
        "className": "class",
        "style": "style",
        "name": "name",
        "onChange": "bindchange",
        "animation": "animation"
      }
    },
    "checkbox": {
      "alias": {
        "id": "id",
        "className": "class",
        "style": "style",
        "value": "value",
        "checked": "checked",
        "disabled": "disabled",
        "onChange": "bindchange",
        "color": "color",
        "animation": "animation"
      }
    },
    "cover-image": {
      "alias": {
        "id": "id",
        "className": "class",
        "style": "style",
        "src": "src",
        "onLoad": "bindload",
        "onError": "binderror",
        "onTap": "bindtap",
        "onClick": "bindtap",
        "animation": "animation"
      }
    },
    "cover-view": {
      "alias": {
        "id": "id",
        "className": "class",
        "style": "style",
        "scrollTop": "scroll-top",
        "onTap": "bindtap",
        "onClick": "bindtap",
        "animation": "animation"
      }
    },
    "editor": {
      "alias": {
        "id": "id",
        "className": "class",
        "style": "style",
        "readOnly": "read-only",
        "placeholder": "placeholder",
        "showImgSize": "show-img-size",
        "showImgToolbar": "show-img-toolbar",
        "showImgResize": "show-img-resize",
        "onReady": "bindready",
        "onFocus": "bindfocus",
        "onBlur": "bindblur",
        "onInput": "bindinput",
        "onStatusChange": "bindstatuschange",
        "animation": "animation"
      }
    },
    "form": {
      "alias": {
        "id": "id",
        "className": "class",
        "style": "style",
        "reportSubmit": "report-submit",
        "onSubmit": "bindsubmit",
        "onReset": "bindreset",
        "reportSubmitTimeout": "report-submit-timeout",
        "animation": "animation"
      }
    },
    "functional-page-navigator": {
      "alias": {
        "version": "version",
        "name": "name",
        "args": "args",
        "onSuccess": "bindsuccess",
        "onFail": "bindfail",
        "animation": "animation"
      }
    },
    "icon": {
      "alias": {
        "id": "id",
        "className": "class",
        "style": "style",
        "type": "type",
        "size": "size",
        "color": "color",
        "animation": "animation"
      }
    },
    "image": {
      "alias": {
        "id": "id",
        "src": "src",
        "mode": "mode",
        "className": "class",
        "style": "style",
        "lazyLoad": "lazy-load",
        "onLoad": "bindload",
        "onError": "binderror",
        "onTap": "bindtap",
        "onClick": "bindtap",
        "showMenuByLongpress": "show-menu-by-longpress",
        "animation": "animation",
        "onTouchStart": "bindtouchstart",
        "onTouchMove": "bindtouchmove",
        "onTouchEnd": "bindtouchend",
        "onTouchCancel": "bindtouchcancel"
      }
    },
    "input": {
      "alias": {
        "id": "id",
        "autoFocus": "auto-focus",
        "className": "class",
        "focus": "focus",
        "name": "name",
        "maxlength": "maxlength",
        "value": "value",
        "style": "style",
        "password": "password",
        "type": "type",
        "confirmType": "confirm-type",
        "confirmHold": "confirm-hold",
        "cursor": "cursor",
        "selectionStart": "selection-start",
        "selectionEnd": "selection-end",
        "adjustPosition": "adjust-position",
        "placeholder": "placeholder",
        "placeholderStyle": "placeholder-style",
        "placeholderClass": "placeholder-class",
        "placeholderClassName": "placeholder-class",
        "disabled": "disabled",
        "cursorSpacing": "cursor-spacing",
        "onInput": "bindinput",
        "onTap": "bindtap",
        "onClick": "bindtap",
        "onFocus": "bindfocus",
        "onBlur": "bindblur",
        "onConfirm": "bindconfirm",
        "onKeyboardHeightChange": "bindkeyboardheightchange",
        "animation": "animation"
      }
    },
    "label": {
      "alias": {
        "id": "id",
        "className": "class",
        "style": "style",
        "for": "for",
        "animation": "animation",
        "onClick": "bindtap",
        "onTap": "bindtap"
      }
    },
    "live-player": {
      "alias": {
        "id": "id",
        "className": "class",
        "style": "style",
        "src": "src",
        "mode": "mode",
        "autoplay": "autoplay",
        "muted": "muted",
        "orientation": "orientation",
        "objectFit": "object-fit",
        "background": "background",
        "minCache": "min-cache",
        "maxCache": "max-cache",
        "soundMode": "sound-mode",
        "autoPauseIfNavigate": "auto-pause-if-navigate",
        "autoPauseIfOpenNative": "auto-pause-if-open-native",
        "onStateChange": "bindstatechange",
        "onFullscreenChange": "bindfullscreenchange",
        "onFullScreenChange": "bindfullscreenchange",
        "onNetStatus": "bindnetstatus",
        "animation": "animation"
      }
    },
    "live-pusher": {
      "alias": {
        "id": "id",
        "className": "class",
        "style": "style",
        "url": "url",
        "mode": "mode",
        "autopush": "autopush",
        "muted": "muted",
        "enableCamera": "enable-camera",
        "autoFocus": "auto-focus",
        "orientation": "orientation",
        "beauty": "beauty",
        "whiteness": "whiteness",
        "aspect": "aspect",
        "minBitrate": "min-bitrate",
        "maxBitrate": "max-bitrate",
        "waitingImage": "waiting-image",
        "waitingImageHash": "waiting-image-hash",
        "zoom": "zoom",
        "devicePosition": "device-position",
        "backgroundMute": "background-mute",
        "mirror": "mirror",
        "onStateChange": "bindstatechange",
        "onNetStatus": "bindnetstatus",
        "onError": "binderror",
        "onBgmStart": "bindbgmstart",
        "onBgmProgress": "bindbgmprogress",
        "onBgmComplete": "bindbgmcomplete",
        "animation": "animation"
      }
    },
    "map": {
      "alias": {
        "id": "id",
        "style": "style",
        "className": "class",
        "latitude": "latitude",
        "longitude": "longitude",
        "scale": "scale",
        "markers": "markers",
        "polyline": "polyline",
        "circles": "circles",
        "controls": "controls",
        "polygon": "polygon",
        "showLocation": "show-location",
        "includePoints": "include-points",
        "includePadding": "include-padding",
        "groundOverlays": "ground-overlays",
        "tileOverlay": "tile-overlay",
        "setting": "setting",
        "covers": "covers",
        "subkey": "subkey",
        "layerStyle": "layer-style",
        "rotate": "rotate",
        "skew": "skew",
        "enable3D": "enable-3D",
        "showCompass": "show-compass",
        "showScale": "show-scale",
        "enableOverlooking": "enable-overlooking",
        "enableZoom": "enable-zoom",
        "enableScroll": "enable-scroll",
        "enableRotate": "enable-rotate",
        "enableSatellite": "enable-satellite",
        "enableTraffic": "enable-traffic",
        "onTap": "bindtap",
        "onClick": "bindtap",
        "onMarkerTap": "bindmarkertap",
        "onMarkerClick": "bindmarkertap",
        "onControlTap": "bindcontroltap",
        "onControlClick": "bindcontroltap",
        "onCalloutTap": "bindcallouttap",
        "onCalloutClick": "bindcallouttap",
        "onUpdated": "bindupdated",
        "onRegionChange": "bindregionchange",
        "onPoiTap": "bindpoitap",
        "onPoiClick": "bindpoitap",
        "animation": "animation"
      }
    },
    "movable-area": {
      "alias": {
        "className": "class",
        "style": "style",
        "width": "width",
        "height": "height",
        "id": "id",
        "scaleArea": "scale-area",
        "animation": "animation"
      }
    },
    "movable-view": {
      "alias": {
        "className": "class",
        "style": "style",
        "id": "id",
        "direction": "direction",
        "inertia": "inertia",
        "outOfBounds": "out-of-bounds",
        "x": "x",
        "y": "y",
        "damping": "damping",
        "friction": "friction",
        "disabled": "disabled",
        "scale": "scale",
        "scaleMin": "scale-min",
        "scaleMax": "scale-max",
        "scaleValue": "scale-value",
        "animation": "animation",
        "onChange": "bindchange",
        "onScale": "bindscale",
        "hTouchMove": "htouchmove",
        "vTouchMove": "vtouchmove"
      }
    },
    "navigator": {
      "alias": {
        "id": "id",
        "className": "class",
        "style": "style",
        "openType": "open-type",
        "hoverClass": "hover-class",
        "hoverClassName": "hover-class",
        "hoverStartTime": "hover-start-time",
        "hoverStayTime": "hover-stay-time",
        "url": "url",
        "target": "target",
        "delta": "delta",
        "appId": "app-id",
        "path": "path",
        "extraData": "extra-data",
        "version": "version",
        "hoverStopPropagation": "hover-stop-propagation",
        "onSuccess": "bindsuccess",
        "onFail": "bindfail",
        "onComplete": "bindcomplete",
        "animation": "animation"
      }
    },
    "official-account": {
      "alias": {
        "onLoad": "onLoad",
        "onError": "onError"
      }
    },
    "open-data": {
      "alias": {
        "type": "type",
        "openGid": "open-gid",
        "lang": "lang"
      }
    },
    "picker-view-column": {
      "alias": {}
    },
    "picker-view": {
      "alias": {
        "id": "id",
        "className": "class",
        "style": "style",
        "value": "value",
        "indicatorStyle": "indicator-style",
        "indicatorClass": "indicator-class",
        "indicatorClassName": "indicator-class",
        "maskStyle": "mask-style",
        "maskClass": "mask-class",
        "maskClassName": "mask-class",
        "onChange": "bindchange",
        "onPickStart": "bindpickstart",
        "onPickEnd": "bindpickend",
        "animation": "animation"
      }
    },
    "picker": {
      "alias": {
        "id": "id",
        "className": "class",
        "style": "style",
        "range": "range",
        "rangeKey": "range-key",
        "value": "value",
        "onChange": "bindchange",
        "onCancel": "bindcancel",
        "onColumnChange": "bindcolumnchange",
        "start": "start",
        "end": "end",
        "fields": "fields",
        "customItem": "custom-item",
        "disabled": "disabled",
        "animation": "animation"
      }
    },
    "progress": {
      "alias": {
        "id": "id",
        "className": "class",
        "style": "style",
        "percent": "percent",
        "showInfo": "show-info",
        "borderRadius": "border-radius",
        "fontSize": "font-size",
        "strokeWidth": "stroke-width",
        "color": "color",
        "activeColor": "activeColor",
        "backgroundColor": "backgroundColor",
        "active": "active",
        "activeMode": "active-mode",
        "onActiveEnd": "bindactiveend",
        "animation": "animation"
      }
    },
    "radio-group": {
      "alias": {
        "id": "id",
        "className": "class",
        "style": "style",
        "onChange": "bindchange",
        "name": "name",
        "animation": "animation"
      }
    },
    "radio": {
      "alias": {
        "id": "id",
        "className": "class",
        "style": "style",
        "value": "value",
        "checked": "checked",
        "disabled": "disabled",
        "color": "color",
        "animation": "animation"
      }
    },
    "rich-text": {
      "alias": {
        "id": "id",
        "className": "class",
        "style": "style",
        "nodes": "nodes",
        "onTap": "bindtap",
        "onClick": "bindtap",
        "space": "space",
        "onTouchStart": "bindtouchstart",
        "onTouchMove": "bindtouchmove",
        "onTouchEnd": "bindtouchend",
        "onTouchCancel": "bindtouchcancel",
        "onLongTap": "bindlongtap",
        "onLongClick": "bindlongtap",
        "animation": "animation"
      }
    },
    "scroll-view": {
      "alias": {
        "id": "id",
        "className": "class",
        "style": "style",
        "scrollX": "scroll-x",
        "scrollY": "scroll-y",
        "upperThreshold": "upper-threshold",
        "lowerThreshold": "lower-threshold",
        "scrollTop": "scroll-top",
        "scrollLeft": "scroll-left",
        "scrollIntoView": "scroll-into-view",
        "scrollWithAnimation": "scroll-with-animation",
        "enableBackToTop": "enable-back-to-top",
        "enableFlex": "enable-flex",
        "onScrollToUpper": "bindscrolltoupper",
        "onScrollToLower": "bindscrolltolower",
        "onScroll": "bindscroll",
        "onTap": "bindtap",
        "onTouchStart": "bindtouchstart",
        "onTouchEnd": "bindtouchend",
        "onTouchMove": "bindtouchmove",
        "onTouchCancel": "bindtouchcancel",
        "onClick": "bindtap",
        "animation": "animation",
        "scrollAnchoring": "scroll-anchoring",
        "refresherEnabled": "refresher-enabled",
        "refresherThreshold": "refresher-threshold",
        "refresherDefaultStyle": "refresher-default-style",
        "refresherBackground": "refresher-background",
        "refresherTriggered": "refresher-triggered",
        "onRefresherPulling": "bindrefresherpulling",
        "onRefresherRefresh": "bindrefresherrefresh",
        "onRefresherRestore": "bindrefresherrestore",
        "onRefresherAbort": "bindrefresherabort"
      }
    },
    "slider": {
      "alias": {
        "id": "id",
        "className": "class",
        "style": "style",
        "name": "name",
        "min": "min",
        "color": "color",
        "max": "max",
        "step": "step",
        "disabled": "disabled",
        "value": "value",
        "showValue": "show-value",
        "activeColor": "activeColor",
        "backgroundColor": "backgroundColor",
        "trackSize": "track-size",
        "blockSize": "block-size",
        "blockColor": "block-color",
        "onChange": "bindchange",
        "onChanging": "bindchanging",
        "selectedColor": "selectedColor",
        "animation": "animation"
      }
    },
    "swiper-item": {
      "alias": {
        "key": "key",
        "id": "id",
        "className": "class",
        "style": "style",
        "itemId": "item-id",
        "animation": "animation"
      }
    },
    "swiper": {
      "alias": {
        "id": "id",
        "className": "class",
        "style": "style",
        "indicatorDots": "indicator-dots",
        "indicatorColor": "indicator-color",
        "indicatorActiveColor": "indicator-active-color",
        "autoplay": "autoplay",
        "current": "current",
        "interval": "interval",
        "duration": "duration",
        "circular": "circular",
        "vertical": "vertical",
        "previousMargin": "previous-margin",
        "nextMargin": "next-margin",
        "displayMultipleItems": "display-multiple-items",
        "skipHiddenItemLayout": "skip-hidden-item-layout",
        "easingFunction": "easing-function",
        "onChange": "bindchange",
        "onTransition": "bindtransition",
        "onAnimationFinish": "bindanimationfinish",
        "onTap": "bindtap",
        "onClick": "bindtap",
        "animation": "animation"
      }
    },
    "switch": {
      "alias": {
        "id": "id",
        "className": "class",
        "style": "style",
        "name": "name",
        "checked": "checked",
        "disabled": "disabled",
        "color": "color",
        "onChange": "bindchange",
        "controlled": "controlled",
        "type": "type",
        "animation": "animation"
      }
    },
    "text": {
      "alias": {
        "id": "id",
        "className": "class",
        "style": "style",
        "selectable": "selectable",
        "space": "space",
        "decode": "decode",
        "onTap": "bindtap",
        "onClick": "bindtap",
        "animation": "animation"
      }
    },
    "textarea": {
      "alias": {
        "id": "id",
        "className": "class",
        "style": "style",
        "name": "name",
        "value": "value",
        "placeholder": "placeholder",
        "placeholderStyle": "placeholder-style",
        "placeholderClass": "placeholder-class",
        "placeholderClassName": "placeholder-class",
        "disabled": "disabled",
        "maxlength": "maxlength",
        "autoFocus": "auto-focus",
        "focus": "focus",
        "fixed": "fixed",
        "autoHeight": "auto-height",
        "showCount": "show-count",
        "controlled": "controlled",
        "cursorSpacing": "cursor-spacing",
        "cursor": "cursor",
        "showConfirmBar": "show-confirm-bar",
        "selectionStart": "selection-start",
        "selectionEnd": "selection-end",
        "adjustPosition": "adjust-position",
        "onFocus": "bindfocus",
        "onBlur": "bindblur",
        "onLineChange": "bindlinechange",
        "onInput": "bindinput",
        "onConfirm": "bindconfirm",
        "onKeyboardHeightChange": "bindkeyboardheightchange",
        "animation": "animation"
      }
    },
    "video": {
      "alias": {
        "id": "id",
        "className": "class",
        "style": "style",
        "src": "src",
        "duration": "duration",
        "controls": "controls",
        "danmuList": "danmu-list",
        "danmuBtn": "danmu-btn",
        "enableDanmu": "enable-danmu",
        "autoplay": "autoplay",
        "loop": "loop",
        "muted": "muted",
        "initialTime": "initial-time",
        "pageGesture": "page-gesture",
        "direction": "direction",
        "showProgress": "show-progress",
        "showFullscreenBtn": "show-fullscreen-btn",
        "showPlayBtn": "show-play-btn",
        "showCenterPlayBtn": "show-center-play-btn",
        "enableProgressGesture": "enable-progress-gesture",
        "objectFit": "object-fit",
        "poster": "poster",
        "showMuteBtn": "show-mute-btn",
        "title": "title",
        "playBtnPosition": "play-btn-position",
        "posterForCrawler": "poster-for-crawler",
        "enablePlayGesture": "enable-play-gesture",
        "autoPauseIfNavigate": "auto-pause-if-navigate",
        "autoPauseIfOpenNative": "auto-pause-if-open-native",
        "vslideGesture": "vslide-gesture",
        "vslideGestureInFullscreen": "vslide-gesture-in-fullscreen",
        "onPlay": "bindplay",
        "onPause": "bindpause",
        "onEnded": "bindended",
        "onTimeUpdate": "bindtimeupdate",
        "onFullScreenChange": "bindfullscreenchange",
        "onWaiting": "bindwaiting",
        "onError": "binderror",
        "onProgress": "bindprogress",
        "animation": "animation"
      }
    },
    "view": {
      "alias": {
        "id": "id",
        "disableScroll": "disable-scroll",
        "hoverClass": "hover-class",
        "hoverClassName": "hover-class",
        "hoverStartTime": "hover-start-time",
        "hoverStayTime": "hover-stay-time",
        "hidden": "hidden",
        "className": "class",
        "style": "style",
        "animation": "animation",
        "hoverStopPropagation": "hover-stop-propagation",
        "onTap": "bindtap",
        "onClick": "bindtap",
        "onTouchStart": "bindtouchstart",
        "onTouchMove": "bindtouchmove",
        "onTouchEnd": "bindtouchend",
        "onTouchCancel": "bindtouchcancel",
        "onLongTap": "bindlongtap",
        "onLongClick": "bindlongtap",
        "onTransitionEnd": "bindtransitionend",
        "onAnimationIteration": "bindanimationiteration",
        "onAnimationStart": "bindanimationstart",
        "onAnimationEnd": "bindanimationend"
      }
    },
    "web-view": {
      "alias": {
        "src": "src",
        "onMessage": "bindmessage",
        "onLoad": "bindload",
        "onError": "binderror"
      }
    },
    "foo-bar": {
      "alias": {
        "foo": "foo",
        "className": "class"
      }
    },
    "custom-component": {
      "alias": {
        "foo": "foo"
      }
    }
  } || {};
  function createHostComponent(name, component) {
    if (component) {
      return component;
    }
  
    var Component = function Component(props, ref) {
      var _a = props.children,
          children = _a === void 0 ? [] : _a;
      return React.createElement(name, __assign(__assign({}, props), {
        ref: ref
      }), children);
    };
  
    return React.forwardRef(Component);
  }
  
  function getAlias(prop, type) {
    var _a, _b;
  
    prop = prop.replace('className', 'class');
    var hostComponent = hostComponents[type];
    var prefix = undefined + "-"; // 判断是否是平台独有属性
  
    if (prop.startsWith(prefix)) {
      return prop.replace(new RegExp("^" + prefix), '');
    }
  
    return (_b = (_a = hostComponent === null || hostComponent === void 0 ? void 0 : hostComponent.alias) === null || _a === void 0 ? void 0 : _a[prop]) !== null && _b !== void 0 ? _b : prop;
  }
  
  function getValue(prop, value) {
    if (prop.toLowerCase().endsWith('style') && _typeof(value) === 'object') {
      return plainStyle(value);
    }
  
    return value;
  }
  
  function propsAlias(props, type) {
    if (!props) {
      return props;
    }
  
    var aliasProps = {};
  
    for (var prop in props) {
      aliasProps[getAlias(prop, type)] = getValue(prop, props[prop]);
    }
  
    return aliasProps;
  }
  
  function toRawNode(node) {
    if (node.type === TYPE_TEXT) {
      return {
        type: node.type,
        text: node.text
      };
    }
  
    return {
      id: node.id,
      type: node.type,
      props: propsAlias(node.props, node.type),
      children: [],
      text: node.text
    };
  }
  
  var VNode =
  /** @class */
  function () {
    function VNode(_a) {
      var id = _a.id,
          type = _a.type,
          props = _a.props,
          container = _a.container;
      this.mounted = false;
      this.parent = null;
      this.firstChild = null;
      this.lastChild = null;
      this.size = 0;
      this.previousSibling = null;
      this.nextSibling = null;
      this.id = id;
      this.container = container;
      this.type = type;
      this.props = props;
    }
  
    VNode.prototype.appendChild = function (node, immediately) {
      this.removeChild(node, immediately);
      this.size += 1;
      node.parent = this;
  
      if (!this.firstChild) {
        this.firstChild = node;
      }
  
      if (this.lastChild) {
        this.lastChild.nextSibling = node;
        node.previousSibling = this.lastChild;
      }
  
      this.lastChild = node;
  
      if (this.isMounted()) {
        this.container.requestUpdate(this.path + '.children', this.size - 1, 0, immediately, node.toJSON());
      }
    };
  
    VNode.prototype.removeChild = function (node, immediately) {
      var previousSibling = node.previousSibling,
          nextSibling = node.nextSibling;
  
      if (node.parent !== this) {
        return;
      }
  
      var index = node.index;
      this.size -= 1;
  
      if (this.firstChild === node) {
        this.firstChild = node.nextSibling;
      }
  
      if (this.lastChild === node) {
        this.lastChild = node.previousSibling;
      }
  
      if (previousSibling) {
        previousSibling.nextSibling = nextSibling;
      }
  
      if (nextSibling) {
        nextSibling.previousSibling = previousSibling;
      }
  
      node.previousSibling = null;
      node.nextSibling = null;
  
      if (this.isMounted()) {
        this.container.requestUpdate(this.path + '.children', index, 1, immediately);
      }
    };
  
    VNode.prototype.insertBefore = function (node, referenceNode, immediately) {
      this.removeChild(node, immediately);
      this.size += 1;
      node.parent = this;
  
      if (referenceNode === this.firstChild) {
        this.firstChild = node;
      }
  
      if (referenceNode.previousSibling) {
        referenceNode.previousSibling.nextSibling = node;
        node.previousSibling = referenceNode.previousSibling;
      }
  
      referenceNode.previousSibling = node;
      node.nextSibling = referenceNode;
  
      if (this.isMounted()) {
        this.container.requestUpdate(this.path + '.children', node.index, 0, immediately, node.toJSON());
      }
    };
  
    VNode.prototype.update = function () {
      // root 不会更新，所以肯定有 parent
      this.container.requestUpdate(this.parent.path + '.children', this.index, 1, false, this.toJSON());
    };
  
    Object.defineProperty(VNode.prototype, "index", {
      get: function get() {
        var value = 0;
        var previousSibling = this.previousSibling;
  
        while (previousSibling) {
          value += 1;
          previousSibling = previousSibling.previousSibling;
        }
  
        return value;
      },
      enumerable: true,
      configurable: true
    });
    Object.defineProperty(VNode.prototype, "children", {
      get: function get() {
        var arr = [];
        var item = this.firstChild;
  
        while (item) {
          arr.push(item);
          item = item.nextSibling;
        }
  
        return arr;
      },
      enumerable: true,
      configurable: true
    });
    Object.defineProperty(VNode.prototype, "path", {
      get: function get() {
        var dataPath = 'root';
        var parents = [];
        var parent = this.parent;
  
        while (parent) {
          parents.unshift(parent);
          parent = parent.parent;
        }
  
        for (var i = 0; i < parents.length; i++) {
          var child = parents[i + 1] || this;
          dataPath += '.children.' + child.index;
        }
  
        return dataPath;
      },
      enumerable: true,
      configurable: true
    });
  
    VNode.prototype.isMounted = function () {
      return this.parent ? this.parent.isMounted() : this.mounted;
    };
  
    VNode.prototype.toJSON = function () {
      var stack = [];
      var rawNode = toRawNode(this);
      stack.push({
        currentNode: rawNode,
        children: this.children
      });
  
      while (stack.length > 0) {
        // while 循环已经保证了不会有空值
        var stackItem = stack.pop();
        var _a = stackItem.children,
            children = _a === void 0 ? [] : _a,
            currentNode = stackItem.currentNode;
  
        for (var i = children.length - 1; i >= 0; i--) {
          var currentVNode = children[i];
          var currentRawNode = toRawNode(currentVNode);
          currentNode.children[i] = currentRawNode;
          stack.push({
            currentNode: currentRawNode,
            children: currentVNode.children
          });
        }
      }
  
      return rawNode;
    };
  
    return VNode;
  }();
  
  var DEPRECATED_CATCH_TYPE = 'catchClick';
  var SYNTHETIC_TYPES = ['onClick', 'onTap', 'onLongClick', 'onLongTap'];
  
  var isPropagationStopped = false;
  /**
   * 检查父元素里还有没有点击事件
   *
   * @export
   * @param {VNode} node
   * @returns
   */
  
  function validate(node) {
    var _a;
  
    var parent = node.parent;
  
    if (!parent) {
      isPropagationStopped = false;
      return;
    }
  
    for (var i = 0; i < SYNTHETIC_TYPES.length; i++) {
      if ((_a = parent.props) === null || _a === void 0 ? void 0 : _a[SYNTHETIC_TYPES[i]]) {
        return;
      }
    }
  
    validate(parent);
  }
  function stopPropagation(node) {
    isPropagationStopped = true;
    validate(node);
  }
  
  var __read$1 = undefined && undefined.__read || function (o, n) {
    var m = typeof Symbol === "function" && o[Symbol.iterator];
    if (!m) return o;
    var i = m.call(o),
        r,
        ar = [],
        e;
  
    try {
      while ((n === void 0 || n-- > 0) && !(r = i.next()).done) {
        ar.push(r.value);
      }
    } catch (error) {
      e = {
        error: error
      };
    } finally {
      try {
        if (r && !r.done && (m = i["return"])) m.call(i);
      } finally {
        if (e) throw e.error;
      }
    }
  
    return ar;
  };
  
  var __spread$1 = undefined && undefined.__spread || function () {
    for (var ar = [], i = 0; i < arguments.length; i++) {
      ar = ar.concat(__read$1(arguments[i]));
    }
  
    return ar;
  };
  
  function isSyntheticType(inputType) {
    if (DEPRECATED_CATCH_TYPE === inputType) {
      console.warn('DEPRECATION: remax 已支持在 onClick 事件中使用 stopPropagation 阻止事件冒泡，请尽量不要使用 catchClick');
    }
  
    return !!SYNTHETIC_TYPES.find(function (type) {
      return type === inputType;
    });
  }
  
  function createBaseSyntheticEvent(node, nativeEvent) {
    // 添加阻止冒泡方法
    nativeEvent.stopPropagation = function () {
      stopPropagation(node);
    };
  
    return nativeEvent;
  }
  
  function createCallbackProxy(eventType, node, callback) {
    if (!isSyntheticType(eventType)) {
      return callback;
    }
  
    return function (nativeEvent) {
      var restParams = [];
  
      for (var _i = 1; _i < arguments.length; _i++) {
        restParams[_i - 1] = arguments[_i];
      }
  
      var syntheticEvent = createBaseSyntheticEvent(node, nativeEvent);
  
      if (isPropagationStopped) {
        validate(node);
        return;
      }
  
      return callback.apply(void 0, __spread$1([syntheticEvent], restParams));
    };
  }
  
  var STYLE = 'style';
  var CHILDREN = 'children';
  function diffProperties(lastRawProps, nextRawProps) {
    var updatePayload = null;
    var lastProps = lastRawProps;
    var nextProps = nextRawProps;
    var propKey;
    var styleName;
    var styleUpdates = null;
  
    for (propKey in lastProps) {
      if (Object.prototype.hasOwnProperty.call(nextProps, propKey) || !Object.prototype.hasOwnProperty.call(lastProps, propKey) || lastProps[propKey] == null) {
        continue;
      }
  
      if (propKey === STYLE) {
        var lastStyle = lastProps[propKey];
  
        for (styleName in lastStyle) {
          if (Object.prototype.hasOwnProperty.call(lastStyle, styleName)) {
            if (!styleUpdates) {
              styleUpdates = {};
            }
  
            styleUpdates[styleName] = '';
          }
        }
      } else {
        // For all other deleted properties we add it to the queue. We use
        // the whitelist in the commit phase instead.
        (updatePayload = updatePayload || []).push(propKey, null);
      }
    }
  
    for (propKey in nextProps) {
      var nextProp = nextProps[propKey];
      var lastProp = lastProps != null ? lastProps[propKey] : undefined;
  
      if (!Object.prototype.hasOwnProperty.call(nextProps, propKey) || nextProp === lastProp || nextProp == null && lastProp == null) {
        continue;
      }
  
      if (propKey === STYLE) {
  
        if (lastProp) {
          // Unset styles on `lastProp` but not on `nextProp`.
          for (styleName in lastProp) {
            if (Object.prototype.hasOwnProperty.call(lastProp, styleName) && (!nextProp || !Object.prototype.hasOwnProperty.call(nextProp, styleName))) {
              if (!styleUpdates) {
                styleUpdates = {};
              }
  
              styleUpdates[styleName] = '';
            }
          } // Update styles that changed since `lastProp`.
  
  
          for (styleName in nextProp) {
            if (Object.prototype.hasOwnProperty.call(nextProp, styleName) && lastProp[styleName] !== nextProp[styleName]) {
              if (!styleUpdates) {
                styleUpdates = {};
              }
  
              styleUpdates[styleName] = nextProp[styleName];
            }
          }
        } else {
          // Relies on `updateStylesByID` not mutating `styleUpdates`.
          if (!styleUpdates) {
            if (!updatePayload) {
              updatePayload = [];
            }
  
            updatePayload.push(propKey, styleUpdates);
          }
  
          styleUpdates = nextProp;
        }
      } else if (propKey === CHILDREN) {
        if (lastProp !== nextProp && (typeof nextProp === 'string' || typeof nextProp === 'number')) {
          (updatePayload = updatePayload || []).push(propKey, '' + nextProp);
        }
      } else {
        // For any other property we always add it to the queue and then we
        // filter it out using the whitelist during the commit.
        (updatePayload = updatePayload || []).push(propKey, nextProp);
      }
    }
  
    if (styleUpdates) {
      (updatePayload = updatePayload || []).push(STYLE, styleUpdates);
    }
  
    return updatePayload;
  }
  
  var __values = undefined && undefined.__values || function (o) {
    var s = typeof Symbol === "function" && Symbol.iterator,
        m = s && o[s],
        i = 0;
    if (m) return m.call(o);
    if (o && typeof o.length === "number") return {
      next: function next() {
        if (o && i >= o.length) o = void 0;
        return {
          value: o && o[i++],
          done: !o
        };
      }
    };
    throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
  };
  var scheduleDeferredCallback = scheduler.unstable_scheduleCallback,
      cancelDeferredCallback = scheduler.unstable_cancelCallback,
      shouldYield = scheduler.unstable_shouldYield,
      now = scheduler.unstable_now;
  
  function processProps(newProps, node, id) {
    var e_1, _a;
  
    var props = {};
  
    try {
      for (var _b = __values(Object.keys(newProps)), _c = _b.next(); !_c.done; _c = _b.next()) {
        var propKey = _c.value;
  
        if (typeof newProps[propKey] === 'function') {
          var contextKey = REMAX_METHOD + "_" + id + "_" + propKey;
          node.container.createCallback(contextKey, createCallbackProxy(propKey, node, newProps[propKey]));
          props[propKey] = contextKey;
        } else if (propKey === 'style') {
          props[propKey] = newProps[propKey] || '';
        } else if (propKey === 'children') {// pass
        } else {
          props[propKey] = newProps[propKey];
        }
      }
    } catch (e_1_1) {
      e_1 = {
        error: e_1_1
      };
    } finally {
      try {
        if (_c && !_c.done && (_a = _b["return"])) _a.call(_b);
      } finally {
        if (e_1) throw e_1.error;
      }
    }
  
    return props;
  }
  
  var rootHostContext = {};
  var childHostContext = {};
  var hostConfig = {
    now: now,
    getPublicInstance: function getPublicInstance(inst) {
      return inst;
    },
    getRootHostContext: function getRootHostContext() {
      return rootHostContext;
    },
    shouldSetTextContent: function shouldSetTextContent(type) {
      return type === 'stub-block';
    },
    prepareForCommit: function prepareForCommit() {// nothing to do
    },
    resetAfterCommit: function resetAfterCommit() {// nothing to do
    },
    getChildHostContext: function getChildHostContext() {
      return childHostContext;
    },
    createInstance: function createInstance(type, newProps, container) {
      var id = generate();
      var node = new VNode({
        id: id,
        type: type,
        props: {},
        container: container
      });
      node.props = processProps(newProps, node, id);
      return node;
    },
    createTextInstance: function createTextInstance(text, container) {
      var id = generate();
      var node = new VNode({
        id: id,
        type: TYPE_TEXT,
        props: null,
        container: container
      });
      node.text = text;
      return node;
    },
    commitTextUpdate: function commitTextUpdate(node, oldText, newText) {
      if (oldText !== newText) {
        node.text = newText;
        node.update();
      }
    },
    prepareUpdate: function prepareUpdate(node, type, lastProps, nextProps) {
      lastProps = processProps(lastProps, node, node.id);
      nextProps = processProps(nextProps, node, node.id);
  
      if (diffProperties(lastProps, nextProps)) {
        return true;
      }
  
      return null;
    },
    commitUpdate: function commitUpdate(node, updatePayload, type, oldProps, newProps) {
      node.props = processProps(newProps, node, node.id);
      node.update();
    },
    appendInitialChild: function appendInitialChild(parent, child) {
      parent.appendChild(child, false);
    },
    appendChild: function appendChild(parent, child) {
      parent.appendChild(child, false);
    },
    insertBefore: function insertBefore(parent, child, beforeChild) {
      parent.insertBefore(child, beforeChild, false);
    },
    removeChild: function removeChild(parent, child) {
      parent.removeChild(child, false);
    },
    finalizeInitialChildren: function finalizeInitialChildren() {
      return false;
    },
    appendChildToContainer: function appendChildToContainer(container, child) {
      container.appendChild(child);
      child.mounted = true;
    },
    insertInContainerBefore: function insertInContainerBefore(container, child, beforeChild) {
      container.insertBefore(child, beforeChild);
    },
    removeChildFromContainer: function removeChildFromContainer(container, child) {
      container.removeChild(child);
    },
    schedulePassiveEffects: scheduleDeferredCallback,
    cancelPassiveEffects: cancelDeferredCallback,
    shouldYield: shouldYield,
    scheduleDeferredCallback: scheduleDeferredCallback,
    cancelDeferredCallback: cancelDeferredCallback,
    supportsMutation: true
  };
  
  var ReactReconcilerInst = ReactReconciler(hostConfig);
  
  function getPublicRootInstance(container) {
    var containerFiber = container.current;
  
    if (!containerFiber.child) {
      return null;
    }
  
    return containerFiber.child.stateNode;
  }
  
  function render(rootElement, container) {
    // Create a root Container if it doesnt exist
    if (!container._rootContainer) {
      container._rootContainer = ReactReconcilerInst.createContainer(container, false, false);
    }
  
    ReactReconcilerInst.updateContainer(rootElement, container._rootContainer, null, function () {// ignore
    });
    return getPublicRootInstance(container._rootContainer);
  }
  
  var __read$2 = undefined && undefined.__read || function (o, n) {
    var m = typeof Symbol === "function" && o[Symbol.iterator];
    if (!m) return o;
    var i = m.call(o),
        r,
        ar = [],
        e;
  
    try {
      while ((n === void 0 || n-- > 0) && !(r = i.next()).done) {
        ar.push(r.value);
      }
    } catch (error) {
      e = {
        error: error
      };
    } finally {
      try {
        if (r && !r.done && (m = i["return"])) m.call(i);
      } finally {
        if (e) throw e.error;
      }
    }
  
    return ar;
  };
  
  var __spread$2 = undefined && undefined.__spread || function () {
    for (var ar = [], i = 0; i < arguments.length; i++) {
      ar = ar.concat(__read$2(arguments[i]));
    }
  
    return ar;
  };
  /* eslint-disable prefer-rest-params */
  
  
  if (typeof Function.prototype.call === 'undefined') {
    Function.prototype.call = function (context) {
      context = context || window;
      context.fn = this;
  
      var args = __spread$2(arguments).slice(1);
  
      var result = context.fn.apply(context, __spread$2(args));
      delete context.fn;
      return result;
    };
  }
  
  if (typeof Function.prototype.apply === 'undefined') {
    Function.prototype.apply = function (context) {
      context = context || window;
      context.fn = this;
      var result;
  
      if (arguments[1]) {
        result = context.fn.apply(context, __spread$2(arguments[1]));
      } else {
        result = context.fn();
      }
  
      delete context.fn;
      return result;
    };
  }
  
  var AppContainer =
  /** @class */
  function () {
    function AppContainer(context) {
      this.updateQueue = [];
      this.context = context;
      this.root = new VNode({
        id: generate(),
        type: 'root',
        container: this
      });
      this.root.mounted = true;
    }
  
    AppContainer.prototype.requestUpdate = function (path, start, deleteCount) {
      var items = [];
  
      for (var _i = 3; _i < arguments.length; _i++) {
        items[_i - 3] = arguments[_i];
      } // ignore
  
    };
  
    AppContainer.prototype.createCallback = function (name, fn) {
      this.context[name] = fn;
    };
  
    AppContainer.prototype.appendChild = function (child) {
      this.root.appendChild(child, true);
    };
  
    AppContainer.prototype.removeChild = function (child) {
      this.root.removeChild(child, true);
    };
  
    AppContainer.prototype.insertBefore = function (child, beforeChild) {
      this.root.insertBefore(child, beforeChild, true);
    };
  
    return AppContainer;
  }();
  
  function fnBody(fn) {
    return fn.toString().replace(/^[^{]*{\s*/, '').replace(/\s*}[^}]*$/, '');
  }
  
  function isClass(fn) {
    if (typeof fn !== 'function') {
      return false;
    }
  
    if (/^class[\s{]/.test(toString.call(fn))) {
      return true;
    } // babel.js classCallCheck() & inlined
  
  
    var body = fnBody(fn);
    return /classCallCheck/.test(body) || /TypeError\("Cannot call a class as a function"\)/.test(body);
  }
  
  function isClassComponent(Component) {
    return Component.prototype && typeof Component.prototype.render === 'function';
  }
  
  function capitalize(str) {
    return str.charAt(0).toUpperCase() + str.slice(1);
  }
  
  var Lifecycle;
  
  (function (Lifecycle) {
    Lifecycle["show"] = "show";
    Lifecycle["hide"] = "hide";
    Lifecycle["ready"] = "ready";
    Lifecycle["pullDownRefresh"] = "pullDownRefresh";
    Lifecycle["reachBottom"] = "reachBottom";
    Lifecycle["pageScroll"] = "pageScroll";
    Lifecycle["shareAppMessage"] = "shareAppMessage";
    Lifecycle["titleClick"] = "titleClick";
    Lifecycle["optionMenuClick"] = "optionMenuClick";
    Lifecycle["popMenuClick"] = "popMenuClick";
    Lifecycle["pullIntercept"] = "pullIntercept";
    Lifecycle["back"] = "back";
    Lifecycle["keyboardHeight"] = "keyboardHeight";
    Lifecycle["tabItemTap"] = "tabItemTap";
    Lifecycle["beforeTabItemTap"] = "beforeTabItemTap";
    Lifecycle["resize"] = "resize";
  })(Lifecycle || (Lifecycle = {}));
  
  var AppLifecycle;
  
  (function (AppLifecycle) {
    AppLifecycle["launch"] = "launch";
    AppLifecycle["show"] = "show";
    AppLifecycle["hide"] = "hide";
    AppLifecycle["error"] = "error";
    AppLifecycle["shareAppMessage"] = "shareAppMessage";
    AppLifecycle["pageNotFound"] = "pageNotFound";
  })(AppLifecycle || (AppLifecycle = {}));
  function callbackName(name) {
    if (name.startsWith('before')) {
      return capitalize(name);
    }
  
    return 'on' + capitalize(name);
  }
  
  var context = {
    lifecycleCallback: {},
    registerLifecycle: function registerLifecycle(lifecycle, callback) {
      var _this = this;
  
      this.lifecycleCallback[lifecycle] = this.lifecycleCallback[lifecycle] || [];
      this.lifecycleCallback[lifecycle].push(callback);
      return function () {
        _this.lifecycleCallback[lifecycle].splice(_this.lifecycleCallback[lifecycle].indexOf(callback), 1);
      };
    }
  };
  
  /* eslint-disable */
  
  /* istanbul ignore file */
  
  /** @license React v16.12.0
   * react-is.development.js
   *
   * Copyright (c) Facebook, Inc. and its affiliates.
   *
   * This source code is licensed under the MIT license found in the
   * LICENSE file in the root directory of this source tree.
   */
  // The Symbol used to tag the ReactElement-like types. If there is no native Symbol
  // nor polyfill, then a plain number is used for performance.
  var hasSymbol = typeof Symbol === 'function' && Symbol["for"];
  var REACT_PORTAL_TYPE = hasSymbol ? Symbol["for"]('react.portal') : 0xeaca;
  var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol["for"]('react.forward_ref') : 0xead0;
  var ForwardRef = REACT_FORWARD_REF_TYPE;
  var Portal = REACT_PORTAL_TYPE;
  
  var __extends = undefined && undefined.__extends || function () {
    var _extendStatics = function extendStatics(d, b) {
      _extendStatics = Object.setPrototypeOf || {
        __proto__: []
      } instanceof Array && function (d, b) {
        d.__proto__ = b;
      } || function (d, b) {
        for (var p in b) {
          if (b.hasOwnProperty(p)) d[p] = b[p];
        }
      };
  
      return _extendStatics(d, b);
    };
  
    return function (d, b) {
      _extendStatics(d, b);
  
      function __() {
        this.constructor = d;
      }
  
      d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
  }();
  
  var __read$3 = undefined && undefined.__read || function (o, n) {
    var m = typeof Symbol === "function" && o[Symbol.iterator];
    if (!m) return o;
    var i = m.call(o),
        r,
        ar = [],
        e;
  
    try {
      while ((n === void 0 || n-- > 0) && !(r = i.next()).done) {
        ar.push(r.value);
      }
    } catch (error) {
      e = {
        error: error
      };
    } finally {
      try {
        if (r && !r.done && (m = i["return"])) m.call(i);
      } finally {
        if (e) throw e.error;
      }
    }
  
    return ar;
  };
  
  var __spread$3 = undefined && undefined.__spread || function () {
    for (var ar = [], i = 0; i < arguments.length; i++) {
      ar = ar.concat(__read$3(arguments[i]));
    }
  
    return ar;
  };
  
  var DefaultAppComponent =
  /** @class */
  function (_super) {
    __extends(DefaultAppComponent, _super);
  
    function DefaultAppComponent() {
      return _super !== null && _super.apply(this, arguments) || this;
    }
  
    DefaultAppComponent.prototype.render = function () {
      return React.createElement(React.Fragment, null, this.props.children);
    };
  
    return DefaultAppComponent;
  }(React.Component);
  
  function createAppConfig(App) {
    var _this = this;
  
    var createConfig = function createConfig(AppComponent) {
      if (AppComponent === void 0) {
        AppComponent = DefaultAppComponent;
      }
  
      var config = {
        _container: new AppContainer(_this),
        _pages: [],
        _instance: React.createRef(),
        callLifecycle: function callLifecycle(lifecycle) {
          var _a;
  
          var args = [];
  
          for (var _i = 1; _i < arguments.length; _i++) {
            args[_i - 1] = arguments[_i];
          }
  
          var callbacks = context.lifecycleCallback[lifecycle] || [];
          var result;
          callbacks.forEach(function (callback) {
            result = callback.apply(void 0, __spread$3(args));
          });
  
          if (result) {
            return result;
          }
  
          var callback = callbackName(lifecycle);
  
          if (this._instance.current && this._instance.current[callback]) {
            return (_a = this._instance.current)[callback].apply(_a, __spread$3(args));
          }
        },
        onLaunch: function onLaunch(options) {
          this._render();
  
          return this.callLifecycle(AppLifecycle.launch, options);
        },
        onShow: function onShow(options) {
          return this.callLifecycle(AppLifecycle.show, options);
        },
        onHide: function onHide() {
          return this.callLifecycle(AppLifecycle.hide);
        },
        onError: function onError(error) {
          return this.callLifecycle(AppLifecycle.error, error);
        },
        // 支付宝
        onShareAppMessage: function onShareAppMessage(options) {
          return this.callLifecycle(AppLifecycle.shareAppMessage, options);
        },
        // 微信
        onPageNotFound: function onPageNotFound(options) {
          return this.callLifecycle(AppLifecycle.pageNotFound, options);
        },
        _mount: function _mount(pageInstance) {
          this._pages.push(pageInstance);
  
          this._render();
        },
        _unmount: function _unmount(pageInstance) {
          this._pages.splice(this._pages.indexOf(pageInstance), 1);
  
          this._render();
        },
        _render: function _render() {
          var props = {};
  
          if (isClassComponent(AppComponent) || AppComponent.$$typeof === ForwardRef) {
            props.ref = this._instance;
          }
  
          return render(React.createElement(AppComponent, props, this._pages.map(function (p) {
            return p.element;
          })), this._container);
        }
      };
      return config;
    }; // 兼容老的写法
  
  
    if (isClass(App) && !isClassComponent(App)) {
      // eslint-disable-next-line no-console
      console.warn('使用非 React 组件定义 App 的方式已经废弃，详细请参考：https://remaxjs.org/guide/framework');
      Object.assign(App.prototype, createConfig());
      return new App();
    } else {
      return createConfig(App);
    }
  }
  
  var PageInstanceContext = React.createContext(null);
  
  var __extends$1 = undefined && undefined.__extends || function () {
    var _extendStatics = function extendStatics(d, b) {
      _extendStatics = Object.setPrototypeOf || {
        __proto__: []
      } instanceof Array && function (d, b) {
        d.__proto__ = b;
      } || function (d, b) {
        for (var p in b) {
          if (b.hasOwnProperty(p)) d[p] = b[p];
        }
      };
  
      return _extendStatics(d, b);
    };
  
    return function (d, b) {
      _extendStatics(d, b);
  
      function __() {
        this.constructor = d;
      }
  
      d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
  }();
  
  var __read$4 = undefined && undefined.__read || function (o, n) {
    var m = typeof Symbol === "function" && o[Symbol.iterator];
    if (!m) return o;
    var i = m.call(o),
        r,
        ar = [],
        e;
  
    try {
      while ((n === void 0 || n-- > 0) && !(r = i.next()).done) {
        ar.push(r.value);
      }
    } catch (error) {
      e = {
        error: error
      };
    } finally {
      try {
        if (r && !r.done && (m = i["return"])) m.call(i);
      } finally {
        if (e) throw e.error;
      }
    }
  
    return ar;
  };
  
  var __spread$4 = undefined && undefined.__spread || function () {
    for (var ar = [], i = 0; i < arguments.length; i++) {
      ar = ar.concat(__read$4(arguments[i]));
    }
  
    return ar;
  };
  function createPageWrapper(Page, query) {
    return (
      /** @class */
      function (_super) {
        __extends$1(PageWrapper, _super);
  
        function PageWrapper(props) {
          var _this = _super.call(this, props) || this; // 页面组件的实例
  
  
          _this.pageComponentInstance = null;
          _this.callbacks = new Map();
          Object.keys(Lifecycle).forEach(function (phase) {
            var callback = callbackName(phase);
  
            _this[callback] = function () {
              var args = [];
  
              for (var _i = 0; _i < arguments.length; _i++) {
                args[_i] = arguments[_i];
              }
  
              return _this.callLifecycle.apply(_this, __spread$4([phase], args));
            };
          });
          return _this;
        }
  
        PageWrapper.prototype.callLifecycle = function (phase) {
          var _a;
  
          var args = [];
  
          for (var _i = 1; _i < arguments.length; _i++) {
            args[_i - 1] = arguments[_i];
          }
  
          var callback = callbackName(phase);
  
          if (this.pageComponentInstance && typeof this.pageComponentInstance[callback] === 'function') {
            return (_a = this.pageComponentInstance)[callback].apply(_a, __spread$4(args));
          }
        };
  
        PageWrapper.prototype.render = function () {
          var _this = this;
  
          var props = {
            location: {
              query: query || {}
            }
          };
  
          if (isClassComponent(Page) || Page.$$typeof === ForwardRef) {
            props.ref = function (node) {
              return _this.pageComponentInstance = node;
            };
          }
  
          return React.createElement(PageInstanceContext.Provider, {
            value: this.props.page
          }, React.createElement(Page, props));
        };
  
        return PageWrapper;
      }(React.Component)
    );
  }
  
  var actionId = 0;
  function generate$1() {
    var id = actionId;
    actionId += 1;
    return id;
  }
  
  var effector = {
    listenerConfigs: []
  };
  
  function dispose(listener) {
    effector.listenerConfigs = effector.listenerConfigs.filter(function (config) {
      return config.listener !== listener;
    });
  }
  
  function connect(listener, once) {
    effector.listenerConfigs.push({
      listener: listener,
      once: once
    });
    return function () {
      return dispose(listener);
    };
  }
  
  function run() {
    effector.listenerConfigs.forEach(function (config) {
      config.listener();
  
      if (config.once) {
        dispose(config.listener);
      }
    });
  }
  
  var nativeEffect = {
    connect: connect,
    run: run,
    dispose: dispose
  };
  
  var is = function is(platform) {
    return undefined === platform;
  };
  
  var Platform = {
    get current() {
      return undefined;
    },
  
    get isAlipay() {
      return is('alipay');
    },
  
    get isWechat() {
      return is('wechat');
    },
  
    get isToutiao() {
      return is('toutiao');
    }
  
  };
  
  var __read$5 = undefined && undefined.__read || function (o, n) {
    var m = typeof Symbol === "function" && o[Symbol.iterator];
    if (!m) return o;
    var i = m.call(o),
        r,
        ar = [],
        e;
  
    try {
      while ((n === void 0 || n-- > 0) && !(r = i.next()).done) {
        ar.push(r.value);
      }
    } catch (error) {
      e = {
        error: error
      };
    } finally {
      try {
        if (r && !r.done && (m = i["return"])) m.call(i);
      } finally {
        if (e) throw e.error;
      }
    }
  
    return ar;
  };
  
  var __spread$5 = undefined && undefined.__spread || function () {
    for (var ar = [], i = 0; i < arguments.length; i++) {
      ar = ar.concat(__read$5(arguments[i]));
    }
  
    return ar;
  };
  
  var Container =
  /** @class */
  function () {
    function Container(context) {
      this.updateQueue = [];
      this.rendered = false;
      this.context = context;
      this.root = new VNode({
        id: generate(),
        type: 'root',
        container: this
      });
      this.root.mounted = true;
    }
  
    Container.prototype.requestUpdate = function (path, start, deleteCount, immediately) {
      var _this = this;
  
      var items = [];
  
      for (var _i = 4; _i < arguments.length; _i++) {
        items[_i - 4] = arguments[_i];
      }
  
      var update = {
        path: path,
        start: start,
        deleteCount: deleteCount,
        items: items
      };
  
      if (immediately) {
        this.updateQueue.push(update);
        this.applyUpdate();
      } else {
        if (this.updateQueue.length === 0) {
          Promise.resolve().then(function () {
            return _this.applyUpdate();
          });
        }
  
        this.updateQueue.push(update);
      }
    };
  
    Container.prototype.applyUpdate = function () {
      var _this = this;
  
      if (this.stopUpdate) {
        return;
      }
  
      var startTime = new Date().getTime();
  
      if (typeof this.context.$spliceData === 'function') {
        var $batchedUpdates = function $batchedUpdates(callback) {
          callback();
        };
  
        if (typeof this.context.$batchedUpdates === 'function') {
          $batchedUpdates = this.context.$batchedUpdates;
        }
  
        $batchedUpdates(function () {
          _this.updateQueue.map(function (update, index) {
            var _a;
  
            var callback = undefined;
  
            if (index + 1 === _this.updateQueue.length) {
              callback = function callback() {
                nativeEffect.run();
              };
            }
  
            _this.context.$spliceData((_a = {}, _a[update.path] = __spread$5([update.start, update.deleteCount], update.items), _a), callback);
          });
        });
        this.updateQueue = [];
        return;
      } // TODO 统一更新行为
  
  
      var action = {
        type: 'splice',
        payload: this.updateQueue.map(function (update) {
          return {
            path: update.path,
            start: update.start,
            deleteCount: update.deleteCount,
            item: update.items[0]
          };
        }),
        id: generate$1()
      };
  
      if (Platform.isToutiao) {
        action = {
          root: this.root.toJSON()
        };
      }
  
      this.context.setData({
        action: action
      }, function () {
        nativeEffect.run();
      });
      this.updateQueue = [];
    };
  
    Container.prototype.clearUpdate = function () {
      this.stopUpdate = true;
  
      if (Platform.isWechat) {
        this.context.setData({
          action: {
            type: 'clear'
          }
        });
      }
    };
  
    Container.prototype.createCallback = function (name, fn) {
      this.context[name] = fn;
    };
  
    Container.prototype.appendChild = function (child) {
      this.root.appendChild(child, true);
    };
  
    Container.prototype.removeChild = function (child) {
      this.root.removeChild(child, true);
    };
  
    Container.prototype.insertBefore = function (child, beforeChild) {
      this.root.insertBefore(child, beforeChild, true);
    };
  
    return Container;
  }();
  
  function createPortal(children, containerInfo, key) {
    return {
      // This tag allow us to uniquely identify this as a React Portal
      $$typeof: Portal,
      key: key == null ? null : '' + key,
      children: children,
      containerInfo: containerInfo,
      implementation: null
    };
  }
  
  var __read$6 = undefined && undefined.__read || function (o, n) {
    var m = typeof Symbol === "function" && o[Symbol.iterator];
    if (!m) return o;
    var i = m.call(o),
        r,
        ar = [],
        e;
  
    try {
      while ((n === void 0 || n-- > 0) && !(r = i.next()).done) {
        ar.push(r.value);
      }
    } catch (error) {
      e = {
        error: error
      };
    } finally {
      try {
        if (r && !r.done && (m = i["return"])) m.call(i);
      } finally {
        if (e) throw e.error;
      }
    }
  
    return ar;
  };
  
  var __spread$6 = undefined && undefined.__spread || function () {
    for (var ar = [], i = 0; i < arguments.length; i++) {
      ar = ar.concat(__read$6(arguments[i]));
    }
  
    return ar;
  };
  var idCounter = 0;
  
  function generatePageId() {
    var id = idCounter;
    var pageId = 'page_' + id;
    idCounter += 1;
    return pageId;
  } // for testing
  function createPageConfig(Page) {
    var app = getApp();
    var config = {
      data: {
        action: {},
        root: {
          children: []
        }
      },
      wrapperRef: React.createRef(),
      lifecycleCallback: {},
      onLoad: function onLoad(query) {
        var PageWrapper = createPageWrapper(Page, query);
        this.pageId = generatePageId();
        this.query = query;
        this.container = new Container(this);
        this.element = createPortal(React.createElement(PageWrapper, {
          page: this,
          ref: this.wrapperRef
        }), this.container, this.pageId);
  
        app._mount(this);
      },
      onUnload: function onUnload() {
        this.unloaded = true;
        this.container.clearUpdate();
  
        app._unmount(this);
      },
  
      /**
       * Lifecycle start
       */
      registerLifecycle: function registerLifecycle(lifecycle, callback) {
        var _this = this;
  
        this.lifecycleCallback[lifecycle] = this.lifecycleCallback[lifecycle] || [];
        this.lifecycleCallback[lifecycle].push(callback);
        return function () {
          _this.lifecycleCallback[lifecycle].splice(_this.lifecycleCallback[lifecycle].indexOf(callback), 1);
        };
      },
      callLifecycle: function callLifecycle(lifecycle) {
        var _a;
  
        var args = [];
  
        for (var _i = 1; _i < arguments.length; _i++) {
          args[_i - 1] = arguments[_i];
        }
  
        var callbacks = this.lifecycleCallback[lifecycle] || [];
        var result;
        callbacks.forEach(function (callback) {
          result = callback.apply(void 0, __spread$6(args));
        });
  
        if (result) {
          return result;
        }
  
        var callback = callbackName(lifecycle);
  
        if (this.wrapperRef.current && this.wrapperRef.current[callback]) {
          return (_a = this.wrapperRef.current)[callback].apply(_a, __spread$6(args));
        }
      },
      onShow: function onShow() {
        return this.callLifecycle(Lifecycle.show);
      },
      onHide: function onHide() {
        return this.callLifecycle(Lifecycle.hide);
      },
      onReady: function onReady() {
        return this.callLifecycle(Lifecycle.ready);
      },
      onPullDownRefresh: function onPullDownRefresh(e) {
        return this.callLifecycle(Lifecycle.pullDownRefresh, e);
      },
      onReachBottom: function onReachBottom() {
        return this.callLifecycle(Lifecycle.reachBottom);
      },
      onPageScroll: function onPageScroll(e) {
        return this.callLifecycle(Lifecycle.pageScroll, e);
      },
      onShareAppMessage: function onShareAppMessage(options) {
        return this.callLifecycle(Lifecycle.shareAppMessage, options) || {};
      },
      onTitleClick: function onTitleClick() {
        return this.callLifecycle(Lifecycle.titleClick);
      },
      onOptionMenuClick: function onOptionMenuClick(e) {
        return this.callLifecycle(Lifecycle.optionMenuClick, e);
      },
      onPopMenuClick: function onPopMenuClick(e) {
        return this.callLifecycle(Lifecycle.popMenuClick, e);
      },
      onPullIntercept: function onPullIntercept() {
        return this.callLifecycle(Lifecycle.pullIntercept);
      },
      events: {
        // 页面返回时触发
        onBack: function onBack(e) {
          return config.callLifecycle(Lifecycle.back, e);
        },
        // 键盘高度变化时触发
        onKeyboardHeight: function onKeyboardHeight(e) {
          return config.callLifecycle(Lifecycle.keyboardHeight, e);
        },
        onTabItemTap: function onTabItemTap(e) {
          return config.callLifecycle(Lifecycle.tabItemTap, e);
        },
        // 点击但切换tabItem前触发
        beforeTabItemTap: function beforeTabItemTap() {
          return config.callLifecycle(Lifecycle.beforeTabItemTap);
        },
        onResize: function onResize(e) {
          return config.callLifecycle(Lifecycle.resize, e);
        }
      }
    };
    return config;
  }
  
  var __assign$1 = undefined && undefined.__assign || function () {
    __assign$1 = Object.assign || function (t) {
      for (var s, i = 1, n = arguments.length; i < n; i++) {
        s = arguments[i];
  
        for (var p in s) {
          if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
        }
      }
  
      return t;
    };
  
    return __assign$1.apply(this, arguments);
  };
  
  var unstable_batchedUpdates = ReactReconcilerInst.batchedUpdates;
  
  exports._classCallCheck = _classCallCheck;
  exports._createClass = _createClass;
  exports._createSuper = _createSuper;
  exports._inherits = _inherits;
  exports.createAppConfig = createAppConfig;
  exports.createHostComponent = createHostComponent;
  exports.createPageConfig = createPageConfig;
  