(window.webpackJsonp=window.webpackJsonp||[]).push([[38],{1128:function(e,t,n){"use strict";var a=n(20),r=n.n(a),i=n(21),c=n.n(i),o=n(22),s=n.n(o),l=n(23),u=n.n(l),d=n(13),p=n.n(d),h=n(33),b=n.n(h),m=n(41),f=n.n(m),v=n(3),y=n.n(v),O=n(1),j=n(5);function g(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,a=p()(e);if(t){var r=p()(this).constructor;n=Reflect.construct(a,arguments,r)}else n=a.apply(this,arguments);return u()(this,n)}}var C=function(e){s()(n,e);var t=g(n);function n(){return r()(this,n),t.apply(this,arguments)}return c()(n,[{key:"render",value:function(){var e=this.props,t=e.src,n=t.content,a=t.attributes,r=e.title,i=f()(e,["src","title"]);return Object(j.g)("svg",b()({},a,i),Object(j.g)("title",null,r),Object(j.g)("g",{dangerouslySetInnerHTML:{__html:n}}))}}]),n}(O.Component);C.propTypes={src:y.a.object.isRequired},t.a=C},1382:function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));var a=n(0);function r(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.selectedKey,i=void 0===r?"selectedProps":r,c=n.dropedKey,o=void 0===c?"dropedProps":c;return Object.keys(e).reduce((function(n,r){var c=t.includes(r)?i:o;return Object.assign({},n,Object(a.a)({},c,Object.assign({},n[c],Object(a.a)({},r,e[r]))))}),{})}},1383:function(e,t,n){"use strict";var a=n(1),r=n.n(a),i=n(18),c=function(e){return r.a.createElement(i.a,e,r.a.createElement("path",{d:"M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10-4.477 10-10 10zm-2.762-5.37c.243.246.452.37.78.37.33 0 .576-.203.827-.443.25-.24 7.052-7.054 7.052-7.054a.988.988 0 0 0-.311-1.354.973.973 0 0 0-1.345.315l-6.222 6.077-2.31-2.418a.971.971 0 0 0-1.368-.19.988.988 0 0 0-.188 1.377s2.841 3.074 3.085 3.32z",fillRule:"evenodd"}))};c.defaultProps={name:"CheckCircle"},t.a=c},1388:function(e,t,n){"use strict";var a=n(1),r=n.n(a),i=n(18),c=function(e){return r.a.createElement(i.a,e,r.a.createElement("path",{d:"M18 8c.1-3.308-2.592-6-5.9-6-3.308 0-6 2.692-6 6v2H5.002C4 10 4 11 4 11v9s0 2 2 2h12c2 0 2-1.97 2-1.97V11s0-1-1-1h-1V8zm-6-4c2.143.018 4.005 1.597 4 4v2H8V7.996C8.013 5.562 9.857 3.982 12 4z",fillRule:"evenodd"}))};c.defaultProps={name:"Lock"},t.a=c},1434:function(e,t){e.exports={attributes:{width:"72px",height:"58px",viewBox:"0 0 72 58"},content:' '}},1477:function(e,t,n){"use strict";n.r(t),n.d(t,"FavlistsModal",(function(){return D}));var a=n(43),r=n(2),i=n(3),c=n.n(i),o=n(78),s=n(1),l=n(134),u=n(1382),d=function(e,t,n){return n&&void 0!==t&&(e||!t)},p=(n(1128),n(31)),h=n(73),b=n(11),m=n.n(b),f=n(135),v=n(398),y=function(e){var t,n=e.onBack,i=e.onSubmit,c=e.authRequired,o=e.isActive,l=e.editItem,u=void 0===l?{}:l,b=e.isDefaultPage,y="edit"===e.currentPage,O=Object(s.useState)(null===(t=u.isPublic)||void 0===t||t),j=Object(a.a)(O,2),g=j[0],C=j[1],k=Object(s.useState)(u.title||""),R=Object(a.a)(k,2),w=R[0],N=R[1],I=Object(s.useState)(u.description||""),S=Object(a.a)(I,2),P=S[0],x=S[1],T=!w||w.length>20||P.length>60,B=y&&!0===u.isPublic&&u.followerCount>0;return Object(r.c)("form",{className:"Favlists-content",onSubmit:function(e){if(e.preventDefault(),w){var t={title:w,description:P,isPublic:g};d(g,o,c)?c(i)(t):(i(t),n())}},children:[Object(r.c)("div",{className:"Favlists-addItems",children:[Object(r.c)("div",{className:"Favlists-addItem",children:[Object(r.b)(f.a,{className:"Favlists-titleInput",placeholder:"收藏标题",onChange:function(e){N(e.target.value)},value:w}),Object(r.b)("div",{className:"Favlists-inputTips",children:Object(r.b)(v.a,{name:"收藏标题",current:w?w.length:0,max:20})})]}),Object(r.c)("div",{className:"Favlists-addItem",children:[Object(r.b)(f.a,{multiline:!0,className:"Favlists-descritionInput",placeholder:"收藏描述(可选)",onChange:function(e){x(e.target.value)},rows:5,value:P}),Object(r.b)("div",{className:"Favlists-inputTips",children:Object(r.b)(v.a,{name:"收藏描述",current:P?P.length:0,max:60})})]}),Object(r.c)("div",{className:"Favlists-addItem",children:[Object(r.c)("label",{className:"Favlists-privacyOption",children:[Object(r.b)("input",{className:"Favlists-privacyOptionRadio",name:"isPublic",type:"radio",value:"true",checked:g,onChange:function(){return C(!0)}}),Object(r.b)("span",{children:"公开"}),Object(r.b)("span",{className:"Favlists-privacyOptionTips",children:"有其他人关注此收藏夹时不可设置为私密"})]}),Object(r.c)("label",{className:m()("Favlists-privacyOption",{"Favlists-privacyOption--privacyDisable":B}),children:[Object(r.b)("input",{className:"Favlists-privacyOptionRadio",name:"isPublic",type:"radio",value:"false",checked:!g,onChange:function(){return C(!1)},disabled:B}),Object(r.b)("span",{children:"私密"}),Object(r.b)("span",{className:"Favlists-privacyOptionTips",children:B?"当前有人在关注此收藏夹,无法设为隐私":"只有你自己可以查看这个收藏夹"})]})]})]}),Object(r.c)(h.a,{direction:"horizontal",className:"",children:[n&&Object(r.b)(p.c,{onClick:n,children:b?"取消":"返回"}),Object(r.b)(p.c,{color:"blue",preset:"primary",type:"submit",disabled:T,children:b?"确认":"确认创建"})]})]})};y.propTypes={onSubmit:c.a.func.isRequired,onBack:c.a.func,authRequired:c.a.func,isActive:c.a.bool,editItem:c.a.shape({type:c.a.oneOf(["collection"])}),currentPage:c.a.oneOf(["edit","add"]),isDefaultPage:c.a.bool};var O=y,j=(n(1434),n(14)),g=n(15),C=n(16),k=n(17),R=n(9),w=n(368),N=n(989),I=n(30),S=n(1388);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,a=Object(R.a)(e);if(t){var r=Object(R.a)(this).constructor;n=Reflect.construct(a,arguments,r)}else n=a.apply(this,arguments);return Object(k.a)(this,n)}}var x=function(e){Object(C.a)(n,e);var t=P(n);function n(){var e;Object(j.a)(this,n);for(var a=arguments.length,r=new Array(a),i=0;i=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var g=function e(t){var n=t.size,a=t.text,r=t.center,i=j(t,["size","text","center"]);a&&(n="1.2em");var c=b.a.createElement("svg",Object.assign({},i,n&&{width:n,height:n}));return r?b.a.createElement("span",{style:e.strutStyle},"​",c):c};g.defaultProps={fill:"currentColor"},g.strutStyle={display:"inline-flex",alignItems:"center"};var C,k,R=g,w=function(e){return b.a.createElement(R,Object.assign({width:"16",height:"16",viewBox:"0 0 32 32"},e,{className:"ZDI ZDI--CheckboxChecked16"+(e.className?" ".concat(e.className):"")}),b.a.createElement("path",{d:"M16 3c7.18 0 13 5.82 13 13s-5.82 13-13 13S3 23.18 3 16 8.82 3 16 3zm6.353 7.854a.5.5 0 00-.707 0l-6.232 6.229a.501.501 0 01-.707 0l-3.233-3.23a.5.5 0 00-.707 0l-1.414 1.415a.5.5 0 000 .707l5 4.997c.391.39 1.024.39 1.415 0l8-7.997a.5.5 0 000-.707z",fillRule:"evenodd"}))},N=function(e){return b.a.createElement(R,Object.assign({width:"16",height:"16",viewBox:"0 0 32 32"},e,{className:"ZDI ZDI--CheckboxUncheck16"+(e.className?" ".concat(e.className):"")}),b.a.createElement("path",{d:"M16 3c7.18 0 13 5.82 13 13s-5.82 13-13 13S3 23.18 3 16 8.82 3 16 3zm0 2C9.925 5 5 9.925 5 16s4.925 11 11 11 11-4.925 11-11S22.075 5 16 5z",fillRule:"evenodd"}))},I=n(73),S=n(31),P=function(e){var t=e.List,n=e.selectedId,a=e.handleClickSearchItem,r=e.handleChangeStage;return Object(u.c)("div",{children:[Object(u.b)("div",{children:t.map((function(e){if(e.id)return Object(u.c)("div",{onClick:function(){return a(e.id)},className:"ReportMenu-item ReportModal-search-suggest-item",children:[e.data,n===e.id?Object(u.b)(w,{className:"ReportModal-search-suggest-item-selected"}):Object(u.b)(N,{className:"ReportModal-search-suggest-item-unselected"})]},e.id)}))}),Object(u.b)(I.a,{direction:"horizontal",children:Object(u.b)(S.c,{className:"ReportMenu-button",disabled:!n,onClick:r,color:"blue",preset:"primary",children:"下一步"})})]})},x=n(11),T=n.n(x),B=n(835);function z(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,a=Object(l.a)(e);if(t){var r=Object(l.a)(this).constructor;n=Reflect.construct(a,arguments,r)}else n=a.apply(this,arguments);return Object(s.a)(this,n)}}var M="oneself",F="enterprise",_={declare:{title:"发表澄清声明",image:"https://zhstatic.zhihu.com/assets/report/Statement@3x.png",description:(C={},Object(r.a)(C,M,"个人可以对站内关于自身的不实描述内容发表澄清声明,声明通过审核后,将会以标记的形式显示在投诉内容的上方,点击可跳转至您的声明全文页面"),Object(r.a)(C,F,"企业可以对站内关于自身的不实描述内容发表澄清声明,声明通过审核后,将会以标记的形式显示在投诉内容的上方,点击可跳转至您的声明全文页面"),C)},trespass:{title:"提交侵权举报",image:"https://zhstatic.zhihu.com/assets/report/Infringement@3x.png",description:Object(u.b)("span",{children:"您提交的侵权举报将会根据知乎侵权举报规范进行受理"})}},E=(k={},Object(r.a)(k,F,"当您发现知乎上存在涉嫌侵犯您企业合法权益的内容时,您可以先尝试与作者沟通解决,如沟通无效,也可以通过以下方式向知乎提出诉求。"),Object(r.a)(k,M,"当您发现知乎上存在涉嫌侵犯您个人合法权益的内容时,您可以通过以下方式向知乎提出诉求。"),k),D=function(e){Object(o.a)(n,e);var t=z(n);function n(){var e;Object(i.a)(this,n);for(var a=arguments.length,r=new Array(a),c=0;c(n||150)?{isLegal:!1,errorReason:n?"".concat(t.title||"举报说明","不能超过 ").concat(n," 字"):be.a.contentTooLong}:/[\u4e00-\u9fa5a-zA-Z0-9]/.test(e)?{isLegal:!0,errorReason:""}:{isLegal:!1,errorReason:be.a.contentIllegal}};function Re(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,a=Object(l.a)(e);if(t){var r=Object(l.a)(this).constructor;n=Reflect.construct(a,arguments,r)}else n=a.apply(this,arguments);return Object(s.a)(this,n)}}var we=function(e){Object(o.a)(n,e);var t=Re(n);function n(){var e;Object(i.a)(this,n);for(var a=arguments.length,r=new Array(a),c=0;c1&&void 0!==arguments[1]?arguments[1]:"请选择举报理由";e.setState({title:t,subtitle:n})},e.handleClose=function(){var t=e.props,n=t.zaEnabled,a=t.type,r=t.onClose;n&&m.a.trackEvent(e.container,{action:"Ok"},{button:{text:"知道了"}}),"search_suggested_word"===a&&e.setState({stage:1,selectedId:void 0}),r()},e.handleChangeStage=function(){e.setState({stage:0})},e.handleClickSearchItem=function(t){e.setState({selectedId:t})},e}return Object(c.a)(n,[{key:"componentDidMount",value:function(){"search_suggested_word"===this.props.type&&this.setState({stage:1})}},{key:"componentDidUpdate",value:function(e){if(!e.shown&&this.props.shown&&this.container){var t=this.props,n=t.type,a=t.id;m.a.setModule(this.container,{module:"ReportDialog"},{card:Object.assign({card_type:"Content"},"search_suggested_word"!==n&&{content:Object(r.a)({type:y(n)},"comment"===n?"id":"token",String(a))})})}}},{key:"render",value:function(){var e=this,t=this.props,n=t.shown,r=t.onClose,i=t.List,c=Object(a.a)(t,["shown","onClose","List"]),o=this.state,s=o.title,l=o.subtitle,d=o.stage,p=o.selectedId,b=Object(v.a)(c,Object.keys(f.b.propTypes)),m=b.selectedProps,y=b.dropedProps;return Object(u.c)(h.Fragment,{children:[Object(u.b)(f.b,Object.assign({title:"举报",subtitle:"哪些联想词属于不适内容",onClose:this.handleClose,className:"ReportModal ReportModal-search-suggest"},m,{children:n&&1===d&&Object(u.b)(P,{List:i,selectedId:p,handleClickSearchItem:this.handleClickSearchItem,handleChangeStage:this.handleChangeStage})})),Object(u.b)(f.b,Object.assign({title:s,subtitle:l,onClose:this.handleClose,className:"ReportModal"},m,{children:n&&0===d&&Object(u.b)(Se,Object.assign({ref:function(t){e.container=t},onSubmit:this.handleSubmit,onEnd:r,onContentChange:this.handleContentChange},y,"search_suggested_word"===this.props.type&&{urlToken:p}))}))]})}}]),n}(h.Component);xe.propTypes={onClose:p.a.func.isRequired,type:p.a.oneOf(O.a).isRequired,shown:p.a.bool.isRequired,isColumnArticle:p.a.bool,isTipjarEnabled:p.a.bool,onBlockUser:p.a.func,onDeleteComment:p.a.func,doReport:p.a.func.isRequired,zaEnabled:p.a.bool,List:p.a.array},xe.defaultTypes={zaEnabled:!1}},2644:function(e,t,n){"use strict";n.r(t),n.d(t,"TipjarDialog",(function(){return J}));var a=n(14),r=n(15),i=n(16),c=n(17),o=n(9),s=n(2),l=n(1),u=n.n(l),d=n(3),p=n.n(d),h=n(11),b=n.n(h),m=n(31),f=n(73),v=n(546),y=n(178),O=n(798),j=n(131),g=Object.assign;var C=function(e){return u.a.createElement(j.a,g({width:"14",height:"16",viewBox:"0 0 18 18"},e),u.a.createElement("path",{fill:"#9FADC7",d:"M18 9h-5.5c-1.37 0-2.5 1.12-2.5 2.5 0 1.39 1.12 2.5 2.5 2.5H18v1.997A1.999 1.999 0 0116.005 18H1.995A1.997 1.997 0 010 15.997V7.003C0 5.897.893 5 1.995 5h14.01C17.107 5 18 5.894 18 7.003V9zM4 4c.872-.374 1.696-.735 2.472-1.083.678-.294 1.35-.588 2.01-.882.663-.294 1.18-.52 1.55-.682.567-.254 1.072-.37 1.516-.35.444.02.765.03 1.126.19.36.16.703.633.857.793L15 4H4zm8.5 9a1.5 1.5 0 11.001-3.001A1.5 1.5 0 0112.5 13z",fillRule:"evenodd"}))},k=Object.assign;var R=function(e){return u.a.createElement(j.a,k({width:"14",height:"16",viewBox:"0 0 18 18"},e),u.a.createElement("path",{fill:"#0C2",d:"M6.276 12.186a.6.6 0 01-.523-.31l-.04-.086-1.638-3.622a.301.301 0 01.452-.369L6.46 9.185a.887.887 0 00.8.092L16.35 5.2C14.722 3.265 12.038 2 9 2 4.03 2 0 5.383 0 9.556c0 2.277 1.212 4.326 3.11 5.712a.608.608 0 01.22.685l-.406 1.524c-.02.07-.048.146-.048.22a.3.3 0 00.3.303.335.335 0 00.173-.056l1.97-1.146a.888.888 0 01.742-.1c.92.266 1.91.414 2.938.414 4.97 0 9-3.383 9-7.556a6.573 6.573 0 00-1.025-3.5L6.612 12.08l-.066.04a.604.604 0 01-.27.064z",fillRule:"evenodd"}))},w=n(66);function N(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,a=Object(o.a)(e);if(t){var r=Object(o.a)(this).constructor;n=Reflect.construct(a,arguments,r)}else n=a.apply(this,arguments);return Object(c.a)(this,n)}}var I=8,S=9,P=13,x=48,T=57;function B(e,t){return e?t?!0===t?"":t:e:""}var z=function(e){Object(i.a)(n,e);var t=N(n);function n(e){var r;return Object(a.a)(this,n),(r=t.call(this,e)).onInputFocus=r.onInputFocus.bind(Object(w.a)(r)),r.onInputChange=r.onInputChange.bind(Object(w.a)(r)),r.onKeyDown=r.onKeyDown.bind(Object(w.a)(r)),r}return Object(r.a)(n,[{key:"onInputFocus",value:function(){this.props.onFocus()}},{key:"onInputChange",value:function(e){var t=String(e.target.value);if(t){t=t[t.length-1];var n=this.props.chars,a=this.props.length;n.length===a?n=n.replace(/.$/,t):n+=t,this.props.onChange(n),n.length===a&&this.props.onFinish(n)}}},{key:"onKeyDown",value:function(e){var t=e.keyCode;if(!e.metaKey&&!e.ctrlKey&&t!==S&&t!==P){var n=this.props.chars;t===I?(n=n.slice(0,-1),this.props.onChange(n)):(tT)&&(e.preventDefault(),this.props.onError(e))}}},{key:"focus",value:function(){this.input.focus()}},{key:"blur",value:function(){this.input.blur()}},{key:"render",value:function(){var e=this,t=this.props,n=t.length,a=t.chars,r=t.maskChar,i=t.autoFocus,c=t.className,o=t.children,l=a.length===n?n-1:a.length,u=a[l]||"";return Object(s.c)("label",{className:b()("TPass",c),children:[Object(s.c)("span",{className:"TPass-wrapper",children:[Object(s.b)(M,{length:n,chars:a,maskChar:r}),Object(s.b)("input",{className:"TPass-input",value:u,style:{left:60*l},onFocus:this.onInputFocus,onChange:this.onInputChange,onKeyDown:this.onKeyDown,onPaste:function(e){return e.preventDefault()},type:"number",min:"0",max:"9",pattern:"[0-9]*",autoFocus:i,ref:function(t){e.input=t}})]}),o]})}}]),n}(l.Component);function M(e){for(var t,n=e.length,a=e.chars,r=e.maskChar,i=[],c=0;c0&&void 0!==arguments[0]?arguments[0]:60;window.clearInterval(this.smsTimer),this.setState({smsTimer:t}),this.smsTimer=window.setInterval((function(){(t-=1)<=0?(window.clearInterval(e.smsTimer),e.smsTimer=null,e.setState({smsTimer:0})):e.setState({smsTimer:t})}),1e3)}},{key:"payWithBalance",value:function(e){return 6!==e.length?(this.setState({error:"请输入 6 位支付密码"}),!1):(this.setState({isInProgress:!0,error:null}),this.props.trade.payWithBalance(e))}},{key:"renderPaymentsList",value:function(){var e=this,t=this.state,n=t.payments,a=t.chosePaymentName,r=t.choseName,i=this.props.trade;if(a)return null;var c=n.balance&&n.balance.amount,o=i.info.total,l=n.wechat&&n.wechat.enable,u=this.props.balanceEnable,d=n.balance&&n.balance.enable,p=n.balance&&!n.balance.enable,h=u&&c>=o,b="使用余额(剩余 ".concat((c/100).toFixed(2),")"),f=h?b:"微信支付",v=h?"wallet":"wechatPayment";r&&(f="wechat"===r?"微信支付":b,v="wechat"===r?"wechatPayment":"wallet");var j=Object(s.c)(m.c,{css:{padding:0,border:"none"},children:["wechatPayment"===v?Object(s.b)(R,{center:!0}):Object(s.b)(C,{center:!0})," ",f,Object(s.b)(O.a,{center:!0})]});return Object(s.c)("div",{className:"PaymentsList",children:[Object(s.b)("span",{className:"Payment-Topline"}),Object(s.b)("span",{className:"PaymentWay",children:"支付方式"}),Object(s.b)(D.a,{placeholder:j,children:Object(s.c)(y.b,{plain:!0,className:"Payment-select",listClassName:"Payment-select-list",targetClassName:"Popover-targetContainer-verification",menuToggler:j,onChange:function(t){"disabled"!==t&&e.setState({choseName:t})},children:[u&&d&&Object(s.c)(y.a,{value:"balance",className:"PaymentItem",children:[Object(s.b)(C,{center:!0}),b]}),u&&p&&Object(s.c)(y.a,{value:"disabled",className:"PaymentItem PaymentItem--disabled",children:[Object(s.b)(C,{center:!0}),b]}),l&&Object(s.c)(y.a,{value:"wechat",className:"PaymentItem",children:[Object(s.b)(R,{center:!0}),"微信支付"]})]})}),Object(s.b)("span",{className:"Payment-Bottomline"}),Object(s.b)(m.c,{className:"Payment-CheckedButton",onClick:this.confirmPayment,children:"确认支付"})]})}},{key:"render",value:function(){var e=this,t=this.props,n=t.className,a=t.trade,r=this.state,i=r.payments,c=r.chosePaymentName,o=r.codeUrl,l=r.needSMS,u=r.isInProgress;return a?Object(s.c)("div",{className:b()("Payment",n),children:[Object.keys(i).length?this.renderPaymentsList():Object(s.b)("div",{className:"Payment-placeholder",children:Object(s.b)(E,{})}),"wechat"===c&&Object(s.c)("div",{className:"Payment-wechatPay",children:[Object(s.c)("div",{className:"Payment-wechatPayTitle",children:[Object(s.b)("i",{className:"icon icon-ic_wechatpay PaymentIconWechat"}),"微信支付"]}),!this.isInWechat&&Object(s.b)("div",{children:"使用微信扫描二维码完成支付"}),this.state.qrLoaded?Object(s.b)("span",{className:"Payment-qrWrapper",children:Object(s.b)("img",{role:"presentation",src:"//www.zhihu.com/qrcode?url=".concat(o),width:"150",height:"150"})}):Object(s.c)("div",{className:"Payment-qrPlaceholder",children:[Object(s.b)(E,{}),!this.isInWechat&&Object(s.b)("div",{children:"正在生成二维码"}),o&&Object(s.b)("img",{role:"presentation",src:"//www.zhihu.com/qrcode?url=".concat(o),width:"1",height:"1",onLoad:this.onQrLoad})]})]}),"balance"===c&&Object(s.c)("form",{onSubmit:this.onBalanceFormSubmit,className:"Payment-balancePay",children:[Object(s.c)("div",{className:"Payment-balancePayTitle",children:[Object(s.b)("i",{className:"icon icon-wallet PaymentIconWallet"}),"余额支付"]}),!l&&Object(s.c)("div",{children:[Object(s.b)("div",{className:"Payment-description",children:"请输入 6 位数知乎支付密码,用于支付验证。"}),Object(s.b)(F,{chars:this.state.passcode,onFocus:this.onPasscodeFocus,onChange:this.onPasscodeInput,maskChar:!0,onFinish:this.onPasscodeFinish,className:b()("Payment-tpass",{"Payment-errorInput":this.state.error,"Payment-progressing":u}),autoFocus:!0,ref:function(t){e.tpass=t},children:u&&Object(s.b)(E,{className:"Payment-balancePaySpinner"})})]}),Boolean(l)&&Object(s.c)("div",{className:"Payment-balancePaySms",children:[Object(s.b)("div",{className:"Payment-balancePaySmsText",children:String(l)}),Object(s.b)("input",{onChange:this.onPasscodeInput,value:this.state.passcode,className:b()("Payment-sms","SimpleInput",{"Payment-errorInput":this.state.error}),type:"text",pattern:"\\d{6}",minLength:"6",maxLength:"6",title:"验证码应为 6 位数字",placeholder:"输入 6 位数验证码",required:!0,autoFocus:!0,ref:function(t){e.smsInput=t}}),this.state.smsTimer?Object(s.c)("button",{className:"Payment-sendSms",type:"button",disabled:!0,children:[this.state.smsTimer," 秒后可重发"]}):Object(s.b)("button",{onClick:this.onSendSMSCode,className:"Payment-sendSms",type:"button",children:"发送验证码"})]}),Object(s.c)("div",{className:"Payment-balancePayFooter",children:[Object(s.b)("p",{className:"Payment-errorTip",style:{visibility:this.state.error?"visible":"hidden"},children:this.state.error}),Boolean(l)&&Object(s.b)(m.c,{color:"blue",disabled:u,className:"Payment-balancePayConfirmBtn",type:"submit",children:"确认"})]}),!l&&Object(s.c)("div",{className:"Payment-balancePayForget",children:["如果忘记密码请邮件联系"," ",Object(s.b)("email",{className:"Payment-email",children:"i@zhihu.com"})]})]})]}):Object(s.b)("div",{className:b()("Payment",n),children:Object(s.b)("div",{className:"Payment-placeholder Payment-placehoder--empty",children:Object(s.b)(E,{})})})}}]),n}(l.Component);A.propTypes={trade:p.a.object,autoChooseSinglePayment:p.a.bool,onSuccess:p.a.func.isRequired,onFail:p.a.func,onError:p.a.func,onConfirmPayment:p.a.func,balanceEnable:p.a.bool},A.defaultProps={trade:null,onSuccess:function(){},onFail:function(){},onError:function(){},autoChooseSinglePayment:!0,className:"",balanceEnable:!0};var U=A,W=n(122),H="",K=null;var Z=n(24);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,a=Object(o.a)(e);if(t){var r=Object(o.a)(this).constructor;n=Reflect.construct(a,arguments,r)}else n=a.apply(this,arguments);return Object(c.a)(this,n)}}var G=[200,500,1e3,5e3,1e4,2e4],J=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)).onConfirmPayment=function(e){r.setState({chosePaymentName:e})},r.onPaySuccess=function(){r.props.onPaySuccess(),r.setState({chosePaymentName:!0,colseTijarDialogStatus:!0,trade:void 0,currentAmount:"",customButton:!1})},r.handleCustomAmount=function(){r.state.trade&&r.state.trade.dispose(),r.setState({showCustom:!0})},r.handleCustomChange=function(e){var t=e.target.value;isNaN(t)?r.setState({customAmount:""}):r.setState({customAmount:parseInt(t)||""})},r.handleCustomKeyUp=function(e){13===e.keyCode&&r.handleSubmitCustom()},r.handleSubmitCustom=function(){var e=100*r.state.customAmount;e>0&&e<=5e4&&(r.setState({customButton:!0,showCustom:!1,colseTijarDialogStatus:!1}),r.createTrade(e))},r.closeModal=function(){r.state.trade&&r.state.trade.dispose(),r.setState(r.getDefaultState())},r.handleAmountButton=function(e){r.createTrade(e.currentTarget.dataset.amount),r.setState({colseTijarDialogStatus:!1,customButton:!1,showCustom:!1})},r.createTrade=function(e){r.setState({tradeLoading:!0,currentAmount:e});var t=r.props.ua;r.props.addReward(e,t.Wechat?"wechat":"normal"),r.setState({tradeLoading:!1})},r.colseTijarDialog=function(){r.setState({chosePaymentName:!0,colseTijarDialogStatus:!0,trade:void 0,currentAmount:""}),r.props.colseTijarDialog()},r.state=r.getDefaultState(),r}return Object(r.a)(n,[{key:"componentDidMount",value:function(){this.showTip()}},{key:"componentDidUpdate",value:function(){var e=this.props,t=e.tradeNumber,n=e.type,a=this.state,r=a.trade,i=a.colseTijarDialogStatus,c="article"===n?11:17;if(t&&(!r||t!==r.tradeNo)&&!i){var o=new window.zhihu.pay.Trade(t,c);this.setState({trade:o})}}},{key:"componentWillUnmount",value:function(){this.props.TipjarRender&&this.props.removeTradeNumber()}},{key:"getDefaultState",value:function(){return{showCustom:!1,customAmount:"",currentAmount:"",showTipModal:!1,customButton:!1,chosePaymentName:!0,colseTijarDialogStatus:!1}}},{key:"showTip",value:function(){var e,t,n=this;e="https://pay.zhihu.com/api/js",t=function(){n.setState({showTipModal:!0})},H&&e&&e!==H&&t(new Error("A pay-sdk from different source has been load")),H=e,window.zhihu&&window.zhihu.pay?window.zhihu.pay.ready(t):(K||(K=Object(W.loadScript)(e)),K.then((function(){return window.zhihu.pay.ready(t)}),(function(e){t(e),K=null})))}},{key:"renderAmountCustom",value:function(){var e=this.state,t=e.showCustom,n=e.customAmount,a=e.currentAmount,r=e.customButton;return Object(s.b)("div",{className:"Reward-TipjarDialog-amountCustom",children:t?Object(s.c)("div",{className:"Reward-TipjarDialog-amountInput",children:[Object(s.b)("input",{name:"",type:"text",className:"SimpleInput",placeholder:"你想赞赏的金额(不超过 500)",value:n,onChange:this.handleCustomChange,onKeyUp:this.handleCustomKeyUp,ref:function(e){e&&e.focus()}}),Object(s.b)(m.c,{disabled:n<=0||n>500,color:"blue",preset:"primary",onClick:this.handleSubmitCustom,children:"确定"}),Object(s.b)("div",{className:"Reward-TipjarDialog-error",style:{display:n>500?"block":"none"},children:"不能超过 500 元"})]}):Object(s.b)(m.c,{preset:"plain",className:r?"TipjarDialog-customButton-cheked":"TipjarDialog-customButton",onClick:this.handleCustomAmount,children:r?"自定义金额: ¥ ".concat(a/100):"自定义金额"})})}},{key:"renderTipjarDialog",value:function(){var e=this,t=this.props,n=t.author,a=n.name,r=n.avatarUrl,i=n.isOrg,c=n.urlToken,o=n.id,l=t.tagline,u=this.state.currentAmount;return Object(s.c)("div",{className:"Reward-TipjarDialog",children:[Object(s.c)("div",{className:"Reward-TipjarDialog-user",children:[Object(s.b)("a",{href:"/".concat(i?"org":"people","/").concat(c||o),className:"Reward-UserAvatar",children:Object(s.b)("img",{src:r.replace("_is","_l"),className:"Reward-Avatar",alt:"当前用户"})}),a]}),Object(s.b)("div",{className:"Reward-TipjarDialog-tagLine",children:l}),Object(s.c)("div",{className:"Reward-TipjarDialog-selectAmount",children:[Object(s.b)("div",{className:"Reward-TipjarDialog-amountList",children:G.map((function(t){return Object(s.b)(m.c,{"data-amount":t,onClick:e.handleAmountButton,color:"red",className:b()({"Reward-Button-checked":Number(u)===t}),children:Object(s.b)("b",{children:Number(u)===t?"".concat(t/100," 元"):"¥ ".concat(t/100)})},t)}))}),this.renderAmountCustom()]})]})}},{key:"render",value:function(){var e=this.props,t=e.ua,n=e.TipjarRender,a=e.isMobile,r=e.tradeNumber,i=e.balanceEnable,c=this.state,o=c.showCustom,l=c.tradeLoading,u=c.showTipModal,d=c.trade,p=c.chosePaymentName,h=a?v.a:f.b,b=a?"small":"default";return Object(s.b)(h,{overlay:!0,size:b,onClose:this.colseTijarDialog,className:"Reward-TipjarDialogModal",children:n&&Object(s.c)("div",{children:[u&&p&&this.renderTipjarDialog(),(d||l)&&!o&&Object(s.b)(U,{trade:d,tradeNumber:r,ua:t,onSuccess:this.onPaySuccess,onConfirmPayment:this.onConfirmPayment,balanceEnable:i})]})})}}]),n}(l.Component);J.propTypes={author:p.a.object,tagline:p.a.string,colseTijarDialog:p.a.func,addReward:p.a.func,tradeNumber:p.a.number,removeTradeNumber:p.a.func,onPaySuccess:p.a.func,isMobile:p.a.bool,type:p.a.string,balanceEnable:p.a.bool},J.defaultProps={tagline:Z.p,balanceEnable:!0}},989:function(e,t,n){"use strict";n.d(t,"a",(function(){return c}));n(1);var a=n(11),r=n.n(a),i=n(5),c=function(e){var t=e.avatar,n=e.bottom,a=e.button,c=e.className,o=e.height,s=e.icon,l=e.inline,u=e.right,d=e.style,p=void 0===d?{}:d,h=e.title,b=e.width,m=Object.assign({},p);return b&&(m.width="".concat(b,"px")),o&&(m.height="".concat(o,"px")),n&&(m.marginBottom="".concat(n,"px")),u&&(m.marginRight="".concat(u,"px")),Object(i.g)("div",{className:r()("Holder",c,{"Holder--inline":l,"Holder--title":h,"Holder--icon":s,"Holder--button":a,"Holder--avatar":t}),style:m})}}}]); //# sourceMappingURL=main.modals.7d92d12a1488c2081885.js.map