-
Notifications
You must be signed in to change notification settings - Fork 0
/
main_002.js
2 lines (2 loc) · 143 KB
/
main_002.js
1
2
(window.webpackJsonp=window.webpackJsonp||[]).push([[52],{1025:function(e,t,n){"use strict";n.d(t,"a",(function(){return y}));var r=n(35),a=n(0),o=n(4),i=n(14),c=n(15),s=n(16),u=n(17),l=n(9),d=n(2),h=n(3),p=n.n(h),f=n(1),g=n(39),m=n(27),b=n(940),v=n.n(b),A=n(83),C=n.n(A);function E(e,t){return t?e.trim():e}var O={useTrim:!0},w={required:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:O,n=t.useTrim;return""!==E(e,n)},maxLength:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:O,r=n.useTrim;return E(e,r).length<=t},minLength:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:O,r=n.useTrim;return E(e,r).length>=t},pattern:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:O,r=n.useTrim;return t.test(E(e,r))}};function y(){return function(e){return function(e){var t=e.contextTypes,n=e.defaultProps,r=Object.assign({},e.prototype);function a(e){for(var t=r[e],n=arguments.length,a=new Array(n>1?n-1:0),o=1;o<n;o++)a[o-1]=arguments[o];return"function"==typeof t?t.apply(void 0,a):void 0}return Object.assign(e.prototype,{componentWillMount:function(){var e=this.context.form;e&&(e.attachToForm(this),this.setState({_value:"",_validations:[]}));for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return a.apply(void 0,["componentWillMount"].concat(n))},componentWillUnmount:function(){var e=this.context.form;e&&e.detachFromForm(this);for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return a.apply(void 0,["componentWillUnmount"].concat(n))},getValue:function(){var e=(this.state||{})._value;return null==e?"":e},setValue:function(e,t){this.setState({_value:e},(function(){"function"==typeof t&&t()}))},getValidationMessage:function(){var e=this.getValidationMessages();return e&&e[0]},getValidationClassName:function(){var e=(this.state||{})._validations;return e&&e[0]&&e[0].className},getValidationMessages:function(){var e=(this.state||{})._validations;return null==e?void 0:e.map((function(e){var t=e.message;return t?"string"==typeof t?t:t.message||"未知错误":""}))},setValidations:function(e){var t=this;this.setState({_validations:e},(function(){return t.forceUpdate()}))},clearValidations:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,n=this.state||{},r=n._validations;r&&r.length>0&&this.setState(Object.assign({},e,{_validations:[]}),t)},addValidation:function(e){this.setState((function(t){var n=t._validations;return{_validations:[e].concat(Object(o.a)(n||[]))}}))},addManualValidation:function(e){this.addValidation({type:"manual",message:e})},validate:function(){this.context.form.validate(this)}}),Object.assign(e,{contextTypes:Object.assign({},t,{form:p.a.object}),defaultProps:Object.assign({},n,{validations:[]})}),e}(e)}}function S(e){var t=function(){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(e){return!1}}();return function(){var n,r=Object(l.a)(e);if(t){var a=Object(l.a)(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return Object(u.a)(this,n)}}var j=function(e){Object(s.a)(n,e);var t=S(n);function n(){var e;Object(i.a)(this,n);for(var r=arguments.length,c=new Array(r),s=0;s<r;s++)c[s]=arguments[s];return(e=t.call.apply(t,[this].concat(c))).state={isValid:!0},e.inputs=[],e.attachToForm=function(t){var n=t.props.name;if(!n||e.inputs.includes(n))throw new Error("form input must specify a unqie name, but current is ".concat(n));e.inputs.push(t)},e.detachFromForm=function(t){var n=e.inputs.indexOf(t);-1!==n&&(e.inputs=[].concat(Object(o.a)(e.inputs.slice(0,n)),Object(o.a)(e.inputs.slice(n+1))))},e.validate=function(e){var t=e.state._value,n=e.props.validations,r=[],a=[];return n?(!Array.isArray(n)&&n.type&&(n=[n]),n.forEach((function(e){var n=e.type,i=e.value,c=e.options,s=w[n];if(!s)throw new Error("no ".concat(n," rules, please define it at Form.validateRules"));var u=s(t,i,c);v()(u)?a=[].concat(Object(o.a)(a),[u.then((function(){}),(function(){r.push(e)}))]):u||(r=[].concat(Object(o.a)(r),[e]))})),Promise.all(a).then((function(){return e.setValidations(r),r}))):r},e.handleSubmit=function(t){t.preventDefault();var n=e.props,r=n.onPreSubmit,o=n.onSubmit,i=n.isWechat;r(),i?new Promise((function(t){var n=e.inputs.find((function(e){return"username"===e.props.name}));n&&!n.state._value&&Object(g.findDOMNode)(n.inputEl).value&&n.handleChange({target:{value:Object(g.findDOMNode)(n.inputEl).value}});var r=e.inputs.find((function(e){return"password"===e.props.name}));r&&!r.state._value&&n&&Object(g.findDOMNode)(n.inputEl).value&&r.handleChange({target:{value:Object(g.findDOMNode)(r.inputEl).value}}),t()})).then((function(){e.validateAll().then((function(t){if(t){var n=e.inputs.reduce((function(e,t){return Object.assign({},e,Object(a.a)({},t.props.name,t.state._value))}),{});o(n)}}))})):e.validateAll().then((function(t){if(t){var n=e.inputs.reduce((function(e,t){return Object.assign({},e,Object(a.a)({},t.props.name,t.state._value))}),{});o(n)}}))},e}return Object(c.a)(n,[{key:"getChildContext",value:function(){return{form:{attachToForm:this.attachToForm,detachFromForm:this.detachFromForm,getValue:this.getValue,setValue:this.setValue,validate:this.validate}}}},{key:"componentDidMount",value:function(){}},{key:"validateAll",value:function(){var e=this,t=this.props,n=t.onValid,r=t.onInvalid,a=[],i=[];return this.inputs.forEach((function(t){var n=e.validate(t);v()(n)?i=[].concat(Object(o.a)(i),[n.then((function(e){a=[].concat(Object(o.a)(a),Object(o.a)(e))}))]):n&&(a=[].concat(Object(o.a)(a),Object(o.a)(n)))})),Promise.all(i).then((function(){var t=0===a.length;return e.setState({isValid:t},(function(){t?n():r(a.map((function(e){return e.message})))})),t}))}},{key:"render",value:function(){var e=C()(this.props,["onValid","onInvalid","onSubmit","onPreSubmit","isWechat","dispatch"]),t=e.children,n=e.onRef,a=Object(r.a)(e,["children","onRef"]);return Object(d.b)("form",Object.assign({noValidate:!0,onSubmit:this.handleSubmit,ref:n},a,{children:t}))}}]),n}(f.Component);j.childContextTypes={form:p.a.object},j.propTypes={onValid:p.a.func,onInvalid:p.a.func,onSubmit:p.a.func,onPreSubmit:p.a.func},j.validateRules=w,j.defaultProps={onValid:function(){},onInvalid:function(){},onSubmit:function(){},onPreSubmit:function(){}};t.b=Object(m.connect)((function(e){return{isWechat:e.env.userAgent.Wechat}}))(j)},1102:function(e,t,n){"use strict";n.d(t,"b",(function(){return o}));var r=n(63),a={400:"请求参数有误",401:"用户认证失败",403:"服务已拒绝",404:"资源不存在",405:"请求方式有误",410:"资源已解散",502:"网关错误",503:"服务无响应",504:"网关超时"},o=function(e){var t;return(null==e||null===(t=e.payload)||void 0===t?void 0:t.message)||(null==e?void 0:e.status)&&a[e.status]||"操作失败"};t.a=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};r.a.dispatch("ui/showToast",{icon:"fail",text:o(e)})}},1119:function(e,t,n){"use strict";var r=n(0),a=n(35),o=n(14),i=n(15),c=n(16),s=n(17),u=n(9),l=n(2),d=n(3),h=n.n(d),p=n(1),f=n(11),g=n.n(f),m=n(83),b=n.n(m),v=n(135),A=n(1025);function C(e){var t=function(){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(e){return!1}}();return function(){var n,r=Object(u.a)(e);if(t){var a=Object(u.a)(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return Object(s.a)(this,n)}}var E=function(e){Object(c.a)(n,e);var t=C(n);function n(){var e;Object(o.a)(this,n);for(var r=arguments.length,a=new Array(r),i=0;i<r;i++)a[i]=arguments[i];return(e=t.call.apply(t,[this].concat(a))).handleErrorHide=function(){e.getValidationMessage()&&e.setState({errorMaskShown:!1},(function(){e.clearValidations({errorMaskShown:!0},(function(){return e.inputEl.focus()}))}))},e.handleKeyUp=function(t){8!==t.keyCode&&9!==t.keyCode||e.clearValidations()},e.handleChange=function(t){var n=t.target.value,r=e.props.onChange;e.setValue(n),"function"==typeof r&&r(n)},e}return Object(i.a)(n,[{key:"componentDidMount",value:function(){var e=this.props.defaultValue;e&&this.setValue(e),this.setState({errorMaskShown:!0})}},{key:"componentWillReceiveProps",value:function(e){var t=this.props,n=t.manualValidateError,r=t.type,a=t.smsType,o=e.manualValidateError,i=e.type,c=e.defaultValue,s=e.smsType;!n&&o||"string"==typeof n&&n!==o?this.addManualValidation(o):n&&!o&&this.clearValidations({errorMaskShown:!0}),r===i&&a===s||(this.setValue(c),this.clearValidations({errorMaskShown:!0}))}},{key:"render",value:function(){var e,t=this,n=b()(this.props,["validations","defaultValue","onChange","smsType","manualValidateError","dispatch"]),o=n.className,i=n.inputClassName,c=n.errorMessageClassName,s=Object(a.a)(n,["className","inputClassName","errorMessageClassName"]),u=(this.state||{}).errorMaskShown,d=this.getValue(),h=this.getValidationMessage();return Object(l.c)("div",{className:g()("SignFlowInput",o),children:[Object(l.b)(v.a,Object.assign({onRef:function(e){t.inputEl=e},value:d,onChange:this.handleChange,onKeyUp:this.handleKeyUp,onClick:this.handleErrorHide,onBlur:function(){return t.validate()},className:i},s)),Object(l.b)("div",{className:g()("SignFlowInput-errorMask",this.getValidationClassName(),(e={},Object(r.a)(e,c,h),Object(r.a)(e,"SignFlowInput-requiredErrorMask",!d),Object(r.a)(e,"SignFlowInput-errorMask--hidden",!h||!u),e)),onClick:this.handleErrorHide,children:h})]})}}]),n}(p.Component);E.propTypes={inputClassName:h.a.string,errorMessageClassName:h.a.string,manualValidateError:h.a.node};t.a=Object(A.a)()(E)},1137:function(e,t,n){"use strict";var r=n(1),a=n.n(r),o=n(18),i=function(e){return a.a.createElement(o.a,e,a.a.createElement("path",{d:"M14.782 16.78a.737.737 0 0 1-1.052 0L9.218 12.53a.758.758 0 0 1 0-1.063L13.73 7.22a.737.737 0 0 1 1.052 0c.29.294.29.77.001 1.063L11 12l3.782 3.716c.29.294.29.77 0 1.063z",fillRule:"evenodd"}))};i.defaultProps={name:"ArrowLeft"},t.a=i},1300:function(e,t,n){"use strict";var r=n(35),a=n(14),o=n(15),i=n(16),c=n(17),s=n(9),u=n(2),l=n(3),d=n.n(l),h=n(1),p=n(27),f=n(178),g=n(83),m=n.n(g),b=n(219),v=n(1119),A=n(43),C=n(798);function E(e){var t=function(){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(e){return!1}}();return function(){var n,r=Object(s.a)(e);if(t){var a=Object(s.a)(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return Object(c.a)(this,n)}}h.Component;function O(e){var t=function(){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(e){return!1}}();return function(){var n,r=Object(s.a)(e);if(t){var a=Object(s.a)(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return Object(c.a)(this,n)}}var w=function(e){Object(i.a)(n,e);var t=O(n);function n(){var e;Object(a.a)(this,n);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return(e=t.call.apply(t,[this].concat(o))).state={selectedCountry:null},e.handleSelect=function(t,n){var r=e.props,a=r.supportedCountries,o=r.onSelect,i=a[n];e.setState({selectedCountry:i}),o(i)},e}return Object(o.a)(n,[{key:"componentDidMount",value:function(){var e=this.props,t=e.supportedCountries,n=e.getSupportedCountries;t&&t.length||n()}},{key:"render",value:function(){var e=m()(this.props,["getSupportedCountries","onSelect"]),t=e.supportedCountries,n=e.onChange,a=e.defaultPhoneNo,o=e.type,i=e.defaultSelectedCountry,c=e.supportedCountriesShown,s=e.placeholderPrefix,l=void 0===s?"":s,d=e.getPlaceholder,h=Object(r.a)(e,["supportedCountries","onChange","defaultPhoneNo","type","defaultSelectedCountry","supportedCountriesShown","placeholderPrefix","getPlaceholder"]),p=this.state.selectedCountry||i,g=p.name,b=p.code,A=Boolean(c&&t&&t.length);return Object(u.c)("div",{className:"SignFlow-account",children:[A&&Object(u.c)(u.a,{children:[Object(u.b)("div",{className:"SignFlow-supportedCountriesSelectContainer",children:Boolean(t)&&Boolean(t.length)&&Object(u.b)(f.b,{plain:!0,text:"".concat(g," ").concat(b),onChange:this.handleSelect,children:t.map((function(e,t){var n=e.name,r=e.code;return Object(u.b)(f.a,{value:"".concat(n," ").concat(r)},t)}))})}),Object(u.b)("span",{className:"SignFlow-accountSeperator",children:" "})]}),Object(u.b)(v.a,Object.assign({className:"SignFlow-accountInputContainer",name:"register"===o?"phoneNo":"username",inputClassName:"SignFlow-accountInput",placeholder:d(o,l),onChange:n,defaultValue:a,validations:[{type:"required",message:d(o,"请输入")}],type:"digits"===o||"register"===o?"tel":"text"},h))]})}}]),n}(h.Component);w.propTypes={defaultPhoneNo:d.a.string,defaultSelectedCountry:d.a.object,supportedCountries:d.a.array,onSelect:d.a.func,onChange:d.a.func,getSupportedCountries:d.a.func,type:d.a.oneOf(["register","digits","password"]).isRequired,supportedCountriesShown:d.a.bool,placeholderPrefix:d.a.string,getPlaceholder:d.a.func},w.defaultProps={defaultPhoneNo:"",defaultSelectedCountry:{name:"中国",code:"+86"},supportedCountriesShown:!0,getPlaceholder:function(e,t){var n="digits"===e||"register"===e?"手机号":"手机号或邮箱";return"".concat(t).concat(n)}};t.a=Object(p.connect)((function(e){return{supportedCountries:e.sms.supportedCountries}}),{getSupportedCountries:b.b})(w)},1325:function(e,t,n){"use strict";n.d(t,"a",(function(){return C}));var r=n(35),a=n(14),o=n(15),i=n(16),c=n(17),s=n(9),u=n(2),l=n(3),d=n.n(l),h=n(1),p=n(31),f=n(1412),g=n(1376),m=n(83),b=n.n(m),v=n(1119);function A(e){var t=function(){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(e){return!1}}();return function(){var n,r=Object(s.a)(e);if(t){var a=Object(s.a)(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return Object(c.a)(this,n)}}var C=function(e){Object(i.a)(n,e);var t=A(n);function n(e){var r;return Object(a.a)(this,n),(r=t.call(this,e)).handleSwitchPasswordInputType=function(){r.setState((function(e){return{inputType:"password"===e.inputType?"text":"password"}}))},r.handleChange=function(e){r.state.hasValue!==Boolean(e)&&r.setState({hasValue:Boolean(e)}),r.props.onChange(e)},r.state={hasValue:Boolean(e.defaultValue),inputType:e.defaultType},r}return Object(o.a)(n,[{key:"render",value:function(){var e=b()(this.props,["onChange","defaultType"]),t=e.switchDisabled,n=e.placeholderPrefix,a=Object(r.a)(e,["switchDisabled","placeholderPrefix"]),o=this.state,i=o.inputType,c=o.hasValue;return Object(u.c)("div",{className:"SignFlow-password",children:[Object(u.b)(v.a,Object.assign({name:"password",inputClassName:"password"===i&&c?"SignFlow-passwordInput":"",type:i,placeholder:"".concat(n||"","密码"),onChange:this.handleChange,errorMessageClassName:"SignFlow-passwordErrorMask",validations:[{type:"required",message:"请输入密码",className:"SignFlow-requiredPasswordErrorMask"}]},a)),!t&&Object(u.b)(p.c,{className:"SignFlow-switchPassword",tabIndex:-1,preset:"plain",onClick:this.handleSwitchPasswordInputType,icon:"password"===i?f.a:g.a})]})}}]),n}(h.Component);C.propTypes={onChange:d.a.func.isRequired,switchDisabled:d.a.bool,defaultType:d.a.string},C.defaultProps={defaultType:"password"}},1326:function(e,t,n){"use strict";var r=n(35),a=n(14),o=n(15),i=n(16),c=n(17),s=n(9),u=n(2),l=n(3),d=n.n(l),h=n(1),p=n(1119);function f(e){var t=function(){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(e){return!1}}();return function(){var n,r=Object(s.a)(e);if(t){var a=Object(s.a)(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return Object(c.a)(this,n)}}var g=function(e){Object(i.a)(n,e);var t=f(n);function n(){return Object(a.a)(this,n),t.apply(this,arguments)}return Object(o.a)(n,[{key:"render",value:function(){var e=this.props,t=e.onChange,n=e.validations,a=Object(r.a)(e,["onChange","validations"]);return Object(u.b)(p.a,Object.assign({className:"SignFlow-username",onChange:t,validations:n||[{type:"required",message:"请输入用户名"}]},a))}}]),n}(h.Component);g.propTypes={onChange:d.a.func.isRequired};t.a=g},1330:function(e,t,n){"use strict";var r=n(1),a=n.n(r),o=n(18),i=function(e){return a.a.createElement(o.a,e,a.a.createElement("path",{d:"M2.224 21.667s4.24-1.825 4.788-2.056C15.029 23.141 22 17.714 22 11.898 22 6.984 17.523 3 12 3S2 6.984 2 11.898c0 1.86.64 3.585 1.737 5.013-.274.833-1.513 4.756-1.513 4.756zm5.943-9.707c.69 0 1.25-.569 1.25-1.271a1.26 1.26 0 0 0-1.25-1.271c-.69 0-1.25.569-1.25 1.27 0 .703.56 1.272 1.25 1.272zm7.583 0c.69 0 1.25-.569 1.25-1.271a1.26 1.26 0 0 0-1.25-1.271c-.69 0-1.25.569-1.25 1.27 0 .703.56 1.272 1.25 1.272z",fillRule:"evenodd"}))};i.defaultProps={name:"WeChat"},t.a=i},1331:function(e,t,n){"use strict";var r=n(1),a=n.n(r),o=n(18),i=function(e){return a.a.createElement(o.a,e,a.a.createElement("path",{fill:"#FB6622",d:"M15.518 3.06c8.834-.854 7.395 7.732 7.394 7.731-.625 1.439-1.673.309-1.673.309.596-7.519-5.692-6.329-5.692-6.329-.898-1.067-.029-1.711-.029-1.711zm4.131 6.985c-.661 1.01-1.377.126-1.376.126.205-3.179-2.396-2.598-2.396-2.598-.719-.765-.091-1.346-.091-1.346 4.882-.551 3.863 3.818 3.863 3.818zM5.317 7.519s4.615-3.86 6.443-1.328c0 0 .662 1.08-.111 2.797.003-.003 3.723-1.96 5.408.159 0 0 .848 1.095-.191 2.649 0 0 2.918-.099 2.918 2.715 0 2.811-4.104 6.44-9.315 6.44-5.214 0-8.026-2.092-8.596-3.102 0 0-3.475-4.495 3.444-10.33zm10.448 7.792s.232-4.411-5.71-4.207c-6.652.231-6.579 4.654-6.579 4.654.021.39.097 3.713 5.842 3.713 5.98 0 6.447-4.16 6.447-4.16zm-9.882.86s-.059-3.632 3.804-3.561c3.412.06 3.206 3.165 3.206 3.165s-.026 2.979-3.684 2.979c-3.288 0-3.326-2.583-3.326-2.583zm2.528 1.037c.672 0 1.212-.447 1.212-.998 0-.551-.543-.998-1.212-.998-.672 0-1.215.447-1.215.998 0 .551.546.998 1.215.998z",fillRule:"evenodd"}))};i.defaultProps={name:"Weibo"},t.a=i},1367:function(e,t,n){"use strict";var r=n(14),a=n(15),o=n(16),i=n(17),c=n(9),s=n(2),u=n(3),l=n.n(u),d=n(1),h=n.n(d),p=n(27),f=n(124),g=n(4),m=n(11),b=n.n(m),v=n(805),A=n(31),C=n(1119),E=n(131),O=Object.assign;var w=function(e){return h.a.createElement(E.a,O({viewBox:"0 0 8 8"},e),h.a.createElement("path",{d:"M7.755 1.434A.839.839 0 007.75.248.837.837 0 006.565.244L4 2.81 1.434.245A.839.839 0 00.248.248c-.33.33-.33.86-.004 1.186L2.81 4 .246 6.566A.839.839 0 00.25 7.752c.33.33.86.33 1.185.004L4 5.19l2.566 2.565a.839.839 0 001.186-.004c.33-.33.33-.86.004-1.185L5.19 4l2.565-2.566z",fillRule:"evenodd"}))},y=Object.assign;var S=function(e){return h.a.createElement(E.a,y({viewBox:"0 0 20 20"},e),h.a.createElement("circle",{cx:"83",cy:"111",r:"10",transform:"translate(-73 -101)"}))};function j(e){var t=function(){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(e){return!1}}();return function(){var n,r=Object(c.a)(e);if(t){var a=Object(c.a)(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return Object(i.a)(this,n)}}var B=function(e){Object(o.a)(n,e);var t=j(n);function n(){var e;Object(r.a)(this,n);for(var a=arguments.length,o=new Array(a),i=0;i<a;i++)o[i]=arguments[i];return(e=t.call.apply(t,[this].concat(o))).state={hovered:!0},e.handleMouseEnter=function(){e.setState({hovered:!0})},e.handleMouseLeave=function(){e.setState({hovered:!1})},e}return Object(a.a)(n,[{key:"componentWillReceiveProps",value:function(e){this.props.position!==e.position&&this.handleMouseLeave()}},{key:"shouldComponentUpdate",value:function(e,t){return this.props.position!==e.position||this.state.hovered!==t.hovered}},{key:"render",value:function(){var e=this.props,t=e.position,n=e.onUnMark,r=this.state.hovered,a=r?w:S;return Object(s.c)(A.c,{className:"ChineseCaptchaPoint",style:t,onClick:n,onMouseEnter:this.handleMouseEnter,onMouseLeave:this.handleMouseLeave,preset:"plain",children:[Object(s.b)(S,{className:b()("ChineseCaptchaPoint-backIcon",{"ChineseCaptchaPoint-backIcon--hovered":r}),fill:r?"#0f88eb":"#aad9ff",width:20,height:20}),Object(s.b)(a,{className:b()("ChineseCaptchaPoint-frontIcon",{"ChineseCaptchaPoint-frontIcon--hovered":r}),fill:r?"#ffffff":"#0f88eb",width:r?8:12,height:r?8:12})]})}}]),n}(d.Component);B.propTypes={onUnMark:l.a.func.isRequired,position:l.a.object.isRequired};var I=B;function R(e){var t=function(){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(e){return!1}}();return function(){var n,r=Object(c.a)(e);if(t){var a=Object(c.a)(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return Object(i.a)(this,n)}}var k="最多只能选择 ".concat(7," 个点"),Q=function(e){Object(o.a)(n,e);var t=R(n);function n(){var e;Object(r.a)(this,n);for(var a=arguments.length,o=new Array(a),i=0;i<a;i++)o[i]=arguments[i];return(e=t.call.apply(t,[this].concat(o))).state={markPositionsArray:[],isClient:!1},e.updateSize=function(){if(e.chineseCaptchaImg){var t=e.chineseCaptchaImg.getBoundingClientRect();e.chineseImgWidth=t.width,e.chineseImgHeight=t.height}},e.handleMarkPoint=function(t){if(e.chineseCaptchaImg){var n=e.state.markPositionsArray,r=e.props.onValidation;if(n.length>=7)r({validationMessage:k});else{var a=t.pageX,o=t.pageY;e.updateSize();var i=e.chineseCaptchaImg.getBoundingClientRect(),c=i.top,s=i.left,u=o-c-window.pageYOffset-10,l=a-s-window.pageXOffset-10,d=[].concat(Object(g.a)(n),[{top:u,left:l+60+16}]);e.updateMarkPoint(d)}}},e.handleUnMarkPoint=function(t){var n=Object(g.a)(e.state.markPositionsArray);n.splice(t,1),e.updateMarkPoint(n)},e.updateMarkPoint=function(t){e.setState({markPositionsArray:t},(function(){e.props.onUpdateInput(e.parseMarkPositionsArrayToInputValue(t))}))},e.parseMarkPositionsArrayToInputValue=function(t){return JSON.stringify({img_size:[e.chineseImgWidth,e.chineseImgHeight],input_points:t.map((function(e){var t=e.top;return[e.left+10-60-16,t+10]}))})},e}return Object(a.a)(n,[{key:"componentDidMount",value:function(){this.setState({isClient:!0}),this.updateSize()}},{key:"componentWillReceiveProps",value:function(e){this.props.url!==e.url&&this.props.isChinese&&this.setState({markPositionsArray:[]})}},{key:"shouldComponentUpdate",value:function(e,t){return this.props.url!==e.url||this.props.validationMessage!==e.validationMessage||this.props.isShown!==e.isShown||this.props.className!==e.className||this.state.markPositionsArray!==t.markPositionsArray}},{key:"renderCaptcha",value:function(){var e=this,t=this.props,n=t.url,r=t.isChinese,a=t.onRefresh;return n?Object(s.c)("div",{className:r?"Captcha-chineseContainer":"Captcha-englishContainer",children:[Object(s.b)("img",{"data-tooltip":"看不清楚?换一张",className:r?"Captcha-chineseImg":"Captcha-englishImg",src:n,alt:"图形验证码",onClick:r?this.handleMarkPoint:a,ref:r&&function(t){e.chineseCaptchaImg=t}}),r?this.state.markPositionsArray.map((function(t,n){return Object(s.b)(I,{onUnMark:function(){return e.handleUnMarkPoint(n)},position:t},n)})):null]}):null}},{key:"render",value:function(){var e=this.props,t=e.isChinese,n=e.validationMessage,r=e.className,a=e.onUpdateInput,o=e.validations,i=e.isShown,c=e.onRefresh,u=this.state.isClient,l=this.renderCaptcha();return Object(s.b)("div",{className:b()("Captcha",r,{"Captcha-chinese":t&&u}),style:i?{}:{width:"0",height:"0",opacity:"0",overflow:"hidden",margin:"0",padding:"0",border:"0"},children:t?Object(s.c)("div",{children:[Object(s.c)("div",{className:"Captcha-chineseOperator",children:[Object(s.b)("span",{className:b()("Captcha-info",{"Captcha-error":Boolean(n)}),children:n||"请点击图中倒立的文字"}),Object(s.b)(A.c,{className:"Captcha-chineseRefreshButton",preset:"plain",onClick:c,children:Object(s.b)(v.a,{size:20})})]}),l]}):Object(s.c)("div",{children:[Object(s.b)(C.a,{name:"captcha",type:"text",errorMessageClassName:"Captcha-errorMessage",placeholder:"验证码",onChange:a,validations:i?o:[],manualValidateError:n,tabIndex:i?0:-1}),Object(s.b)("span",{className:"Captcha-englishImage",children:l})]})})}}]),n}(d.Component);Q.propTypes={isChinese:l.a.bool,url:l.a.string,validationMessage:l.a.string,onValidation:l.a.func,onRefresh:l.a.func.isRequired,onUpdateInput:l.a.func.isRequired,isShown:l.a.bool,validations:l.a.array},Q.defaultProps={isChinese:!1,isShown:!1,validations:[{type:"required",message:"请填写验证码",className:"Captcha-requiredErrorMessage"}]};var N=Q;function T(e){var t=function(){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(e){return!1}}();return function(){var n,r=Object(c.a)(e);if(t){var a=Object(c.a)(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return Object(i.a)(this,n)}}var P=function(e){Object(o.a)(n,e);var t=T(n);function n(){var e;Object(r.a)(this,n);for(var a=arguments.length,o=new Array(a),i=0;i<a;i++)o[i]=arguments[i];return(e=t.call.apply(t,[this].concat(o))).state={validationMessage:""},e.handleValidation=function(t){var n=t.message,r=t.needsRefresh;n&&e.setState({validationMessage:n});var a=e.props,o=a.captchaNeeded,i=a.checkIfCaptchaNeeded,c=a.requestForCaptcha;!o&&r?i(e.lang):r&&c(e.lang)},e.handleRefresh=function(){e.props.requestForCaptcha(e.lang)},e}return Object(a.a)(n,[{key:"componentDidMount",value:function(){var e=this.props,t=e.type,n=e.isChinese,r=e.checkIfCaptchaNeeded;this.lang=n?"cn":"en",this.type="register"===t?"register":"login",r(this.lang)}},{key:"componentWillReceiveProps",value:function(e){var t=this.props,n=t.validationResult,r=void 0===n?{}:n,a=t.captchaNeeded,o=t.requestForCaptcha,i=e.validationResult,c=void 0===i?{}:i,s=e.captchaNeeded;!a&&s&&o(this.lang),r.timestamp!==c.timestamp&&this.handleValidation(c)}},{key:"componentWillUnmount",value:function(){this.props.resetCaptchaInfo()}},{key:"render",value:function(){var e=this.props,t=e.type,n=e.isChinese,r=e.onUpdateInput,a=e.className,o=e.captchaBase64String,i=e.isShown,c=this.state.validationMessage,u="digitsLogin"!==t?N.defaultProps.validations:[];return Object(s.b)(N,{className:a,isShown:i,isChinese:n,url:"data:image/jpg;base64,".concat(o),validationMessage:c,onRefresh:this.handleRefresh,onValidation:this.handleValidation,validations:u,onUpdateInput:r})}}]),n}(d.Component);P.propTypes={canCaptchaShown:l.a.bool,isChinese:l.a.bool,type:l.a.oneOf(["login","digitsLogin","register"]).isRequired,validationResult:l.a.object,captchaNeeded:l.a.bool,captchaBase64String:l.a.string,onUpdateInput:l.a.func,checkIfCaptchaNeeded:l.a.func,requestForCaptcha:l.a.func},P.defaultProps={canCaptchaShown:!1,isChinese:!1};var M=Object(p.connect)((function(e,t){var n=e.captcha,r=n.captchaNeeded,a=n.captchaBase64String,o=t.canCaptchaShown;return{isShown:Boolean(o&&r&&a),captchaNeeded:r,captchaBase64String:a}}),{checkIfCaptchaNeeded:f.c,requestForCaptcha:f.f,resetCaptchaInfo:f.h})(P);t.a=M},1376:function(e,t,n){"use strict";var r=n(1),a=n.n(r),o=n(18),i=function(e){return a.a.createElement(o.a,e,a.a.createElement("path",{d:"M17.007 11.504c0 .65-.13 1.26-.36 1.83l3 3.073S23 14.136 23 11.504C23 8.008 17.255 4 11.995 4c-1.4 0-2.741.25-3.982.701l2.161 2.16c.57-.23 1.18-.36 1.831-.36a5.004 5.004 0 0 1 5.002 5.003zM2.57 4.342l2.067 2.075C3.499 7.258 1 9.119 1 11.504c0 3.336 5.79 7.503 11.005 7.503 1.55 0 3.031-.3 4.382-.84l.42.42 2.125 2.118s.782.571 1.314 0-.074-1.305-.074-1.305L3.955 3.183s-.76-.742-1.385-.19c-.626.554 0 1.35 0 1.35zm4.963 4.96l1.55 1.552c-.05.21-.08.43-.08.65 0 1.66 1.341 3.001 3.002 3.001.22 0 .44-.03.65-.08l1.551 1.551c-.67.33-1.41.53-2.2.53a5.004 5.004 0 0 1-5.003-5.002c0-.79.2-1.53.53-2.201zm4.312-.78l3.151 3.152.02-.16c0-1.66-1.34-3.001-3.001-3.001l-.17.01z",opacity:".9",fillRule:"evenodd"}))};i.defaultProps={name:"EyeSlash"},t.a=i},1377:function(e,t,n){"use strict";n.d(t,"a",(function(){return r})),n.d(t,"b",(function(){return a}));var r=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return new Promise((function(t){return setTimeout(t,e)}))};function a(e){var t=[];return e.reduce((function(e,n){return e.then((function(){return n().then((function(e){t.push(e)}))}))}),Promise.resolve()).then((function(){return t}))}},1378:function(e,t,n){"use strict";var r=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/;t.a=function(e){return r.test(e)}},1411:function(e,t,n){"use strict";function r(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return function(){for(var t=arguments.length,r=new Array(t),a=0;a<t;a++)r[a]=arguments[a];var o=r[r.length-1]||{};return n.reduce((function(t,n,a){return t.concat(Number.isInteger(n)&&r[n]||o[n],e[a+1])}),[e[0]]).join("")}}n.d(t,"a",(function(){return r}))},1412:function(e,t,n){"use strict";var r=n(1),a=n.n(r),o=n(18),i=function(e){return a.a.createElement(o.a,e,a.a.createElement("path",{d:"M1 11.5C1 15 7 19 12 19s11-4 11-7.5S17 4 12 4 1 8 1 11.5zm11 5c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5zm-3-5c0 1.66 1.34 3 3 3s3-1.34 3-3-1.34-3-3-3-3 1.34-3 3z",fillRule:"evenodd"}))};i.defaultProps={name:"Eye"},t.a=i},1413:function(e,t,n){},1443:function(e,t,n){"use strict";var r=n(0),a=n(14),o=n(15),i=n(16),c=n(17),s=n(9),u=n(2),l=n(1),d=n(19),h=n(27),p=n(31),f=n(249),g=n(423),m=n(124),b=n(1025),v=n(1300),A=n(1325),C=n(1326),E=n(1367);n(1413);function O(e){var t=function(){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(e){return!1}}();return function(){var n,r=Object(s.a)(e);if(t){var a=Object(s.a)(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return Object(c.a)(this,n)}}var w={phoneNoError:null,fullnameError:null,passwordError:null,digitsError:null},y=function(e){Object(i.a)(n,e);var t=O(n);function n(){var e;Object(a.a)(this,n);for(var o=arguments.length,i=new Array(o),c=0;c<o;c++)i[c]=arguments[c];return(e=t.call.apply(t,[this].concat(i))).state={email:"",password:"",fullname:"",captcha:"",customErrorInputMap:Object.assign({},w)},e.handleChange=function(t){return function(n){e.setState(Object(r.a)({},t,n))}},e.runBeforeCheckCaptcha=function(t){var n=e.state.captcha,r=e.props,a=r.captchaNeeded,o=r.checkCaptcha;if(!e.captchaValidated&&a)return n?void o(n).then((function(n){n.payload.success&&(e.captchaValidated=!0,t())})):void e.setState({validationResult:{message:"请输入验证码",needsRefresh:!1,timestamp:Date.now()},smsInputInterceptTime:Date.now()});t()},e.handleSubmit=function(){e.runBeforeCheckCaptcha((function(){var t=e.props,n=t.validateAndRegister;(0,t.resetRegisterValidateResult)();var r=e.state;n({source:"com.zhihu.web",registerType:"email",email:r.email,password:r.password,fullname:r.fullname})}))},e}return Object(o.a)(n,[{key:"componentDidMount",value:function(){this.props.isLogin&&(location.href="https://www.zhihu.com/logout?next=/email-register")}},{key:"componentWillReceiveProps",value:function(e){var t=this.props,n=t.captchaValidationMessage,r=t.registerConfirmSucceeded,a=e.captchaValidationMessage,o=e.registerConfirmSucceeded;!r&&o&&(location.href="/"),!n&&a&&this.setState({smsInputInterceptTime:Date.now(),validationResult:{message:a,needsRefresh:Boolean(a),timestamp:Date.now()}})}},{key:"render",value:function(){var e=this.state.validationResult,t=this.props.registerValidateErrors,n=t.email,r=(n=void 0===n?{}:n).message,a=t.fullname,o=(a=void 0===a?{}:a).message,i=t.password,c=(i=void 0===i?{}:i).message;return Object(u.c)(b.b,{className:"SignContainer-content EmailRegister",onSubmit:this.handleSubmit,children:[Object(u.b)(C.a,{onChange:this.handleChange("fullname"),name:"fullname",placeholder:"用户名",manualValidateError:o}),Object(u.b)(v.a,{type:"register",placeholder:"输入邮箱",onChange:this.handleChange("email"),manualValidateError:r,supportedCountriesShown:!1}),Object(u.b)(A.a,{onChange:this.handleChange("password"),manualValidateError:c}),Object(u.b)(E.a,{className:"SignFlow-captchaContainer Register-captcha",type:"register",isChinese:this.captchaIsChinese,canCaptchaShown:!0,onUpdateInput:this.handleChange("captcha"),validationResult:e}),Object(u.b)(p.c,{className:"EmailRegister-submitButton",preset:"primary",color:"blue",type:"submit",children:"注册"})]})}}]),n}(l.Component);t.a=Object(d.compose)(Object(f.b)(),Object(h.connect)((function(e){var t=e.captcha,n=t.captchaNeeded,r=t.captchaValidationMessage,a=e.register;return{captchaNeeded:n,registerValidateErrors:a.registerValidateErrors,captchaValidationMessage:r,registerConfirmSucceeded:a.registerConfirmSucceeded}}),{checkCaptcha:m.b,validateAndRegister:g.f,resetRegisterValidateResult:g.d}))(y)},1447:function(e,t,n){"use strict";var r=n(35),a=n(14),o=n(15),i=n(16),c=n(17),s=n(9),u=n(2),l=n(3),d=n.n(l),h=n(1),p=n(11),f=n.n(p),g=n(31),m=n(83),b=n.n(m);function v(e){var t=function(){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(e){return!1}}();return function(){var n,r=Object(s.a)(e);if(t){var a=Object(s.a)(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return Object(c.a)(this,n)}}var A=function(e){Object(i.a)(n,e);var t=v(n);function n(e){var r;return Object(a.a)(this,n),(r=t.call(this,e)).clearTimer=function(){r.timer&&window.clearInterval(r.timer)},r.handleClick=function(e){r.state.isCounting||r.startTiming(e)},r.state={countDownTime:e.countDownTime,isCounting:!1},r.isInitialState=!0,r}return Object(o.a)(n,[{key:"componentDidMount",value:function(){this.props.startAtOnce&&this.startTiming()}},{key:"componentWillReceiveProps",value:function(e){var t=this.props,n=t.interceptTime,r=t.reStartTime,a=e.interceptTime,o=e.reStartTime;n!==a&&this.resetTiming(),r!==o&&(this.resetTiming(),this.startTiming())}},{key:"componentWillUnmount",value:function(){this.clearTimer()}},{key:"resetTiming",value:function(){this.clearTimer(),this.setState({countDownTime:this.props.countDownTime,isCounting:!1})}},{key:"startTiming",value:function(e){var t=this,n=this.props,r=n.event,a=n.countDownEndEvent,o=null,i=function(){t.isInitialState=!1,t.setState({isCounting:!0}),t.timer=setInterval((function(){var e=t.state.countDownTime;e<=0?(a&&a(),t.resetTiming()):t.setState({countDownTime:e-1})}),1e3)};"function"==typeof r&&(o=r(e,i)),!1!==o&&i()}},{key:"renderText",value:function(){var e=this.props,t=e.initialText,n=e.resetText,r=e.countingText,a=this.state,o=a.countDownTime;return a.isCounting?r({count:o}):this.isInitialState?t:n||t}},{key:"render",value:function(){var e=b()(this.props,["initialText","resetText","countingText","startAtOnce","countDownTime","event","interceptTime","countDownEndEvent","reStartTime"]),t=e.className,n=e.disabled,a=Object(r.a)(e,["className","disabled"]),o=this.state.isCounting;return Object(u.b)(g.c,Object.assign({className:f()("CountingDownButton",t,{"is-counting":o})},a,{onClick:this.handleClick,disabled:n||o,children:this.renderText()}))}}]),n}(h.Component);A.propTypes={countDownTime:d.a.number,startAtOnce:d.a.bool,initialText:d.a.string.isRequired,resetText:d.a.string,countingText:d.a.func.isRequired,event:d.a.func,countDownEndEvent:d.a.func,interceptTime:d.a.number,reStartTime:d.a.number},A.defaultProps={countDownTime:60,startAtOnce:!1,interceptTime:-1,reStartTime:-1};t.a=A},1704:function(e,t,n){"use strict";var r;!function(a){function o(e,t,n){var r,a,o,i,c,g,m,b,v,A=0,C=[],E=0,O=!1,w=[],y=[],S=!1,j=!1,B=-1;if(r=(n=n||{}).encoding||"UTF8",(v=n.numRounds||1)!==parseInt(v,10)||1>v)throw Error("numRounds must a integer >= 1");if("SHA-1"===e)c=512,g=x,m=z,i=160,b=function(e){return e.slice()};else if(0===e.lastIndexOf("SHA-",0))if(g=function(t,n){return q(t,n,e)},m=function(t,n,r,a){var o,i;if("SHA-224"===e||"SHA-256"===e)o=15+(n+65>>>9<<4),i=16;else{if("SHA-384"!==e&&"SHA-512"!==e)throw Error("Unexpected error in SHA-2 implementation");o=31+(n+129>>>10<<5),i=32}for(;t.length<=o;)t.push(0);for(t[n>>>5]|=128<<24-n%32,n+=r,t[o]=4294967295&n,t[o-1]=n/4294967296|0,r=t.length,n=0;n<r;n+=i)a=q(t.slice(n,n+i),a,e);if("SHA-224"===e)t=[a[0],a[1],a[2],a[3],a[4],a[5],a[6]];else if("SHA-256"===e)t=a;else if("SHA-384"===e)t=[a[0].a,a[0].b,a[1].a,a[1].b,a[2].a,a[2].b,a[3].a,a[3].b,a[4].a,a[4].b,a[5].a,a[5].b];else{if("SHA-512"!==e)throw Error("Unexpected error in SHA-2 implementation");t=[a[0].a,a[0].b,a[1].a,a[1].b,a[2].a,a[2].b,a[3].a,a[3].b,a[4].a,a[4].b,a[5].a,a[5].b,a[6].a,a[6].b,a[7].a,a[7].b]}return t},b=function(e){return e.slice()},"SHA-224"===e)c=512,i=224;else if("SHA-256"===e)c=512,i=256;else if("SHA-384"===e)c=1024,i=384;else{if("SHA-512"!==e)throw Error("Chosen SHA variant is not supported");c=1024,i=512}else{if(0!==e.lastIndexOf("SHA3-",0)&&0!==e.lastIndexOf("SHAKE",0))throw Error("Chosen SHA variant is not supported");var I=6;if(g=L,b=function(e){var t,n=[];for(t=0;5>t;t+=1)n[t]=e[t].slice();return n},B=1,"SHA3-224"===e)c=1152,i=224;else if("SHA3-256"===e)c=1088,i=256;else if("SHA3-384"===e)c=832,i=384;else if("SHA3-512"===e)c=576,i=512;else if("SHAKE128"===e)c=1344,i=-1,I=31,j=!0;else{if("SHAKE256"!==e)throw Error("Chosen SHA variant is not supported");c=1088,i=-1,I=31,j=!0}m=function(e,t,n,r,a){var o,i=I,s=[],u=(n=c)>>>5,l=0,d=t>>>5;for(o=0;o<d&&t>=n;o+=u)r=L(e.slice(o,o+u),r),t-=n;for(e=e.slice(o),t%=n;e.length<u;)e.push(0);for(e[(o=t>>>3)>>2]^=i<<o%4*8,e[u-1]^=2147483648,r=L(e,r);32*s.length<a&&(e=r[l%5][l/5|0],s.push(e.b),!(32*s.length>=a));)s.push(e.a),0==64*(l+=1)%n&&(L(null,r),l=0);return s}}o=f(t,r,B),a=F(e),this.setHMACKey=function(t,n,o){var s;if(!0===O)throw Error("HMAC key already set");if(!0===S)throw Error("Cannot set HMAC key after calling update");if(!0===j)throw Error("SHAKE is not supported for HMAC");for(t=(n=f(n,r=(o||{}).encoding||"UTF8",B)(t)).binLen,n=n.value,o=(s=c>>>3)/4-1,s<t/8&&(n=m(n,t,0,F(e),i));n.length<=o;)n.push(0);for(t=0;t<=o;t+=1)w[t]=909522486^n[t],y[t]=1549556828^n[t];a=g(w,a),A=c,O=!0},this.update=function(e){var t,n,r,i=0,s=c>>>5;for(e=(t=o(e,C,E)).binLen,n=t.value,t=e>>>5,r=0;r<t;r+=s)i+c<=e&&(a=g(n.slice(r,r+s),a),i+=c);A+=i,C=n.slice(i>>>5),E=e%c,S=!0},this.getHash=function(t,n){var r,o,c,f;if(!0===O)throw Error("Cannot call getHash after setting HMAC key");if(c=p(n),!0===j){if(-1===c.shakeLen)throw Error("shakeLen must be specified in options");i=c.shakeLen}switch(t){case"HEX":r=function(e){return s(e,i,B,c)};break;case"B64":r=function(e){return u(e,i,B,c)};break;case"BYTES":r=function(e){return l(e,i,B)};break;case"ARRAYBUFFER":try{o=new ArrayBuffer(0)}catch(e){throw Error("ARRAYBUFFER not supported by this environment")}r=function(e){return d(e,i,B)};break;case"UINT8ARRAY":try{o=new Uint8Array(0)}catch(e){throw Error("UINT8ARRAY not supported by this environment")}r=function(e){return h(e,i,B)};break;default:throw Error("format must be HEX, B64, BYTES, ARRAYBUFFER, or UINT8ARRAY")}for(f=m(C.slice(),E,A,b(a),i),o=1;o<v;o+=1)!0===j&&0!=i%32&&(f[f.length-1]&=16777215>>>24-i%32),f=m(f,i,0,F(e),i);return r(f)},this.getHMAC=function(t,n){var r,o,f,v;if(!1===O)throw Error("Cannot call getHMAC without first setting HMAC key");switch(f=p(n),t){case"HEX":r=function(e){return s(e,i,B,f)};break;case"B64":r=function(e){return u(e,i,B,f)};break;case"BYTES":r=function(e){return l(e,i,B)};break;case"ARRAYBUFFER":try{r=new ArrayBuffer(0)}catch(e){throw Error("ARRAYBUFFER not supported by this environment")}r=function(e){return d(e,i,B)};break;case"UINT8ARRAY":try{r=new Uint8Array(0)}catch(e){throw Error("UINT8ARRAY not supported by this environment")}r=function(e){return h(e,i,B)};break;default:throw Error("outputFormat must be HEX, B64, BYTES, ARRAYBUFFER, or UINT8ARRAY")}return o=m(C.slice(),E,A,b(a),i),v=g(y,F(e)),r(v=m(o,i,c,v,i))}}function i(e,t){this.a=e,this.b=t}function c(e,t,n,r){var a,o,i,c,s;for(t=t||[0],o=(n=n||0)>>>3,s=-1===r?3:0,a=0;a<e.length;a+=1)i=(c=a+o)>>>2,t.length<=i&&t.push(0),t[i]|=e[a]<<8*(s+c%4*r);return{value:t,binLen:8*e.length+n}}function s(e,t,n,r){var a,o,i,c="";for(t/=8,i=-1===n?3:0,a=0;a<t;a+=1)o=e[a>>>2]>>>8*(i+a%4*n),c+="0123456789abcdef".charAt(o>>>4&15)+"0123456789abcdef".charAt(15&o);return r.outputUpper?c.toUpperCase():c}function u(e,t,n,r){var a,o,i,c,s="",u=t/8;for(c=-1===n?3:0,a=0;a<u;a+=3)for(o=a+1<u?e[a+1>>>2]:0,i=a+2<u?e[a+2>>>2]:0,i=(e[a>>>2]>>>8*(c+a%4*n)&255)<<16|(o>>>8*(c+(a+1)%4*n)&255)<<8|i>>>8*(c+(a+2)%4*n)&255,o=0;4>o;o+=1)s+=8*a+6*o<=t?"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(i>>>6*(3-o)&63):r.b64Pad;return s}function l(e,t,n){var r,a,o,i="";for(t/=8,o=-1===n?3:0,r=0;r<t;r+=1)a=e[r>>>2]>>>8*(o+r%4*n)&255,i+=String.fromCharCode(a);return i}function d(e,t,n){t/=8;var r,a,o,i=new ArrayBuffer(t);for(o=new Uint8Array(i),a=-1===n?3:0,r=0;r<t;r+=1)o[r]=e[r>>>2]>>>8*(a+r%4*n)&255;return i}function h(e,t,n){t/=8;var r,a,o=new Uint8Array(t);for(a=-1===n?3:0,r=0;r<t;r+=1)o[r]=e[r>>>2]>>>8*(a+r%4*n)&255;return o}function p(e){var t={outputUpper:!1,b64Pad:"=",shakeLen:-1};if(e=e||{},t.outputUpper=e.outputUpper||!1,!0===e.hasOwnProperty("b64Pad")&&(t.b64Pad=e.b64Pad),!0===e.hasOwnProperty("shakeLen")){if(0!=e.shakeLen%8)throw Error("shakeLen must be a multiple of 8");t.shakeLen=e.shakeLen}if("boolean"!=typeof t.outputUpper)throw Error("Invalid outputUpper formatting option");if("string"!=typeof t.b64Pad)throw Error("Invalid b64Pad formatting option");return t}function f(e,t,n){switch(t){case"UTF8":case"UTF16BE":case"UTF16LE":break;default:throw Error("encoding must be UTF8, UTF16BE, or UTF16LE")}switch(e){case"HEX":e=function(e,t,r){var a,o,i,c,s,u,l=e.length;if(0!=l%2)throw Error("String of HEX type must be in byte increments");for(t=t||[0],s=(r=r||0)>>>3,u=-1===n?3:0,a=0;a<l;a+=2){if(o=parseInt(e.substr(a,2),16),isNaN(o))throw Error("String of HEX type contains invalid characters");for(i=(c=(a>>>1)+s)>>>2;t.length<=i;)t.push(0);t[i]|=o<<8*(u+c%4*n)}return{value:t,binLen:4*l+r}};break;case"TEXT":e=function(e,r,a){var o,i,c,s,u,l,d,h,p=0;if(r=r||[0],u=(a=a||0)>>>3,"UTF8"===t)for(h=-1===n?3:0,c=0;c<e.length;c+=1)for(i=[],128>(o=e.charCodeAt(c))?i.push(o):2048>o?(i.push(192|o>>>6),i.push(128|63&o)):55296>o||57344<=o?i.push(224|o>>>12,128|o>>>6&63,128|63&o):(c+=1,o=65536+((1023&o)<<10|1023&e.charCodeAt(c)),i.push(240|o>>>18,128|o>>>12&63,128|o>>>6&63,128|63&o)),s=0;s<i.length;s+=1){for(l=(d=p+u)>>>2;r.length<=l;)r.push(0);r[l]|=i[s]<<8*(h+d%4*n),p+=1}else if("UTF16BE"===t||"UTF16LE"===t)for(h=-1===n?2:0,i="UTF16LE"===t&&1!==n||"UTF16LE"!==t&&1===n,c=0;c<e.length;c+=1){for(o=e.charCodeAt(c),!0===i&&(o=(s=255&o)<<8|o>>>8),l=(d=p+u)>>>2;r.length<=l;)r.push(0);r[l]|=o<<8*(h+d%4*n),p+=2}return{value:r,binLen:8*p+a}};break;case"B64":e=function(e,t,r){var a,o,i,c,s,u,l,d,h=0;if(-1===e.search(/^[a-zA-Z0-9=+\/]+$/))throw Error("Invalid character in base-64 string");if(o=e.indexOf("="),e=e.replace(/\=/g,""),-1!==o&&o<e.length)throw Error("Invalid '=' found in base-64 string");for(t=t||[0],u=(r=r||0)>>>3,d=-1===n?3:0,o=0;o<e.length;o+=4){for(s=e.substr(o,4),i=c=0;i<s.length;i+=1)c|=(a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(s.charAt(i)))<<18-6*i;for(i=0;i<s.length-1;i+=1){for(a=(l=h+u)>>>2;t.length<=a;)t.push(0);t[a]|=(c>>>16-8*i&255)<<8*(d+l%4*n),h+=1}}return{value:t,binLen:8*h+r}};break;case"BYTES":e=function(e,t,r){var a,o,i,c,s,u;for(t=t||[0],i=(r=r||0)>>>3,u=-1===n?3:0,o=0;o<e.length;o+=1)a=e.charCodeAt(o),c=(s=o+i)>>>2,t.length<=c&&t.push(0),t[c]|=a<<8*(u+s%4*n);return{value:t,binLen:8*e.length+r}};break;case"ARRAYBUFFER":try{e=new ArrayBuffer(0)}catch(e){throw Error("ARRAYBUFFER not supported by this environment")}e=function(e,t,r){return c(new Uint8Array(e),t,r,n)};break;case"UINT8ARRAY":try{e=new Uint8Array(0)}catch(e){throw Error("UINT8ARRAY not supported by this environment")}e=function(e,t,r){return c(e,t,r,n)};break;default:throw Error("format must be HEX, TEXT, B64, BYTES, ARRAYBUFFER, or UINT8ARRAY")}return e}function g(e,t){return e<<t|e>>>32-t}function m(e,t){return 32<t?(t-=32,new i(e.b<<t|e.a>>>32-t,e.a<<t|e.b>>>32-t)):0!==t?new i(e.a<<t|e.b>>>32-t,e.b<<t|e.a>>>32-t):e}function b(e,t){return e>>>t|e<<32-t}function v(e,t){var n=null;n=new i(e.a,e.b);return 32>=t?new i(n.a>>>t|n.b<<32-t&4294967295,n.b>>>t|n.a<<32-t&4294967295):new i(n.b>>>t-32|n.a<<64-t&4294967295,n.a>>>t-32|n.b<<64-t&4294967295)}function A(e,t){return 32>=t?new i(e.a>>>t,e.b>>>t|e.a<<32-t&4294967295):new i(0,e.a>>>t-32)}function C(e,t,n){return e&t^~e&n}function E(e,t,n){return new i(e.a&t.a^~e.a&n.a,e.b&t.b^~e.b&n.b)}function O(e,t,n){return e&t^e&n^t&n}function w(e,t,n){return new i(e.a&t.a^e.a&n.a^t.a&n.a,e.b&t.b^e.b&n.b^t.b&n.b)}function y(e){return b(e,2)^b(e,13)^b(e,22)}function S(e){var t=v(e,28),n=v(e,34);return e=v(e,39),new i(t.a^n.a^e.a,t.b^n.b^e.b)}function j(e){return b(e,6)^b(e,11)^b(e,25)}function B(e){var t=v(e,14),n=v(e,18);return e=v(e,41),new i(t.a^n.a^e.a,t.b^n.b^e.b)}function I(e){return b(e,7)^b(e,18)^e>>>3}function R(e){var t=v(e,1),n=v(e,8);return e=A(e,7),new i(t.a^n.a^e.a,t.b^n.b^e.b)}function k(e){return b(e,17)^b(e,19)^e>>>10}function Q(e){var t=v(e,19),n=v(e,61);return e=A(e,6),new i(t.a^n.a^e.a,t.b^n.b^e.b)}function N(e,t){var n=(65535&e)+(65535&t);return((e>>>16)+(t>>>16)+(n>>>16)&65535)<<16|65535&n}function T(e,t,n,r){var a=(65535&e)+(65535&t)+(65535&n)+(65535&r);return((e>>>16)+(t>>>16)+(n>>>16)+(r>>>16)+(a>>>16)&65535)<<16|65535&a}function P(e,t,n,r,a){var o=(65535&e)+(65535&t)+(65535&n)+(65535&r)+(65535&a);return((e>>>16)+(t>>>16)+(n>>>16)+(r>>>16)+(a>>>16)+(o>>>16)&65535)<<16|65535&o}function M(e,t){var n,r,a;return n=(65535&e.b)+(65535&t.b),a=(65535&(r=(e.b>>>16)+(t.b>>>16)+(n>>>16)))<<16|65535&n,n=(65535&e.a)+(65535&t.a)+(r>>>16),new i((65535&(r=(e.a>>>16)+(t.a>>>16)+(n>>>16)))<<16|65535&n,a)}function D(e,t,n,r){var a,o,c;return a=(65535&e.b)+(65535&t.b)+(65535&n.b)+(65535&r.b),c=(65535&(o=(e.b>>>16)+(t.b>>>16)+(n.b>>>16)+(r.b>>>16)+(a>>>16)))<<16|65535&a,a=(65535&e.a)+(65535&t.a)+(65535&n.a)+(65535&r.a)+(o>>>16),new i((65535&(o=(e.a>>>16)+(t.a>>>16)+(n.a>>>16)+(r.a>>>16)+(a>>>16)))<<16|65535&a,c)}function V(e,t,n,r,a){var o,c,s;return o=(65535&e.b)+(65535&t.b)+(65535&n.b)+(65535&r.b)+(65535&a.b),s=(65535&(c=(e.b>>>16)+(t.b>>>16)+(n.b>>>16)+(r.b>>>16)+(a.b>>>16)+(o>>>16)))<<16|65535&o,o=(65535&e.a)+(65535&t.a)+(65535&n.a)+(65535&r.a)+(65535&a.a)+(c>>>16),new i((65535&(c=(e.a>>>16)+(t.a>>>16)+(n.a>>>16)+(r.a>>>16)+(a.a>>>16)+(o>>>16)))<<16|65535&o,s)}function U(e,t){return new i(e.a^t.a,e.b^t.b)}function F(e){var t,n=[];if("SHA-1"===e)n=[1732584193,4023233417,2562383102,271733878,3285377520];else if(0===e.lastIndexOf("SHA-",0))switch(n=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428],t=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],e){case"SHA-224":break;case"SHA-256":n=t;break;case"SHA-384":n=[new i(3418070365,n[0]),new i(1654270250,n[1]),new i(2438529370,n[2]),new i(355462360,n[3]),new i(1731405415,n[4]),new i(41048885895,n[5]),new i(3675008525,n[6]),new i(1203062813,n[7])];break;case"SHA-512":n=[new i(t[0],4089235720),new i(t[1],2227873595),new i(t[2],4271175723),new i(t[3],1595750129),new i(t[4],2917565137),new i(t[5],725511199),new i(t[6],4215389547),new i(t[7],327033209)];break;default:throw Error("Unknown SHA variant")}else{if(0!==e.lastIndexOf("SHA3-",0)&&0!==e.lastIndexOf("SHAKE",0))throw Error("No SHA variants supported");for(e=0;5>e;e+=1)n[e]=[new i(0,0),new i(0,0),new i(0,0),new i(0,0),new i(0,0)]}return n}function x(e,t){var n,r,a,o,i,c,s,u=[];for(n=t[0],r=t[1],a=t[2],o=t[3],i=t[4],s=0;80>s;s+=1)u[s]=16>s?e[s]:g(u[s-3]^u[s-8]^u[s-14]^u[s-16],1),c=20>s?P(g(n,5),r&a^~r&o,i,1518500249,u[s]):40>s?P(g(n,5),r^a^o,i,1859775393,u[s]):60>s?P(g(n,5),O(r,a,o),i,2400959708,u[s]):P(g(n,5),r^a^o,i,3395469782,u[s]),i=o,o=a,a=g(r,30),r=n,n=c;return t[0]=N(n,t[0]),t[1]=N(r,t[1]),t[2]=N(a,t[2]),t[3]=N(o,t[3]),t[4]=N(i,t[4]),t}function z(e,t,n,r){var a;for(a=15+(t+65>>>9<<4);e.length<=a;)e.push(0);for(e[t>>>5]|=128<<24-t%32,t+=n,e[a]=4294967295&t,e[a-1]=t/4294967296|0,t=e.length,a=0;a<t;a+=16)r=x(e.slice(a,a+16),r);return r}function q(e,t,n){var r,a,o,c,s,u,l,d,h,p,f,g,m,b,v,A,U,F,x,z,q,L,W,K=[];if("SHA-224"===n||"SHA-256"===n)p=64,g=1,L=Number,m=N,b=T,v=P,A=I,U=k,F=y,x=j,q=O,z=C,W=H;else{if("SHA-384"!==n&&"SHA-512"!==n)throw Error("Unexpected error in SHA-2 implementation");p=80,g=2,L=i,m=M,b=D,v=V,A=R,U=Q,F=S,x=B,q=w,z=E,W=J}for(n=t[0],r=t[1],a=t[2],o=t[3],c=t[4],s=t[5],u=t[6],l=t[7],f=0;f<p;f+=1)16>f?(h=f*g,d=e.length<=h?0:e[h],h=e.length<=h+1?0:e[h+1],K[f]=new L(d,h)):K[f]=b(U(K[f-2]),K[f-7],A(K[f-15]),K[f-16]),d=v(l,x(c),z(c,s,u),W[f],K[f]),h=m(F(n),q(n,r,a)),l=u,u=s,s=c,c=m(o,d),o=a,a=r,r=n,n=m(d,h);return t[0]=m(n,t[0]),t[1]=m(r,t[1]),t[2]=m(a,t[2]),t[3]=m(o,t[3]),t[4]=m(c,t[4]),t[5]=m(s,t[5]),t[6]=m(u,t[6]),t[7]=m(l,t[7]),t}function L(e,t){var n,r,a,o,c=[],s=[];if(null!==e)for(r=0;r<e.length;r+=2)t[(r>>>1)%5][(r>>>1)/5|0]=U(t[(r>>>1)%5][(r>>>1)/5|0],new i(e[r+1],e[r]));for(n=0;24>n;n+=1){for(o=F("SHA3-"),r=0;5>r;r+=1){a=t[r][0];var u=t[r][1],l=t[r][2],d=t[r][3],h=t[r][4];c[r]=new i(a.a^u.a^l.a^d.a^h.a,a.b^u.b^l.b^d.b^h.b)}for(r=0;5>r;r+=1)s[r]=U(c[(r+4)%5],m(c[(r+1)%5],1));for(r=0;5>r;r+=1)for(a=0;5>a;a+=1)t[r][a]=U(t[r][a],s[r]);for(r=0;5>r;r+=1)for(a=0;5>a;a+=1)o[a][(2*r+3*a)%5]=m(t[r][a],W[r][a]);for(r=0;5>r;r+=1)for(a=0;5>a;a+=1)t[r][a]=U(o[r][a],new i(~o[(r+1)%5][a].a&o[(r+2)%5][a].a,~o[(r+1)%5][a].b&o[(r+2)%5][a].b));t[0][0]=U(t[0][0],K[n])}return t}var H,J,W,K;J=[new i((H=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298])[0],3609767458),new i(H[1],602891725),new i(H[2],3964484399),new i(H[3],2173295548),new i(H[4],4081628472),new i(H[5],3053834265),new i(H[6],2937671579),new i(H[7],3664609560),new i(H[8],2734883394),new i(H[9],1164996542),new i(H[10],1323610764),new i(H[11],3590304994),new i(H[12],4068182383),new i(H[13],991336113),new i(H[14],633803317),new i(H[15],3479774868),new i(H[16],2666613458),new i(H[17],944711139),new i(H[18],2341262773),new i(H[19],2007800933),new i(H[20],1495990901),new i(H[21],1856431235),new i(H[22],3175218132),new i(H[23],2198950837),new i(H[24],3999719339),new i(H[25],766784016),new i(H[26],2566594879),new i(H[27],3203337956),new i(H[28],1034457026),new i(H[29],2466948901),new i(H[30],3758326383),new i(H[31],168717936),new i(H[32],1188179964),new i(H[33],1546045734),new i(H[34],1522805485),new i(H[35],2643833823),new i(H[36],2343527390),new i(H[37],1014477480),new i(H[38],1206759142),new i(H[39],344077627),new i(H[40],1290863460),new i(H[41],3158454273),new i(H[42],3505952657),new i(H[43],106217008),new i(H[44],3606008344),new i(H[45],1432725776),new i(H[46],1467031594),new i(H[47],851169720),new i(H[48],3100823752),new i(H[49],1363258195),new i(H[50],3750685593),new i(H[51],3785050280),new i(H[52],3318307427),new i(H[53],3812723403),new i(H[54],2003034995),new i(H[55],3602036899),new i(H[56],1575990012),new i(H[57],1125592928),new i(H[58],2716904306),new i(H[59],442776044),new i(H[60],593698344),new i(H[61],3733110249),new i(H[62],2999351573),new i(H[63],3815920427),new i(3391569614,3928383900),new i(3515267271,566280711),new i(3940187606,3454069534),new i(4118630271,4000239992),new i(116418474,1914138554),new i(174292421,2731055270),new i(289380356,3203993006),new i(460393269,320620315),new i(685471733,587496836),new i(852142971,1086792851),new i(1017036298,365543100),new i(1126000580,2618297676),new i(1288033470,3409855158),new i(1501505948,4234509866),new i(1607167915,987167468),new i(1816402316,1246189591)],K=[new i(0,1),new i(0,32898),new i(2147483648,32906),new i(2147483648,2147516416),new i(0,32907),new i(0,2147483649),new i(2147483648,2147516545),new i(2147483648,32777),new i(0,138),new i(0,136),new i(0,2147516425),new i(0,2147483658),new i(0,2147516555),new i(2147483648,139),new i(2147483648,32905),new i(2147483648,32771),new i(2147483648,32770),new i(2147483648,128),new i(0,32778),new i(2147483648,2147483658),new i(2147483648,2147516545),new i(2147483648,32896),new i(0,2147483649),new i(2147483648,2147516424)],W=[[0,36,3,41,18],[1,44,10,45,2],[62,6,43,15,61],[28,55,25,21,56],[27,20,39,8,14]],void 0===(r=function(){return o}.call(t,n,t,e))||(e.exports=r)}()},1705:function(e,t,n){"use strict";var r=n(1),a=n.n(r),o=n(18),i=function(e){return a.a.createElement(o.a,e,a.a.createElement("path",{d:"M12.003 2c-2.265 0-6.29 1.364-6.29 7.325v1.195S3.55 14.96 3.55 17.474c0 .665.17 1.025.281 1.025.114 0 .902-.484 1.748-2.072 0 0-.18 2.197 1.904 3.967 0 0-1.77.495-1.77 1.182 0 .686 4.078.43 6.29 0 2.239.425 6.287.687 6.287 0 0-.688-1.768-1.182-1.768-1.182 2.085-1.77 1.905-3.967 1.905-3.967.845 1.588 1.634 2.072 1.746 2.072.111 0 .283-.36.283-1.025 0-2.514-2.166-6.954-2.166-6.954V9.325C18.29 3.364 14.268 2 12.003 2z",fillRule:"evenodd"}))};i.defaultProps={name:"QQ"},t.a=i},1706:function(e,t,n){"use strict";var r=n(1),a=n.n(r),o=n(18),i=function(e){return a.a.createElement(o.a,e,a.a.createElement("g",{fill:"none",fillRule:"evenodd"},a.a.createElement("path",{fill:"#0F88EB",d:"M2.64 13.39c1.068.895 1.808 2.733 1.66 4.113l.022-.196c-.147 1.384.856 2.4 2.24 2.278l-.198.016c1.387-.122 3.21.655 4.083 1.734l-.125-.154c.876 1.084 2.304 1.092 3.195.027l-.127.152c.895-1.068 2.733-1.808 4.113-1.66l-.198-.022c1.386.147 2.402-.856 2.279-2.238l.017.197c-.122-1.388.655-3.212 1.734-4.084l-.154.125c1.083-.876 1.092-2.304.027-3.195l.152.127c-1.068-.895-1.808-2.732-1.66-4.113l-.022.198c.147-1.386-.856-2.4-2.24-2.279l.198-.017c-1.387.123-3.21-.654-4.083-1.733l.125.153c-.876-1.083-2.304-1.092-3.195-.027l.127-.152c-.895 1.068-2.733 1.808-4.113 1.662l.198.02c-1.386-.147-2.4.857-2.279 2.24L4.4 6.363c.122 1.387-.655 3.21-1.734 4.084l.154-.126c-1.083.878-1.092 2.304-.027 3.195l-.152-.127z"}),a.a.createElement("path",{fill:"#FFF",d:"M9.78 15.728l-2.633-2.999s-.458-.705.242-1.362c.7-.657 1.328-.219 1.328-.219l1.953 2.132 4.696-4.931s.663-.348 1.299.198c.636.545.27 1.382.27 1.382s-3.466 3.858-5.376 5.782c-.98.93-1.778.017-1.778.017z"})))};i.defaultProps={name:"BadgeCert"},t.a=i},1782:function(e,t,n){"use strict";var r=n(14),a=n(15),o=n(16),i=n(17),c=n(9),s=n(2),u=n(1),l=n.n(u),d=n(11),h=n.n(d),p=n(90),f=n(30),g=n(249),m=n(0),b=n(66),v=n(19),A=n(27),C=n(371),E=n(31),O=n(1137),w=n(366),y=n(24),S=n(423),j=n(124),B=n(1025),I=n(1367),R=n(1300),k=n(849),Q=n(35),N=n(3),T=n.n(N),P=n(1447),M=n(1411),D=n(1119);function V(){var e=Object(k.a)([""," 秒后可重发"]);return V=function(){return e},e}function U(e){var t=function(){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(e){return!1}}();return function(){var n,r=Object(c.a)(e);if(t){var a=Object(c.a)(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return Object(i.a)(this,n)}}var F=function(e){Object(o.a)(n,e);var t=U(n);function n(){return Object(r.a)(this,n),t.apply(this,arguments)}return Object(a.a)(n,[{key:"render",value:function(){var e,t=this.props,n=t.countDownEvent,r=t.countDownEndEvent,a=t.startAtOnce,o=t.interceptTime,i=t.isEmail,c=t.reStartTime,u=t.smsType,l=Object(Q.a)(t,["countDownEvent","countDownEndEvent","startAtOnce","interceptTime","isEmail","reStartTime","smsType"]);return e=i?"邮箱":"voice"===u?"语音":"短信",Object(s.c)("div",{className:"SignFlow SignFlow-smsInputContainer",children:[Object(s.b)(D.a,Object.assign({name:"digits",className:"SignFlow-smsInput",type:"number",smsType:u,errorMessageClassName:"SignFlow-smsInputErrorMessage",placeholder:"输入 6 位".concat(e,"验证码"),validations:[{type:"required",message:"请输入".concat(e,"验证码"),className:"SignFlow-smsInputRequiredErrorMask"}]},l)),Object(s.b)(P.a,{className:"SignFlow-smsInputButton",preset:"plain",initialText:"获取".concat(e,"验证码"),resetText:"重新获取".concat(e,"验证码"),countingText:Object(M.a)(V(),"count"),startAtOnce:a,event:n,countDownEndEvent:r,interceptTime:o,reStartTime:c})]})}}]),n}(u.Component);F.propTypes={countDownEvent:T.a.func.isRequired,startAtOnce:T.a.bool,interceptTime:T.a.number,reStartTime:T.a.number,isEmail:T.a.bool,countDownEndEvent:T.a.func,smsType:T.a.string},F.defaultProps={startAtOnce:!1,isEmail:!1};var x=F,z=n(1325),q=n(1326),L=n(38),H=n.n(L);function J(e){var t=function(){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(e){return!1}}();return function(){var n,r=Object(c.a)(e);if(t){var a=Object(c.a)(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return Object(i.a)(this,n)}}var W={phoneNoError:null,fullnameError:null,passwordError:null,digitsError:null},K=function(e){Object(o.a)(n,e);var t=J(n);function n(e){var a;return Object(r.a)(this,n),(a=t.call(this,e)).handleCountDownEndEvent=function(){a.setState({smsBackUpDisplay:!0})},a.handleChange=function(e){return function(t){a.setState(Object(m.a)({},e,t))}},a.testPhoneNo=function(){var e=a.state,t=e.selectedCountry.code,n=e.phoneNo;return"+86"!==t||/^\d{11}$/.test(n)},a.handleBackUpDigits=function(){a.setState({smsType:"text"===a.state.smsType?"voice":"text",reStartTime:Date.now()})},a.sendDigits=function(){var e=a.props,t=e.sendDigits,n=e.validateRegisterForm;(0,e.resetRegisterValidateResult)();var r=a.state,o=r.phoneNo,i=r.selectedCountry,c=r.smsType,s="".concat(i.code).concat(o);n({phoneNo:s}).then((function(e){if(e.payload.success)return a.setState({smsBackUpDisplay:!1}),void t(s,c);a.setState({smsInputInterceptTime:Date.now()})}))},a.runBeforeCheckCaptcha=function(e){var t=a.state.captcha,n=a.props,r=n.captchaNeeded,o=n.checkCaptcha;if(!a.captchaValidated&&r)return t?void o(t,a.captchaIsChinese?"cn":"en").then((function(t){t.payload.success&&(a.captchaValidated=!0,e())})):void a.setState({validationResult:{message:a.captchaIsChinese?"请点击图中倒立的文字":"请输入验证码",needsRefresh:!1,timestamp:Date.now()},smsInputInterceptTime:Date.now()});e()},a.runBeforeResetValidateResult=function(e){a.props.resetRegisterValidateResult(),a.setState({customErrorInputMap:Object.assign({},W),validationResult:{needsRefresh:!1,timestamp:Date.now()}},(function(){e()}))},a.handleSendDigits=function(){f.a.trackEvent(Object(b.a)(a),{id:4940}),a.runBeforeResetValidateResult((function(){var e=a.state.phoneNo;a.testPhoneNo()?a.runBeforeResetValidateResult((function(){a.runBeforeCheckCaptcha((function(){a.sendDigits()}))})):a.setState({customErrorInputMap:Object.assign({},a.state.customErrorInputMap,{phoneNoError:e?"请输入正确的手机号":"请输入手机号"}),smsInputInterceptTime:Date.now()})}))},a.parseErrorMessages=function(){var e=a.props,t=e.registerValidateErrors,n=void 0===t?{}:t,r=e.onChangeToSigin,o=n.phoneNo,i=void 0===o?{}:o,c=n.fullname,u=void 0===c?{}:c,l=n.password,d=void 0===l?{}:l,h=n.username,p=void 0===h?"":h,f=i.code,g=i.message;return{phoneNoError:f===y.s?Object(s.c)("span",{children:["该手机号已注册 · ",Object(s.b)(E.c,{preset:"plain",style:{color:"#3f3f3f"},onClick:function(){r()},children:"直接登录"})]}):g,fullnameError:u.message,passwordError:d.message,usernameError:p}},a.handlePhoneNumberFormSubmit=function(e){f.a.trackEvent(Object(b.a)(a),{id:4942}),a.runBeforeCheckCaptcha((function(){a.runBeforeResetValidateResult((function(){var t=e.digits,n=a.props,r=n.validateDigits,o=n.onSetShowHeader,i=a.state,c=i.phoneNo,s=i.selectedCountry;c&&t&&r("".concat(s.code).concat(c),t).then((function(e){e.payload.success?a.setState({digitsValidated:!0},(function(){o(!1)})):a.setState({customErrorInputMap:Object.assign({},a.state.customErrorInputMap,{digitsError:"验证码填写错误"})})}))}))}))},a.handleSetNameFormSubmit=function(e){a.runBeforeCheckCaptcha((function(){a.runBeforeResetValidateResult((function(){var t=a.state,n=t.phoneNo,r=t.digits,o=t.password,i=t.fullname,c=t.selectedCountry,s=a.props,u=s.confirmRegister,l=s.validateRegister,d=s.nextUrl,h={phoneNo:"".concat(c.code).concat(n),password:o,digits:r,fullname:i},p=Object(C.c)(d),f=p.utm_source,g=p.utm_medium;l(h).then((function(t){t.payload.success&&u({phoneNo:"".concat(c.code).concat(n),digits:r,password:o,fullname:i||e.fullname,registerType:"phone_digits",source:"com.zhihu.web",utmSource:f,refSource:g})}))}))}))},a.state={fullname:"",password:"",captcha:"",phoneNo:"",digits:"",smsType:"text",digitsValidated:!1,smsBackUpDisplay:!0,selectedCountry:{name:"中国",code:"+86"},validationResult:{},customErrorInputMap:Object.assign({},W),smsInputInterceptTime:-1,reStartTime:Date.now()},a.captchaIsChinese=Math.random()<.5,a}return Object(a.a)(n,[{key:"componentWillReceiveProps",value:function(e){var t=this.props,n=t.captchaValidationMessage,r=t.registerConfirmSucceeded,a=t.sendDigitsError,o=t.isInSignPage,i=t.nextUrl,c=e.captchaValidationMessage,s=e.registerConfirmSucceeded,u=e.sendDigitsError;if(!r&&s){var l=this.state,d=l.selectedCountry.code,h=l.phoneNo;return f.a.trackEvent(this,{action:"StatusReport",id:234},{status:{result:"Success",event:{action:"SignUp",element:"Button"}},account:{phone:"".concat(d).concat(h),type:"Zhihu"}}),void(i?location.href=i:o?location.href="/":location.reload())}if(!a&&u||r!==s&&!1===s){var p={};!a&&u&&(p={smsInputInterceptTime:Date.now(),smsBackUpDisplay:!0},this.captchaValidated=!1),this.setState(Object.assign({},p,{validationResult:{message:a,needsRefresh:!0,timestamp:Date.now()}}))}!n&&c&&this.setState({smsInputInterceptTime:Date.now(),validationResult:{message:c,needsRefresh:Boolean(c),timestamp:Date.now()}})}},{key:"render",value:function(){var e=this,t=this.state,n=t.phoneNo,r=t.smsType,a=t.password,o=t.reStartTime,i=t.digitsValidated,c=t.validationResult,l=t.smsBackUpDisplay,d=t.customErrorInputMap,p=t.smsInputInterceptTime,g=this.props,m=g.sendDigitsError,b=g.onSetShowHeader,v=this.parseErrorMessages(),A=v.phoneNoError,C=v.fullnameError,w=v.passwordError,y=v.usernameError,S=d.phoneNoError,j=d.digitsError;return Object(s.b)("div",{className:"Register",children:i?Object(s.c)("div",{className:"Register-padName",children:[Object(s.c)("div",{className:"Register-padNameHeader",children:[Object(s.b)(E.c,{onClick:function(){e.setState({digitsValidated:!1},(function(){b(!0)}))},children:Object(s.b)(O.a,{size:30})}),Object(s.b)("span",{className:"Register-padNameTitle",children:"设置用户名和密码"})]}),Object(s.c)(B.b,{onSubmit:this.handleSetNameFormSubmit,children:[Object(s.b)(q.a,{name:"fullname",placeholder:"用户名",onChange:this.handleChange("fullname"),manualValidateError:C}),Object(s.b)(z.a,{defaultValue:a,onChange:this.handleChange("password"),manualValidateError:w}),Object(s.b)(E.c,{className:"Register-getIn",type:"submit",preset:"primary",color:"blue",children:"进入知乎"})]})]}):Object(s.b)(u.Fragment,{children:Object(s.c)("div",{className:"Register-content",children:[Object(s.c)(B.b,{onSubmit:this.handlePhoneNumberFormSubmit,children:[Object(s.b)(R.a,{type:"register",onChange:this.handleChange("phoneNo"),onSelect:this.handleChange("selectedCountry"),manualValidateError:A||S||y}),Object(s.b)(I.a,{className:"SignFlow-captchaContainer Register-captcha",type:"register",isChinese:this.captchaIsChinese,canCaptchaShown:Boolean(n),onUpdateInput:this.handleChange("captcha"),validationResult:c}),Object(s.c)("div",{className:"Register-SMSInput",children:[Object(s.b)(x,{smsType:r,reStartTime:o,onChange:this.handleChange("digits"),countDownEvent:this.handleSendDigits,countDownEndEvent:this.handleCountDownEndEvent,interceptTime:p,manualValidateError:j||m}),Object(s.b)("div",{className:h()("Register-smsBackUp",{"Register-hiddenSmsBackUp":!l}),children:Object(s.c)("span",{onClick:this.handleBackUpDigits,children:["接收","text"===r?"语音":"短信","验证码"]})})]}),Object(s.b)(E.c,{className:"Register-submitButton",preset:"primary",color:"blue",type:"submit",children:"注册"})]}),Object(s.c)("div",{className:"Register-footer",children:[Object(s.c)("span",{className:"Register-declaration",children:["注册即代表同意",Object(s.b)("a",{href:"//".concat(H.a.wwwHost,"/term/zhihu-terms"),children:"《知乎协议》"}),Object(s.b)("a",{href:"//".concat(H.a.wwwHost,"/term/privacy"),children:"《隐私保护指引》"})]}),Object(s.b)("a",{className:"Register-org",href:"//".concat(H.a.wwwHost,"/org/signup"),onClick:function(e){return f.a.trackEvent(e.currentTarget,{id:4943})},children:"注册机构号"})]})]})})})}}]),n}(u.Component),Y=(Object(v.compose)(Object(w.b)((function(){return{module:"SignUpForm",view:{id:233},trackCardShow:!0}})),Object(A.connect)((function(e){var t=e.captcha,n=t.captchaNeeded,r=t.captchaValidationMessage,a=e.register;return{captchaNeeded:n,sendDigitsError:a.sendDigitsError,registerValidateErrors:a.registerValidateErrors,captchaValidationMessage:r,registerConfirmSucceeded:a.registerConfirmSucceeded}}),{sendDigits:S.e,checkCaptcha:j.b,validateDigits:S.g,confirmRegister:S.a,validateRegister:S.h,validateRegisterForm:S.i,resetRegisterValidateResult:S.d}))(K),n(1443),n(183)),Z=n.n(Y),G=n(388),_=n(25),X=n(1704),$=n.n(X),ee=(n(80),"c3cef7c66a1843f8b3a9e6a1e3160e20");"".concat("z_").concat("c0"),"".concat("SZYUpkoc0tvY").concat("Xh0V2E2UTB").concat("UID096dwe");var te=function(e,t){var n=Date.now(),r=new $.a("SHA-1","TEXT");return r.setHMACKey("d1b964811afb40118a12068ff74a12f4","TEXT"),r.update(e),r.update(ee),r.update("com.zhihu.web"),r.update(String(n)),Object.assign({clientId:ee,grantType:e,timestamp:n,source:"com.zhihu.web",signature:r.getHMAC("HEX")},t)};function ne(e){var t=function(){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(e){return!1}}();return function(){var n,r=Object(c.a)(e);if(t){var a=Object(c.a)(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return Object(i.a)(this,n)}}var re={phoneNoError:null,fullnameError:null,digitsError:null},ae=function(e){Object(o.a)(n,e);var t=ne(n);function n(){var e;Object(r.a)(this,n);for(var a=arguments.length,o=new Array(a),i=0;i<a;i++)o[i]=arguments[i];return(e=t.call.apply(t,[this].concat(o))).state={fullname:e.props.defaultFullname||"",avatarPath:"",phoneNo:"",digits:"",captcha:"",isRegister:null,smsBackUpDisplay:!0,smsType:"text",selectedCountry:{name:"中国",code:"+86"},smsInputInterceptTime:-1,reStartTime:-1,customErrorInputMap:Object.assign({},re),validationResult:{}},e.captchaIsChinese=Math.random()<.5,e.getSocialInfo=function(t){var n=t||e.props,r=n.getSocialInfo,a=n.socialType;a&&r(a).then((function(t){var n=t.payload,r=n.name,a=n.profileImageUrl;e.setState({avatarPath:a.split("/").reverse()[0],fullname:r})}))},e.testPhoneNo=function(){var t=e.state,n=t.selectedCountry.code,r=t.phoneNo;return"+86"!==n||/^\d{11}$/.test(r)},e.handleChange=function(t){return function(n){e.setState(Object(m.a)({},t,n))}},e.handleBackUpDigits=function(){e.setState({smsType:"text"===e.state.smsType?"voice":"text",reStartTime:Date.now()})},e.handleCountDownEndEvent=function(){e.setState({smsBackUpDisplay:!0})},e.parseServerError=function(t){var n=t||e.props,r=n.showNotification,a=n.registerValidateErrors,o=n.loginConfirmError,i=n.registerConfirmError,c=n.sendDigitsError,s=o||{},u=s.username,l=s.password,d=s.digits,h=s.captcha,p=i||{},f=p.username,g=p.password,m=p.digits,b=p.undefined;b&&r(b,"red");var v=c||{},A=v.username,C=v.captcha,E=(a||{}).fullname;return{usernameServerError:u||A,passwordServerError:l||g,digitsServerError:d||m,captchaServerError:h||C,fullnameServerError:(E=void 0===E?{}:E).message||f}},e.runBeforeCheckCaptcha=function(t){var n=e.state.captcha,r=e.props,a=r.captchaNeeded,o=r.checkCaptcha;if(!e.captchaValidated&&a)return n?void o(n,e.captchaIsChinese?"cn":"en").then((function(n){n.payload.success&&(e.captchaValidated=!0,t())})):void e.setState({validationResult:{message:e.captchaIsChinese?"请点击图中倒立的文字":"请输入验证码",needsRefresh:!1,timestamp:Date.now()},smsInputInterceptTime:Date.now()});t()},e.runBeforeResetValidateResult=function(t){e.setState({customErrorInputMap:Object.assign({},re),validationResult:{needsRefresh:!1,timestamp:Date.now()}},(function(){t()}))},e.handleSendDigits=function(){var t=e.state.phoneNo;t&&e.testPhoneNo()?e.runBeforeCheckCaptcha((function(){e.runBeforeCheckCaptcha(e.sendDigits)})):e.setState({customErrorInputMap:Object.assign({},e.state.customErrorInputMap,{phoneNoError:t?"请输入正确的手机号":"请输入手机号"}),smsInputInterceptTime:Date.now()})},e.sendDigits=function(){var t=e.state,n=t.selectedCountry,r=t.phoneNo,a=t.smsType,o=e.props.sendLoginDigits;e.props.validateRegisterForm({phoneNo:"".concat(n.code).concat(r)}).then((function(t){var i=t.payload;e.setState({smsBackUpDisplay:!1,isRegister:!(i.phoneNo&&i.phoneNo.code===y.s)}),o("".concat(n.code).concat(r),a)}))},e.handleSumbit=function(){e.runBeforeCheckCaptcha((function(){e.runBeforeResetValidateResult((function(){var t=e.state,n=t.selectedCountry,r=t.phoneNo,a=t.digits,o=t.isRegister,i=t.fullname,c=t.avatarPath,s=e.props,u=s.validateAndLogin,l=s.validateAndRegister,d=s.nextUrl,h=s.socialType,p=Object(C.c)(d),f=p.utm_source,g=p.utm_medium;o?l(Object.assign({source:"com.zhihu.web",registerType:"phone_digits",phoneNo:"".concat(n.code).concat(r),fullname:i,digits:a,refSource:g,utmSource:f},c&&{avatarPath:c},h&&{socialRegisterType:h})):u(te("digits",{username:"".concat(n.code).concat(r),digits:a,refSource:g,utmSource:f}))}))}))},e}return Object(a.a)(n,[{key:"componentDidMount",value:function(){if(Z.a.get("atoken")){this.getSocialInfo();var e=Z.a.get("accountcallback");if(!this.state.fullname&&e){var t=JSON.parse(decodeURIComponent(e));this.setState({fullname:t.fullname})}}else this.props.onResetRegister()}},{key:"componentWillReceiveProps",value:function(e){var t=this.props,n=t.nextUrl,r=t.socialType,a=t.defaultFullname,o=t.sendDigitsError,i=t.loginConfirmError,c=t.loginConfirmSucceeded,s=t.registerConfirmSucceeded,u=t.captchaValidationMessage,l=e.socialType,d=e.defaultFullname,h=e.sendDigitsError,p=e.loginConfirmError,f=e.loginConfirmSucceeded,g=e.registerConfirmSucceeded,m=e.captchaValidationMessage;if(!r&&l&&this.getSocialInfo(e),a!==d&&this.setState({fullname:d}),!c&&f||!s&&g)n?location.href=n:location.reload();else{if(!i&&p&&p.validateDigitsError&&this.setState({customErrorInputMap:Object.assign({},this.state.customErrorInputMap,{digitsError:p.validateDigitsError}),smsInputInterceptTime:Date.now()}),!o&&h){var b=this.parseServerError(e).captchaServerError;this.setState({validationResult:{message:b,needsRefresh:!0,timestamp:Date.now()},smsInputInterceptTime:Date.now()})}!u&&m&&this.setState({smsInputInterceptTime:Date.now(),validationResult:{message:m,needsRefresh:Boolean(m),timestamp:Date.now()}})}}},{key:"render",value:function(){var e=this.state,t=e.smsInputInterceptTime,n=e.customErrorInputMap,r=e.smsBackUpDisplay,a=e.validationResult,o=e.reStartTime,i=e.isRegister,c=e.phoneNo,u=e.smsType,l=e.fullname,d=this.props.onResetRegister,p=n.phoneNoError,f=n.digitsError,g=this.parseServerError(),m=g.usernameServerError,b=g.fullnameServerError,v=g.digitsServerError;return Object(s.c)(B.b,{className:"Register-content",onSubmit:this.handleSumbit,children:[Object(s.b)("div",{className:"Register-socialHeader",children:Object(s.c)("div",{className:"Register-socialTitle",children:[Object(s.b)(E.c,{onClick:d,children:Object(s.b)(O.a,{size:30})}),"绑定手机号"]})},"header"),Object(s.b)(q.a,{className:h()("Register-socialName",{"Register-hiddenSocialName":!i}),name:"fullname",placeholder:"用户名",value:l,onChange:this.handleChange("fullname"),manualValidateError:b,validations:[]},"fullname"),Object(s.b)(R.a,{type:"register",onChange:this.handleChange("phoneNo"),onSelect:this.handleChange("selectedCountry"),manualValidateError:p||m}),Object(s.b)(I.a,{className:"SignFlow-captchaContainer",type:"register",isChinese:this.captchaIsChinese,canCaptchaShown:Boolean(c),onUpdateInput:this.handleChange("captcha"),validationResult:a}),Object(s.b)(x,{smsType:u,reStartTime:o,onChange:this.handleChange("digits"),countDownEvent:this.handleSendDigits,countDownEndEvent:this.handleCountDownEndEvent,interceptTime:t,manualValidateError:f||v}),Object(s.b)("div",{className:h()("Register-smsBackUp",{"Register-hiddenSmsBackUp":!r}),children:Object(s.c)("span",{onClick:this.handleBackUpDigits,children:["接收","text"===u?"语音":"短信","验证码"]})}),Object(s.b)(E.c,{className:"Register-submitButton",type:"submit",preset:"primary",color:"blue",children:"进入知乎"})]})}}]),n}(u.Component),oe=Object(A.connect)((function(e){var t=e.captcha,n=t.captchaNeeded,r=t.captchaValidationMessage,a=e.register,o=a.registerConfirmError,i=a.registerValidateErrors,c=a.registerConfirmSucceeded,s=e.login,u=s.loginConfirmSucceeded,l=s.validateDigitsError,d=s.loginConfirmError;return{captchaNeeded:n,sendDigitsError:s.sendDigitsError,registerConfirmError:o,registerValidateErrors:i,captchaValidationMessage:r,registerConfirmSucceeded:c,loginConfirmSucceeded:u,validateDigitsError:l,loginConfirmError:d}}),{showNotification:_.h,checkCaptcha:j.b,validateDigits:G.i,sendLoginDigits:G.g,validateAndLogin:G.h,validateAndRegister:S.f,getSocialInfo:S.c,validateRegisterForm:S.i,resetLoginValidateResult:G.f,resetRegisterValidateResult:S.d})(ae),ie=n(34),ce=n(53),se=n(43),ue=n(78),le=function(e){var t=e.onBack,n=e.data,r=n.phoneNo,a=n.code,o=n.targetNo,i=e.onSubmit;return Object(s.c)("div",{className:"SMSIdentify",children:[Object(s.c)("div",{className:"SMSIdentify-back",onClick:t,children:[Object(s.b)(O.a,{fill:"#8590a6",size:36,center:!0}),"返回"]}),Object(s.b)("div",{className:"SMSIdentify-title",children:"身份验证"}),Object(s.c)("div",{className:"SMSIdentify-tip",children:["请用手机号 ",r.slice(0,-8),"****",r.slice(-4)," 发送短信"]}),Object(s.c)("div",{className:"SMSIdentify-content",children:[Object(s.c)("div",{children:["短信内容",Object(s.b)("span",{children:a})]}),Object(s.c)("div",{children:["发送到号码",Object(s.b)("span",{children:o})]})]}),Object(s.b)("div",{className:"SMSIdentify-submitTip",children:"发送完成后,请点击下方按钮进行校验"}),Object(s.b)(E.c,{className:"SMSIdentify-submit",preset:"primary",color:"blue",onClick:i,children:"我已发送"})]})},de=Object(A.connect)(null,{getSMSIdentify:G.d,postSMSIdentify:G.e,showNotification:_.h})((function(e){var t=e.getSMSIdentify,n=e.postSMSIdentify,r=e.showNotification,a=e.onBack,o=e.phoneNo,i=Object(u.useState)({code:"",phoneNo:"",targetNo:""}),c=Object(se.a)(i,2),l=c[0],d=c[1];Object(u.useEffect)((function(){f.a.trackCardShow(null,{id:5935})}),[]),Object(u.useEffect)((function(){o&&t(o).then((function(e){var t=e.payload;t&&d(t)})).catch((function(e){var t=e.payload;t&&d(t)}))}),[t,o]);var h=le;return Object(s.b)(h,{onBack:a,onSubmit:function(){f.a.trackEvent(null,{id:23456}),n(o).then((function(e){var t=e.payload;f.a.trackEvent(null,{id:6729,action:"Click",name:t.success?"通过":"失败"}),t.success?a():r("没有收到短信,请稍后重试","red")}))},data:l})})),he=function(e){var t=e.captcha,n=t.captchaValidationMessage,r=t.captchaNeeded,a=t.captchaValidated,o=t.v2,i=e.login,c=i.loginConfirmSucceeded,s=i.loginConfirmError,u=i.sendDigitsError,l=i.needSMSIdentify,d=i.loginUnregisteredError,h=e.register;return{loginConfirmSucceeded:c,loginConfirmError:s,sendDigitsError:u,loginUnregisteredError:d,captchaValidationMessage:n,captchaNeeded:r,captchaValidated:a,registerValidateErrors:h.registerValidateErrors,registerConfirmError:h.registerConfirmError,registerConfirmSucceeded:h.registerConfirmSucceeded,needSMSIdentify:l,captchaV2:o}},pe=Object(u.createContext)({}),fe=function(e){var t=e.handleChangeType,n=e.setState,r=e.handleChange,a=e.testPhoneNo,o=e.handleSendDigits,i=e.continueActionRef,c=e.captchaV2Ref,u=e.captchaNeeded,l=e.captchaV2;return Object(s.b)(pe.Provider,{value:{handleChangeType:t,handleChange:r,testPhoneNo:a,handleSendDigits:o,setState:n,continueActionRef:i,captchaV2Ref:c,captchaNeeded:u,captchaV2:l},children:e.children})},ge=pe,me=n(375),be=n(181),ve=n(131),Ae=Object.assign;var Ce=function(e){return l.a.createElement(ve.a,Ae({width:"116",height:"116",viewBox:"0 0 116 116"},e),l.a.createElement("path",{d:"M58 106c-26.51 0-48-21.49-48-48s21.49-48 48-48 48 21.49 48 48-21.49 48-48 48zm0-5c23.748 0 43-19.252 43-43S81.748 15 58 15 15 34.252 15 58s19.252 43 43 43zm-7.495-32.502L80.113 38.89a3.017 3.017 0 014.262-.017c1.184 1.176 1.17 3.075-.015 4.26l-31.71 31.71c-1.183 1.182-3.096 1.194-4.27.02l-12.52-12.52a2.997 2.997 0 01-.008-4.24 2.996 2.996 0 014.242.008L50.507 68.5z"}))},Ee=Object.assign;var Oe=function(e){return l.a.createElement(ve.a,Ee({width:"116",height:"116",viewBox:"0 0 116 116"},e),l.a.createElement("path",{d:"M58 106c-26.51 0-48-21.49-48-48s21.49-48 48-48 48 21.49 48 48-21.49 48-48 48zm0-5c23.748 0 43-19.252 43-43S81.748 15 58 15 15 34.252 15 58s19.252 43 43 43zm-4-19c0-2.21 1.795-4 4-4 2.21 0 4 1.795 4 4 0 2.21-1.795 4-4 4-2.21 0-4-1.795-4-4zm1-48.993A3.006 3.006 0 0158 30c1.657 0 3 1.334 3 3.007v36.986A3.006 3.006 0 0158 73c-1.657 0-3-1.334-3-3.007V33.007z",fillRule:"evenodd"}))},we=Object.assign;var ye=function(e){return l.a.createElement(ve.a,we({width:"52",height:"52",fill:"none"},e),l.a.createElement("mask",{id:"id-320414155-a",width:"52",height:"52",x:"0",y:"0",maskUnits:"userSpaceOnUse"},l.a.createElement("path",{fill:"#fff",d:"M0 0l52 52V0H0z"})),l.a.createElement("g",{mask:"url(#id-320414155-a)"},l.a.createElement("path",{fill:"#06F",d:"M0 0l52 52V0H0z"}),l.a.createElement("path",{fill:"#fff",d:"M22.125 4h13.75A4.125 4.125 0 0140 8.125v27.75A4.125 4.125 0 0135.875 40h-13.75A4.125 4.125 0 0118 35.875V8.125A4.125 4.125 0 0122.125 4zm6.938 34.222c1.139 0 2.062-.945 2.062-2.11 0-1.167-.923-2.112-2.063-2.112-1.139 0-2.062.945-2.062 2.111 0 1.166.923 2.111 2.063 2.111zM21 8.333v24h16v-24H21z",fillRule:"evenodd",clipRule:"evenodd"}),l.a.createElement("path",{fill:"#fff",d:"M46.996 15.482L39 19.064l-7.996-3.582A1.6 1.6 0 0132.6 14h12.8a1.6 1.6 0 011.596 1.482zM47 16.646V24.4a1.6 1.6 0 01-1.6 1.6H32.6a1.6 1.6 0 01-1.6-1.6v-7.754l8 3.584 8-3.584z",fillRule:"evenodd",clipRule:"evenodd"}),l.a.createElement("path",{fill:"#06F",d:"M31 15.483v1.17l8 3.577 8-3.577v-1.17l-8 3.581-8-3.581z"})))};function Se(e){var t=function(){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(e){return!1}}();return function(){var n,r=Object(c.a)(e);if(t){var a=Object(c.a)(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return Object(i.a)(this,n)}}var je={1:"a",2:"b",3:"c"};var Be=function(e){Object(o.a)(n,e);var t=Se(n);function n(e){var a;return Object(r.a)(this,n),(a=t.call(this,e)).cancelCheckQrcodeScanStatus=function(){a.timer&&window.clearInterval(a.timer)},a.checkQrcodeScanStatus=function(e){var t=a.props.checkQrcodeScanStatus;a.timer=setInterval((function(){t({token:e})}),2e3)},a.handleChangestatus=function(e,t){a.setState({status:e}),"init"!==e||t||a.getToken()},a.handleChangeLoginType=function(){var e=a.props.onChangeType;a.cancelCheckQrcodeScanStatus(),e()},a.initTips=function(){var e=a.props,t=e.guideType,n=e.isInSignPage,r=a.state.enableSwitchGuide,o=!n||!["2","3"].includes(t),i=r?7300:1e3;r&&(a.showSwitchGuideTimeout=setTimeout((function(){a.setState({showSwitchGuide:!0}),a.hideSwitchGuideTimeout=setTimeout((function(){a.setState({showSwitchGuide:!1})}),3e3)}),1e3)),o&&(a.showTipsTimeout=setTimeout((function(){a.setState({showTips:!0}),a.hideTipsTimeout=setTimeout((function(){a.setState({showTips:!1})}),5e3)}),i))},a.state={type:"password",status:"init",errorMessage:"",showTips:!1,showSwitchGuide:!1,enableSwitchGuide:a.props.isInSignPage&&["1","2","3"].includes(a.props.guideType),guideTypeSymbol:je[a.props.guideType]||"d"},a}return Object(a.a)(n,[{key:"componentDidMount",value:function(){var e=this.props.isInSignPage,t=this.state.guideTypeSymbol;e&&f.a.trackCardShow(null,{id:9214,name:t}),this.getToken().then(this.initTips)}},{key:"componentWillReceiveProps",value:function(e){var t=this.props,n=t.qrcodeLoginToken,r=t.qrcodeLoginScanStatus,a=e.qrcodeLoginToken,o=e.qrcodeLoginScanStatus,i=e.qrcodeLoginError,c=e.qrcodeLoginReturnNewToken;""!==a&&n!==a?(this.cancelCheckQrcodeScanStatus(),"init"!==this.state.status&&this.handleChangestatus("init",!0),this.checkQrcodeScanStatus(a)):r!==o?2!==o&&this.handleChangestatus(1===o?"success":"init",c||1===r&&0===o):i&&i.code&&(this.cancelCheckQrcodeScanStatus(),40321===i.code&&this.setState({status:"error",errorMessage:i.message}))}},{key:"componentWillUnmount",value:function(){this.cancelCheckQrcodeScanStatus(),clearTimeout(this.showTipsTimeout),clearTimeout(this.hideTipsTimeout),clearTimeout(this.showSwitchGuideTimeout),clearTimeout(this.hideSwitchGuideTimeout)}},{key:"getToken",value:function(){return this.props.getQrcodeLoginToken()}},{key:"render",value:function(){var e=this,t=this.props,n=t.className,r=t.qrcodeLoginToken,a=t.guideType,o=t.isInSignPage,i=this.state,c=i.status,l=i.errorMessage,d=i.showTips,f=i.showSwitchGuide,g=i.enableSwitchGuide,m=i.guideTypeSymbol,b=null;return b="init"===c?Object(s.c)("div",{className:"Qrcode-content",children:[Object(s.b)("div",{className:h()("Qrcode-img",{"Qrcode-img--hover":d}),children:r?Object(s.c)(s.a,{children:[Object(s.b)("img",{className:"Qrcode-qrcode",width:"150",height:"150",src:"//".concat(H.a.wwwHost,"/api/v3/account/api/login/qrcode/").concat(r,"/image").concat(o?"?utm_campaign=internal&utm_medium=qr&utm_source=login&utm_term=force_launch&utm_content=qrscan".concat(m):""),alt:"二维码"}),Object(s.b)("img",{className:"Qrcode-tips",src:"https://pic1.zhimg.com/80/v2-3ca9dfefdc7ab9034c123abd69a57ae0.png"})]}):Object(s.b)(me.a,{count:3})}),"3"===a?Object(s.c)("p",{children:["使用"," ",Object(s.b)("a",{href:"https://www.zhihu.com/app/",target:"_blank",rel:"noopener noreferrer",children:"知乎 App"})," ","| 微信 扫一扫登录"]}):Object(s.c)(s.a,{children:[Object(s.c)("p",{children:["打开",Object(s.c)("a",{href:"https://www.zhihu.com/app/",target:"_blank",rel:"noopener noreferrer",children:[" ","知乎 App"]})]}),Object(s.b)("p",{children:"在「我的」页面顶部打开扫一扫"}),Object(s.b)("p",{children:"如扫码异常请下载最新版客户端"})]})]}):"success"===c?Object(s.c)(u.Fragment,{children:[Object(s.c)("div",{className:"Qrcode-content",children:[Object(s.b)("div",{className:"Qrcode-scanResultStaus",children:Object(s.b)(Ce,{fill:"#2db370",size:58})}),Object(s.b)("p",{className:"Qrcode-scanResultTips",children:"扫描成功"}),Object(s.b)("p",{children:"请在手机上「确认登录」"})]}),Object(s.b)("div",{className:"Qrcode-cutButton",children:Object(s.b)("span",{onClick:function(){return e.handleChangestatus("init")},children:"返回二维码"})})]}):Object(s.c)("div",{className:"Qrcode-content Qrcode-failure",children:[Object(s.b)("div",{children:Object(s.b)(Oe,{fill:"#ffaa00",size:58})}),Object(s.b)("p",{children:l})]}),Object(s.c)("div",{className:h()("Qrcode-container",n),children:[g&&Object(s.b)(p.Box,{color:"GBL01A",fontSize:"14px",height:"40px",width:"260px",mt:"-24px",mx:"auto",mb:"15px",css:function(e){return{textAlign:"center",lineHeight:"40px",backgroundColor:e.colorMod(e.colors.GBL01A).alpha(.1),borderRadius:"20px",borderTopRightRadius:"0",transformOrigin:"top right",transform:"scale(".concat(f?"1":"0",")"),opacity:f?"1":"0",transition:"transform 300ms cubic-bezier(0.4, 0, 0.2, 1), opacity 300ms linear"}},children:"点击使用手机号、帐号密码登录"}),Object(s.b)("div",{className:"Qrcode-title",children:"扫码登录"}),b,Object(s.b)(ye,{onClick:this.handleChangeLoginType})]})}}]),n}(u.Component);Be.propTypes={type:T.a.string,isShowPasswordLogin:T.a.bool,onChangeType:T.a.func,getQrcodeLoginToken:T.a.func,checkQrcodeScanStatus:T.a.func,isInSignPage:T.a.bool},Be.defaultProps={qrcodeLoginToken:"",qrcodeLoginScanStatus:""};var Ie=Object(v.compose)(ie.withRouter,Object(A.connect)((function(e){var t=e.login;return{qrcodeLoginToken:t.qrcodeLoginToken,qrcodeLoginTokenExpires:t.qrcodeLoginTokenExpires,qrcodeLoginScanStatus:t.qrcodeLoginScanStatus,qrcodeLoginError:t.qrcodeLoginError,qrcodeLoginReturnNewToken:t.qrcodeLoginReturnNewToken,edition:Object(be.b)(e),guideType:Object(be.a)(e,"web_login")}}),{getQrcodeLoginToken:G.c,checkQrcodeScanStatus:G.a}))(Be),Re=Object.assign;var ke=function(e){return l.a.createElement(ve.a,Re({width:"52",height:"52",fill:"none",xmlnsXlink:"http://www.w3.org/1999/xlink"},e),l.a.createElement("mask",{id:"id-3757926926-a",width:"52",height:"52",x:"0",y:"0",maskUnits:"userSpaceOnUse"},l.a.createElement("path",{fill:"#fff",d:"M0 0l52 52V0H0z"})),l.a.createElement("g",{mask:"url(#id-3757926926-a)"},l.a.createElement("path",{fill:"#06F",d:"M0 0h48a4 4 0 014 4v48L0 0z"}),l.a.createElement("path",{fill:"url(#pattern0)",d:"M0 0h52v52H0z"})),l.a.createElement("defs",null,l.a.createElement("pattern",{id:"pattern0",width:"1",height:"1",patternContentUnits:"objectBoundingBox"},l.a.createElement("use",{transform:"scale(.00216)",xlinkHref:"#image0"})),l.a.createElement("image",{id:"image0",width:"463",height:"463",xlinkHref:"data:image/png;base64,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"})))},Qe=function(e){var t=e.type,n=Object(u.useContext)(ge).handleChangeType;return Object(s.c)("div",{className:"SignFlow-tabs",children:[Object(s.b)("div",{className:h()("SignFlow-tab",{"SignFlow-tab--active":"digits"===t}),onClick:function(){"digits"!==t&&n("digits")},children:"免密码登录"}),Object(s.b)("div",{className:h()("SignFlow-tab",{"SignFlow-tab--active":"password"===t}),onClick:function(){"password"!==t&&n("password")},children:"密码登录"}),Object(s.b)("div",{className:"SignFlow-qrcodeTab",onClick:function(){n("qrcode")},children:Object(s.b)(ke,{})})]})},Ne=function(e){var t=e.type,n=e.isOversea,r=e.supportedCountriesShown,a=e.selectedCountry,o=e.username,i=e.usernameServerError,c=e.customErrorInputMap,l=(c=void 0===c?{}:c).username,d=Object(u.useContext)(ge).handleChange;return Object(s.b)(R.a,{type:"digits"===t||r?"digits":"password",supportedCountriesShown:"digits"===t||n,onChange:function(e){return d("username",e)},onSelect:function(e){return d("selectedCountry",e)},defaultSelectedCountry:a,manualValidateError:i||l,defaultValue:o})},Te=function(e){var t=e.handleRegister,n=Object(u.useContext)(ge),r=Object(A.useDispatch)(),a=n.fullnameError,o=n.password,i=n.passwordServerError,c=n.submitDisabled,l=n.setState,d=Object(ue.c)((function(e){return function(t){return l(Object(m.a)({},e,t))}}));return Object(s.c)(B.b,{className:"SignFlow-setting",onSubmit:t,children:[Object(s.c)("div",{className:"SignFlow-back",onClick:function(){return r(G.f.apply(void 0,arguments))},children:[Object(s.b)(O.a,{center:!0,size:28,fill:"#8590a6"}),"返回"]}),Object(s.b)("div",{className:"SignFlow-settingTitle",children:"设置用户名和密码"}),Object(s.b)(q.a,{name:"fullname",placeholder:"用户名",onChange:d("fullname"),manualValidateError:a}),Object(s.b)(z.a,{onChange:d("password"),defaultValue:o,placeholderPrefix:"8 位数字或字母",defaultType:"text",manualValidateError:i}),Object(s.b)(E.c,{type:"submit",className:"SignFlow-submitButton",preset:"primary",color:"blue",disabled:c,children:"进入知乎"})]},"setting")},Pe=function(e){var t=e.type,n=e.smsInputInterceptTime,r=e.digitsServerError,a=e.smsType,o=e.reStartTime,i=e.passwordServerError,c=e.password,l=Object(u.useContext)(ge),d=l.handleSendDigits,h=l.setState,p=Object(ue.c)((function(){h({smsBackUpDisplay:!0})})),f=Object(ue.c)((function(e){return h({digits:e})})),g=Object(ue.c)((function(e){return h({password:e})}));return Object(s.c)(s.a,{children:["digits"===t&&Object(s.b)(s.a,{children:Object(s.b)(x,{countDownEvent:d,countDownEndEvent:p,interceptTime:n,manualValidateError:r,smsType:a,reStartTime:o,onChange:f})}),"password"===t&&Object(s.b)(s.a,{children:Object(s.b)(z.a,{onChange:g,manualValidateError:i,defaultValue:c})})]})},Me=function(e){var t=e.smsBackUpName,n=e.smsBackUpDisplay,r=e.isOverSea,a=e.smsType,o=e.type,i=Object(u.useContext)(ge),c=i.handleChangeType,l=i.setState,d=Object(ue.c)((function(){f.a.trackEvent(event.currentTarget,{id:4947}),f.a.trackEvent(void 0,{action:"Click",element:"Button",element_name:"ResetPassword"}),window.open("".concat(y.E,"/account/password_reset"),"_blank")})),h=Object(ue.c)((function(e){f.a.trackEvent(e.currentTarget,{id:4941}),l({smsType:"text"===a?"voice":"text",smsBackUpName:"text"===a?"短信":"语音",reStartTime:Date.now()})}));return Object(s.c)("div",{className:"Login-options",children:[Object(s.b)(E.c,{preset:"plain",className:"Login-switchType",onClick:function(){"digits"!==o&&c(r?"email":"oversea")},children:"digits"!==o&&(r?"邮箱帐号登录":"海外手机号登录")}),Object(s.b)(E.c,{preset:"plain",className:"Login-cannotLogin",onClick:"digits"===o?h:d,children:"digits"===o?n&&"接收".concat(t,"验证码"):"忘记密码?"})]})},De=function(e){var t=e.type,n=e.submitDisabled;return Object(s.c)(s.a,{children:[Object(s.c)(E.c,{type:"submit",className:"SignFlow-submitButton",preset:"primary",color:"blue",disabled:n,children:["password"===t?"":"注册/","登录"]}),Object(s.b)("div",{className:"SignContainer-tip",children:Object(s.b)("div",{children:Object(s.c)("div",{children:["未注册手机验证后自动登录,注册即代表同意",Object(s.b)("a",{href:"https://www.zhihu.com/term/zhihu-terms",children:"《知乎协议》"}),Object(s.b)("a",{href:"https://www.zhihu.com/term/privacy",children:"《隐私保护指引》"})]})})})]})},Ve=n(1102),Ue=n(44),Fe=n.n(Ue),xe=n(122),ze=n(893),qe=n(1377);function Le(e,t){var n,r=e.onReady,a=e.onVerify,o=e.onClose,i=Object(A.useSelector)((function(e){return e.captcha})).v2,c=Object(u.useRef)(null),l=Object(ze.a)(),d=null==i||null===(n=i.script)||void 0===n?void 0:n[1],h=Object(u.useRef)(null),p=Object(u.useRef)(),f=Object(u.useRef)(),g=Object(u.useState)("init"),m=Object(se.a)(g,2),b=m[0],v=m[1];Object(u.useEffect)((function(){if(null==i?void 0:i.script){var e=d?Fe.a.parse(null==d?void 0:d.split("?")[1]).captchaId:"0";return h.current&&h.current!==e?(l.confirm("页面将自动刷新,请在刷新后重试",{title:"验证码已过期",ok:"刷新"}).then((function(){location.reload()})).catch((function(){c.current&&clearTimeout(c.current)})),c.current=setTimeout((function(){location.reload()}),5e3)):h.current=e,function(){c.current&&clearTimeout(c.current)}}}),[i,d,l]),Object(u.useImperativeHandle)(t,(function(){return{get required(){return Boolean(i)},get ready(){return Boolean(f.current)},get type(){var e;return(null===(e=f.current)||void 0===e?void 0:e.type)||"vendor"},show:function(){var e;null===(e=f.current)||void 0===e||e.show()},close:function(){var e;return null===(e=f.current)||void 0===e?void 0:e.close()},refresh:function(){var e;return null===(e=f.current)||void 0===e?void 0:e.refresh()}}}));var C=Object(ue.c)((function(e){var t;if(null===(t=e.script)||void 0===t?void 0:t.length){v("loading");var n=e.script.map((function(e){return function(){return Object(xe.loadScript)(e)}}));Object(qe.b)(n).then((function(){return v("mount"),window.ZS_CAP.init({element:p.current,callback:function(e){null==a||a(e)},onClose:o})})).then((function(e){f.current=e,v("ready"),null==r||r()})).catch((function(e){var t;return null===(t=window.Raven)||void 0===t?void 0:t.captureException(e)}))}else v("bypass")}));return Object(u.useEffect)((function(){i&&"init"===b&&C(i)}),[i,b,C]),i?Object(s.b)("div",{ref:p}):null}var He=l.a.memo(l.a.forwardRef(Le)),Je=function(e){var t=e.type,n=e.captchaV2,r=Object(A.useDispatch)();return Object(ue.c)((function(){"qrcode"!==t&&(n&&r(Object(j.h)()),r(Object(j.d)("captcha_sign_in")))}))},We=function(e){var t=e.type,n=e.captchaV2Ref,r=e.onVerify,a=e.lastSubmittedTimestamp,o=Object(A.useDispatch)(),i=Object(u.useContext)(ge),c=i.continueActionRef,l=i.captchaV2,d=Je({type:t,captchaV2:l});Object(u.useEffect)((function(){d()}),[d]);return Object(u.useEffect)((function(){var e;a&&(-1!==a&&(console.log("captcha refresh!"),null===(e=n.current)||void 0===e||e.refresh()))}),[a,n]),Object(s.b)(He,{ref:n,onVerify:function(e){if(e instanceof Error)return o(Object(_.h)(e.message||"验证失败","red"));if(!(null==e?void 0:e.type)||!(null==e?void 0:e.result))return o(Object(_.h)("错误的验证方式","red"));var t=e.result;o(Object(j.g)(JSON.stringify(t),!0,"captcha_sign_in")).then((function(e){var t,n=e.payload;(null==n?void 0:n.success)&&(null==r||r({result:"success"}),c&&(null===(t=c.current)||void 0===t||t.call(c)))})).catch((function(e){if(null==r||r({result:"fail"}),120001!==e.payload.code)throw o(Object(_.h)(Object(Ve.b)(e),"red")),e;o(Object(_.h)("页面已过期,请刷新页面重试","red"))})).finally((function(){c&&(c.current=null)}))},onClose:function(){var e;a||(console.log("captcha refresh!"),null===(e=n.current)||void 0===e||e.refresh())}})},Ke=n(1378),Ye=function(e){var t=e.props,n=e.setState,r=e.state,a=t.onChangeType,o=t.type,i=t.captchaV2,c=Object(A.useDispatch)(),s=r.username,u=Je({props:t});return Object(ue.c)((function(e){c(Object(G.f)()),a(e),"qrcode"!==e&&"password"!==e||f.a.trackEvent(null,{action:"Click",name:"qrcode"===e?"使用二维码登录":"使用密码登录"},{account:{type:"Zhihu"}}),"qrcode"!==e&&(n({username:"password"===o&&Object(Ke.a)(s)?"":s,smsBackUpDisplay:!0}),i||u())}))},Ze=function(e){var t=e.loginConfirmError,n=e.sendDigitsError,r=e.registerValidateErrors,a=Object(A.useDispatch)(),o=t||{},i=o.username,c=o.password,s=o.digits,u=o.captcha,l=o.undefined,d=o.validateDigitsError,h=r||{},p=h.fullname,f=(p=void 0===p?{}:p).message,g=h.password,m=(g=void 0===g?{}:g).message,b=n||{},v=b.username,C=b.undefined;return(l||C)&&a(Object(_.h)(l||C,"red")),{usernameServerError:v||i,passwordServerError:c||m,digitsServerError:s||d,captchaServerError:u,fullnameError:f}},Ge=function(e){var t=e.setState,n=Object(A.useDispatch)();return Object(ue.c)((function(e,r){n(Object(G.f)()),t(Object(m.a)({},e,r))}))},_e=function(e){var t=e.state,n=t.selectedCountry.code,r=t.username;return Object(ue.c)((function(){return"+86"!==n||/^\d{11}$/.test(r)}))};function Xe(e,t){if(!e)return{};var n,r=e=e.trim(),a=Object(Ke.a)(e);if(!a){var o={hasCode:(n=e).startsWith("+")||n.startsWith("00"),parsedPhoneNo:n.startsWith("00")?"+".concat(n.slice(2)):n};r=o.hasCode?o.parsedPhoneNo:"".concat(t).concat(e)}return{value:r,isEmail:a}}var $e=function(e){var t=e.props,n=e.setState,r=e.runBeforeResetValidateResult,a=e.runBeforeCheckCaptcha,o=e.testPhoneNo,i=e.continueActionRef,c=e.selectedCountry,s=e.captcha,u=e.customErrorInputMap,l=e.username,d=t.type,h=t.isOverSea,p=t.nextUrl,g=Object(A.useDispatch)();return Object(ue.c)((function(e){f.a.trackEvent(void 0,{id:4948}),r((function(){if("digits"!==d&&!h||o()){var t=function(){var t=Object(C.c)(p),r=t.utm_source,a=t.utm_medium,o=Object.assign({},e,{username:Xe(e.username,c.code).value,captcha:s,utmSource:r,refSource:a});n({lastSubmittedTimestamp:Date.now()}),g(Object(G.h)(te(d,o)))};i.current=t,a().then((function(e){e&&t()})).finally((function(){return n({submitDisabled:!1})}))}else n({customErrorInputMap:Object.assign({},u,{username:l?"请输入正确的手机号":"请输入手机号"}),smsInputInterceptTime:Date.now()})}))}))},et=function(e){var t=e.customErrorInputMap,n=e.smsType,r=e.selectedCountry.code,a=e.username,o=e.testPhoneNo,i=e.captchaV2Ref,c=e.runBeforeResetValidateResult,s=e.setState,u=e.captchaNeeded,l=e.continueActionRef,d=Object(A.useDispatch)();return Object(ue.c)((function(e,h){return c((function(){var e;if(o()){var c=Xe(a,r).value,p=function(){d(Object(G.j)({username:c,smsType:n,type:"login"})),s({smsBackUpDisplay:!1})};if(!a||u){if(u&&(null===(e=i.current)||void 0===e?void 0:e.required)){i.current.show();return l.current=function(){p(),h()},!1}s({customErrorInputMap:Object.assign({},t,{username:a?"":"请输入手机号"})})}else p()}else s({customErrorInputMap:Object.assign({},t,{username:a?"请输入正确的手机号":"请输入手机号"}),smsInputInterceptTime:Date.now()})}),!u)}))},tt={username:null,password:null,captcha:null,digits:null},nt=function(e){var t=e.setState,n=Object(A.useDispatch)();return Object(ue.c)((function(e,r){return n(Object(G.f)()),t({customErrorInputMap:Object.assign({},tt),validationResult:{needsRefresh:!1,timestamp:Date.now()}},e),r}))},rt=function(e){var t=e.props,n=e.captchaV2Ref,r=t.captchaValidated,a=t.captchaNeeded;return Object(ue.c)((function(){var e;if(!r&&a&&(null===(e=n.current)||void 0===e?void 0:e.required))return n.current.show(),Promise.resolve(!1);return Promise.resolve(!0)}))},at=n(446),ot=function(e){var t=e.registerConfirmSucceeded,n=e.loginConfirmSucceeded,r=e.sendDigitsError,a=e.nextUrl,o=e.username,i=e.isInSignPage,c=e.loginConfirmError,s=e.captchaValidationMessage,l=e.setState,d=e.loginUnregisteredError,h=e.loginBindWechatError,p=e.type,f=Object(A.useDispatch)();Object(u.useEffect)((function(){!c||d||h||(f(Object(j.i)(p)),f(Object(j.d)()))}),[c,d,h,l,f,p]),Object(u.useEffect)((function(){if(s){var e=s?{smsInputInterceptTime:Date.now()}:{};l(Object.assign({captchaValidated:!1,captchaNeeded:!0},e))}}),[s,l]),Object(u.useEffect)((function(){(n||t)&&(Object(at.b)(o),a?location.href=a:i?location.href="/":location.reload())}),[n,t]),Object(u.useEffect)((function(){if(r||!1===n){var e=r?{smsInputInterceptTime:Date.now()}:{};l(Object.assign({},e,{captchaValidated:!1,captchaNeeded:!0}))}}),[r,n]),Object(u.useEffect)((function(){(s||r&&null===c)&&l({smsBackUpDisplay:!0})}),[s,r])},it="UPDATE_STATE",ct=function(e){return{smsType:"text",smsBackUpName:"语音",smsBackUpDisplay:!0,reStartTime:-1,supportedCountriesShown:!1,selectedCountry:e.selectedCountry,username:e.username,password:e.password,fullname:"",customErrorInputMap:Object.assign({},tt),submitDisabled:!1,lastSubmittedTimestamp:-1}},st=function(e,t){var n=t.type,r=t.callback;if(n===it){var a=t.payload;return r&&r(e),Object.assign({},e,a)}return e},ut=function(e){var t=e.props,n=e.captchaV2Ref,r=e.continueActionRef,a=e.setState,o=e.selectedCountry.code,i=e.username,c=e.fullname,s=e.digits,u=e.password,l=Object(A.useDispatch)(),d=rt({props:t,captchaV2Ref:n});return Object(ue.c)((function(){var e=function(){l(Object(S.f)({source:"com.zhihu.web",registerType:"phone_digits",phoneNo:"".concat(o).concat(i),fullname:c,digits:s,password:u}))};r&&(r.current=e),a({submitDisabled:!0}),d().then((function(t){return t&&e()})).finally((function(){return a({submitDisabled:!1})}))}))},lt=function(e){var t=e.isInSignPage,n=e.type,r=e.isOversea,a=e.needSMSIdentify,o=e.captchaV2,i=e.registerConfirmSucceeded,c=e.loginConfirmSucceeded,l=e.nextUrl,d=e.captchaNeeded,h=e.loginUnregisteredError,p=e.loginConfirmError,f=e.captchaValidationMessage,g=Object(A.useDispatch)().dispatch,m=Object(u.useReducer)(st,e,ct),b=Object(se.a)(m,2),v=b[0],C=b[1],E=v.selectedCountry,O=v.username,w=v.supportedCountriesShown,y=v.customErrorInputMap,S=v.smsInputInterceptTime,j=v.smsType,I=v.reStartTime,R=v.password,k=v.smsBackUpDisplay,Q=v.smsBackUpName,N=v.submitDisabled,T=v.captcha,P=v.fullname,M=v.digits,D=v.lastSubmittedTimestamp,V=Object(u.useRef)(null),U=Object(u.useRef)(null),F=Object(u.useRef)(null),x=Object(ue.c)((function(e,t){return C({type:it,payload:e,callback:t})})),z=Ye({props:e,state:v,setState:x,rootRef:F}),q=Ze(e),L=q.usernameServerError,H=q.digitsServerError,J=q.passwordServerError,W=Ge({setState:x}),K=_e({state:v}),Y=nt({setState:x}),Z=et({customErrorInputMap:y,smsType:j,selectedCountry:E,username:O,runBeforeResetValidateResult:Y,testPhoneNo:K,setState:x,captchaNeeded:d,captchaV2Ref:U,continueActionRef:V}),_=rt({props:e,captchaV2Ref:U}),X=$e({props:e,selectedCountry:E,captcha:T,setState:x,runBeforeResetValidateResult:Y,runBeforeCheckCaptcha:_,testPhoneNo:K,continueActionRef:V,customErrorInputMap:y,username:O});ot({registerConfirmSucceeded:i,loginConfirmSucceeded:c,nextUrl:l,username:O,isInSignPage:t,loginConfirmError:p,captchaValidationMessage:f,setState:x,loginUnregisteredError:h});var $=ut({props:e,captchaV2Ref:U,continueActionRef:V,setState:x,selectedCountry:E,username:O,fullname:P,digits:M,password:R}),ee=null;if("qrcode"===n)ee=Object(s.b)(Ie,{ref:F,isInSignPage:t,className:"SignInQrcode",onChangeType:function(){return z("password")}});else{if(a)return Object(s.b)(de,{ref:F,onBack:function(){return g(Object(G.f)())},phoneNo:"".concat(E.code).concat(O)});ee=h&&"digits"==n?Object(s.b)(Te,{handleRegister:$,setState:x}):Object(s.c)(B.b,{className:"SignFlow Login-content",onSubmit:X,children:[Object(s.b)(Qe,{type:n}),Object(s.b)(Ne,{type:n,isOversea:r,supportedCountriesShown:w,selectedCountry:E,username:O,usernameServerError:L,customErrorInputMap:y}),Object(s.b)(Pe,{type:n,smsInputInterceptTime:S,digitsServerError:H,smsType:j,reStartTime:I,passwordServerError:J,password:R}),Object(s.b)(Me,{type:n,isOverSea:r,smsBackUpName:Q,smsBackUpDisplay:k,smsType:j}),Object(s.b)(We,{type:n,captchaV2Ref:U,lastSubmittedTimestamp:D}),Object(s.b)(De,{submitDisabled:N,type:n})]})}return Object(s.b)(fe,{handleChangeType:z,setState:x,dispatch:C,handleChange:W,testPhoneNo:K,handleSendDigits:Z,continueActionRef:V,captchaNeeded:d,captchaV2:o,children:ee})};lt.propTypes={validateAndLogin:T.a.func,resetLoginValidateResult:T.a.func,validateSendDigits:T.a.func,loginConfirmSucceeded:T.a.bool,loginConfirmError:T.a.object,sendDigitsError:T.a.object,captchaValidationMessage:T.a.string,captchaNeeded:T.a.bool,selectedCountry:T.a.object,username:T.a.string,password:T.a.string,type:T.a.oneOf(["password","digits","qrcode"]),onChangeType:T.a.func,isInSignPage:T.a.bool},lt.defaultProps={selectedCountry:{name:"中国",code:"+86"},username:"",password:""};var dt=Object(A.connect)(he)(lt),ht=n(213);function pt(e){var t=function(){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(e){return!1}}();return function(){var n,r=Object(c.a)(e);if(t){var a=Object(c.a)(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return Object(i.a)(this,n)}}var ft=function(e){Object(o.a)(n,e);var t=pt(n);function n(){var e;Object(r.a)(this,n);for(var a=arguments.length,o=new Array(a),i=0;i<a;i++)o[i]=arguments[i];return(e=t.call.apply(t,[this].concat(o))).state={type:e.props.showQrcodeFirst?"qrcode":"digits",isOversea:!1,passwordType:"email"},e.handleSwitchLoginType=function(t){"email"!==t&&"oversea"!==t?e.setState({type:t}):e.setState({type:"password",isOversea:"oversea"===t,passwordType:t})},e}return Object(a.a)(n,[{key:"renderNotification",value:function(){var e=this.props,t=e.notification,n=e.account,r=n.isAppealed,a=n.spamLevel,o=r||a?y.K:y.J,i=null;return i=6===a?Object.assign({},t,{theme:"red"}):t,Object(s.b)(ht.a,{notification:i.global,delay:o,className:"AppHeader-notification"})}},{key:"render",value:function(){var e=this.props,t=e.nextUrl,n=e.isInSignPage,r=this.state,a=r.type,o=r.isOversea;return Object(s.c)(s.a,{children:[Object(s.b)(dt,{type:a,isInSignPage:n,isOversea:o,onChangeType:this.handleSwitchLoginType,nextUrl:t}),this.renderNotification()]})}}]),n}(u.Component);ft.propTypes={nextUrl:T.a.string,isInSignPage:T.a.bool};var gt=Object(v.compose)(ie.withRouter,Object(A.connect)((function(e,t){return{showQrcodeFirst:t.showQrcodeFirst||t.isInSignPage&&["1","2","3"].includes(Object(ce.a)(e,"web_login")),notification:e.notification,account:e.account}})))(ft),mt=n(1330),bt=n(1705),vt=n(1331),At=n(367),Ct={sina:"Weibo",qq:"QQ",wechat:"Wechat"};function Et(e){var t=function(){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(e){return!1}}();return function(){var n,r=Object(c.a)(e);if(t){var a=Object(c.a)(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return Object(i.a)(this,n)}}var Ot="/oauth/account_callback",wt={qqconn:"/oauth/redirect/login/qqconn?next=",sina:"/oauth/redirect/login/sina?next=",wechat:"/oauth/redirect/login/wechat?next="};function yt(e){return"sina"!==e||!/WindowsWechat/.test(navigator.userAgent)}var St=function(e){Object(o.a)(n,e);var t=Et(n);function n(){var e;Object(r.a)(this,n);for(var a=arguments.length,o=new Array(a),i=0;i<a;i++)o[i]=arguments[i];return(e=t.call.apply(t,[this].concat(o))).accountCallback=function(t){var n=e.props,r=n.onRegister,a=n.nextUrl,o=t.login,i=t.type,c=t.fullname;o?(Object(at.b)(e.clickedServiceName),e.handleLogSocialLoginSuccess(),a?location.href=a:location.reload()):r({bySocial:!0,socialType:i,fullname:c})},e.handleBuildSocialAuthLink=function(t){e.clickedServiceName=t,e.handleLogSingleSocialButtonClick(t);var n=wt[t],r=Object(C.c)(),a=r.utm_source,o=r.utm_medium;yt(t)?(e.ready(),window.open("https://www.zhihu.com".concat(n).concat(Ot).concat(a?"&utm_source=".concat(a):"","&ref_source=").concat(o),"_blank","top=200,left=400,width=600,height=550,directories=no,menubar=no,toolbar=no")):location.href="https://www.zhihu.com".concat(n).concat(Ot,"&from=").concat(encodeURIComponent(e.parseNextInfoFromUrl()))},e.handleEntranceButtonClick=function(t){e.props.onEntranceButtonClick&&e.props.onEntranceButtonClick(t),e.handleLogSocialLogin(),e.setState((function(e){return{socialButtonExpanded:!e.socialButtonExpanded}}))},e.parseNextInfoFromUrl=function(){var t=e.props.router.location.query.next,n="/";if(t)try{n=decodeURIComponent(t)}catch(e){n=unescape(t)}return n},e}return Object(a.a)(n,[{key:"componentDidMount",value:function(){if(document.referrer.startsWith("https://www.zhihu.com/oauth/callback/sina")){var e=Z.a.get("atoken"),t=Z.a.get("accountcallback");if(e&&t){var n=JSON.parse(decodeURIComponent(t));if(!n)return;var r=n.fullname,a=n.type;(0,this.props.onRegister)({fullname:r,socialType:a})}}}},{key:"componentWillUnmount",value:function(){this.unready()}},{key:"ready",value:function(){window.NWEB={accountCallback:this.accountCallback},this.domain=document.domain,document.domain="zhihu.com"}},{key:"unready",value:function(){if(window.NWEB&&"www.zhihu.com"===location.host){try{document.domain=this.domain}catch(e){}delete window.NWEB}}},{key:"handleLogSocialLogin",value:function(){f.a.trackEvent(this,{action:"Click",element:"Button",element_name:"SNSSignIn"})}},{key:"handleLogSingleSocialButtonClick",value:function(e){var t,n,r,a;t=this,n="SignIn",r={type:Ct[e]},f.a.trackEvent(t,{action:n,element:"Button",element_name:a},{account:r})}},{key:"handleLogSocialLoginSuccess",value:function(){var e,t,n,r;e=this,t="SignIn",n=this.clickedServiceName,f.a.trackEvent(e,{id:236,action:"StatusReport",element_name:r},{status:{result:"Success",event:{action:t,element:"Button"}},account:n})}},{key:"render",value:function(){var e=this;return Object(s.c)("div",{className:"Login-socialLogin",children:[Object(s.b)("span",{children:"社交帐号登录"}),Object(s.c)("span",{className:"Login-socialButtonGroup",children:[Object(s.c)(E.c,{className:"Login-socialButton",preset:"plain",onClick:function(){return e.handleBuildSocialAuthLink("wechat")},children:[Object(s.b)(mt.a,{className:"Login-socialIcon",fill:"#60c84d",size:20}),"微信"]}),Object(s.c)(E.c,{className:"Login-socialButton",preset:"plain",onClick:function(){return e.handleBuildSocialAuthLink("qqconn")},children:[Object(s.b)(bt.a,{className:"Login-socialIcon",fill:"#50c8fd",size:20}),"QQ"]}),Object(s.c)(E.c,{className:"Login-socialButton",preset:"plain",onClick:function(){return e.handleBuildSocialAuthLink("sina")},children:[Object(s.b)(vt.a,{className:"Login-socialIcon",fill:"#fb6622",size:20}),"微博"]})]})]})}}]),n}(u.Component);St.propTypes={onRegister:T.a.func.isRequired,onEntranceButtonClick:T.a.func};Object(ie.withRouter)(St);function jt(e){var t=Object(At.b)();return/bux/.test(t.origin)?null:Object(s.b)(St,Object.assign({},e))}var Bt=n(1706),It=Object.assign;var Rt=function(e){return l.a.createElement(ve.a,It({width:"20",height:"20",fill:"none",viewBox:"0 0 20 20"},e),l.a.createElement("path",{fill:"url(#paint0_linear)",d:"M16.131 0H3.87A3.869 3.869 0 000 3.869V16.13A3.869 3.869 0 003.869 20H16.13A3.869 3.869 0 0020 16.131V3.87A3.869 3.869 0 0016.131 0z"}),l.a.createElement("path",{fill:"#fff",d:"M14.9 10.046V7.391l2.67-.137.232-.015c.147-.26.214-.559.192-.857-.02-.071-.059-.19-.178-.163a9.048 9.048 0 01-1.204.207c-.777.092-1.119.116-2.196.193-1.893.14-3.56.205-3.56.205a.722.722 0 00.75.724c.642-.027 1.582-.071 2.531-.119v2.617h-3.616a.753.753 0 00.753.754h2.843v2.008c0 .255-.13.341-.345.347h-1.1a1.187 1.187 0 00.632.742c.244.081.503.109.76.08.385-.02.836-.237.836-1.014V10.8h3.175a.362.362 0 00.361-.362v-.392H14.9z"}),l.a.createElement("path",{fill:"#fff",d:"M12.414 8.251a.65.65 0 00-.908-.148l-.107.077 1.187 1.662.635-.457-.807-1.134zm4.147-.057l-.89 1.166.647.472 1.273-1.685-.107-.077a.653.653 0 00-.923.124zM9.737 7.031H6.263v6.065h.858l.112.732 1.154-.732h1.356L9.737 7.03zm-1.465 5.311l-.674.415-.065-.427h-.487V7.785h1.908v4.557h-.682zM5.637 9.761H4.379V7.785h1.436v-.368a.386.386 0 00-.383-.385h-2.24a115.436 115.436 0 01.347-1.018 1.187 1.187 0 00-.68.199.908.908 0 00-.385.551c-.151.416-.296.813-.368 1.05-.136.38-.466 1.048-.466 1.048.248-.002.493-.06.716-.169a1.205 1.205 0 00.575-.822c0-.027 0-.053.024-.086h.65V9.35c0 .142 0 .279-.018.412H2.433a.754.754 0 00-.754.754h1.837a4.955 4.955 0 01-.226 1.035 4.746 4.746 0 01-.845 1.484 9.363 9.363 0 01-.89.845 1.56 1.56 0 001.527-.27 4.21 4.21 0 00.908-1.623c.152-.483.258-.98.318-1.483h1.685v-.38a.362.362 0 00-.356-.362z"}),l.a.createElement("path",{fill:"#fff",d:"M4.747 11.318l-.658.425 1.418 2.118a1.96 1.96 0 00.19-.629.908.908 0 00-.08-.617l-.87-1.297z"}),l.a.createElement("defs",null,l.a.createElement("linearGradient",{id:"paint0_linear",x1:"-6.708",x2:"25.504",y1:"29.91",y2:"-8.476",gradientUnits:"userSpaceOnUse"},l.a.createElement("stop",{offset:".42",stopColor:"#06F"}),l.a.createElement("stop",{offset:".92",stopColor:"#00C4FF"}))))},kt=function(e){var t=e.isQRCodeShown,n=void 0!==t&&t,r=e.onQRCodeLinkClick,a=e.zaClickId,o=Object(Q.a)(e,["isQRCodeShown","onQRCodeLinkClick","zaClickId"]);return Object(s.c)(p.Flex,Object.assign({px:"24px",color:"GBL01A",width:"400px",height:"60px",alignItems:"center"},o,{children:[Object(s.b)(p.Box,{flex:"1",children:Object(s.c)(p.Link,{href:"/org/signup",color:"inherit","data-za-detail-view-id":a,children:[Object(s.b)(Bt.a,{size:26,css:{marginRight:".5em"},center:!0}),"开通机构号"]})}),Object(s.b)(p.Box,{height:"20px",width:"1px",bg:"GBK09C"}),Object(s.b)(p.Box,{flex:"1",textAlign:"right",children:Object(s.b)(p.Button,{bg:"unset",color:"inherit",fontSize:"inherit",fontWeight:"inherit",padding:0,onClick:r,children:n?"关闭二维码":Object(s.c)(s.a,{children:[Object(s.b)(Rt,{center:!0,css:{marginRight:".5em"}}),"下载知乎 App"]})})})]}))};n(1413);function Qt(e){var t=function(){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(e){return!1}}();return function(){var n,r=Object(c.a)(e);if(t){var a=Object(c.a)(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return Object(i.a)(this,n)}}var Nt=function(e){Object(o.a)(n,e);var t=Qt(n);function n(){var e;Object(r.a)(this,n);for(var a=arguments.length,o=new Array(a),i=0;i<a;i++)o[i]=arguments[i];return(e=t.call.apply(t,[this].concat(o))).state={showHeader:!0,showQrcode:!1,fullname:"",socialType:""},e.changeSignType=function(t){e.props.onChangeSignType(t),e.handleSetShowHeader(!0)},e.handleSetShowHeader=function(t){e.setState({showHeader:t})},e.handleSocialRegister=function(t){var n=t.fullname,r=t.socialType;e.props.onChangeSignType("register"),e.setState({fullname:n,socialType:r,showHeader:!1})},e.handleResetRegister=function(){e.props.onChangeSignType("login"),e.setState({fullname:"",socialType:"",showHeader:!0})},e}return Object(a.a)(n,[{key:"componentDidMount",value:function(){var e=this.props,t=e.nextUrl;e.isLogin&&(location.href=t||"/")}},{key:"render",value:function(){var e=this,t=this.state,n=t.fullname,r=t.socialType,a=t.showQrcode,o=this.props,i=o.nextUrl,c=o.isInSignPage,u=o.signType,l=o.showQrcodeFirst,d=c?p.Card:p.Box;return Object(s.c)(d,{bg:"background",width:400,css:{overflow:"hidden"},children:["login"===u?Object(s.b)("div",{className:"SignContainer-content",children:Object(s.c)("div",{className:"SignContainer-inner",children:[Object(s.b)(gt,{showQrcodeFirst:l,nextUrl:i,isInSignPage:c}),Object(s.b)("div",{className:h()("SignFlowQRImage",{"SignFlowQRImage--isHidden":!a}),children:Object(s.b)("div",{})})]})}):Object(s.b)(oe,{socialType:r,nextUrl:i,defaultFullname:n,onResetRegister:this.handleResetRegister}),Object(s.b)(p.Box,{mx:"24px",sx:{borderTop:"1px solid",borderColor:"GBK09A"}}),Object(s.b)(jt,{onRegister:this.handleSocialRegister}),Object(s.b)(kt,{zaClickId:c?4943:8270,isQRCodeShown:a,onQRCodeLinkClick:function(t){e.setState({showQrcode:!a}),c?a&&f.a.trackEvent(t.currentTarget,{id:4945}):f.a.trackEvent(t.currentTarget,{id:a?8272:8271})},bg:"GBK10A"})]})}}]),n}(u.Component);t.a=Object(g.b)()(Nt)},2647:function(e,t,n){"use strict";n.r(t);var r=n(14),a=n(15),o=n(16),i=n(17),c=n(9),s=n(2),u=n(3),l=n.n(u),d=n(1),h=n(19),p=n(27),f=n(227),g=n(249),m=n(0),b=n(31),v=n(134),A=n(30),C=n(1025),E=n(1300),O=n(849),w=n(4),y=n(35),S=n(1447),j=n(1411),B=n(1119);function I(){var e=Object(O.a)(["","s 后可重发"]);return I=function(){return e},e}function R(e){var t=function(){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(e){return!1}}();return function(){var n,r=Object(c.a)(e);if(t){var a=Object(c.a)(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return Object(i.a)(this,n)}}var k=function(e){Object(o.a)(n,e);var t=R(n);function n(){return Object(r.a)(this,n),t.apply(this,arguments)}return Object(a.a)(n,[{key:"render",value:function(){var e=this.props,t=e.countDownEvent,n=e.startAtOnce,r=e.interceptTime,a=e.resetText,o=e.manualValidateError,i=e.onChange,c=e.validations,u=e.countDownEndEvent,l=e.reStartTime,d=e.isIOS,h=Object(y.a)(e,["countDownEvent","startAtOnce","interceptTime","resetText","manualValidateError","onChange","validations","countDownEndEvent","reStartTime","isIOS"]);return Object(s.c)("div",{className:"SignFlow SignFlow-smsBindPhoneInputContainer",children:[Object(s.b)(B.a,Object.assign({name:"digits",className:"SignFlow-smsBindPhoneInput",type:d?"tel":"number",errorMessageClassName:"SignFlow-smsBindPhoneInputErrorMask",placeholder:"输入 6 位验证码",manualValidateError:o,onChange:i,validations:[{type:"required",message:"请填写验证码",className:"SignFlow-smsInputBindPhoneRequiredErrorMask"}].concat(Object(w.a)(c||[]))},h)),Object(s.b)(S.a,{className:"SignFlow-smsBindPhoneInputButton",preset:"plain",initialText:"发送验证码",resetText:a,countingText:Object(j.a)(I(),"count"),startAtOnce:n,event:t,countDownEndEvent:u,interceptTime:r,reStartTime:l})]})}}]),n}(d.Component);k.propTypes={countDownEvent:l.a.func.isRequired,startAtOnce:l.a.bool,interceptTime:l.a.number,resetText:l.a.string,manualValidateError:l.a.string},k.defaultProps={startAtOnce:!1,resetText:"重发验证码"};var Q=Object(p.connect)((function(e){return{isIOS:e.env.userAgent.iOS}}))(k),N=n(24);function T(e){var t=function(){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(e){return!1}}();return function(){var n,r=Object(c.a)(e);if(t){var a=Object(c.a)(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return Object(i.a)(this,n)}}var P=function(e){Object(o.a)(n,e);var t=T(n);function n(){var e;Object(r.a)(this,n);for(var a=arguments.length,o=new Array(a),i=0;i<a;i++)o[i]=arguments[i];return(e=t.call.apply(t,[this].concat(o))).state={selectedCountry:{code:"+86",name:"中国"},phoneNo:null,smsInputInterceptTime:-1,manualError:null,showFooter:!1,sendValidationCodeButtonText:"发送验证码",identifyingCodeError:null},e.testPhoneNo=function(){var t=e.state,n=t.selectedCountry.code,r=t.phoneNo;return"+86"!==n||/^\d{11}$/.test(r)},e.handleChange=function(t){return function(n){e.setState(Object(m.a)({},t,n))}},e.handleSendDigits=function(t){var n=e.props.requestPhoneVerificationCode,r=e.state,a=r.selectedCountry.code,o=r.phoneNo,i=r.manualError;if(A.a.trackEvent(t.target,{action:"GetCaptcha"}),e.testPhoneNo())return n("".concat(a).concat(o)).then((function(){e.setState({manualError:null})})).catch((function(t){var n=t.payload,r=(n=void 0===n?{}:n).message;return e.setState({manualError:r,smsInputInterceptTime:Date.now()})}));return e.setState({manualError:"请输入正确的手机号"===i?" ".concat("请输入正确的手机号"):"请输入正确的手机号",smsInputInterceptTime:Date.now()})},e.handleSubmit=function(t){var n=t.phoneNo,r=t.digits,a=e.props,o=a.updatePhoneNumber,i=a.onSuccess,c=a.onNeedUnbind,s=e.state,u=s.selectedCountry.code,l=s.identifyingCodeError;o("".concat(u).concat(n),r).then((function(e){var t=e.payload,r=t.data;if(t.success)return i();var a=r.bindedAccountFullname,o=r.requestAccountFullname;return c({phoneNumber:n,bindName:a,requiredName:o})})).catch((function(t){var n=t.payload,r=(n=void 0===n?{}:n).code,a=n.message;r===N.B&&e.setState({identifyingCodeError:l===a?" ".concat(a):a})}))},e.handleZaOK=function(e){A.a.trackEvent(e.target,{action:"Ok"})},e.renderContent=function(){var t=e.state,n=t.smsInputInterceptTime,r=t.manualError,a=t.sendValidationCodeButtonText,o=t.identifyingCodeError;return Object(s.b)("div",{ref:function(t){e.container=t},children:Object(s.c)(C.b,{className:"SignFlow BindPhoneForm",onSubmit:e.handleSubmit,children:[!1,Object(s.b)(E.a,{type:"register",supportedCountriesShown:!0,manualValidateError:r,onSelect:e.handleChange("selectedCountry"),onChange:e.handleChange("phoneNo")}),Object(s.b)(Q,{resetText:a,interceptTime:n,countDownEvent:e.handleSendDigits,manualValidateError:o},"sms-input"),Object(s.b)("div",{className:"BindPhone-helpWrapper",children:Object(s.b)(b.c,{className:"BindPhone-helpText",preset:"link",onClick:function(){e.setState({showFooter:!0})},children:"需要帮助?"})}),Object(s.b)(b.c,{css:{display:"block",width:"220px",margin:"55px auto 0"},preset:"primary",color:"blue",type:"submit",onClick:e.handleZaOK,children:"确认"})]})})},e}return Object(a.a)(n,[{key:"componentDidMount",value:function(){A.a.setModule(this.container,{module:"BindPhoneForm"}),A.a.trackCardShow(this.container)}},{key:"render",value:function(){var e=this.props.onClose,t=this.state.showFooter;return Object(s.b)(v.b,{title:"设置手机号",subtitle:"绑定手机后,你就可以使用知乎的提问、回答、评论等功能。",footer:t?"如需要帮助,请联系 i@zhihu.com,我们会尽快帮你解决":null,onClose:e,size:"default",children:this.renderContent()})}}]),n}(d.Component);P.propTypes={requestPhoneVerificationCode:l.a.func.isRequired,updatePhoneNumber:l.a.func.isRequired,onClose:l.a.func.isRequired,onSuccess:l.a.func.isRequired,onNeedUnbind:l.a.func.isRequired};var M=n(101);function D(e){var t=function(){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(e){return!1}}();return function(){var n,r=Object(c.a)(e);if(t){var a=Object(c.a)(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return Object(i.a)(this,n)}}var V=function(e){Object(o.a)(n,e);var t=D(n);function n(){var e;Object(r.a)(this,n);for(var a=arguments.length,o=new Array(a),i=0;i<a;i++)o[i]=arguments[i];return(e=t.call.apply(t,[this].concat(o))).zaKnowMore=function(e){A.a.trackEvent(e.target,{action:"OpenUrl",name:"了解更多"})},e.toBindPhone=function(t){var n=e.props.onBindPhone;A.a.trackEvent(t.target,{action:"OpenUrl",name:"去绑定手机"}),n()},e.handleClose=function(t){var n=e.props,r=n.onClose,a=n.config.canWrite;A.a.trackEvent(t.target,{action:"Cancel",name:a?"暂不绑定":"取消"}),r()},e.renderContent=function(){var t=e.props.config,n=t.tip,r=t.canWrite;return Object(s.c)("div",{ref:function(t){e.container=t},children:[Object(s.c)("p",{children:[n,Object(s.b)(M.a,{preset:"link",target:"_blank",href:"https://zhuanlan.zhihu.com/p/27257715",onClick:e.zaKnowMore,children:"了解更多"})]}),Object(s.c)("div",{className:"BindPhone-buttonSection",children:[Object(s.b)(M.a,{className:"BindPhone-button",onClick:e.handleClose,children:r?"暂不绑定":"取消"}),Object(s.b)(b.c,{className:"BindPhone-button",preset:"primary",color:"blue",onClick:e.toBindPhone,children:"去绑定手机"})]})]})},e}return Object(a.a)(n,[{key:"componentDidMount",value:function(){A.a.setModule(this.container,{module:"BindPhoneForm"}),A.a.trackCardShow(this.container)}},{key:"render",value:function(){var e=this.props.onClose;return Object(s.b)(v.b,{className:!1,title:"绑定手机",onClose:e,size:"default",children:this.renderContent()})}}]),n}(d.Component);function U(e){var t=function(){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(e){return!1}}();return function(){var n,r=Object(c.a)(e);if(t){var a=Object(c.a)(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return Object(i.a)(this,n)}}V.propTypes={config:l.a.object,onClose:l.a.func,onBindPhone:l.a.func};var F=function(e){Object(o.a)(n,e);var t=U(n);function n(){var e;Object(r.a)(this,n);for(var a=arguments.length,o=new Array(a),i=0;i<a;i++)o[i]=arguments[i];return(e=t.call.apply(t,[this].concat(o))).handleCancel=function(t){var n=e.props.onClose;A.a.trackEvent(t.target,{action:"Cancel",name:"不绑定"}),n()},e}return Object(a.a)(n,[{key:"componentDidMount",value:function(){A.a.setModule(this.container,{module:"BindMailForm"}),A.a.trackCardShow(this.container)}},{key:"render",value:function(){var e=this,t=this.props.onClose;return Object(s.b)(v.b,{className:!1,title:"手机号绑定成功",onClose:t,size:"default",children:Object(s.c)("div",{ref:function(t){e.container=t},children:[Object(s.b)("p",{children:"由于你此前绑定的邮箱未经验证,未来请使用手机号登录知乎。"}),Object(s.b)(b.c,{className:"BindPhone-remindLoginWithPhoneButton",onClick:this.handleCancel,preset:"primary",color:"blue",children:"知道了"})]})})}}]),n}(d.Component);function x(e){var t=function(){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(e){return!1}}();return function(){var n,r=Object(c.a)(e);if(t){var a=Object(c.a)(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return Object(i.a)(this,n)}}F.propTypes={onClose:l.a.func};var z=function(e){Object(o.a)(n,e);var t=x(n);function n(){var e;Object(r.a)(this,n);for(var a=arguments.length,o=new Array(a),i=0;i<a;i++)o[i]=arguments[i];return(e=t.call.apply(t,[this].concat(o))).handleCancel=function(t){var n=e.props.onCancel;A.a.trackEvent(t.target,{action:"Click",name:"暂不绑定"}),n()},e.handleConfirm=function(t){var n=e.props.onConfirm;A.a.trackEvent(t.target,{action:"Click",name:"确认解绑"}),n()},e}return Object(a.a)(n,[{key:"componentDidMount",value:function(){A.a.setModule(this.container,{module:"BindPhoneFailForm"}),A.a.trackCardShow(this.container)}},{key:"render",value:function(){var e=this,t=this.props,n=t.onClose,r=t.phoneNumber,a=t.bindName,o=t.requiredName;return Object(s.b)(v.b,{className:!1,title:"绑定失败",onClose:n,size:"default",children:Object(s.c)("div",{ref:function(t){e.container=t},children:[Object(s.c)("p",{children:["你所输入的手机号 ",r," 已经被绑定到帐号「",a,"」。"]}),!1,Object(s.c)("p",{children:["你可以选择将该手机号从该帐号中解绑,并绑定至当前帐号「",o,"」。"]}),!1,Object(s.b)("p",{children:Object(s.c)("b",{children:["解绑后,你将无法再通过手机号登录原帐号「",a,"」。"]})}),Object(s.c)("div",{className:"BindPhone-buttonSection",children:[Object(s.b)(b.c,{className:"BindPhone-button",onClick:this.handleConfirm,children:"确认解绑"}),Object(s.b)(b.c,{className:"BindPhone-button",preset:"primary",color:"blue",onClick:this.handleCancel,children:"暂不绑定"})]})]})})}}]),n}(d.Component);function q(e){var t=function(){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(e){return!1}}();return function(){var n,r=Object(c.a)(e);if(t){var a=Object(c.a)(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return Object(i.a)(this,n)}}z.propTypes={onClose:l.a.func.isRequired,onCancel:l.a.func.isRequired,onConfirm:l.a.func.isRequired,phoneNumber:l.a.string.isRequired,bindName:l.a.string.isRequired,requiredName:l.a.string.isRequired};var L=function(e){Object(o.a)(n,e);var t=q(n);function n(){var e;Object(r.a)(this,n);for(var a=arguments.length,o=new Array(a),i=0;i<a;i++)o[i]=arguments[i];return(e=t.call.apply(t,[this].concat(o))).handleUnbind=function(t){var n=e.props,r=n.onSuccess,a=n.monopolizePhoneNumber,o=n.showNotification;A.a.trackEvent(t.target,{action:"Click",name:"确认解绑"}),a().then((function(){return o("绑定成功!","white"),r()}))},e.handleCancel=function(t){var n=e.props.onCancel;A.a.trackEvent(t.target,{action:"Click",name:"暂不绑定"}),n()},e}return Object(a.a)(n,[{key:"componentDidMount",value:function(){A.a.setModule(this.container,{module:"BindPhoneVerifyForm"}),A.a.trackCardShow(this.container)}},{key:"render",value:function(){var e=this,t=this.props,n=t.onClose,r=t.bindName;return Object(s.b)(v.b,{className:!1,title:"解绑手机",onClose:n,size:"default",children:Object(s.c)("div",{ref:function(t){e.container=t},children:[Object(s.b)("p",{children:Object(s.b)("b",{children:"解绑操作无法撤销。"})}),!1,Object(s.c)("p",{children:["如果你没有其他登录方式,你将无法再使用帐号「",r,"」。"]}),Object(s.c)("div",{className:"BindPhone-buttonSection",children:[Object(s.b)(b.c,{className:"BindPhone-button",onClick:this.handleUnbind,children:"确认解绑"}),Object(s.b)(b.c,{className:"BindPhone-button",preset:"primary",color:"blue",onClick:this.handleCancel,children:"暂不绑定"})]})]})})}}]),n}(d.Component);L.propTypes={onClose:l.a.func.isRequired,onSuccess:l.a.func.isRequired,onCancel:l.a.func.isRequired,bindName:l.a.string.isRequired,showNotification:l.a.func.isRequired,monopolizePhoneNumber:l.a.string.isRequired};var H=n(123),J=n(36),W=n(25);function K(e){var t=function(){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(e){return!1}}();return function(){var n,r=Object(c.a)(e);if(t){var a=Object(c.a)(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return Object(i.a)(this,n)}}var Y=function(e){Object(o.a)(n,e);var t=K(n);function n(){var e;Object(r.a)(this,n);for(var a=arguments.length,o=new Array(a),i=0;i<a;i++)o[i]=arguments[i];return(e=t.call.apply(t,[this].concat(o))).state={},e.handleBindPhoneSuccess=function(){var t=e.props,n=t.needShowLoginWithPhoneNumber,r=t.showNotification,a=t.onToggle;return n?e.goToStep("LOGIN_WITH_PHONE")():(r("绑定成功!","white"),setTimeout((function(){return location.reload()}),2e3),a())},e.handleNeedUnbind=function(t){var n=t.bindName,r=t.phoneNumber,a=t.requiredName;return e.setState({bindName:n,phoneNumber:r,requiredName:a,step:"NEED_UNBIND"})},e.goToStep=function(t){return function(){return e.setState({step:t})}},e.handleCloseWithReload=function(){return location.reload()},e}return Object(a.a)(n,[{key:"componentDidMount",value:function(){(0,this.props.fillCurrentUserIfNeeded)(["email","isActive"])}},{key:"componentWillReceiveProps",value:function(e){var t=this.props,n=t.getUnlockRequest,r=t.hasActiveEmail,a=t.shown,o=t.account,i=o.errorStatus,c=o.challenge,s=document.querySelector(".VerificationDialogModalHeader");if(e.shown&&!a){n();var u="";u=r?"CONFIRM_BIND_PHONE":i&&!s&&c&&c.length?"SAFETY_VERIFICATION":"BIND_PHONE",this.setState({step:u})}}},{key:"render",value:function(){var e=this.props,t=e.shown,n=e.requestPhoneVerificationCode,r=e.updatePhoneNumber,a=e.monopolizePhoneNumber,o=e.showNotification,i=e.config,c=e.account,u=e.unlockTicketByDigits,l=e.requestUnlockTicket,d=e.unlockTicketByPassword,h=e.onToggle,p=this.state,g=p.step,m=p.bindName,b=p.phoneNumber,v=p.requiredName;return t?"CONFIRM_BIND_PHONE"===g?Object(s.b)(V,{onBindPhone:this.goToStep("SAFETY_VERIFICATION"),onClose:h,config:i}):"BIND_PHONE"===g?Object(s.b)(P,{onClose:h,onSuccess:this.handleBindPhoneSuccess,onNeedUnbind:this.handleNeedUnbind,requestPhoneVerificationCode:n,updatePhoneNumber:r}):"LOGIN_WITH_PHONE"===g?Object(s.b)(F,{onClose:this.handleCloseWithReload}):"NEED_UNBIND"===g?Object(s.b)(z,{onClose:h,onCancel:this.goToStep("BIND_PHONE"),onConfirm:this.goToStep("CONFIRM_UNBIND"),bindName:m,phoneNumber:b,requiredName:v}):"CONFIRM_UNBIND"===g?Object(s.b)(L,{onClose:h,onSuccess:this.handleBindPhoneSuccess,onCancel:this.goToStep("BIND_PHONE"),bindName:m,monopolizePhoneNumber:a,showNotification:o}):"SAFETY_VERIFICATION"===g?Object(s.b)(f.a,{isShown:!0,account:c,unlockTicketByDigits:u,requestUnlockTicket:l,unlockTicketByPassword:d,onClose:h,onSuccess:this.goToStep("BIND_PHONE"),zaModuleName:"BindMailForm"}):null:null}}]),n}(d.Component);Y.propTypes={shown:l.a.bool.isRequired,onToggle:l.a.func.isRequired,needShowLoginWithPhoneNumber:l.a.bool.isRequired,config:l.a.object.isRequired,requestPhoneVerificationCode:l.a.func.isRequired,updatePhoneNumber:l.a.func.isRequired,monopolizePhoneNumber:l.a.func.isRequired};t.default=Object(h.compose)(Object(g.b)(),Object(p.connect)((function(e,t){var n=e.account,r=t.currentUser,a=r.isActive,o=r.email;return{account:n,hasActiveEmail:a&&o,needShowLoginWithPhoneNumber:!a&&!!o,config:N.O}}),{requestPhoneVerificationCode:H.o,updatePhoneNumber:H.B,monopolizePhoneNumber:H.l,showNotification:W.h,getUnlockRequest:H.j,unlockTicketByDigits:H.w,requestUnlockTicket:H.p,unlockTicketByPassword:H.x,fillCurrentUserIfNeeded:J.e}))(Y)},786:function(e,t,n){"use strict";n.r(t),n.d(t,"default",(function(){return f}));var r=n(35),a=n(14),o=n(15),i=n(16),c=n(17),s=n(9),u=n(2),l=n(1),d=n(73),h=n(1782);function p(e){var t=function(){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(e){return!1}}();return function(){var n,r=Object(s.a)(e);if(t){var a=Object(s.a)(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return Object(c.a)(this,n)}}var f=function(e){Object(i.a)(n,e);var t=p(n);function n(){var e;Object(a.a)(this,n);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return(e=t.call.apply(t,[this].concat(o))).state={signType:e.props.signType||"login"},e.handleChangeSignType=function(t){e.setState({signType:t})},e}return Object(o.a)(n,[{key:"render",value:function(){var e=this.props,t=e.onClose,n=e.showQrcodeFirst,a=e.titlePart,o=Object(r.a)(e,["onClose","showQrcodeFirst","titlePart"]);return Object(u.c)(d.b,Object.assign({className:"signFlowModal",onClose:t},o,{children:[a,Object(u.b)(h.a,{showQrcodeFirst:n,signType:this.state.signType,onChangeSignType:this.handleChangeSignType})]}))}}]),n}(l.Component)},849:function(e,t,n){"use strict";function r(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}n.d(t,"a",(function(){return r}))},893:function(e,t,n){"use strict";var r=n(43),a=n(35),o=n(2),i=n(1),c=n(90),s=n(73),u=n(31),l=n(111),d=n.n(l),h=n(367),p=n(405),f=function(e){var t=e.title,n=e.content,l=e.ok,d=e.cancel,p=e.onOk,f=e.onCancel,g=Object(a.a)(e,["title","content","ok","cancel","onOk","onCancel"]),m=Object(i.useState)(!0),b=Object(r.a)(m,2),v=b[0],A=b[1],C=function(e){return function(){A(!1),e()}},E=Object(h.b)();return Object(o.b)(s.b,Object.assign({closeButton:null,maskClosable:!1,hotKeyClosable:!1,css:[{overflow:"hidden",maxWidth:"96vw",".Modal-content":{margin:0,padding:0}},E.Mobile&&{width:320,borderRadius:12,boxShadow:""}]},g,{children:v&&Object(o.c)(c.Box,{px:"36px",py:"24px",children:[t&&Object(o.b)(c.Text,{fontSize:"18px",lineHeight:"28px",fontWeight:"bold",textAlign:"center",children:t}),n&&Object(o.b)(c.Text,{mt:t?"16px":"0",fontSize:"14px",lineHeight:"normal",color:"GBK03A",maxHeight:"calc(67vh - 100px)",css:{wordBreak:"break-all",overflowY:"auto",WebkitOverflowScrolling:"touch",marginRight:-10,paddingRight:10},children:n}),Object(o.c)(c.Flex,{mt:"16px",css:{button:{padding:0,flex:1,height:36,lineHeight:1,fontSize:15,borderRadius:4,":active":{opacity:.6}}},fontWeight:"bold",children:[d&&Object(o.b)(u.c,{css:{marginRight:4},onClick:C(f),children:d}),Object(o.b)(u.c,{preset:"primary",color:"blue",onClick:C(p),children:l})]})]})}))};t.a=function(){var e=Object(p.b)(),t=e.addInstance,n=e.removeInstance,r=function(e){return setTimeout((function(){return n(e)}),300)};return{alert:function(e){var n,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=a.title,c=a.ok;return new Promise((function(r){n=Object(o.b)(f,{content:e,title:i,ok:c||"确定",onOk:r,css:{textAlign:"center"}},d()("modal")),t(n)})).finally((function(){return r(n)}))},confirm:function(e){var n,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=a.title,c=a.ok,s=a.cancel;return new Promise((function(r,a){n=Object(o.b)(f,{content:e,title:i,ok:c||"确定",onOk:r,cancel:s||"取消",onCancel:a},d()("modal")),t(n)})).finally((function(){return r(n)}))}}}},940:function(e,t){function n(e){return!!e&&("object"==typeof e||"function"==typeof e)&&"function"==typeof e.then}e.exports=n,e.exports.default=n}}]);
//# sourceMappingURL=main.signflow.eac6e1a87999d51a879b.js.map