1&&this.pop({animated:!0})}},{key:"push",value:function(e){if(null==e?void 0:e.component){if(!this.routeList[e.routeName])new mn({appName:e.routeName,entryPage:e.component}).regist(),this.routeList[e.routeName]=!0;delete e.component}var t=[e];this.stack.push(e),Ct(this.instance,"push",t)}},{key:"pop",value:function(e){if(this.stack.size>1){var t=[e];this.stack.pop(),Ct(this.instance,"pop",t)}}},{key:"clear",value:function(){this.stack.clear()}},{key:"render",value:function(){var e=this,t=this.props,n=t.initialRoute,r=(n.component,_(n,m)),i=_(t,v);return i.initialRoute=r,o.a.createElement("div",I({nativeName:"Navigator",ref:function(t){e.instance=t}},i))}}]),n}(o.a.Component);function zn(e){return o.a.createElement("div",I(I({nativeName:"ViewPagerItem"},e),{},{style:{position:"absolute",left:0,top:0,right:0,bottom:0,collapsable:!1}}))}var On=function(e){k(n,e);var t=S(n);function n(e){var r;return O(this,n),(r=t.call(this,e)).instance=null,r.setPage=r.setPage.bind(C(r)),r.setPageWithoutAnimation=r.setPageWithoutAnimation.bind(C(r)),r.onPageScrollStateChanged=r.onPageScrollStateChanged.bind(C(r)),r}return j(n,[{key:"onPageScrollStateChanged",value:function(e){var t=this.props.onPageScrollStateChanged;t&&t(e.pageScrollState)}},{key:"setPage",value:function(e){"number"==typeof e&&Ct(this.instance,"setPage",[e])}},{key:"setPageWithoutAnimation",value:function(e){"number"==typeof e&&Ct(this.instance,"setPageWithoutAnimation",[e])}},{key:"render",value:function(){var e=this,t=this.props,n=t.children,r=t.onPageScrollStateChanged,i=_(t,y),a=[];return Array.isArray(n)?a=n.map((function(e){var t={};return"string"==typeof e.key&&(t.key="viewPager_".concat(e.key)),o.a.createElement(zn,I({},t),e)})):a.push(o.a.createElement(zn,null,n)),"function"==typeof r&&(i.onPageScrollStateChanged=this.onPageScrollStateChanged),o.a.createElement("div",I({nativeName:"ViewPager",ref:function(t){e.instance=t}},i),a)}}]),n}(o.a.Component);function Tn(){var e=W.platform.Localization;return!!e&&1===e.direction}var jn=function(e){k(n,e);var t=S(n);function n(e){var r;return O(this,n),(r=t.call(this,e)).instance=null,r._lastNativeText="",r.onChangeText=r.onChangeText.bind(C(r)),r.onKeyboardWillShow=r.onKeyboardWillShow.bind(C(r)),r}return j(n,[{key:"componentDidMount",value:function(){var e=this.props,t=e.value,n=e.autoFocus;this._lastNativeText=t,n&&this.focus()}},{key:"componentWillUnmount",value:function(){this.blur()}},{key:"getValue",value:function(){var e=this;return new Promise((function(t){Ct(e.instance,"getValue",(function(e){return t(e.text)}))}))}},{key:"setValue",value:function(e){return Ct(this.instance,"setValue",[e]),e}},{key:"focus",value:function(){Ct(this.instance,"focusTextInput",[])}},{key:"blur",value:function(){Ct(this.instance,"blurTextInput",[])}},{key:"showInputMethod",value:function(){Ct(this.instance,"showInputMethod",[])}},{key:"hideInputMethod",value:function(){Ct(this.instance,"hideInputMethod",[])}},{key:"clear",value:function(){Ct(this.instance,"clear",[])}},{key:"render",value:function(){var e=this,t=I({},this.props);return["underlineColorAndroid","placeholderTextColor","placeholderTextColors"].forEach((function(n){"string"==typeof e.props[n]&&(Array.isArray(t.style)?t.style.push({[n]:e.props[n]}):t.style&&"object"===L(t.style)?t.style[n]=e.props[n]:t.style={[n]:e.props[n]},t[n]=void 0)})),Tn()&&(t.style?"object"!==L(t.style)||Array.isArray(t.style)||t.style.textAlign||(t.style.textAlign="right"):t.style={textAlign:"right"}),o.a.createElement("div",I(I({nativeName:"TextInput"},t),{},{ref:function(t){e.instance=t},onChangeText:this.onChangeText,onKeyboardWillShow:this.onKeyboardWillShow}))}},{key:"onChangeText",value:function(e){var t=this.props.onChangeText;"function"==typeof t&&t(e.text),this.instance&&(this._lastNativeText=e.text)}},{key:"onKeyboardWillShow",value:function(e){var t=this.props.onKeyboardWillShow,n=e;"android"===qt.platform.OS&&(n.keyboardHeight/=qt.screen.scale),"function"==typeof t&&t(n)}}]),n}(o.a.Component),Fn=qt.window.scale,Hn=Math.round(.4*Fn)/Fn;function Mn(e){return e}0===Hn&&(Hn=1/Fn);var Dn=Object.freeze({__proto__:null,get hairlineWidth(){return Hn},create:Mn}),Un={baseVertical:{flexGrow:1,flexShrink:1,flexDirection:"column",overflow:"scroll"},baseHorizontal:{flexGrow:1,flexShrink:1,flexDirection:"row",overflow:"scroll"},contentContainerVertical:{collapsable:!1,flexDirection:"column"},contentContainerHorizontal:{collapsable:!1,flexDirection:"row"}},Wn=function(e){k(n,e);var t=S(n);function n(){var e;return O(this,n),(e=t.apply(this,arguments)).instance=null,e}return j(n,[{key:"scrollTo",value:function(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=e,i=t,a=n;"number"==typeof e||"object"===L(e)&&e&&(r=e.x,i=e.y,a=e.animated),r=r||0,i=i||0,a=!!a,Ct(this.instance,"scrollTo",[r,i,a])}},{key:"scrollToWithDuration",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1e3;Ct(this.instance,"scrollToWithOptions",[{x:e,y:t,duration:n}])}},{key:"render",value:function(){var e=this,t=this.props,n=t.horizontal,r=t.contentContainerStyle,i=t.children,a=t.style,l=[n?Un.contentContainerHorizontal:Un.contentContainerVertical,r],u=n?Object.assign({},Un.baseHorizontal,a):Object.assign({},Un.baseVertical,a);return n&&(u.flexDirection=Tn()?"row-reverse":"row"),o.a.createElement("div",I(I({nativeName:"ScrollView",ref:function(t){e.instance=t}},this.props),{},{style:u}),o.a.createElement(yn,{style:l},i))}}]),n}(o.a.Component),Bn={modal:{position:"absolute"},container:{position:"absolute",left:0,top:0}},Vn=function(e){k(n,e);var t=S(n);function n(e){var r;return O(this,n),(r=t.call(this,e)).eventSubscription=null,r}return j(n,[{key:"componentDidMount",value:function(){var e=this;"ios"===qt.platform.OS&&(this.eventSubscription=new Ne("modalDismissed"),this.eventSubscription.addCallback((function(t){var n=e.props,r=n.primaryKey,i=n.onDismiss;t.primaryKey===r&&"function"==typeof i&&i()})))}},{key:"componentWillUnmount",value:function(){"ios"===qt.platform.OS&&this.eventSubscription&&this.eventSubscription.unregister()}},{key:"render",value:function(){var e=this.props,t=e.children,n=e.visible,r=e.transparent,i=e.animated,a=this.props.animationType;if(!1===n)return null;var l={backgroundColor:r?"transparent":"white"};return a||(a="none",i&&(a="slide")),o.a.createElement("div",I({nativeName:"Modal",animationType:a,transparent:r,style:Bn.modal},this.props),o.a.createElement(yn,{style:[Bn.container,l]},t))}}]),n}(o.a.Component);Vn.defaultProps={visible:!0};var $n=function(e){k(n,e);var t=S(n);function n(e){var r;O(this,n);var i=(r=t.call(this,e)).props.requestFocus;return r.state={isFocus:!!i},r.handleFocus=r.handleFocus.bind(C(r)),r}return j(n,[{key:"render",value:function(){var e,t,n,r,i=this.props,a=i.requestFocus,l=i.children,u=i.nextFocusDownId,s=i.nextFocusUpId,c=i.nextFocusLeftId,f=i.nextFocusRightId,d=i.style,p=i.noFocusStyle,h=i.focusStyle,m=i.onClick,v=this.state.isFocus,y=o.a.Children.only(l);(null===(t=null===(e=null==y?void 0:y.child)||void 0===e?void 0:e.memoizedProps)||void 0===t?void 0:t.nativeName)?r=y.child.memoizedProps.nativeName:(null===(n=null==y?void 0:y.type)||void 0===n?void 0:n.displayName)&&(r=y.type.displayName);var g=u&&Et(u),b=s&&Et(s),k=c&&Et(c),w=f&&Et(f),S=d;if("Text"!==r){var E=y.memoizedProps.style;S=I(I({},S),E)}if(Object.assign(S,v?h:p),"Text"===r)return o.a.createElement(yn,{focusable:!0,nextFocusDownId:g,nextFocusUpId:b,nextFocusLeftId:k,nextFocusRightId:w,requestFocus:a,style:S,onClick:m,onFocus:this.handleFocus},y);var C=y.memoizedProps.children;return o.a.cloneElement(y,{nextFocusDownId:u,nextFocusUpId:s,nextFocusLeftId:c,nextFocusRightId:f,requestFocus:a,onClick:m,focusable:!0,children:C,style:S,onFocus:this.handleFocus})}},{key:"handleFocus",value:function(e){var t=this.props.onFocus;"function"==typeof t&&t(e),this.state.isFocus!==e.focus&&this.setState({isFocus:e.focus})}}]),n}(o.a.Component);function qn(e){return o.a.createElement("iframe",I({title:"hippy",nativeName:"WebView"},e))}var Qn,Kn=function(){function e(t,n,r){var i=this;if(O(this,e),this.protocol="",this.onWebSocketEvent=this.onWebSocketEvent.bind(this),Qn||(Qn=new Ne("hippyWebsocketEvents")),this.readyState=0,this.webSocketCallbacks={},!t||"string"!=typeof t)throw new TypeError("Invalid WebSocket url");var a=I({},r);if(void 0!==n)if(Array.isArray(n)&&n.length>0)a["Sec-WebSocket-Protocol"]=n.join(",");else{if("string"!=typeof n)throw new TypeError("Invalid WebSocket protocols");a["Sec-WebSocket-Protocol"]=n}var o={headers:a,url:t};this.url=t,this.webSocketCallbackId=Qn.addCallback(this.onWebSocketEvent),U.callNativeWithPromise("websocket","connect",o).then((function(e){e&&0===e.code&&"number"==typeof e.id&&(i.webSocketId=e.id)}))}return j(e,[{key:"close",value:function(e,t){1===this.readyState&&(this.readyState=2,U.callNative("websocket","close",{id:this.webSocketId,code:e,reason:t}))}},{key:"send",value:function(e){if(1===this.readyState){if("string"!=typeof e)throw new TypeError("Unsupported websocket data type: ".concat(L(e)));U.callNative("websocket","send",{id:this.webSocketId,data:e})}}},{key:"onopen",set:function(e){this.webSocketCallbacks.onOpen=e}},{key:"onclose",set:function(e){this.webSocketCallbacks.onClose=e}},{key:"onerror",set:function(e){this.webSocketCallbacks.onError=e}},{key:"onmessage",set:function(e){this.webSocketCallbacks.onMessage=e}},{key:"onWebSocketEvent",value:function(e){if("object"===L(e)&&e.id===this.webSocketId){var t=e.type;"onOpen"===t?this.readyState=1:"onClose"===t&&(this.readyState=3,Qn.removeCallback(this.webSocketCallbackId));var n=this.webSocketCallbacks[t];"function"==typeof n&&n(e.data)}}}]),e}();function Gn(e){return o.a.createElement("li",I({nativeName:"WaterfallItem"},e))}var Yn=function(e){k(n,e);var t=S(n);function n(e){var r;return O(this,n),(r=t.call(this,e)).instance=null,r.pullHeader=null,r.pullFooter=null,r.handleInitialListReady=r.handleInitialListReady.bind(C(r)),r}return j(n,[{key:"scrollToIndex",value:function(e){var t=e.index,n=void 0===t?0:t,r=e.animated,i=void 0===r||r;Ct(this.instance,"scrollToIndex",[n,n,i])}},{key:"scrollToContentOffset",value:function(e){var t=e.xOffset,n=void 0===t?0:t,r=e.yOffset,i=void 0===r?0:r,a=e.animated,o=void 0===a||a;Ct(this.instance,"scrollToContentOffset",[n,i,o])}},{key:"expandPullHeader",value:function(){this.pullHeader&&this.pullHeader.expandPullHeader()}},{key:"collapsePullHeader",value:function(e){this.pullHeader&&this.pullHeader.collapsePullHeader(e)}},{key:"expandPullFooter",value:function(){this.pullFooter&&this.pullFooter.expandPullFooter()}},{key:"collapsePullFooter",value:function(){this.pullFooter&&this.pullFooter.collapsePullFooter()}},{key:"render",value:function(){var e=this,t=this.props,n=t.style,r=void 0===n?{}:n,i=t.renderBanner,a=t.numberOfColumns,l=void 0===a?2:a,u=t.columnSpacing,s=void 0===u?0:u,c=t.interItemSpacing,f=void 0===c?0:c,d=t.numberOfItems,p=void 0===d?0:d,h=t.preloadItemNumber,m=void 0===h?0:h,v=t.renderItem,y=t.renderPullHeader,b=t.renderPullFooter,k=t.getItemType,w=t.getItemKey,S=t.getItemStyle,E=t.contentInset,C=void 0===E?{top:0,left:0,bottom:0,right:0}:E,x=t.onItemLayout,N=t.onHeaderPulling,P=t.onHeaderReleased,L=t.onFooterPulling,A=t.onFooterReleased,R=t.containPullHeader,z=void 0!==R&&R,O=t.containPullFooter,T=void 0!==O&&O,j=t.containBannerView,F=void 0!==j&&j,H=I(I({},_(t,g)),{},{style:r,numberOfColumns:l,columnSpacing:s,interItemSpacing:f,preloadItemNumber:m,contentInset:C,containPullHeader:z,containPullFooter:T,containBannerView:F}),M=[];if("function"==typeof i){var D=i();D&&(M.push(o.a.createElement(yn,{key:"bannerView"},o.a.cloneElement(D))),H.containBannerView=!0)}if("function"==typeof v){for(var U=this.getPullHeader(y,N,P),W=this.getPullFooter(b,L,A),B=0;B0||e.didTimeout)&&function e(t){"number"==typeof t?ee(t):t&&(ee(t.nodeId),Array.isArray(t.childNodes)&&t.childNodes.forEach((function(t){return e(t)})))}(t)}),{timeout:50})}var ie={onTouchStart:["onTouchStart","onTouchDown"],onPress:["onPress","onClick"]},ae=new RegExp(/^\d+$/),oe=!1;function le(){}function ue(e){return e.replace(/\\u[\dA-F]{4}|\\x[\dA-F]{2}/gi,(function(e){return String.fromCharCode(parseInt(e.replace(/\\u|\\x/g,""),16))}))}var se=new RegExp("^on.+Capture$");var ce=new RegExp("^(?=.+)[+-]?\\d*\\.?\\d*([Ee][+-]?\\d+)?$");function fe(e){if("number"==typeof e)return e;if("string"==typeof e&&ce.test(e))try{return parseFloat(e)}catch(t){return e}return e}function de(e){return"[object Function]"===Object.prototype.toString.call(e)}function pe(e){e}function he(){return oe}function me(e){if(e&&!/^(http|https):\/\//.test(e)&&e.indexOf("assets")>-1){return"".concat("hpfile://","./").concat(e)}return e}function ve(e){return 5===e}var ye=function(){function e(t){O(this,e),this.handlerContainer={},this.nextIdForHandler=0,this.eventName=t}return j(e,[{key:"getEventListeners",value:function(){var e=this;return Object.keys(this.handlerContainer).filter((function(t){return e.handlerContainer[t]})).map((function(t){return e.handlerContainer[t]}))}},{key:"getHandlerSize",value:function(){return Object.keys(this.handlerContainer).length}},{key:"addEventHandler",value:function(e,t){if(!e)throw new TypeError("Invalid arguments for addEventHandler");var n=this.nextIdForHandler;this.nextIdForHandler+=1;var r={id:n,eventHandler:e,context:t},i="eventHandler_".concat(n);return this.handlerContainer[i]=r,n}},{key:"notifyEvent",value:function(e){var t=this;Object.keys(this.handlerContainer).forEach((function(n){var r=t.handlerContainer[n];r&&r.eventHandler&&(r.context?r.eventHandler.call(r.context,e):r.eventHandler(e))}))}},{key:"removeEventHandler",value:function(e){if("number"!=typeof e)throw new TypeError("Invalid arguments for removeEventHandler");var t="eventHandler_".concat(e);this.handlerContainer[t]&&delete this.handlerContainer[t]}}]),e}(),ge=function(){function e(t,n,r){O(this,e),this.type=t,this.bubbles=!0,this.timeStamp=Date.now(),this.currentTarget=n,this.target=r}return j(e,[{key:"stopPropagation",value:function(){this.bubbles=!1}},{key:"preventDefault",value:function(){}}]),e}(),be=new Map,ke=["%c[event]%c","color: green","color: auto"];function we(e,t){var n=e;if(t.memoizedProps&&!t.memoizedProps[e])for(var r=Object.keys(ie),i=0;i0)for(var l,u=!1,s=te(n);!u&&void 0!==(l=r.shift());)try{var c=l,f=c.eventName,d=c.currentTarget,p=c.listener,h=c.isCapture,m=new ge(f,d,s);Object.assign(m,t),h?(p(m),m.bubbles||(u=!0)):("boolean"!=typeof(u=p(m))&&(u=!he()),m.bubbles||(u=!0))}catch(e){console.reportUncaughtException(e)}}(r,e,a):function(e,t,n){var r=!1,i=n,a=e,o=te(n);do{if(Se(a=we(a,i),i))try{var l=te(i),u=new ge(a,l,o);Object.assign(u,t),"boolean"!=typeof(r=i.memoizedProps[a](u))&&(r=!he()),u.bubbles||(r=!0)}catch(e){console.reportUncaughtException(e)}if(!1===r)for(i=i.return;i&&!ve(i.tag);)i=i.return}while(!r&&i)}(r,e,a)}}},receiveUIComponentEvent:function(e){if(le.apply(void 0,ke.concat(["receiveUIComponentEvent",e])),e&&Array.isArray(e)&&!(e.length<2)){var t=A(e,3),n=t[0],r=t[1],i=t[2];if("number"==typeof n&&"string"==typeof r){var a=ne(n);a&&Se(r,a)&&a.memoizedProps[r](i)}}}};e.__GLOBAL__&&(e.__GLOBAL__.jsModuleList.EventDispatcher=Ce);var xe=function(){function e(t,n){O(this,e),this.callback=t,this.bindListener=n}return j(e,[{key:"remove",value:function(){"number"==typeof this.callback&&this.bindListener&&(this.bindListener.removeCallback(this.callback),this.bindListener=void 0)}}]),e}(),Ne=function(){function e(t){O(this,e),this.eventName=t,this.listenerIdList=[]}return j(e,[{key:"unregister",value:function(){var e=Ce.getHippyEventHub(this.eventName);if(!e)throw new ReferenceError("No listeners for ".concat(this.eventName));for(var t=this.listenerIdList.length,n=0;n=0?un(t):t}var We=function(){function e(t){var n;O(this,e);var r=0;if((null===(n=t.startValue)||void 0===n?void 0:n.constructor)&&"Animation"===t.startValue.constructor.name)r={animationId:t.startValue.animationId};else{var i=t.startValue;r=Ue(t.valueType,i)}var a=Ue(t.valueType,t.toValue);this.mode=t.mode||"timing",this.delay=t.delay||0,this.startValue=r||0,this.toValue=a||0,this.valueType=t.valueType||void 0,this.duration=t.duration||0,this.direction=t.direction||"center",this.timingFunction=t.timingFunction||"linear",this.repeatCount=Me(t.repeatCount||0),this.inputRange=t.inputRange||[],this.outputRange=t.outputRange||[],this.animationId=$t.callNativeWithCallbackId("AnimationModule","createAnimation",!0,this.mode,Object.assign({delay:this.delay,startValue:this.startValue,toValue:this.toValue,duration:this.duration,direction:this.direction,timingFunction:this.timingFunction,repeatCount:this.repeatCount,inputRange:this.inputRange,outputRange:this.outputRange},this.valueType?{valueType:this.valueType}:{})),this.destroy=this.destroy.bind(this),this.onRNfqbAnimationStart=this.onAnimationStart.bind(this),this.onRNfqbAnimationEnd=this.onAnimationEnd.bind(this),this.onRNfqbAnimationCancel=this.onAnimationCancel.bind(this),this.onRNfqbAnimationRepeat=this.onAnimationRepeat.bind(this),this.onHippyAnimationStart=this.onAnimationStart.bind(this),this.onHippyAnimationEnd=this.onAnimationEnd.bind(this),this.onHippyAnimationCancel=this.onAnimationCancel.bind(this),this.onHippyAnimationRepeat=this.onAnimationRepeat.bind(this)}return j(e,[{key:"removeEventListener",value:function(){this.animationStartListener&&this.animationStartListener.remove(),this.animationEndListener&&this.animationEndListener.remove(),this.animationCancelListener&&this.animationCancelListener.remove(),this.animationRepeatListener&&this.animationRepeatListener.remove()}},{key:"start",value:function(){var e=this;this.removeEventListener();var t="onAnimation";"android"===qt.platform.OS&&(t="onHippyAnimation"),"function"==typeof this.onAnimationStartCallback&&(this.animationStartListener=De.addListener("".concat(t,"Start"),(function(t){t===e.animationId&&(e.animationStartListener.remove(),"function"==typeof e.onAnimationStartCallback&&e.onAnimationStartCallback())}))),"function"==typeof this.onAnimationEndCallback&&(this.animationEndListener=De.addListener("".concat(t,"End"),(function(t){t===e.animationId&&(e.animationEndListener.remove(),"function"==typeof e.onAnimationEndCallback&&e.onAnimationEndCallback())}))),"function"==typeof this.onAnimationCancelCallback&&(this.animationCancelListener=De.addListener("".concat(t,"Cancel"),(function(t){t===e.animationId&&(e.animationCancelListener.remove(),"function"==typeof e.onAnimationCancelCallback&&e.onAnimationCancelCallback())}))),"function"==typeof this.onAnimationRepeatCallback&&(this.animationRepeatListener=De.addListener("".concat(t,"Repeat"),(function(t){t===e.animationId&&"function"==typeof e.onAnimationRepeatCallback&&e.onAnimationRepeatCallback()}))),$t.callNative("AnimationModule","startAnimation",this.animationId)}},{key:"destory",value:function(){this.destroy()}},{key:"destroy",value:function(){this.removeEventListener(),$t.callNative("AnimationModule","destroyAnimation",this.animationId)}},{key:"pause",value:function(){$t.callNative("AnimationModule","pauseAnimation",this.animationId)}},{key:"resume",value:function(){$t.callNative("AnimationModule","resumeAnimation",this.animationId)}},{key:"updateAnimation",value:function(t){var n=this;if("object"!==L(t))throw new TypeError("Invalid arguments");if("string"==typeof t.mode&&t.mode!==this.mode)throw new TypeError("Update animation mode not supported");Object.keys(t).forEach((function(r){var i=t[r];if("startValue"===r){var a=0;if(t.startValue instanceof e)a={animationId:t.startValue.animationId};else{var o=t.startValue;a=Ue(n.valueType,o)}n.startValue=a||0}else"repeatCount"===r?n.repeatCount=Me(t.repeatCount||0):Object.defineProperty(n,r,{value:i})})),$t.callNative("AnimationModule","updateAnimation",this.animationId,Object.assign({delay:this.delay,startValue:this.startValue,toValue:Ue(this.valueType,this.toValue),duration:this.duration,direction:this.direction,timingFunction:this.timingFunction,repeatCount:this.repeatCount,inputRange:this.inputRange,outputRange:this.outputRange},this.valueType?{valueType:this.valueType}:{}))}},{key:"onAnimationStart",value:function(e){this.onAnimationStartCallback=e}},{key:"onAnimationEnd",value:function(e){this.onAnimationEndCallback=e}},{key:"onAnimationCancel",value:function(e){this.onAnimationCancelCallback=e}},{key:"onAnimationRepeat",value:function(e){this.onAnimationRepeatCallback=e}}]),e}(),Be=new Pe,Ve=function(){function e(t){var n=this;O(this,e),this.animationList=[],t.children.forEach((function(e){n.animationList.push({animationId:e.animation.animationId,follow:e.follow||!1})})),this.animationId=$t.callNativeWithCallbackId("AnimationModule","createAnimationSet",!0,{repeatCount:Me(t.repeatCount||0),children:this.animationList,virtual:t.virtual}),this.onRNfqbAnimationStart=this.onAnimationStart.bind(this),this.onRNfqbAnimationEnd=this.onAnimationEnd.bind(this),this.onRNfqbAnimationCancel=this.onAnimationCancel.bind(this),this.onRNfqbAnimationRepeat=this.onAnimationRepeat.bind(this),this.onHippyAnimationStart=this.onAnimationStart.bind(this),this.onHippyAnimationEnd=this.onAnimationEnd.bind(this),this.onHippyAnimationCancel=this.onAnimationCancel.bind(this),this.onHippyAnimationRepeat=this.onAnimationRepeat.bind(this)}return j(e,[{key:"removeEventListener",value:function(){this.animationStartListener&&this.animationStartListener.remove(),this.animationEndListener&&this.animationEndListener.remove(),this.animationCancelListener&&this.animationCancelListener.remove(),this.animationRepeatListener&&this.animationRepeatListener.remove()}},{key:"start",value:function(){var e=this;this.removeEventListener();var t="onAnimation";"android"===qt.platform.OS&&(t="onHippyAnimation"),"function"==typeof this.onAnimationStartCallback&&(this.animationStartListener=Be.addListener("".concat(t,"Start"),(function(t){t===e.animationId&&(e.animationStartListener.remove(),"function"==typeof e.onAnimationStartCallback&&e.onAnimationStartCallback())}))),"function"==typeof this.onAnimationEndCallback&&(this.animationEndListener=Be.addListener("".concat(t,"End"),(function(t){t===e.animationId&&(e.animationEndListener.remove(),"function"==typeof e.onAnimationEndCallback&&e.onAnimationEndCallback())}))),"function"==typeof this.onAnimationCancelCallback&&(this.animationCancelListener=Be.addListener("".concat(t,"Cancel"),(function(t){t===e.animationId&&(e.animationCancelListener.remove(),"function"==typeof e.onAnimationCancelCallback&&e.onAnimationCancelCallback())}))),"function"==typeof this.onAnimationRepeatCallback&&(this.animationRepeatListener=Be.addListener("".concat(t,"Repeat"),(function(t){t===e.animationId&&"function"==typeof e.onAnimationRepeatCallback&&e.onAnimationRepeatCallback()}))),$t.callNative("AnimationModule","startAnimation",this.animationId)}},{key:"destory",value:function(){this.destroy()}},{key:"destroy",value:function(){this.removeEventListener(),this.animationList.forEach((function(e){return Number.isInteger(e.animationId)&&$t.callNative("AnimationModule","destroyAnimation",e.animationId)})),$t.callNative("AnimationModule","destroyAnimation",this.animationId)}},{key:"pause",value:function(){$t.callNative("AnimationModule","pauseAnimation",this.animationId)}},{key:"resume",value:function(){$t.callNative("AnimationModule","resumeAnimation",this.animationId)}},{key:"onAnimationStart",value:function(e){this.onAnimationStartCallback=e}},{key:"onAnimationEnd",value:function(e){this.onAnimationEndCallback=e}},{key:"onAnimationCancel",value:function(e){this.onAnimationCancelCallback=e}},{key:"onAnimationRepeat",value:function(e){this.onAnimationRepeatCallback=e}}]),e}(),$e=["%c[native]%c","color: red","color: auto"],qe={createNode:Symbol("createNode"),updateNode:Symbol("updateNode"),deleteNode:Symbol("deleteNode")},Qe=!0,Ke=[];function Ge(e){(function(e){for(var t=[],n=0;n0&&void 0!==arguments[0]&&arguments[0];if(Qe)if(Qe=!1,0!==Ke.length){var t=X();e?(Ge(t),bt(),Ke=[],Qe=!0):Promise.resolve().then((function(){Ge(t),bt(),Ke=[],Qe=!0}))}else Qe=!0}function Xe(e){var t=e.attributes;t.children;return _(t,l)}function Je(e,t){var n;if(!t.nativeName)return null;if(t.meta.skipAddToDom)return null;if(!t.meta.component)throw new Error("Specific tag is not supported yet: ".concat(t.tagName));return{id:t.nodeId,pId:(null===(n=t.parentNode)||void 0===n?void 0:n.nodeId)||e,index:t.index,name:t.nativeName,props:I(I({},Xe(t)),{},{style:t.style})}}function Ze(e,t,n,r){var i=[],a=n;return void 0===a&&t&&t.parentNode&&(a=t.parentNode.childNodes.indexOf(t)),t.traverseChildren((function(t){var n=Je(e,t);n&&i.push(n),"function"==typeof r&&r(t)}),a),i}function et(e){return!!F&&e instanceof F.containerInfo.constructor}function tt(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:-1;if(e&&t&&!t.meta.skipAddToDom){var r=X();if(et(e)&&!e.isMounted){var i=Ze(r,t,n,(function(e){e.isMounted||(e.isMounted=!0)}));Ke.push({type:qe.createNode,nodes:i})}else if(e.isMounted&&!t.isMounted){var a=Ze(r,t,n,(function(e){e.isMounted||(e.isMounted=!0)}));Ke.push({type:qe.createNode,nodes:a})}}}function nt(e,t,n){if(t&&!t.meta.skipAddToDom){t.isMounted=!1,t.index=n;var r=X(),i=[{id:t.nodeId,pId:t.parentNode?t.parentNode.nodeId:r,index:t.index}];Ke.push({type:qe.deleteNode,nodes:i})}}function rt(e){if(e.isMounted){var t=Je(X(),e);t&&Ke.push({type:qe.updateNode,nodes:[t]})}}var it=0;var at=function(){function e(){O(this,e),this.meta={component:{}},this.index=0,this.childNodes=[],this.parentNode=null,this.mounted=!1,this.nodeId=((it+=1)%10==0&&(it+=1),it)}return j(e,[{key:"toString",value:function(){return this.constructor.name}},{key:"isMounted",get:function(){return this.mounted},set:function(e){this.mounted=e}},{key:"insertBefore",value:function(e,t){if(!e)throw new Error("Can't insert child.");if(!e.meta.skipAddToDom){if(!t)return this.appendChild(e);if(t.parentNode!==this)throw new Error("Can't insert child, because the reference node has a different parent.");if(e.parentNode&&e.parentNode!==this)throw new Error("Can't insert child, because it already has a different parent.");var n=this.childNodes.indexOf(t);return e.parentNode=this,this.childNodes.splice(n,0,e),tt(this,e,n)}}},{key:"moveChild",value:function(e,t){if(!e)throw new Error("Can't move child.");if(!e.meta.skipAddToDom){if(!t)return this.appendChild(e);if(t.parentNode!==this)throw new Error("Can't move child, because the reference node has a different parent.");if(e.parentNode&&e.parentNode!==this)throw new Error("Can't move child, because it already has a different parent.");var n=this.childNodes.indexOf(e);if(this.childNodes.indexOf(t)===n)return e;this.childNodes.splice(n,1),nt(0,e,n);var r=this.childNodes.indexOf(t);return this.childNodes.splice(r,0,e),tt(this,e,r)}}},{key:"appendChild",value:function(e){if(!e)throw new Error("Can't append child.");if(!e.meta.skipAddToDom){if(e.parentNode&&e.parentNode!==this)throw new Error("Can't append child, because it already has a different parent.");e.parentNode=this,this.childNodes.push(e),tt(this,e,this.childNodes.length-1)}}},{key:"removeChild",value:function(e){if(!e)throw new Error("Can't remove child.");if(!e.meta.skipAddToDom){if(!e.parentNode)throw new Error("Can't remove child, because it has no parent.");if(e.parentNode!==this)throw new Error("Can't remove child, because it has a different parent.");var t=this.childNodes.indexOf(e);this.childNodes.splice(t,1),nt(0,e,t)}}},{key:"findChild",value:function(e){if(e(this))return this;if(this.childNodes.length)for(var t=0;t1&&void 0!==arguments[1]?arguments[1]:0;this.index=this.parentNode?n:0,e(this),this.childNodes.length&&this.childNodes.forEach((function(n,r){t.traverseChildren.call(n,e,r)}))}}]),e}(),ot={textDecoration:"textDecorationLine",boxShadowOffset:"shadowOffset",boxShadowOffsetX:"shadowOffsetX",boxShadowOffsetY:"shadowOffsetY",boxShadowOpacity:"shadowOpacity",boxShadowRadius:"shadowRadius",boxShadowSpread:"shadowSpread",boxShadowColor:"shadowColor"},lt={totop:"0",totopright:"totopright",toright:"90",tobottomright:"tobottomright",tobottom:"180",tobottomleft:"tobottomleft",toleft:"270",totopleft:"totopleft"},ut="turn",st="rad",ct="deg";function ft(e){var t=(e||"").replace(/\s*/g,"").toLowerCase(),n=/^([+-]?\d+\.?\d*)+(deg|turn|rad)|(to\w+)$/g.exec(t);if(Array.isArray(n)){var r="180",i=A(n,3),a=i[0],o=i[1],l=i[2];return o&&l?r=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:ct,n=parseFloat(e),r=e||"",i=e.split("."),a=A(i,2),o=a[1];switch(o&&o.length>2&&(r=n.toFixed(2)),t){case ut:r="".concat((360*n).toFixed(2));break;case st:r="".concat((180/Math.PI*n).toFixed(2))}return r}(o,l):a&&void 0!==lt[a]&&(r=lt[a]),r}}function dt(e){var t=A((e||"").replace(/\s+/g," ").trim().split(/\s+(?![^(]*?\))/),2),n=t[0],r=t[1],i=/^([+-]?\d+\.?\d*)%$/g;return!n||i.exec(n)||r?n&&i.exec(r)?{ratio:parseFloat(r.split("%")[0])/100,color:un(n)}:void 0:{color:un(n)}}function pt(e){var t;return t=e,se.test(t)&&(e=e.replace("Capture","")),ie[e]?ie[e][1]:e}var ht=function(e){k(n,e);var t=S(n);function n(e){var r;return O(this,n),(r=t.call(this)).id="",r.style={},r.attributes={},r.tagName=e,r}return j(n,[{key:"nativeName",get:function(){return this.meta.component.name}},{key:"toString",value:function(){return"".concat(this.tagName,":(").concat(this.nativeName,")")}},{key:"hasAttribute",value:function(e){return!!this.attributes[e]}},{key:"getAttribute",value:function(e){return this.attributes[e]}},{key:"setStyleAttribute",value:function(e){var t=this;this.style={};var n=e;if(!Array.isArray(n)&&Object.hasOwnProperty.call(n,0)){var r=[],i={};Object.keys(n).forEach((function(e){var t;t=e,ae.test(t)?r.push(n[e]):i[e]=n[e]})),n=[].concat(r,[i])}Array.isArray(n)||(n=[n]);var a={};n.forEach((function(e){Array.isArray(e)?e.forEach((function(e){a=I(I({},a),e)})):"object"===L(e)&&e&&(a=I(I({},a),e))})),Object.keys(a).forEach((function(e){var n=a[e];if(Object.prototype.hasOwnProperty.call(ot,e)&&(e=ot[e]),"transform"===e){var r={};if(!Array.isArray(n))throw new TypeError("transform only support array args");n.forEach((function(e){Object.keys(e).forEach((function(t){var n=e[t];n instanceof We||n instanceof Ve?r[t]={animationId:n.animationId}:null===n?r[t]&&delete r[t]:void 0!==n&&(r[t]=n)}))}));var i=Object.keys(r);i.length&&(Array.isArray(t.style.transform)||(t.style.transform=[]),i.forEach((function(e){return t.style.transform.push({[e]:r[e]})})))}else if(null===n&&void 0!==t.style[e])t.style[e]=void 0;else if(n instanceof We||n instanceof Ve)t.style[e]={animationId:n.animationId};else if(["caretColor","caret-color"].indexOf(e)>=0)t.attributes["caret-color"]=un(n);else if(e.toLowerCase().indexOf("colors")>-1)t.style[e]=sn(n);else if(e.toLowerCase().indexOf("color")>-1)t.style[e]=un(n);else if("backgroundImage"===e&&n)t.style=function(e,t,n){if(0===t.indexOf("linear-gradient")){var r=t.substring(t.indexOf("(")+1,t.lastIndexOf(")")).split(/,(?![^(]*?\))/),i=[];n.linearGradient=n.linearGradient||{},r.forEach((function(e,t){if(0===t){var r=ft(e);if(r)n.linearGradient.angle=r;else{n.linearGradient.angle="180";var a=dt(e);a&&i.push(a)}}else{var o=dt(e);o&&i.push(o)}})),n.linearGradient.colorStopList=i}else n[e]=me(t);return n}(e,n,t.style);else if("textShadowOffset"===e){var o=n||{},l=o.x,u=void 0===l?0:l,s=o.width,c=void 0===s?0:s,f=o.y,d=void 0===f?0:f,p=o.height,h=void 0===p?0:p;t.style[e]={width:u||c,height:d||h}}else["textShadowOffsetX","textShadowOffsetY"].indexOf(e)>=0?t.style=function(e,t,n){return n.textShadowOffset=n.textShadowOffset||{},Object.assign(n.textShadowOffset,{[{textShadowOffsetX:"width",textShadowOffsetY:"height"}[e]]:t||0}),n}(e,n,t.style):t.style[e]=n}))}},{key:"setAttribute",value:function(e,t){var n=this;try{if("boolean"==typeof this.attributes[e]&&""===t&&(t=!0),void 0===e)return void rt(this);var r=!1;if([{match:function(){return["id"].indexOf(e)>=0},action:function(){return t===n.id||(n.id=t,function(e){if(e.isMounted){var t=Ze(X(),e);Ke.push({type:qe.updateNode,nodes:t})}}(n)),!0}},{match:function(){return["value","defaultValue","placeholder"].indexOf(e)>=0},action:function(){return n.attributes[e]=ue(t),!1}},{match:function(){return["text"].indexOf(e)>=0},action:function(){return n.attributes[e]=t,!1}},{match:function(){return["numberOfRows"].indexOf(e)>=0},action:function(){return n.attributes[e]=t,"ios"!==qt.platform.OS}},{match:function(){return["caretColor","caret-color"].indexOf(e)>=0},action:function(){return n.attributes["caret-color"]=un(t),!1}},{match:function(){return["style"].indexOf(e)>=0},action:function(){return"object"!==L(t)||null==t||(n.setStyleAttribute(t),!1)}},{match:function(){return!0},action:function(){if("function"==typeof t){var r=pt(e);n.attributes["__bind__".concat(r)]=!0}else{n.attributes[e]=t;var i=pt(e);!0===n.attributes["__bind__".concat(i)]&&"function"!=typeof t&&(n.attributes["__bind__".concat(i)]=!1)}return!1}}].some((function(e){return!!e.match()&&(r=e.action(),!0)})),r)return;var i=!1;Object.keys(this.style).some((function(e){var t=n.style[e];if(t&&Array.isArray(t)&&"transform"===e)for(var r=0;r2&&void 0!==arguments[2]&&arguments[2];if(null!==t){var r=t,i=e;Object.prototype.hasOwnProperty.call(ot,e)&&(i=ot[e]),"string"==typeof r&&(r=t.trim(),r=i.toLowerCase().indexOf("colors")>-1?sn(r):i.toLowerCase().indexOf("color")>-1?un(r):fe(r)),null!=r&&this.style[i]!==r&&(this.style[i]=r,n||rt(this))}else delete this.style[e]}},{key:"setNativeProps",value:function(e){var t=this;if(e){var n=e.style;if(n){var r=n;Object.keys(r).forEach((function(e){t.setStyle(e,r[e],!0)})),rt(this),Ye(!0)}}}},{key:"setText",value:function(e){if("string"!=typeof e)try{e=e.toString()}catch(e){throw new Error("Only string type is acceptable for setText")}return(e=e.trim())||this.getAttribute("text")?(e=(e=ue(e)).replace(/ /g," ").replace(/Â/g," "),"textarea"===this.tagName?this.setAttribute("value",e):this.setAttribute("text",e)):null}}]),n}(at),mt=B.createNode,vt=B.updateNode,yt=B.deleteNode,gt=B.flushBatch,bt=B.endBatch,kt=B.sendRenderError,wt=function(e){return J((function(t){return t.stateNode&&t.stateNode.nodeId===e}))};function St(e){if(e instanceof ht)return e;var t=e._reactInternalFiber||e._reactInternals;if(null==t?void 0:t.child){for(var n=t.child;n&&!(n.stateNode instanceof ht);)n=n.child;return n&&n.stateNode?n.stateNode:null}return null}function Et(e){var t=e;if("string"==typeof e){"getNodeIdByRef('".concat(e,"') use string ref will affect to performance, recommend use reference to the ref instead");var n=J((function(t){return!!(t.return&&t.return.ref&&t.return.ref._stringRef)&&t.return.ref._stringRef===e}));if(!n||!n.stateNode)return 0;t=n.stateNode}if(!t.nodeId){var r=St(t);return r?r.nodeId:0}return t.nodeId}function Ct(e,t){var n=e.nativeName,r=e.nodeId;if(!r||!n){var i=St(e);i&&(r=i.nodeId,n=i.nativeName)}if(!n)throw new Error("callUIFunction is calling a unnamed component");if(!r)throw new Error("callUIFunction is calling a component have no nodeId");for(var a=arguments.length,o=new Array(a>2?a-2:0),l=2;l=0&&e.removeChild(t),e.appendChild(t)},appendChildToContainer:function(e,t){e.appendChild(t)},appendInitialChild:function(e,t){e.appendChild(t)},beforeActiveInstanceBlur:function(){},commitMount:function(){},commitTextUpdate:function(){},commitUpdate:function(e,t,n,r,i,a){Z(a,e.nodeId);var o=Object.keys(t);0!==o.length&&o.forEach((function(n){return e.setAttribute(n,t[n])}))},clearContainer:function(){},createContainerChildSet:function(){},createInstance:function(e,t,n,r,i){var a=n.createElement(e);return Object.keys(t).forEach((function(e){switch(e){case"children":break;case"nativeName":a.meta.component.name=t.nativeName;break;default:a.setAttribute(e,t[e])}})),[5,7].indexOf(i.tag)<0&&(a.meta.skipAddToDom=!0),Z(i,a.nodeId),a},createTextInstance:function(e,t,n,r){var i=t.createElement("p");return i.setAttribute("text",ue(e)),i.meta={component:{name:"Text"}},Z(r,i.nodeId),i},detachDeletedInstance:function(){},finalizeContainerChildren:function(){},finalizeInitialChildren:function(){return!0},getChildHostContext:function(){return{}},getPublicInstance:function(e){return e},getInstanceFromNode:function(){throw new Error("Not yet implemented.")},getFundamentalComponentInstance:function(){throw new Error("Not yet implemented.")},getRootHostContext:function(){return{}},hideInstance:function(e){var t={style:{display:"none"}};Object.keys(t).forEach((function(n){return e.setAttribute(n,t[n])}))},hideTextInstance:function(){throw new Error("Not yet implemented.")},insertBefore:function(e,t,n){e.childNodes.indexOf(t)>=0?e.moveChild(t,n):e.insertBefore(t,n)},isOpaqueHydratingObject:function(){throw new Error("Not yet implemented")},makeClientId:function(){throw new Error("Not yet implemented")},makeClientIdInDEV:function(){throw new Error("Not yet implemented")},makeOpaqueHydratingObject:function(){throw new Error("Not yet implemented.")},mountFundamentalComponent:function(){throw new Error("Not yet implemented.")},prepareForCommit:function(){return null},preparePortalMount:function(){},prepareUpdate:function(e,t,n,r){var i={},a=!1;Object.keys(r).forEach((function(e){var t=n[e],o=r[e];switch(e){case"children":t===o||"number"!=typeof o&&"string"!=typeof o||(i[e]=o);break;default:"function"!=typeof t||"function"!=typeof o||Tt(t,o)?Tt(t,o)||(i[e]=o):a=!0}}));var o=0===Object.keys(i).length;return o&&a?{}:o?null:i},replaceContainerChildren:function(){},removeChild:function(e,t){e.removeChild(t),re(t)},removeChildFromContainer:function(e,t){e.removeChild(t),re(t)},resetAfterCommit:function(){},resetTextContent:function(){},unmountFundamentalComponent:function(){throw new Error("Not yet implemented.")},updateFundamentalComponent:function(){throw new Error("Not yet implemented.")},unhideTextInstance:function(){throw new Error("Not yet implemented.")},unhideInstance:function(e,t){var n=I(I({},t),{},{style:I(I({},t.style),{},{display:"flex"})});Object.keys(n).forEach((function(t){return e.setAttribute(t,n[t])}))},shouldDeprioritizeSubtree:function(){return!0},shouldUpdateFundamentalComponent:function(){throw new Error("Not yet implemented.")},shouldSetTextContent:function(e,t){if(t&&"Text"===t.nativeName||-1!==["p","span"].indexOf(e)){var n=t.children;return"string"==typeof n||"number"==typeof n}return!1}}),Mt=i()(I(I({},Ht),{},{clearTimeout:clearTimeout,setTimeout:setTimeout,isPrimaryRenderer:!0,noTimeout:-1,supportsMutation:!0,supportsHydration:!1,supportsPersistence:!1,now:Date.now,scheduleDeferredCallback:function(){},cancelDeferredCallback:function(){}})),Dt=Mt.flushSync,Ut=K.addEventListener,Wt=K.removeEventListener,Bt=K.dispatchEvent,Vt=K.AsyncStorage,$t=K.Bridge,qt=K.Device,Qt=K.HippyRegister,Kt=Object.freeze({__proto__:null,addEventListener:Ut,removeEventListener:Wt,dispatchEvent:Bt,AsyncStorage:Vt,BackAndroid:At,Bridge:$t,Clipboard:_e,Cookie:Le,Device:qt,HippyRegister:Qt,ImageLoader:Oe,NetworkInfo:He,UIManager:Nt,flushSync:Dt});function Gt(){for(var e=arguments.length,t=new Array(e),n=0;n255?255:t}function tn(e){var t=parseFloat(e);return t<0?0:t>1?255:Math.round(255*t)}function nn(e,t,n){var r=n;return r<0&&(r+=1),r>1&&(r-=1),r<1/6?e+6*(t-e)*r:r<.5?t:r<2/3?e+(t-e)*(2/3-r)*6:e}function rn(e,t,n){var r=n<.5?n*(1+t):n+t-n*t,i=2*n-r,a=nn(i,r,e+1/3),o=nn(i,r,e),l=nn(i,r,e-1/3);return Math.round(255*a)<<24|Math.round(255*o)<<16|Math.round(255*l)<<8}function an(e){return(parseFloat(e)%360+360)%360/360}function on(e){var t=parseFloat(e);return t<0?0:t>100?1:t/100}function ln(e){var t;return"number"==typeof e?e>>>0===e&&e>=0&&e<=4294967295?e:null:(t=Zt.hex6.exec(e),Array.isArray(t)?parseInt("".concat(t[1],"ff"),16)>>>0:Object.hasOwnProperty.call(Yt,e)?Yt[e]:(t=Zt.rgb.exec(e),Array.isArray(t)?(en(t[1])<<24|en(t[2])<<16|en(t[3])<<8|255)>>>0:(t=Zt.rgba.exec(e))?(en(t[1])<<24|en(t[2])<<16|en(t[3])<<8|tn(t[4]))>>>0:(t=Zt.hex3.exec(e))?parseInt("".concat(t[1]+t[1]+t[2]+t[2]+t[3]+t[3],"ff"),16)>>>0:(t=Zt.hex8.exec(e))?parseInt(t[1],16)>>>0:(t=Zt.hex4.exec(e))?parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+t[4]+t[4],16)>>>0:(t=Zt.hsl.exec(e))?(255|rn(an(t[1]),on(t[2]),on(t[3])))>>>0:(t=Zt.hsla.exec(e))?(rn(an(t[1]),on(t[2]),on(t[3]))|tn(t[4]))>>>0:null))}function un(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(Number.isInteger(e))return e;var n=ln(e);return t.platform||(t.platform="ios"),null===n?0:(n=(n<<24|n>>>8)>>>0,"android"===t.platform&&(n|=0),n)}function sn(e,t){return Array.isArray(e)?e.map((function(e){return un(e,t)})):[0]}var cn=function(e){k(n,e);var t=S(n);function n(){var e;return O(this,n),(e=t.call(this)).documentElement=new ht("document"),e}return j(n,[{key:"createElement",value:function(e){return new ht(e)}},{key:"createElementNS",value:function(e,t){return new ht("".concat(e,":").concat(t))}}]),n}(at);cn.createElement=cn.prototype.createElement,cn.createElementNS=cn.prototype.createElementNS;var fn=Mt.createContainer,dn=Mt.updateContainer,pn=Mt.getPublicRootInstance,hn=(Mt.injectIntoDevTools,['%c[Hippy-React "2.2.1"]%c',"color: #61dafb","color: auto"]),mn=function(){function e(t){if(O(this,e),!t.appName||!t.entryPage)throw new TypeError("Invalid arguments");this.config=t,this.regist=this.start,this.render=this.render.bind(this);var n=new cn;this.rootContainer=fn(n,0,!1,null)}return j(e,[{key:"start",value:function(){Qt.regist(this.config.appName,this.render)}},{key:"render",value:function(e){var t=this.config,n=t.appName,r=t.entryPage,i=t.silent,a=void 0!==i&&i,l=t.bubbles,u=void 0!==l&&l,s=t.callback,c=void 0===s?function(){}:s,f=e.__instanceId__;le.apply(void 0,hn.concat(["Start",n,"with rootViewId",f,e])),this.rootContainer.containerInfo.nodeId=f,a&&pe(a),u&&function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];oe=e}(u),Y(f,this.rootContainer);var d=o.a.createElement(r,e);return dn(d,this.rootContainer,null,c),pn(this.rootContainer)}}],[{key:"Native",get:function(){return Kt}}]),e}();mn.version="2.2.1";var vn={registerComponent:function(e,t){new mn({appName:e,entryPage:t}).start()}},yn=function(e){k(n,e);var t=S(n);function n(){var e;return O(this,n),(e=t.apply(this,arguments)).instance=null,e}return j(n,[{key:"setPressed",value:function(e){Ct(this.instance,"setPressed",[e])}},{key:"setHotspot",value:function(e,t){Ct(this.instance,"setHotspot",[e,t])}},{key:"render",value:function(){var e=this,t=this.props,n=t.collapsable,r=t.style,i=void 0===r?{}:r,a=_(t,u),l=i,s=a.nativeBackgroundAndroid;return"boolean"==typeof n&&(l.collapsable=n),void 0!==(null==s?void 0:s.color)&&(s.color=un(s.color)),o.a.createElement("div",I({ref:function(t){e.instance=t},nativeName:"View",style:l},a))}}]),n}(o.a.Component);function gn(e,t){var n=e.style,r=_(e,s),i=n;if(n&&(Array.isArray(n)?-1===n.filter((function(e){return"object"===L(e)&&e})).findIndex((function(e){return e.color||e.colors}))&&(i[0].color="#000"):"object"===L(n)&&void 0===n.color&&void 0===n.colors&&(i.color="#000")),r.text="","string"==typeof r.children)r.text=ue(r.children);else if("number"==typeof r.children)r.text=ue(r.children.toString());else if(Array.isArray(r.children)){var a=r.children.filter((function(e){return"string"==typeof e||"number"==typeof e})).join("");a&&(r.text=ue(a),r.children=r.text)}return o.a.createElement("p",I({ref:t,nativeName:"Text",style:i},r))}gn.displayName="Text";var bn=o.a.forwardRef(gn);bn.displayName="Text";var kn=Object.freeze({__proto__:null,default:bn}),wn=function(e){k(n,e);var t=S(n);function n(){return O(this,n),t.apply(this,arguments)}return j(n,[{key:"render",value:function(){var e=this.props,t=e.children,n=e.style,r=e.imageStyle,i=e.imageRef,a=e.source,l=e.sources,u=e.src,s=e.srcs,f=e.tintColor,d=e.tintColors,p=_(e,c),h=this.getImageUrls({src:u,srcs:s,source:a,sources:l});if("ios"===qt.platform.OS)h.length&&(p.source=h.map((function(e){return{uri:e}})));else if("android"===qt.platform.OS)if(1===h.length){var m=A(h,1);p.src=m[0]}else h.length>1&&(p.srcs=h);"string"==typeof p.defaultSource&&(p.defaultSource.indexOf("data:image/"),p.defaultSource=me(p.defaultSource));var v=I({},n);return this.handleTintColor(v,f,d),p.style=v,t?o.a.createElement(yn,{style:n},o.a.createElement("img",I(I({},p),{},{nativeName:"Image",alt:"",ref:i,style:[{position:"absolute",left:0,right:0,top:0,bottom:0,width:n.width,height:n.height},r]})),t):o.a.createElement("img",I(I({},p),{},{nativeName:"Image",alt:"",ref:i}))}},{key:"getImageUrls",value:function(e){var t=e.src,n=e.srcs,r=e.source,i=e.sources,a=[];if("string"==typeof t&&a.push(t),Array.isArray(n)&&(a=[].concat(b(a),b(n))),r)if("string"==typeof r)a.push(r);else if("object"===L(r)&&null!==r){var o=r.uri;o&&a.push(o)}return i&&Array.isArray(i)&&i.forEach((function(e){"string"==typeof e?a.push(e):"object"===L(e)&&null!==e&&e.uri&&a.push(e.uri)})),a.length&&(a=a.map((function(e){return me(e)}))),a}},{key:"handleTintColor",value:function(e,t,n){t&&(e.tintColor=un(t)),Array.isArray(n)&&(e.tintColors=sn(n))}}],[{key:"resizeMode",get:function(){return{contain:"contain",cover:"cover",stretch:"stretch",center:"center",repeat:"repeat"}}},{key:"getSize",value:function(e,t,n){if("string"!=typeof e)throw new TypeError("Image.getSize first argument must be a string url");var r=Ae(e);return"function"==typeof t&&r.then((function(e){return t(e.width,e.height)})),"function"==typeof n?r.catch(n):r.catch((function(t){"Failed to get size for image: ".concat(e)})),r}}]),n}(o.a.Component);wn.prefetch=Re;var Sn=function(){function e(){O(this,e),this.Value=e.Value}return j(e,null,[{key:"Value",value:function(e){return e}},{key:"timing",value:function(e,t){return new We({mode:"timing",delay:0,startValue:e,toValue:t.toValue,duration:t.duration,timingFunction:t.easing||"linear"})}}]),e}();Sn.View=yn,Sn.Text=kn,Sn.Image=wn;var En={step0:function(e){return e>0?1:0},step1:function(e){return e>=1?1:0},linear:function(){return"linear"},ease:function(){return"ease"},quad:function(e){return Math.pow(e,2)},cubic:function(e){return Math.pow(e,3)},poly:function(e){return function(t){return Math.pow(t,e)}},sin:function(e){return 1-Math.cos(e*Math.PI/2)},circle:function(e){return 1-Math.sqrt(1-e*e)},exp:function(e){return Math.pow(2,10*(e-1))},elastic:function(){return"elastic"},back:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1.70158;return function(t){return t*t*((e+1)*t-e)}},bounce:function(e){var t=e;return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375},bezier:function(){return"bezier"},in:function(){return"ease-in"},out:function(){return"ease-out"},inOut:function(){return"ease-in-out"}};function Cn(e){return o.a.createElement("li",I({nativeName:"ListViewItem"},e))}var xn=function(e){k(n,e);var t=S(n);function n(){var e;return O(this,n),(e=t.apply(this,arguments)).instance=null,e}return j(n,[{key:"expandPullHeader",value:function(){Ct(this.instance,"expandPullHeader",[])}},{key:"collapsePullHeader",value:function(e){"android"===qt.platform.OS?Ct(this.instance,"collapsePullHeader",[e]):void 0!==e?Ct(this.instance,"collapsePullHeaderWithOptions",[e]):Ct(this.instance,"collapsePullHeader",[])}},{key:"render",value:function(){var e=this,t=this.props,n=t.children,r=_(t,f);return o.a.createElement("div",I({nativeName:"PullHeaderView",ref:function(t){e.instance=t}},r),n)}}]),n}(o.a.Component),Nn=function(e){k(n,e);var t=S(n);function n(){var e;return O(this,n),(e=t.apply(this,arguments)).instance=null,e}return j(n,[{key:"expandPullFooter",value:function(){Ct(this.instance,"expandPullFooter",[])}},{key:"collapsePullFooter",value:function(){Ct(this.instance,"collapsePullFooter",[])}},{key:"render",value:function(){var e=this,t=this.props,n=t.children,r=_(t,d);return o.a.createElement("div",I({nativeName:"PullFooterView",ref:function(t){e.instance=t}},r),n)}}]),n}(o.a.Component);Nn.defaultProps={sticky:!0};var In={onDisappear:"onDisAppear"},Pn={onDisappear:"onDisappear"},_n=function(e){k(n,e);var t=S(n);function n(e){var r;return O(this,n),(r=t.call(this,e)).instance=null,r.pullHeader=null,r.pullFooter=null,r.handleInitialListReady=r.handleInitialListReady.bind(C(r)),r.state={initialListReady:!1},r}return j(n,[{key:"componentDidMount",value:function(){this.props.getRowKey}},{key:"scrollToIndex",value:function(e,t,n){"number"==typeof e&&"number"==typeof t&&"boolean"==typeof n&&Ct(this.instance,"scrollToIndex",[e,t,n])}},{key:"scrollToContentOffset",value:function(e,t,n){"number"==typeof e&&"number"==typeof t&&"boolean"==typeof n&&Ct(this.instance,"scrollToContentOffset",[e,t,n])}},{key:"expandPullHeader",value:function(){this.pullHeader&&this.pullHeader.expandPullHeader()}},{key:"collapsePullHeader",value:function(e){this.pullHeader&&this.pullHeader.collapsePullHeader(e)}},{key:"expandPullFooter",value:function(){this.pullFooter&&this.pullFooter.expandPullFooter()}},{key:"collapsePullFooter",value:function(){this.pullFooter&&this.pullFooter.collapsePullFooter()}},{key:"render",value:function(){var e=this,t=this.props,r=t.children,i=t.style,a=t.renderRow,l=t.renderPullHeader,u=t.renderPullFooter,s=t.getRowType,c=t.getRowStyle,f=t.getRowKey,d=t.dataSource,h=t.initialListSize,m=t.rowShouldSticky,v=t.onRowLayout,y=t.onHeaderPulling,g=t.onHeaderReleased,b=t.onFooterPulling,k=t.onFooterReleased,w=t.onAppear,S=t.onDisappear,E=t.onWillAppear,C=t.onWillDisappear,x=_(t,p),N=[];if("function"==typeof a){var P=this.state.initialListReady,L=this.props.numberOfRows,A=this.getPullHeader(l,y,g),R=this.getPullFooter(u,b,k);!L&&d&&(L=d.length),P||(L=Math.min(L,h||10));for(var z=function(t){var r={},i=void 0;i=d?a(d[t],null,t):a(t),e.handleRowProps(r,t,{getRowKey:f,getRowStyle:c,getRowType:s,onRowLayout:v,rowShouldSticky:m}),[{func:w,name:"onAppear"},{func:S,name:"onDisappear"},{func:E,name:"onWillAppear"},{func:C,name:"onWillDisappear"}].forEach((function(e){var i=e.func,a=e.name;"function"==typeof i&&(r[n.convertName(a)]=function(){i(t)})})),i&&N.push(o.a.createElement(Cn,I({},r),i))},O=0;O0&&(this.size-=1),e.data}},{key:"clear",value:function(){this.top=null,this.size=0}},{key:"displayAll",value:function(){var e=[];if(null===this.top)return e;for(var t=this.top,n=0,r=this.size;n1&&this.pop({animated:!0})}},{key:"push",value:function(e){if(null==e?void 0:e.component){if(!this.routeList[e.routeName])new mn({appName:e.routeName,entryPage:e.component}).regist(),this.routeList[e.routeName]=!0;delete e.component}var t=[e];this.stack.push(e),Ct(this.instance,"push",t)}},{key:"pop",value:function(e){if(this.stack.size>1){var t=[e];this.stack.pop(),Ct(this.instance,"pop",t)}}},{key:"clear",value:function(){this.stack.clear()}},{key:"render",value:function(){var e=this,t=this.props,n=t.initialRoute,r=(n.component,_(n,m)),i=_(t,v);return i.initialRoute=r,o.a.createElement("div",I({nativeName:"Navigator",ref:function(t){e.instance=t}},i))}}]),n}(o.a.Component);function zn(e){return o.a.createElement("div",I(I({nativeName:"ViewPagerItem"},e),{},{style:{position:"absolute",left:0,top:0,right:0,bottom:0,collapsable:!1}}))}var On=function(e){k(n,e);var t=S(n);function n(e){var r;return O(this,n),(r=t.call(this,e)).instance=null,r.setPage=r.setPage.bind(C(r)),r.setPageWithoutAnimation=r.setPageWithoutAnimation.bind(C(r)),r.onPageScrollStateChanged=r.onPageScrollStateChanged.bind(C(r)),r}return j(n,[{key:"onPageScrollStateChanged",value:function(e){var t=this.props.onPageScrollStateChanged;t&&t(e.pageScrollState)}},{key:"setPage",value:function(e){"number"==typeof e&&Ct(this.instance,"setPage",[e])}},{key:"setPageWithoutAnimation",value:function(e){"number"==typeof e&&Ct(this.instance,"setPageWithoutAnimation",[e])}},{key:"render",value:function(){var e=this,t=this.props,n=t.children,r=t.onPageScrollStateChanged,i=_(t,y),a=[];return Array.isArray(n)?a=n.map((function(e){var t={};return"string"==typeof e.key&&(t.key="viewPager_".concat(e.key)),o.a.createElement(zn,I({},t),e)})):a.push(o.a.createElement(zn,null,n)),"function"==typeof r&&(i.onPageScrollStateChanged=this.onPageScrollStateChanged),o.a.createElement("div",I({nativeName:"ViewPager",ref:function(t){e.instance=t}},i),a)}}]),n}(o.a.Component);function Tn(){var e=W.platform.Localization;return!!e&&1===e.direction}var jn=function(e){k(n,e);var t=S(n);function n(e){var r;return O(this,n),(r=t.call(this,e)).instance=null,r._lastNativeText="",r.onChangeText=r.onChangeText.bind(C(r)),r.onKeyboardWillShow=r.onKeyboardWillShow.bind(C(r)),r}return j(n,[{key:"componentDidMount",value:function(){var e=this.props,t=e.value,n=e.autoFocus;this._lastNativeText=t,n&&this.focus()}},{key:"componentWillUnmount",value:function(){this.blur()}},{key:"getValue",value:function(){var e=this;return new Promise((function(t){Ct(e.instance,"getValue",(function(e){return t(e.text)}))}))}},{key:"setValue",value:function(e){return Ct(this.instance,"setValue",[e]),e}},{key:"focus",value:function(){Ct(this.instance,"focusTextInput",[])}},{key:"blur",value:function(){Ct(this.instance,"blurTextInput",[])}},{key:"showInputMethod",value:function(){Ct(this.instance,"showInputMethod",[])}},{key:"hideInputMethod",value:function(){Ct(this.instance,"hideInputMethod",[])}},{key:"clear",value:function(){Ct(this.instance,"clear",[])}},{key:"render",value:function(){var e=this,t=I({},this.props);return["underlineColorAndroid","placeholderTextColor","placeholderTextColors"].forEach((function(n){"string"==typeof e.props[n]&&(Array.isArray(t.style)?t.style.push({[n]:e.props[n]}):t.style&&"object"===L(t.style)?t.style[n]=e.props[n]:t.style={[n]:e.props[n]},t[n]=void 0)})),Tn()&&(t.style?"object"!==L(t.style)||Array.isArray(t.style)||t.style.textAlign||(t.style.textAlign="right"):t.style={textAlign:"right"}),o.a.createElement("div",I(I({nativeName:"TextInput"},t),{},{ref:function(t){e.instance=t},onChangeText:this.onChangeText,onKeyboardWillShow:this.onKeyboardWillShow}))}},{key:"onChangeText",value:function(e){var t=this.props.onChangeText;"function"==typeof t&&t(e.text),this.instance&&(this._lastNativeText=e.text)}},{key:"onKeyboardWillShow",value:function(e){var t=this.props.onKeyboardWillShow,n=e;"android"===qt.platform.OS&&(n.keyboardHeight/=qt.screen.scale),"function"==typeof t&&t(n)}}]),n}(o.a.Component),Fn=qt.window.scale,Hn=Math.round(.4*Fn)/Fn;function Mn(e){return e}0===Hn&&(Hn=1/Fn);var Dn=Object.freeze({__proto__:null,get hairlineWidth(){return Hn},create:Mn}),Un={baseVertical:{flexGrow:1,flexShrink:1,flexDirection:"column",overflow:"scroll"},baseHorizontal:{flexGrow:1,flexShrink:1,flexDirection:"row",overflow:"scroll"},contentContainerVertical:{collapsable:!1,flexDirection:"column"},contentContainerHorizontal:{collapsable:!1,flexDirection:"row"}},Wn=function(e){k(n,e);var t=S(n);function n(){var e;return O(this,n),(e=t.apply(this,arguments)).instance=null,e}return j(n,[{key:"scrollTo",value:function(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=e,i=t,a=n;"number"==typeof e||"object"===L(e)&&e&&(r=e.x,i=e.y,a=e.animated),r=r||0,i=i||0,a=!!a,Ct(this.instance,"scrollTo",[r,i,a])}},{key:"scrollToWithDuration",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1e3;Ct(this.instance,"scrollToWithOptions",[{x:e,y:t,duration:n}])}},{key:"render",value:function(){var e=this,t=this.props,n=t.horizontal,r=t.contentContainerStyle,i=t.children,a=t.style,l=[n?Un.contentContainerHorizontal:Un.contentContainerVertical,r],u=n?Object.assign({},Un.baseHorizontal,a):Object.assign({},Un.baseVertical,a);return n&&(u.flexDirection=Tn()?"row-reverse":"row"),o.a.createElement("div",I(I({nativeName:"ScrollView",ref:function(t){e.instance=t}},this.props),{},{style:u}),o.a.createElement(yn,{style:l},i))}}]),n}(o.a.Component),Bn={modal:{position:"absolute"},container:{position:"absolute",left:0,top:0}},Vn=function(e){k(n,e);var t=S(n);function n(e){var r;return O(this,n),(r=t.call(this,e)).eventSubscription=null,r}return j(n,[{key:"componentDidMount",value:function(){var e=this;"ios"===qt.platform.OS&&(this.eventSubscription=new Ne("modalDismissed"),this.eventSubscription.addCallback((function(t){var n=e.props,r=n.primaryKey,i=n.onDismiss;t.primaryKey===r&&"function"==typeof i&&i()})))}},{key:"componentWillUnmount",value:function(){"ios"===qt.platform.OS&&this.eventSubscription&&this.eventSubscription.unregister()}},{key:"render",value:function(){var e=this.props,t=e.children,n=e.visible,r=e.transparent,i=e.animated,a=this.props.animationType;if(!1===n)return null;var l={backgroundColor:r?"transparent":"white"};return a||(a="none",i&&(a="slide")),o.a.createElement("div",I({nativeName:"Modal",animationType:a,transparent:r,style:Bn.modal},this.props),o.a.createElement(yn,{style:[Bn.container,l]},t))}}]),n}(o.a.Component);Vn.defaultProps={visible:!0};var $n=function(e){k(n,e);var t=S(n);function n(e){var r;O(this,n);var i=(r=t.call(this,e)).props.requestFocus;return r.state={isFocus:!!i},r.handleFocus=r.handleFocus.bind(C(r)),r}return j(n,[{key:"render",value:function(){var e,t,n,r,i=this.props,a=i.requestFocus,l=i.children,u=i.nextFocusDownId,s=i.nextFocusUpId,c=i.nextFocusLeftId,f=i.nextFocusRightId,d=i.style,p=i.noFocusStyle,h=i.focusStyle,m=i.onClick,v=this.state.isFocus,y=o.a.Children.only(l);(null===(t=null===(e=null==y?void 0:y.child)||void 0===e?void 0:e.memoizedProps)||void 0===t?void 0:t.nativeName)?r=y.child.memoizedProps.nativeName:(null===(n=null==y?void 0:y.type)||void 0===n?void 0:n.displayName)&&(r=y.type.displayName);var g=u&&Et(u),b=s&&Et(s),k=c&&Et(c),w=f&&Et(f),S=d;if("Text"!==r){var E=y.memoizedProps.style;S=I(I({},S),E)}if(Object.assign(S,v?h:p),"Text"===r)return o.a.createElement(yn,{focusable:!0,nextFocusDownId:g,nextFocusUpId:b,nextFocusLeftId:k,nextFocusRightId:w,requestFocus:a,style:S,onClick:m,onFocus:this.handleFocus},y);var C=y.memoizedProps.children;return o.a.cloneElement(y,{nextFocusDownId:u,nextFocusUpId:s,nextFocusLeftId:c,nextFocusRightId:f,requestFocus:a,onClick:m,focusable:!0,children:C,style:S,onFocus:this.handleFocus})}},{key:"handleFocus",value:function(e){var t=this.props.onFocus;"function"==typeof t&&t(e),this.state.isFocus!==e.focus&&this.setState({isFocus:e.focus})}}]),n}(o.a.Component);function qn(e){return o.a.createElement("iframe",I({title:"hippy",nativeName:"WebView"},e))}var Qn,Kn=function(){function e(t,n,r){var i=this;if(O(this,e),this.protocol="",this.onWebSocketEvent=this.onWebSocketEvent.bind(this),Qn||(Qn=new Ne("hippyWebsocketEvents")),this.readyState=0,this.webSocketCallbacks={},!t||"string"!=typeof t)throw new TypeError("Invalid WebSocket url");var a=I({},r);if(void 0!==n)if(Array.isArray(n)&&n.length>0)a["Sec-WebSocket-Protocol"]=n.join(",");else{if("string"!=typeof n)throw new TypeError("Invalid WebSocket protocols");a["Sec-WebSocket-Protocol"]=n}var o={headers:a,url:t};this.url=t,this.webSocketCallbackId=Qn.addCallback(this.onWebSocketEvent),U.callNativeWithPromise("websocket","connect",o).then((function(e){e&&0===e.code&&"number"==typeof e.id&&(i.webSocketId=e.id)}))}return j(e,[{key:"close",value:function(e,t){1===this.readyState&&(this.readyState=2,U.callNative("websocket","close",{id:this.webSocketId,code:e,reason:t}))}},{key:"send",value:function(e){if(1===this.readyState){if("string"!=typeof e)throw new TypeError("Unsupported websocket data type: ".concat(L(e)));U.callNative("websocket","send",{id:this.webSocketId,data:e})}}},{key:"onopen",set:function(e){this.webSocketCallbacks.onOpen=e}},{key:"onclose",set:function(e){this.webSocketCallbacks.onClose=e}},{key:"onerror",set:function(e){this.webSocketCallbacks.onError=e}},{key:"onmessage",set:function(e){this.webSocketCallbacks.onMessage=e}},{key:"onWebSocketEvent",value:function(e){if("object"===L(e)&&e.id===this.webSocketId){var t=e.type;"onOpen"===t?this.readyState=1:"onClose"===t&&(this.readyState=3,Qn.removeCallback(this.webSocketCallbackId));var n=this.webSocketCallbacks[t];"function"==typeof n&&n(e.data)}}}]),e}();function Gn(e){return o.a.createElement("li",I({nativeName:"WaterfallItem"},e))}var Yn=function(e){k(n,e);var t=S(n);function n(e){var r;return O(this,n),(r=t.call(this,e)).instance=null,r.pullHeader=null,r.pullFooter=null,r.handleInitialListReady=r.handleInitialListReady.bind(C(r)),r}return j(n,[{key:"scrollToIndex",value:function(e){var t=e.index,n=void 0===t?0:t,r=e.animated,i=void 0===r||r;Ct(this.instance,"scrollToIndex",[n,n,i])}},{key:"scrollToContentOffset",value:function(e){var t=e.xOffset,n=void 0===t?0:t,r=e.yOffset,i=void 0===r?0:r,a=e.animated,o=void 0===a||a;Ct(this.instance,"scrollToContentOffset",[n,i,o])}},{key:"expandPullHeader",value:function(){this.pullHeader&&this.pullHeader.expandPullHeader()}},{key:"collapsePullHeader",value:function(e){this.pullHeader&&this.pullHeader.collapsePullHeader(e)}},{key:"expandPullFooter",value:function(){this.pullFooter&&this.pullFooter.expandPullFooter()}},{key:"collapsePullFooter",value:function(){this.pullFooter&&this.pullFooter.collapsePullFooter()}},{key:"render",value:function(){var e=this,t=this.props,n=t.style,r=void 0===n?{}:n,i=t.renderBanner,a=t.numberOfColumns,l=void 0===a?2:a,u=t.columnSpacing,s=void 0===u?0:u,c=t.interItemSpacing,f=void 0===c?0:c,d=t.numberOfItems,p=void 0===d?0:d,h=t.preloadItemNumber,m=void 0===h?0:h,v=t.renderItem,y=t.renderPullHeader,b=t.renderPullFooter,k=t.getItemType,w=t.getItemKey,S=t.getItemStyle,E=t.contentInset,C=void 0===E?{top:0,left:0,bottom:0,right:0}:E,x=t.onItemLayout,N=t.onHeaderPulling,P=t.onHeaderReleased,L=t.onFooterPulling,A=t.onFooterReleased,R=t.containPullHeader,z=void 0!==R&&R,O=t.containPullFooter,T=void 0!==O&&O,j=t.containBannerView,F=void 0!==j&&j,H=I(I({},_(t,g)),{},{style:r,numberOfColumns:l,columnSpacing:s,interItemSpacing:f,preloadItemNumber:m,contentInset:C,containPullHeader:z,containPullFooter:T,containBannerView:F}),M=[];if("function"==typeof i){var D=i();D&&(M.push(o.a.createElement(yn,{key:"bannerView"},o.a.cloneElement(D))),H.containBannerView=!0)}if("function"==typeof v){for(var U=this.getPullHeader(y,N,P),W=this.getPullFooter(b,L,A),B=0;B {
- retries = 0;
- maxRetries = reconnect;
- });
+ client.onOpen(() => {});
- client.onClose(() => {
+ client.onClose((reason) => {
+ log.warn(reason);
if (retries === 0) {
handlers.close();
}
@@ -39,6 +38,7 @@ const socket = function initSocket(url, handlers, reconnect) {
});
client.onMessage((data) => {
+ retries = 0;
const message = JSON.parse(data);
log.info(message);
diff --git a/framework/js/packages/hippy-debug-server/webpack-dev-server/lib/Server.js b/framework/js/packages/hippy-debug-server/webpack-dev-server/lib/Server.js
index dd2841425..c6538a452 100644
--- a/framework/js/packages/hippy-debug-server/webpack-dev-server/lib/Server.js
+++ b/framework/js/packages/hippy-debug-server/webpack-dev-server/lib/Server.js
@@ -1002,56 +1002,7 @@ class Server {
}
getClientTransport() {
- let ClientImplementation;
- let clientImplementationFound = true;
-
- const isKnownWebSocketServerImplementation = this.options.webSocketServer
- && typeof this.options.webSocketServer.type === 'string'
- && (this.options.webSocketServer.type === 'ws' || this.options.webSocketServer.type === 'sockjs');
-
- let clientTransport;
-
- if (this.options.client) {
- if (typeof this.options.client.webSocketTransport !== 'undefined') {
- clientTransport = this.options.client.webSocketTransport;
- } else if (isKnownWebSocketServerImplementation) {
- clientTransport = this.options.webSocketServer.type;
- } else {
- clientTransport = 'ws';
- }
- } else {
- clientTransport = 'ws';
- }
-
- switch (typeof clientTransport) {
- case 'string':
- // could be 'sockjs', 'ws', or a path that should be required
- if (clientTransport === 'sockjs') {
- ClientImplementation = require.resolve('../client/clients/SockJSClient');
- } else if (clientTransport === 'ws') {
- ClientImplementation = require.resolve('../client/clients/WebSocketClient');
- } else {
- try {
- // eslint-disable-next-line import/no-dynamic-require
- ClientImplementation = require.resolve(clientTransport);
- } catch (e) {
- clientImplementationFound = false;
- }
- }
- break;
- default:
- clientImplementationFound = false;
- }
-
- if (!clientImplementationFound) {
- throw new Error(`${
- !isKnownWebSocketServerImplementation
- ? 'When you use custom web socket implementation you must explicitly specify client.webSocketTransport. '
- : ''
- }client.webSocketTransport must be a string denoting a default implementation (e.g. 'sockjs', 'ws') or a full path to a JS file via require.resolve(...) which exports a class `);
- }
-
- return ClientImplementation;
+ return require.resolve('../client/clients/WebSocketClient');
}
getServerTransport() {
diff --git a/framework/js/packages/hippy-debug-server/webpack-dev-server/lib/options.json b/framework/js/packages/hippy-debug-server/webpack-dev-server/lib/options.json
index c79e3e2b9..cbb541036 100644
--- a/framework/js/packages/hippy-debug-server/webpack-dev-server/lib/options.json
+++ b/framework/js/packages/hippy-debug-server/webpack-dev-server/lib/options.json
@@ -62,9 +62,6 @@
"reconnect": {
"$ref": "#/definitions/ClientReconnect"
},
- "webSocketTransport": {
- "$ref": "#/definitions/ClientWebSocketTransport"
- },
"webSocketURL": {
"$ref": "#/definitions/ClientWebSocketURL"
}