UNPKG

vuereact-combined

Version:

Vue和React快捷集成的工具包,并且适合复杂的集成场景

2 lines (1 loc) 44.6 kB
import React,{version,lazy}from"react";import Vue from"vue";import ReactDOM,{createPortal}from"react-dom";function ownKeys(e,t){var r,o=Object.keys(e);return Object.getOwnPropertySymbols&&(r=Object.getOwnPropertySymbols(e),t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),o.push.apply(o,r)),o}function _objectSpread2(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ownKeys(Object(r),!0).forEach(function(t){_defineProperty(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ownKeys(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function _typeof(t){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function _classCallCheck(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function _defineProperties(t,e){for(var r=0;r<e.length;r++){var o=e[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}function _createClass(t,e,r){return e&&_defineProperties(t.prototype,e),r&&_defineProperties(t,r),t}function _defineProperty(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function _extends(){return(_extends=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var r,o=arguments[e];for(r in o)Object.prototype.hasOwnProperty.call(o,r)&&(t[r]=o[r])}return t}).apply(this,arguments)}function _inherits(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&_setPrototypeOf(t,e)}function _getPrototypeOf(t){return(_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function _setPrototypeOf(t,e){return(_setPrototypeOf=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}function _objectWithoutPropertiesLoose(t,e){if(null==t)return{};for(var r,o={},n=Object.keys(t),a=0;a<n.length;a++)r=n[a],0<=e.indexOf(r)||(o[r]=t[r]);return o}function _objectWithoutProperties(t,e){if(null==t)return{};var r,o=_objectWithoutPropertiesLoose(t,e);if(Object.getOwnPropertySymbols)for(var n=Object.getOwnPropertySymbols(t),a=0;a<n.length;a++)r=n[a],0<=e.indexOf(r)||Object.prototype.propertyIsEnumerable.call(t,r)&&(o[r]=t[r]);return o}function _assertThisInitialized(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function _possibleConstructorReturn(t,e){return!e||"object"!=typeof e&&"function"!=typeof e?_assertThisInitialized(t):e}function _createSuper(r){var o=_isNativeReflectConstruct();return function(){var t,e=_getPrototypeOf(r);return _possibleConstructorReturn(this,o?(t=_getPrototypeOf(this).constructor,Reflect.construct(e,arguments,t)):e.apply(this,arguments))}}function _toConsumableArray(t){return _arrayWithoutHoles(t)||_iterableToArray(t)||_unsupportedIterableToArray(t)||_nonIterableSpread()}function _arrayWithoutHoles(t){if(Array.isArray(t))return _arrayLikeToArray(t)}function _iterableToArray(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}function _unsupportedIterableToArray(t,e){if(t){if("string"==typeof t)return _arrayLikeToArray(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Map"===(r="Object"===r&&t.constructor?t.constructor.name:r)||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?_arrayLikeToArray(t,e):void 0}}function _arrayLikeToArray(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,o=new Array(e);r<e;r++)o[r]=t[r];return o}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _toPrimitive(t,e){if("object"!=typeof t||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0===r)return("string"===e?String:Number)(t);e=r.call(t,e||"default");if("object"!=typeof e)return e;throw new TypeError("@@toPrimitive must return a primitive value.")}function _toPropertyKey(t){t=_toPrimitive(t,"string");return"symbol"==typeof t?t:String(t)}var originOptions={react:{componentWrap:"div",slotWrap:"div",componentWrapAttrs:{__use_react_component_wrap:"",style:{all:"unset"}},slotWrapAttrs:{__use_react_slot_wrap:"",style:{all:"unset"}}},vue:{componentWrapHOC:function(e){var r=1<arguments.length&&void 0!==arguments[1]?arguments[1]:[];return function(){var t=(0<arguments.length&&void 0!==arguments[0]?arguments[0]:{}).portals,t=void 0===t?[]:t;return React.createElement("div",r,e,t.map(function(t){var e=t.Portal,t=t.key;return React.createElement(e,{key:t})}))}},componentWrapAttrs:{"data-use-vue-component-wrap":"",style:{all:"unset"}},slotWrapAttrs:{"data-use-vue-slot-wrap":"",style:{all:"unset"}}}};function setOptions(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{react:{},vue:{}},e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:originOptions,r=2<arguments.length?arguments[2]:void 0;t.vue||(t.vue={}),t.react||(t.react={});t=[e,_objectSpread2(_objectSpread2({},t),{},{react:_objectSpread2(_objectSpread2(_objectSpread2({},e.react),t.react),{},{componentWrapAttrs:_objectSpread2(_objectSpread2({},e.react.componentWrapAttrs),t.react.componentWrapAttrs),slotWrapAttrs:_objectSpread2(_objectSpread2({},e.react.slotWrapAttrs),t.react.slotWrapAttrs)}),vue:_objectSpread2(_objectSpread2(_objectSpread2({},e.vue),t.vue),{},{componentWrapAttrs:_objectSpread2(_objectSpread2({},e.vue.componentWrapAttrs),t.vue.componentWrapAttrs),slotWrapAttrs:_objectSpread2(_objectSpread2({},e.vue.slotWrapAttrs),t.vue.slotWrapAttrs)})})];return r&&t.unshift({}),Object.assign.apply(this,t)}var vueRootInfo={},_excluded=["ref"],_excluded2=["style"],_excluded3=["key","data-passed-props"],_excluded4=["data-passed-props","hashList"],_excluded5=["style"],_excluded6=["on","$slots","$scopedSlots","children"],ReactMajorVersion=parseInt(version),domMethods=["getElementById","getElementsByClassName","getElementsByTagName","getElementsByTagNameNS","querySelector","querySelectorAll"],domTopObject={Document:{},Element:{}};function overwriteDomMethods(s){Object.keys(domTopObject).forEach(function(t){domMethods.forEach(function(n){var a=window[t].prototype[n];domTopObject[t][n]=a,window[t].prototype[n]=function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];var o=a.apply(this,e);return o&&o.constructor!==NodeList||o&&o.constructor===NodeList&&0<o.length?o:Element.prototype[n].apply(s,e)}})})}function recoverDomMethods(){Object.keys(domTopObject).forEach(function(e){domMethods.forEach(function(t){window[e].prototype[t]=domTopObject[e][t]})})}var FunctionComponentWrap=function(){_inherits(r,React.Component);var e=_createSuper(r);function r(t){return _classCallCheck(this,r),e.call(this,t)}return _createClass(r,[{key:"render",value:function(){var t=this.props.component,e=this.props.passedProps,e=(e.ref,_objectWithoutProperties(e,_excluded));return React.createElement(t,e,this.props.children)}}]),r}(),createReactContainer=function(f,h,_){var t,e=t=function(){_inherits(d,React.Component);var r=_createSuper(d);function d(t){var e;return _classCallCheck(this,d),(e=r.call(this,t)).state=_objectSpread2(_objectSpread2({},t),h.isSlots?{children:f}:{}),e.setRef=e.setRef.bind(_assertThisInitialized(e)),e.vueInReactCall=e.vueInReactCall.bind(_assertThisInitialized(e)),e.vueWrapperRef=_,e}return _createClass(d,[{key:"setRef",value:function(e){e&&(_.reactRef=e,Object.keys(e).forEach(function(t){_[t]||(_[t]=e[t])}),Promise.resolve().then(function(){Object.keys(e).forEach(function(t){_[t]||(_[t]=e[t])})}),(this.setRef.current=e).vueWrapperRef=_)}},{key:"createSlot",value:function(r){var t=h.react.slotWrapAttrs,o=t.style,n=_objectWithoutProperties(t,_excluded2);return{inheritAttrs:!1,__fromReactSlot:!0,render:function(t){var e;return 1===(null===(r=r instanceof Function?r(this):r)||void 0===r?void 0:r.length)&&null!==(e=r[0])&&void 0!==e&&e.data&&((e=this.$attrs).key,e["data-passed-props"],e=_objectWithoutProperties(e,_excluded3),r[0].data.attrs=_objectSpread2(_objectSpread2({},e),r[0].data.attrs)),t(h.react.slotWrap,{attrs:n,style:o},r)}}}},{key:"componentWillUnmount",value:function(){_.reactRef&&(_.reactRef.vueWrapperRef=null,_.reactRef=null)}},{key:"vueInReactCall",value:function(t){var o=this,n=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};return(2<arguments.length?arguments[2]:void 0)&&t&&t[0]?t.map(function(t,e){var r;return applyVueInReact(o.createSlot(t instanceof Function?t:[t]),_objectSpread2(_objectSpread2(_objectSpread2({},h),n),{},{isSlots:!0,wrapInstance:_})).render({key:(null==t||null===(r=t.data)||void 0===r?void 0:r.key)||e})}):applyVueInReact(this.createSlot(t),_objectSpread2(_objectSpread2(_objectSpread2({},h),n),{},{isSlots:!0,wrapInstance:_})).render()}},{key:"render",value:function(){var t,e,r,o,n=this,a=this.state,s=a["data-passed-props"],i=a.hashList,c=_objectWithoutProperties(a,_excluded4),u={},p={};for(e in c)r=e,o=void 0,c.hasOwnProperty(r)&&null!=c[r]&&(c[r].__slot?(c[r].reactSlot?c[r]=c[r].reactSlot:(o=c[r],h.defaultSlotsFormatter?(c[r].__top__=n.vueWrapperRef,c[r]=h.defaultSlotsFormatter(c[r],n.vueInReactCall,i),c[r]instanceof Array?c[r]=_toConsumableArray(c[r]):-1<["string","number"].indexOf(_typeof(c[r]))?c[r]=[c[r]]:"object"===_typeof(c[r])&&(c[r]=_objectSpread2({},c[r]))):c[r]=_objectSpread2({},applyVueInReact(n.createSlot(c[r]),_objectSpread2(_objectSpread2({},h),{},{isSlots:!0,wrapInstance:_})).render()),c[r].vueSlot=o),u[r]=c[r]):c[r].__scopedSlot&&(c[r]=c[r](n.createSlot),p[r]=c[r]));null!==(l=c.children)&&void 0!==l&&l.vueFunction||(t=c.children),u.default=t;s=_objectSpread2(_objectSpread2(_objectSpread2({},s),{$slots:u,$scopedSlots:p}),{},{children:t}),a={};if(a.ref=this.setRef,h.isSlots)return this.state.children||this.props.children;var l=c,l=_objectSpread2(_objectSpread2({},l=h.defaultPropsFormatter?h.defaultPropsFormatter(c,this.vueInReactCall,i):l),{"data-passed-props":s});return Object.getPrototypeOf(f)!==Function.prototype&&("object"!==_typeof(f)||f.render)||d.catchVueRefs()?React.createElement(f,_extends({},l,{"data-passed-props":s},a),t||l.children):React.createElement(FunctionComponentWrap,_extends({passedProps:l,component:f},a),t||l.children)}}],[{key:"catchVueRefs",value:function(){if(!_.$parent)return!1;for(var t in _.$parent.$refs)if(_.$parent.$refs[t]===_)return!0;return!1}}]),d}();return _defineProperty(t,"displayName","useReact_".concat(f.displayName||f.name||"Component")),e};function applyReactInVue(E){var W=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};return E.__esModule&&E.default&&(E=E.default),W.isSlots&&(E=E()),W=setOptions(W,void 0,!0),{originReactComponent:E,data:function(){return{portals:[],portalKeyPool:[],maxPortalCount:0}},created:function(){this.cleanVnodeStyleClass(),this.$root.$options.router&&(vueRootInfo.router=this.$root.$options.router),this.$root.$options.router&&(vueRootInfo.store=this.$root.$options.store)},props:["dataPassedProps"],render:function(r){this.slotsInit();var t=W.react.componentWrapAttrs,e=t.style,t=_objectWithoutProperties(t,_excluded5);return r(W.react.componentWrap,{ref:"react",attrs:t,style:e},this.portals.map(function(t){var e=t.Portal,t=t.key;return e(r,t)}))},methods:{pushVuePortal:function(t){var e=this.portalKeyPool.shift()||this.maxPortalCount++;this.portals.push({Portal:t,key:e})},removeVuePortal:function(r){var o,t=this.portals.find(function(t,e){if(t.Portal===r)return o=e,!0});this.portalKeyPool.push(t.key),this.portals.splice(o,1)},slotsInit:function(e){var t,r,o,n,a=this;if(e)return null===(t=e.componentOptions)||void 0===t||null===(r=t.Ctor)||void 0===r||!r.options||null!==(r=e.componentOptions)&&void 0!==r&&null!==(o=r.Ctor)&&void 0!==o&&o.options.originReactComponent?(null!==(o=e.data)&&void 0!==o&&o.scopedSlots&&Object.keys(null===(n=e.data)||void 0===n?void 0:n.scopedSlots).forEach(function(t){if("function"==typeof e.data.scopedSlots[t])try{e.data.scopedSlots[t]()}catch(t){}}),void(e.children||(null===(n=e.componentOptions)||void 0===n?void 0:n.children)||[]).forEach(function(t){a.slotsInit(t)})):void 0;Object.keys(this.$slots).forEach(function(t){(a.$slots[t]||[]).forEach(function(t){a.slotsInit(t)})}),Object.keys(this.$scopedSlots).forEach(function(t){try{a.$scopedSlots[t]()}catch(t){}})},updateLastVnodeData:function(t){return this.lastVnodeData={style:_objectSpread2(_objectSpread2({},this.formatStyle(t.data.style)),this.formatStyle(t.data.staticStyle)),class:Array.from(new Set([].concat(_toConsumableArray(this.formatClass(t.data.class)),_toConsumableArray(this.formatClass(t.data.staticClass))))).join(" ")},Object.assign(t.data,{staticStyle:null,style:null,staticClass:null,class:null}),t},cleanVnodeStyleClass:function(){var e=this,r=this.$vnode;this.updateLastVnodeData(r),Object.defineProperty(this,"$vnode",{get:function(){return r},set:function(t){return t===r?r:r=e.updateLastVnodeData(t)}})},toCamelCase:function(t){return t.replace(/-(\w)/g,function(t,e){return e.toUpperCase()})},formatStyle:function(e){var r=this;if(!e)return{};if("string"==typeof e)return(e=e.trim()).split(/\s*;\s*/).reduce(function(t,e){return e&&(2!==(e=e.split(/\s*:\s*/)).length||Object.assign(t,_defineProperty({},r.toCamelCase(e[0]),e[1]))),t},{});if("object"!==_typeof(e))return{};var o={};return Object.keys(e).forEach(function(t){o[r.toCamelCase(t)]=e[t]}),o},formatClass:function(e){return e?e instanceof Array?e:"string"==typeof e?(e=e.trim()).split(/\s+/):"object"===_typeof(e)?Object.keys(e).map(function(t){return e[t]||""}):[]:[]},getScopeSlot:function(a,s,e){var i=this;function t(n){function t(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];if(a.reactFunction)return a.reactFunction.apply(this,e);if(W.defaultSlotsFormatter){var o=a.apply(this,e);return o.__top__=i,(o=W.defaultSlotsFormatter(o,i.vueInReactCall,s))instanceof Array||-1<_typeof(o).indexOf("string","number")?o=_toConsumableArray(o):"object"===_typeof(o)&&(o=_objectSpread2({},o)),o}return applyVueInReact(n(a.apply(this,e)),_objectSpread2(_objectSpread2({},W),{},{isSlots:!0,wrapInstance:i})).render()}return W.pureTransformer&&e?t.vueFunction=e:t.vueFunction=a,t}return t.__scopedSlot=!0,t},__syncUpdateProps:function(t){this.reactInstance&&this.reactInstance.setState(t)},mountReactComponent:function(t,e){var r,o,n,a=this,s=2<arguments.length&&void 0!==arguments[2]?arguments[2]:{},i=null!=this.$props.dataPassedProps?this.$props.dataPassedProps:{},c=i.on,u=i.$slots,p=i.$scopedSlots,l=i.children,d=_objectWithoutProperties(i,_excluded6),f={},h=[],_=null===(i=this.$vnode.context)||void 0===i||null===(r=i.$vnode)||void 0===r||null===(o=r.componentOptions)||void 0===o||null===(n=o.Ctor)||void 0===n||null===(_=n.extendOptions)||void 0===_?void 0:_._scopeId;_&&(f[_]="",h.push(_));var m={},v={};if(!t||t&&null!=e&&e.slot){var y,S=_objectSpread2(_objectSpread2({},u),this.$slots);for(y in S)m[y]=S[y],m[y].__slot=!0;var b,R,g,j,P=_objectSpread2(_objectSpread2({},p),this.$scopedSlots);for(b in P)m[b]?this.$scopedSlots[b]&&(this.$scopedSlots[b].__slot=!0):P[b].__slot?(m[b]=P[b](),m[b].__slot=!0):v[b]=this.getScopeSlot(P[b],h,null===(R=this.$vnode)||void 0===R||null===(g=R.data)||void 0===g||null===(j=g.scopedSlots)||void 0===j?void 0:j[b])}var C,$=_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2({},d),_objectSpread2({},this.$attrs)),!t||t&&null!=e&&e.slot?{$slots:m,$scopedSlots:v,children:l}:{}),{},{on:_objectSpread2(_objectSpread2({},c),this.$listeners)});(!t||t&&null!=e&&e.slot)&&(C=_objectSpread2({},m),l=C.default,delete C.default),this.last=this.last||{},this.last.slot=this.last.slot||{},this.last.listeners=this.last.listeners||{},this.last.attrs=this.last.attrs||{};var I={slot:function(){a.last.slot=_objectSpread2(_objectSpread2(_objectSpread2({},l?{children:l}:{children:null}),C),v)},listeners:function(){a.last.listeners=$.on},attrs:function(){a.last.attrs=a.$attrs}};if(e&&Object.keys(e).forEach(function(t){return I[t]()}),t){function w(){a.reactInstance&&a.reactInstance.setState(function(e){return Object.keys(e).forEach(function(t){W.isSlots&&"children"===t||delete e[t]}),_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2({},a.cache),!W.isSlots&&a.last.slot),a.last.attrs),O)}),a.cache=null}this.microTaskUpdate&&(this.cache||this.$nextTick(function(){w(),a.microTaskUpdate=!1})),this.macroTaskUpdate&&(clearTimeout(this.updateTimer),this.updateTimer=setTimeout(function(){clearTimeout(a.updateTimer),w(),a.macroTaskUpdate=!1}));var O={};Object.keys(this.last.listeners).forEach(function(t){O["on".concat(t.replace(/^(\w)/,function(t,e){return e.toUpperCase()}))]=a.$listeners[t]}),this.cache=_objectSpread2(_objectSpread2({},this.cache||{}),_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2({},d),s),{"data-passed-props":$}),this.lastVnodeData.class?{className:this.lastVnodeData.class}:{}),_objectSpread2({},f)),{},{hashList:h,style:this.lastVnodeData.style})),this.macroTaskUpdate||this.microTaskUpdate||w()}else{I.slot(),I.listeners(),I.attrs();var s=createReactContainer(E,W,this),x={};Object.keys($.on).forEach(function(t){x["on".concat(t.replace(/^(\w)/,function(t,e){return e.toUpperCase()}))]=$.on[t]});var V=React.createElement(s,_extends({},d,this.$attrs,x,{children:l},C,v,{"data-passed-props":$},this.lastVnodeData.class?{className:this.lastVnodeData.class}:{},f,{hashList:h,style:this.lastVnodeData.style,ref:function(t){return a.reactInstance=t}}));this.$redux&&this.$redux.store&&this.$redux.ReactReduxContext&&(f=this.$redux.ReactReduxContext,V=React.createElement(f.Provider,{value:{store:this.$redux.store}},V));var k=this.$refs.react,T=W.wrapInstance;if(T)(T=W.wrapInstance).vueWrapperRef=this;else for(var A=this.$parent;A;){if(A.parentReactWrapperRef){T=A.parentReactWrapperRef;break}if(A.reactWrapperRef){T=A.reactWrapperRef;break}A=A.$parent}if(T)return this.parentReactWrapperRef=T,this.reactPortal=function(){return createPortal(V,k)},void T.pushReactPortal(this.reactPortal);if(17<ReactMajorVersion)return void 0!==ReactDOM.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED&&(ReactDOM.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.usingClientEntryPoint=!0),this.__veauryReactApp__=ReactDOM.createRoot(k),void this.__veauryReactApp__.render(V);ReactDOM.render(V,k)}}},mounted:function(){clearTimeout(this.updateTimer),this.mountReactComponent()},beforeDestroy:function(){if(clearTimeout(this.updateTimer),this.reactPortal)return overwriteDomMethods(this.$refs.react),this.parentReactWrapperRef&&this.parentReactWrapperRef.removeReactPortal(this.reactPortal),void recoverDomMethods();overwriteDomMethods(this.$refs.react),17<ReactMajorVersion?this.__veauryReactApp__.unmount():ReactDOM.unmountComponentAtNode(this.$refs.react),recoverDomMethods()},updated:function(){this.mountReactComponent(!0,{slot:!0})},inheritAttrs:!1,watch:{$attrs:{handler:function(){this.mountReactComponent(!0,{attrs:!0})},deep:!0},$listeners:{handler:function(){this.mountReactComponent(!0,{listeners:!0})},deep:!0},"$props.dataPassedProps":{handler:function(){this.mountReactComponent(!0,{passedProps:!0})},deep:!0}}}}var reactRouterInfo={};function applyReactRouterInVue(t){return reactRouterInfo.withRouter||(reactRouterInfo.withRouter=t,reactRouterInfo.withRouter)}function setReactRouterInVue(t){reactRouterInfo.vueInstance?updateReactRouterInVue(t):(reactRouterInfo.vueInstance=new Vue({data:_objectSpread2({},t)}),Vue.prototype.$reactRouter=reactRouterInfo.vueInstance.$data)}function updateReactRouterInVue(t){Object.assign(reactRouterInfo.vueInstance.$data,_objectSpread2({},t))}function _typeof$1(t){return(_typeof$1="function"==typeof Symbol&&"symbol"===_typeof(Symbol.iterator)?function(t){return _typeof(t)}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":_typeof(t)})(t)}function _toConsumableArray$1(t){return _arrayWithoutHoles$1(t)||_iterableToArray$1(t)||_nonIterableSpread$1()}function _arrayWithoutHoles$1(t){if(Array.isArray(t)){for(var e=0,r=new Array(t.length);e<t.length;e++)r[e]=t[e];return r}}function _iterableToArray$1(t){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t))return Array.from(t)}function _nonIterableSpread$1(){throw new TypeError("Invalid attempt to spread non-iterable instance")}var inBrowser="undefined"!=typeof window;function freeze(t){return Array.isArray(t)||"object"===_typeof$1(t)?Object.freeze(t):t}function combinePassengers(t){var o=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};return t.reduce(function(t,e){var r=e.passengers[0],e="function"==typeof r?r(o):e.passengers;return t.concat(e)},[])}function stableSort(t,r){return t.map(function(t,e){return[e,t]}).sort(function(t,e){return r(t[1],e[1])||t[0]-e[0]}).map(function(t){return t[1]})}function pick(r,t){return t.reduce(function(t,e){return r.hasOwnProperty(e)&&(t[e]=r[e]),t},{})}var transports={},targets={},sources={},Wormhole=Vue.extend({data:function(){return{transports:transports,targets:targets,sources:sources,trackInstances:inBrowser}},methods:{open:function(t){var e,r,o;inBrowser&&(e=t.to,r=t.from,o=t.passengers,t=void 0===(t=t.order)?1/0:t,e&&r&&o&&(r={to:e,from:r,passengers:freeze(o),order:t},-1===Object.keys(this.transports).indexOf(e)&&Vue.set(this.transports,e,[]),o=this.$_getTransportIndex(r),t=this.transports[e].slice(0),-1===o?t.push(r):t[o]=r,this.transports[e]=stableSort(t,function(t,e){return t.order-e.order})))},close:function(t){var e=1<arguments.length&&void 0!==arguments[1]&&arguments[1],r=t.to,o=t.from;r&&(o||!1!==e)&&this.transports[r]&&(e?this.transports[r]=[]:0<=(o=this.$_getTransportIndex(t))&&((e=this.transports[r].slice(0)).splice(o,1),this.transports[r]=e))},registerTarget:function(t,e,r){inBrowser&&(this.trackInstances&&!r&&this.targets[t]&&console.warn("[portal-vue]: Target ".concat(t," already exists")),this.$set(this.targets,t,Object.freeze([e])))},unregisterTarget:function(t){this.$delete(this.targets,t)},registerSource:function(t,e,r){inBrowser&&(this.trackInstances&&!r&&this.sources[t]&&console.warn("[portal-vue]: source ".concat(t," already exists")),this.$set(this.sources,t,Object.freeze([e])))},unregisterSource:function(t){this.$delete(this.sources,t)},hasTarget:function(t){return!(!this.targets[t]||!this.targets[t][0])},hasSource:function(t){return!(!this.sources[t]||!this.sources[t][0])},hasContentFor:function(t){return!!this.transports[t]&&!!this.transports[t].length},$_getTransportIndex:function(t){var e,r=t.to,o=t.from;for(e in this.transports[r])if(this.transports[r][e].from===o)return+e;return-1}}}),wormhole=new Wormhole(transports),_id=1,Portal=Vue.extend({name:"portal",props:{disabled:{type:Boolean},name:{type:String,default:function(){return String(_id++)}},order:{type:Number,default:0},slim:{type:Boolean},slotProps:{type:Object,default:function(){return{}}},tag:{type:String,default:"DIV"},to:{type:String,default:function(){return String(Math.round(1e7*Math.random()))}}},created:function(){var t=this;this.$nextTick(function(){wormhole.registerSource(t.name,t)})},mounted:function(){this.disabled||this.sendUpdate()},updated:function(){this.disabled?this.clear():this.sendUpdate()},beforeDestroy:function(){wormhole.unregisterSource(this.name),this.clear()},watch:{to:function(t,e){e&&e!==t&&this.clear(e),this.sendUpdate()}},methods:{clear:function(t){t={from:this.name,to:t||this.to};wormhole.close(t)},normalizeSlots:function(){return this.$scopedSlots.default?[this.$scopedSlots.default]:this.$slots.default},normalizeOwnChildren:function(t){return"function"==typeof t?t(this.slotProps):t},sendUpdate:function(){var t=this.normalizeSlots();t?(t={from:this.name,to:this.to,passengers:_toConsumableArray$1(t),order:this.order},wormhole.open(t)):this.clear()}},render:function(t){var e=this.$slots.default||this.$scopedSlots.default||[],r=this.tag;return e&&this.disabled?e.length<=1&&this.slim?this.normalizeOwnChildren(e)[0]:t(r,[this.normalizeOwnChildren(e)]):this.slim?t():t(r,{class:{"v-portal":!0},style:{display:"none"},key:"v-portal-placeholder"})}}),PortalTarget=Vue.extend({name:"portalTarget",props:{multiple:{type:Boolean,default:!1},name:{type:String,required:!0},slim:{type:Boolean,default:!1},slotProps:{type:Object,default:function(){return{}}},tag:{type:String,default:"div"},transition:{type:[String,Object,Function]}},data:function(){return{transports:wormhole.transports,firstRender:!0}},created:function(){var t=this;this.$nextTick(function(){wormhole.registerTarget(t.name,t)})},watch:{ownTransports:function(){this.$emit("change",0<this.children().length)},name:function(t,e){wormhole.unregisterTarget(e),wormhole.registerTarget(t,this)}},mounted:function(){var t=this;this.transition&&this.$nextTick(function(){t.firstRender=!1})},beforeDestroy:function(){wormhole.unregisterTarget(this.name)},computed:{ownTransports:function(){var t=this.transports[this.name]||[];return this.multiple?t:0===t.length?[]:[t[t.length-1]]},passengers:function(){return combinePassengers(this.ownTransports,this.slotProps)}},methods:{children:function(){return 0!==this.passengers.length?this.passengers:this.$scopedSlots.default?this.$scopedSlots.default(this.slotProps):this.$slots.default||[]},noWrapper:function(){var t;return(t=this.slim&&!this.transition)&&1<this.children().length&&console.warn("[portal-vue]: PortalTarget with `slim` option received more than one child element."),t}},render:function(t){var e=this.noWrapper(),r=this.children(),o=this.transition||this.tag;return e?r[0]:this.slim&&!o?t():t(o,{props:{tag:this.transition&&this.tag?this.tag:void 0},class:{"vue-portal-target":!0}},r)}}),_id$1=0,portalProps=["disabled","name","order","slim","slotProps","tag","to"],targetProps=["multiple","transition"],MountingPortal=Vue.extend({name:"MountingPortal",inheritAttrs:!1,props:{append:{type:[Boolean,String]},bail:{type:Boolean},mountTo:{type:String,required:!0},disabled:{type:Boolean},name:{type:String,default:function(){return"mounted_"+String(_id$1++)}},order:{type:Number,default:0},slim:{type:Boolean},slotProps:{type:Object,default:function(){return{}}},tag:{type:String,default:"DIV"},to:{type:String,default:function(){return String(Math.round(1e7*Math.random()))}},multiple:{type:Boolean,default:!1},targetSlim:{type:Boolean},targetSlotProps:{type:Object,default:function(){return{}}},targetTag:{type:String,default:"div"},transition:{type:[String,Object,Function]}},created:function(){var t,e,r;"undefined"!=typeof document&&((t=document.querySelector(this.mountTo))?(e=this.$props,wormhole.targets[e.name]?e.bail?console.warn("[portal-vue]: Target ".concat(e.name," is already mounted.\n Aborting because 'bail: true' is set")):this.portalTarget=wormhole.targets[e.name]:((e=e.append)&&(r=document.createElement("string"==typeof e?e:"DIV"),t.appendChild(r),t=r),(r=pick(this.$props,targetProps)).slim=this.targetSlim,r.tag=this.targetTag,r.slotProps=this.targetSlotProps,r.name=this.to,this.portalTarget=new PortalTarget({el:t,parent:this.$parent||this,propsData:r}))):console.error("[portal-vue]: Mount Point '".concat(this.mountTo,"' not found in document")))},beforeDestroy:function(){var t,e=this.portalTarget;this.append&&(t=e.$el).parentNode.removeChild(t),e.$destroy()},render:function(t){if(!this.portalTarget)return console.warn("[portal-vue] Target wasn't mounted"),t();if(!this.$scopedSlots.manual){var e=pick(this.$props,portalProps);return t(Portal,{props:e,attrs:this.$attrs,on:this.$listeners,scopedSlots:this.$scopedSlots},this.$slots.default)}e=this.$scopedSlots.manual({to:this.to});return(e=Array.isArray(e)?e[0]:e)?e:t()}}),REACT_ALL_HANDLERS=new Set(["onClick","onContextMenu","onDoubleClick","onDrag","onDragEnd","onDragEnter","onDragExit","onDragLeave","onDragOver","onDragStart","onDrop","onMouseDown","onMouseEnter","onMouseLeave","onMouseMove","onMouseOut","onMouseOver","onMouseUp","onChange","onInput","onInvalid","onReset","onSubmit","onError","onLoad","onPointerDown","onPointerMove","onPointerUp","onPointerCancel","onGotPointerCapture","onLostPointerCapture","onPointerEnter","onPointerLeave","onPointerOver","onPointerOut","onSelect","onTouchCancel","onTouchEnd","onTouchMove","onTouchStart","onScroll","onWheel","onAbort","onCanPlay","onCanPlayThrough","onDurationChange","onEmptied","onEncrypted","onEnded","onError","onLoadedData","onLoadedMetadata","onLoadStart","onPause","onPlay","onPlaying","onProgress","onRateChange","onSeeked","onSeeking","onStalled","onSuspend","onTimeUpdate","onVolumeChange","onWaiting","onLoad","onError","onAnimationStart","onAnimationEnd","onAnimationIteration","onTransitionEnd","onToggle"]),_excluded$1=["history","match","location"],_excluded2$1=["$model"],_excluded3$1=["$sync"],_excluded4$1=["$slots","$scopedSlots","children","on"],_excluded5$1=["component","on","$slots","$scopedSlots","children","class","style","data-passed-props"],_excluded6$1=["className","classname"],unsafePrefix=17<=parseFloat(version)?"UNSAFE_":"",optionsName="vuereact-combined-options";function filterVueComponent(t){return"string"==typeof t?Vue.component(t):t}function getOptions(t){return"function"==typeof t?t.options:t}var GetReactRouterPropsCom=function(){_inherits(o,React.Component);var r=_createSuper(o);function o(t){_classCallCheck(this,o);var e=r.call(this,t);return setReactRouterInVue({history:t.history,match:t.match,location:t.location}),e}return _createClass(o,[{key:"".concat(unsafePrefix,"componentWillReceiveProps"),value:function(t){updateReactRouterInVue({history:t.history,match:t.match,location:t.location})}},{key:"render",value:function(){var t=this.props,t=(t.history,t.match,t.location,_objectWithoutProperties(t,_excluded$1));return React.createElement(VueComponentLoader,_extends({},t,{ref:this.props.forwardRef}))}}]),o}(),VueContainer=React.forwardRef(function(t,e){var r=setOptions(t[optionsName]||{},void 0,!0);return reactRouterInfo.withRouter?(VueContainer.RouterTargetComponent||(VueContainer.RouterTargetComponent=reactRouterInfo.withRouter(GetReactRouterPropsCom)),React.createElement(VueContainer.RouterTargetComponent,_extends({},_objectSpread2(_objectSpread2({},t),{},_defineProperty({},optionsName,r)),{forwardRef:e}))):React.createElement(VueComponentLoader,_extends({},_objectSpread2(_objectSpread2({},t),{},_defineProperty({},optionsName,r)),{ref:e}))}),VueComponentLoader=function(){_inherits(o,React.Component);var r=_createSuper(o);function o(t){var e;return _classCallCheck(this,o),(e=r.call(this,t)).state={portals:[]},e.portalKeyPool=[],e.maxPortalCount=0,e.currentVueComponent=filterVueComponent(t.component),e.createVueInstance=e.createVueInstance.bind(_assertThisInitialized(e)),e.vueComponentContainer=e.createVueComponentContainer(),e}return _createClass(o,[{key:"pushReactPortal",value:function(t){var e=this.state.portals,r=this.portalKeyPool.shift()||this.maxPortalCount++;e.push({Portal:t,key:r}),this.setState({portals:e})}},{key:"removeReactPortal",value:function(r){var o,t=this.state.portals,e=t.find(function(t,e){if(t.Portal===r)return o=e,!0});this.portalKeyPool.push(e.key),t.splice(o,1),this.vueRef&&this.setState({portals:t})}},{key:"createVueComponentContainer",value:function(){var e=this,r={},t=this.props[optionsName];return t.isSlots?(Object.keys(this.props).forEach(function(t){REACT_ALL_HANDLERS.has(t)&&"function"==typeof e.props[t]&&(r[t]=e.props[t])}),t.vue.slotWrapAttrs&&(r=_objectSpread2(_objectSpread2({},r),t.vue.slotWrapAttrs))):t.vue.componentWrapAttrs&&(r=_objectSpread2(_objectSpread2({},r),t.vue.componentWrapAttrs)),t.vue.componentWrapHOC(React.createElement("div",{ref:this.createVueInstance,key:null}),r)}},{key:"".concat(unsafePrefix,"componentWillReceiveProps"),value:function(t){var e,r=this,o=t.component,n=(t[optionsName],t.children),a=t.$slots,t=_objectWithoutProperties(t,["component",optionsName,"children","$slots"].map(_toPropertyKey)),o=filterVueComponent(o);this.currentVueComponent!==o&&this.updateVueComponent(o),this.vueInstance&&(n=this.transferChildren(n),a=this.transferSlots(a),n&&(t.children=n),a&&(t.$slots=a),e=this.doSync(this.doVModel(t)),Object.keys(this.vueInstance.$data.reactProps).forEach(function(t){t in e||"data-passed-props"===t||r.vueInstance.$set(r.vueInstance.$data.reactProps,t,void 0)}),Object.keys(e).forEach(function(t){r.vueInstance.$set(r.vueInstance.$data.reactProps,t,e[t])}))}},{key:"componentWillUnmount",value:function(){this.vuePortal?this.parentVueWrapperRef.removeVuePortal(this.vuePortal):this.vueInstance&&this.vueInstance.$destroy()}},{key:"doVModel",value:function(t){var o=t.$model,e=_objectWithoutProperties(t,_excluded2$1);if(void 0===o)return t;var n,r=_objectSpread2(_objectSpread2({},{prop:"value",event:"input"}),getOptions(this.currentVueComponent).model),t=_defineProperty({},r.prop,o.value);return e.on||(e.on={}),e.on[r.event]?(n=e.on[r.event],e.on[r.event]=function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];n.apply(this,e),o.setter&&o.setter.apply(this,e)}):e.on=_objectSpread2(_objectSpread2({},e.on),_defineProperty({},r.event,o.setter||function(){})),_objectSpread2(_objectSpread2({},e),t)}},{key:"doSync",value:function(t){var a=t.$sync,e=_objectWithoutProperties(t,_excluded3$1);if(void 0===a)return t;var r,s={};for(r in a)(function(o){if(!a.hasOwnProperty(o)||!a[o]||null==a[o].value||null==a[o].setter)return;s[o]=a[o].value;var n,t="update:"+o;e.on||(e.on={}),e.on[t]?(n=e.on[t],e.on[t]=function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];n.apply(this,e),a[o].setter&&a[o].setter.apply(this,e)}):e.on=_objectSpread2(_objectSpread2({},e.on),_defineProperty({},t,a[o].setter||function(){}))})(r);return _objectSpread2(_objectSpread2({},e),s)}},{key:"transferSlots",value:function(r){if(r)return Object.keys(r).forEach(function(t){var e=r[t];r[t]=function(){return e}}),r}},{key:"transferChildren",value:function(t){if(t){var e=t;return t=function(){return e}}}},{key:"createVueInstance",value:function(t){var _=this,p=this,e=this.props,r=e.component,o=e["data-passed-props"],n=void 0===o?{}:o,l=e[optionsName],a=e.children,o=e.$slots,e=_objectWithoutProperties(e,["component","data-passed-props",optionsName,"children","$slots"].map(_toPropertyKey)),a=this.transferChildren(a),o=this.transferSlots(o);a&&(e.children=a),o&&(e.$slots=o);r=filterVueComponent(r);function s(t){this.vueInstance||(this.vueInstance=t)}s=s.bind(this);var i=_objectSpread2(_objectSpread2({},this.doSync(this.doVModel(e))),{},{"data-passed-props":n}),c=_objectSpread2(_objectSpread2({},vueRootInfo),{},{data:function(){return{reactProps:i}},created:function(){this.reactWrapperRef=p,s(this)},methods:{getNamespaceSlots:function(i,t){var c=this;this.getNamespaceSlots.__namespaceSlots||(this.getNamespaceSlots.__namespaceSlots={});var e,u=Object.assign({},t);for(e in u)(function(t){if(!u.hasOwnProperty(t)||!u[t])return;var e,r,o,n,a,s;"function"==typeof u[t]&&(u[t]=u[t]()),u[t]=(e=u[t],r=t,e.vueSlot||(null!==(o=c.getNamespaceSlots.__namespaceSlots[t])&&void 0!==o&&null!==(n=o[0])&&void 0!==n&&null!==(a=n.child)&&void 0!==a&&a.reactInstance?(s=c.getNamespaceSlots.__namespaceSlots[t],c.$nextTick(function(){s[0].child.reactInstance.setState({children:e})})):(s=[i(applyReactInVue(function(){return e},_objectSpread2(_objectSpread2({},l),{},{isSlots:!0,wrapInstance:p})),{slot:r})],c.getNamespaceSlots.__namespaceSlots[t]=s),s.reactSlot=e,s))})(e);return u},getScopedSlots:function(c,t){var u=this;this.getScopedSlots.__scopeSlots||(this.getScopedSlots.__scopeSlots={});var e,r=_objectSpread2({},t);for(e in r)(function(s){if(!r.hasOwnProperty(s))return;var i,t=r[s];r[s]=(i=t,function(){for(var t,e,r,o=arguments.length,n=new Array(o),a=0;a<o;a++)n[a]=arguments[a];return i.vueFunction?i.vueFunction.apply(u,n):(null!==(t=u.getScopedSlots.__scopeSlots[s])&&void 0!==t&&null!==(e=t.child)&&void 0!==e&&e.reactInstance?(r=u.getScopedSlots.__scopeSlots[s],u.$nextTick(function(){r.child.reactInstance.setState({children:i.apply(u,n)})})):(r=c(applyReactInVue(function(){return i.apply(u,n)},_objectSpread2(_objectSpread2({},l),{},{isSlots:!0,wrapInstance:p}))),u.getScopedSlots.__scopeSlots[s]=r),r)}),r[s].reactFunction=t})(e);return r},getChildren:function(t,e){var r,o,n,a;if(null!=e)return(e="function"==typeof e?e():e).vueSlot?e.vueSlot:(null!==(r=this.getChildren.__vnode)&&void 0!==r&&null!==(o=r[0])&&void 0!==o&&null!==(n=o.child)&&void 0!==n&&n.reactInstance?(a=this.getChildren.__vnode,this.$nextTick(function(){a[0].child.reactInstance.setState({children:e})})):(a=[t(applyReactInVue(function(){return e},_objectSpread2(_objectSpread2({},l),{},{isSlots:!0,wrapInstance:p})))],this.getChildren.__vnode=a),a.reactSlot=e,a)}},mounted:function(){p.vueRef=this.$children[0],this.$children[0].reactWrapperRef=p},beforeDestroy:function(){p.vueRef=null,this.$children[0].reactWrapperRef=null},render:function(t){var e=this.$data.reactProps,r=(e.component,e.on),o=e.$slots,n=e.$scopedSlots,a=(e.children,e.class),s=void 0===a?"":a,i=e.style,c=void 0===i?"":i,u=e["data-passed-props"],p=u.$slots,l=u.$scopedSlots,a=u.children,i=u.on,u=_objectWithoutProperties(u,_excluded4$1),d=_objectWithoutProperties(e,_excluded5$1);!function(t,e){if(!t)return;if(!e)return;for(var r in t)t.hasOwnProperty(r)&&e[r]&&delete t[r]}(l,p);var n=this.getScopedSlots(t,_objectSpread2(_objectSpread2({},l),n)),a=this.getChildren(t,this.reactProps.children||a),f=this.getNamespaceSlots(t,_objectSpread2(_objectSpread2({},p),o));a&&(f.default=a);var p=[a||[]].concat(_toConsumableArray(Object.keys(f).map(function(t){if("default"!==t)return f[t]}))),o=_objectSpread2(_objectSpread2({},i),r),h={};Object.keys(d).forEach(function(t){REACT_ALL_HANDLERS.has(t)&&"function"==typeof d[t]&&(h[t.replace(/^on/,"").toLowerCase()]=d[t],delete d[t])});i=_objectSpread2(_objectSpread2(_objectSpread2({},u),d),{},{"data-passed-props":_objectSpread2(_objectSpread2(_objectSpread2({},u),d),{},{on:o,children:a,$slots:f,$scopedSlots:n})}),r=function(t){var e=[],r={},o=getOptions(_.currentVueComponent);o.mixins&&o.mixins.forEach(function(t){t.props&&(t.props instanceof Array?e=_toConsumableArray(t.props):r=_objectSpread2({},t.props))});var n=Object.assign({},t),o=o.props;if(o)if(o instanceof Array)[].concat(_toConsumableArray(o),_toConsumableArray(e)).forEach(function(t){delete n[t]});else{var a,s=_objectSpread2(_objectSpread2({},o),r);for(a in s)s.hasOwnProperty(a)&&delete n[a]}return n}(_objectSpread2({},i)),u=r.className,a=r.classname,r=_objectWithoutProperties(r,_excluded6$1);return t("use_vue_wrapper",{props:i,on:o,nativeOn:h,attrs:r,class:s||u||a||"",style:c,scopedSlots:_objectSpread2({},n)},p)},components:{use_vue_wrapper:r}});if(t){var u="__vue_wrapper_container_"+(Math.random()+"").substr(2);t.id=u;var d=l.wrapInstance;if(d)(d=l.wrapInstance).reactWrapperRef=p;else for(var f,h=(this._reactInternals||this._reactInternalFiber).return;h;){if(null!==(f=h.stateNode)&&void 0!==f&&f.parentVueWrapperRef){d=h.stateNode.parentVueWrapperRef;break}if(null!==(f=h.stateNode)&&void 0!==f&&f.vueWrapperRef){d=h.stateNode.vueWrapperRef;break}h=h.return}if(d&&document.getElementById(u))return this.parentVueWrapperRef=d,this.vuePortal=function(t,e){return t(MountingPortal,{props:{mountTo:"#"+u,slim:!0,targetSlim:!0},key:u},[t(Object.assign(c,{router:_._router}))])},void d.pushVuePortal(this.vuePortal);this.vueInstance=new Vue(_objectSpread2(_objectSpread2({},c),{},{el:t}))}}},{key:"updateVueComponent",value:function(t){this.currentVueComponent=t,this.vueInstance&&(t.__fromReactSlot?Object.assign(this.vueInstance.$options.components.use_vue_wrapper._Ctor[0].options,t):this.vueInstance.$options.components.use_vue_wrapper=t,this.vueInstance.$forceUpdate())}},{key:"render",value:function(){return React.createElement(this.vueComponentContainer,{portals:this.state.portals})}}]),o}();function applyVueInReact(r){var o=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};return r||console.warn("Component must be passed in applyVueInReact!"),r.__esModule&&r.default&&(r=r.default),React.forwardRef(function(t,e){return React.createElement(VueContainer,_extends({},t,{component:r,ref:e},_defineProperty({},optionsName,o)))})}function lazyVueInReact(t,e){return lazy(function(){return t().then(function(t){return{default:applyVueInReact(t.default,e)}})})}function lazyReactInVue(t,e){return function(){return t().then(function(t){return applyReactInVue(t.default,e)})}}var reduxInstance,vuexStore,ReduxLinkVue=function(){function r(t){var e=this;if(_classCallCheck(this,r),!t||!t.subscribe||!t.getState)throw Error("incorrect store passed in, please check the function applyRedux's parameter must contains redux store");(this.store=t).subscribe(function(){e._vm.state=t.getState()}),this._vm=new Vue({data:function(){return{state:t.getState()}}})}return _createClass(r,[{key:"state",get:function(){return this._vm.state}},{key:"dispatch",get:function(){return this.store.dispatch}}]),r}();function applyRedux(t){var e=t.store,t=t.ReactReduxContext;return reduxInstance||(reduxInstance=new ReduxLinkVue(e),t&&(reduxInstance.ReactReduxContext=t),Vue.prototype.$redux=reduxInstance)}function connectVuex(t){var e=t.mapStateToProps,o=void 0===e?function(t){}:e,e=t.mapGettersToProps,n=void 0===e?function(t){}:e,e=t.mapCommitToProps,a=void 0===e?function(t){}:e,t=t.mapDispatchToProps,s=void 0===t?function(t){}:t;return function(t){var r=function(){_inherits(r,React.Component);var e=_createSuper(r);function r(t){if(_classCallCheck(this,r),t=e.call(this,t),!((vuexStore=vueRootInfo.store?vueRootInfo.store:vuexStore)&&vuexStore.state&&vuexStore.subscribe&&vuexStore.dispatch&&vuexStore.commit))throw Error("[vuereact-combined warn]Error: incorrect store passed in, please check the function applyVuex's parameter must be vuex store");return t.state=_objectSpread2(_objectSpread2({},o(vuexStore.state)),n(vuexStore.getters)),t}return _createClass(r,[{key:"componentDidMount",value:function(){var e=this;this.watch=vuexStore.watch(function(){return _objectSpread2(_objectSpread2({},o(vuexStore.state)),n(vuexStore.getters))},function(t){e.setState(t)},{deep:!0})}},{key:"componentWillUnmount",value:function(){this.watch()}},{key:"render",value:function(){return React.createElement(t,_extends({},this.props,_objectSpread2(_objectSpread2(_objectSpread2({},this.state),a(vuexStore.commit)),s(vuexStore.dispatch)),{ref:this.props.forwardedRef}))}}]),r}();return React.forwardRef(function(t,e){return React.createElement(r,_extends({forwardedRef:e},t))})}}function applyVuex(t){vuexStore=t}var vueRouterInfo={};function widthVueRouter(t){var r=function(){_inherits(r,React.Component);var e=_createSuper(r);function r(t){if(_classCallCheck(this,r),t=e.call(this,t),!vueRouterInfo.instance){if(!vueRootInfo.router)throw Error("Vue router does not exist! You must setting the Vue router in the Vue Instance options first.");vueRouterInfo.instance=new Vue({router:vueRootInfo.router})}return t.state={$vueRouter:vueRouterInfo.instance.$router,$vueRoute:vueRouterInfo.instance.$route},t}return _createClass(r,[{key:"componentDidMount",value:function(){var t=this;this.subscribe=vueRouterInfo.instance.$watch("$route",function(){t.setState({$vueRouter:vueRouterInfo.instance.$router,$vueRoute:vueRouterInfo.instance.$route})})}},{key:"componentWillUnmount",value:function(){this.subscribe()}},{key:"render",value:function(){return React.createElement(t,_extends({},this.props,this.state,{ref:this.props.forwardedRef}))}}]),r}();return React.forwardRef(function(t,e){return React.createElement(r,_extends({forwardedRef:e},t))})}var useReactInVue=applyReactInVue,useVueInReact=applyVueInReact,useRedux=applyRedux,useVuex=applyVuex;export{REACT_ALL_HANDLERS,VueContainer,applyReactInVue,applyReactRouterInVue,applyRedux,applyVueInReact,applyVuex,connectVuex,lazyReactInVue,lazyVueInReact,useReactInVue,useRedux,useVueInReact,useVuex,vueRootInfo,widthVueRouter as withVueRouter};