"use strict";(self.webpackChunkseahub_frontend=self.webpackChunkseahub_frontend||[]).push([[6472],{21870:function(e,t,n){var s=n(23029),a=n(92901),i=n(39874),o=n(85501),r=n(9950),l=n(58195),c=n(14113),d=n(99308),h=n(76152),u=n(55627),m=n(85077),p=n(85907),g=n(18849),f=n(40326),A=n(44414),x=function(e){function t(e){var n;return(0,s.A)(this,t),(n=(0,i.A)(this,t,[e])).toggle=function(){n.props.toggleDialog()},n.executeOperation=function(){n.toggle(),n.props.executeOperation(n.state.isChecked)},n.onInputChange=function(e){n.setState({isChecked:e.target.checked})},n.state={isChecked:!1},n}return(0,o.A)(t,e),(0,a.A)(t,[{key:"render",value:function(){return(0,A.jsxs)(l.A,{isOpen:!0,toggle:this.toggle,children:[(0,A.jsx)(c.A,{toggle:this.toggle,children:(0,f.AP)("Unlink device")}),(0,A.jsxs)(d.A,{children:[(0,A.jsx)("p",{children:(0,f.AP)("Are you sure you want to unlink this device?")}),(0,A.jsx)(h.A,{check:!0,children:(0,A.jsxs)(u.A,{check:!0,children:[(0,A.jsx)(m.A,{type:"checkbox",checked:this.state.isChecked,onChange:this.onInputChange}),(0,A.jsx)("span",{children:(0,f.AP)("Delete files from this device the next time it comes online.")})]})})]}),(0,A.jsxs)(p.A,{children:[(0,A.jsx)(g.A,{color:"secondary",onClick:this.toggle,children:(0,f.AP)("Cancel")}),(0,A.jsx)(g.A,{color:"primary",onClick:this.executeOperation,children:(0,f.AP)("Unlink")})]})]})}}])}(r.Component);t.A=x},34555:function(e,t,n){var s=n(23029),a=n(92901),i=n(39874),o=n(85501),r=n(9950),l=n(44414),c=function(e){function t(){return(0,s.A)(this,t),(0,i.A)(this,t,arguments)}return(0,o.A)(t,e),(0,a.A)(t,[{key:"render",value:function(){var e=this;return(0,l.jsx)("div",{className:"side-nav",children:(0,l.jsx)("div",{className:"side-nav-con",children:(0,l.jsx)("ul",{className:"nav nav-pills flex-column",children:this.props.data.map((function(t,n){return t.show?(0,l.jsx)("li",{className:"nav-item".concat(e.props.curItemID==t.href.substr(1)?" active":""),children:(0,l.jsx)("a",{className:"nav-link".concat(e.props.curItemID==t.href.substr(1)?" active":""),href:t.href,children:t.text})},n):null}))})})})}}])}(r.Component);t.A=c},57208:function(e,t,n){var s=n(23029),a=n(92901),i=n(39874),o=n(85501),r=n(9950),l=n(17119),c=n(70446),d=n.n(c),h=n(58195),u=n(65604),m=n(40326),p=n(97011),g=n(4086),f=n(44414),A=function(e){function t(){return(0,s.A)(this,t),(0,i.A)(this,t,arguments)}return(0,o.A)(t,e),(0,a.A)(t,[{key:"render",value:function(){return(0,f.jsx)("div",{className:"main-panel",children:this.props.children})}}])}(r.Component),x=A,v=n(49403),j=n(48738),w=n.n(j),b=n(34555),P=function(e){function t(){return(0,s.A)(this,t),(0,i.A)(this,t,arguments)}return(0,o.A)(t,e),(0,a.A)(t,[{key:"render",value:function(){return(0,f.jsxs)("div",{className:w()("side-panel",{"left-zero":!this.props.isSidePanelClosed}),children:[(0,f.jsx)("div",{className:"side-panel-north",children:(0,f.jsx)(v.A,{onCloseSidePanel:this.props.onCloseSidePanel})}),(0,f.jsx)("div",{className:"side-panel-center",children:(0,f.jsx)(b.A,{data:this.props.data,curItemID:this.props.curItemID})})]})}}])}(r.Component),k=P,C=n(27288),S=function(e){function t(){return(0,s.A)(this,t),(0,i.A)(this,t,arguments)}return(0,o.A)(t,e),(0,a.A)(t,[{key:"render",value:function(){var e=this.props,t=e.onShowSidePanel,n=e.onSearchedClick,s=e.children,a=e.showSearch;return(0,f.jsxs)("div",{className:"main-panel-north ".concat(s?"border-left-show":""),children:[(0,f.jsxs)("div",{className:"cur-view-toolbar",children:[(0,f.jsx)("span",{title:"Side Nav Menu",onClick:t,className:"sf2-icon-menu side-nav-toggle hidden-md-up d-md-none"}),this.props.children]}),(0,f.jsx)(C.A,{showSearch:a,searchPlaceholder:this.props.searchPlaceholder,onSearchedClick:n})]})}}])}(r.Component),y=S,D=window.app.pageOptions,N=D.avatarURL,O=D.csrfToken,I=function(e){function t(e){var n;return(0,s.A)(this,t),(n=(0,i.A)(this,t,[e])).fileInputChange=function(){if(n.fileInput.current.files.length){var e=n.fileInput.current.files[0],t=e.name;if(-1==t.lastIndexOf("."))return g.A.danger((0,m.AP)("Please choose an image file."),{duration:5}),!1;var s=t.substr(t.lastIndexOf(".")+1).toLowerCase(),a=["jpg","jpeg","png","gif"];if(-1==a.indexOf(s)){var i=(0,m.AP)("File extensions can only be {placeholder}.").replace("{placeholder}",a.join(", "));return g.A.danger(i,{duration:5}),!1}if(e.size>1048576){var o=(0,m.AP)("The file is too large. Allowed maximum size is 1MB.");return g.A.danger(o,{duration:5}),!1}p.e.updateUserAvatar(e).then((function(e){n.setState({avatarSrc:e.data.avatar_url}),g.A.success((0,m.AP)("Avatar updated"))})).catch((function(e){var t=u.Aq.getErrorMsg(e);g.A.danger(t)}))}},n.openFileInput=function(){n.fileInput.current.click()},n.handleMouseOver=function(){n.setState({isEditShown:!0})},n.handleMouseOut=function(){n.setState({isEditShown:!1})},n.onEditIconKeyDown=function(e){"Enter"!=e.key&&"Space"!=e.key||e.target.click()},n.state={avatarSrc:N,isEditShown:!1},n.fileInput=r.createRef(),n.form=r.createRef(),n}return(0,o.A)(t,e),(0,a.A)(t,[{key:"render",value:function(){return(0,f.jsxs)("form",{ref:this.form,className:"form-group row",encType:"multipart/form-data",method:"post",action:"".concat(m.Yc,"avatar/add/"),children:[(0,f.jsx)("input",{type:"hidden",name:"csrfmiddlewaretoken",value:O}),(0,f.jsx)("label",{className:"col-sm-1 col-form-label",children:(0,m.AP)("Avatar:")}),(0,f.jsxs)("div",{className:"col-auto position-relative",onMouseOver:this.handleMouseOver,onMouseOut:this.handleMouseOut,onFocus:this.handleMouseOver,tabIndex:"0",children:[(0,f.jsx)("img",{src:this.state.avatarSrc,width:"80",height:"80",alt:"",className:"user-avatar"}),(0,f.jsx)("input",{type:"file",name:"avatar",className:"d-none",onChange:this.fileInputChange,ref:this.fileInput}),(0,f.jsx)("span",{className:"avatar-edit sf3-font sf3-font-rename ".concat(!this.state.isEditShown&&"d-none"),onClick:this.openFileInput,role:"button","aria-label":(0,m.AP)("Edit"),tabIndex:"0",onKeyDown:this.onEditIconKeyDown})]})]})}}])}(r.Component),M=window.app.pageOptions,T=M.nameLabel,U=M.enableUpdateUserInfo,E=M.enableUserSetContactEmail,V=M.enableUserSetName,R=function(e){function t(e){var n;(0,s.A)(this,t),(n=(0,i.A)(this,t,[e])).handleNameInputChange=function(e){n.setState({name:e.target.value})},n.handleContactEmailInputChange=function(e){n.setState({contactEmail:e.target.value})},n.handleSubmit=function(e){e.preventDefault();var t={};V&&(t.name=n.state.name),E&&(t.contact_email=n.state.contactEmail),n.props.updateUserInfo(t)};var a=n.props.userInfo,o=a.contact_email,r=a.login_id,l=a.name;return n.state={contactEmail:o,loginID:r,name:l},n}return(0,o.A)(t,e),(0,a.A)(t,[{key:"render",value:function(){var e=this.state,t=e.contactEmail,n=e.loginID,s=e.name;return(0,f.jsxs)("form",{action:"",method:"post",onSubmit:this.handleSubmit,children:[(0,f.jsxs)("div",{className:"form-group row",children:[(0,f.jsx)("label",{className:"col-sm-1 col-form-label",htmlFor:"name",children:T}),(0,f.jsx)("div",{className:"col-sm-5",children:(0,f.jsx)("input",{className:"form-control",id:"name",type:"text",name:"nickname",value:s,disabled:!U||!V,onChange:this.handleNameInputChange})})]}),n&&(0,f.jsxs)("div",{className:"form-group row",children:[(0,f.jsx)("label",{className:"col-sm-1 col-form-label",htmlFor:"user-name",children:(0,m.AP)("Username:")}),(0,f.jsx)("div",{className:"col-sm-5",children:(0,f.jsx)("input",{className:"form-control",id:"user-name",type:"text",name:"username",value:n,disabled:!0,readOnly:!0})}),(0,f.jsx)("p",{className:"col-sm-5 m-0 input-tip",children:(0,m.AP)("You can use this field at login.")})]}),(t||E)&&(0,f.jsxs)("div",{className:"form-group row",children:[(0,f.jsx)("label",{className:"col-sm-1 col-form-label",htmlFor:"contact-email",children:(0,m.AP)("Contact Email:")}),(0,f.jsx)("div",{className:"col-sm-5",children:(0,f.jsx)("input",{className:"form-control",id:"contact-email",type:"text",name:"contact_email",value:t,disabled:!E,readOnly:!E,onChange:this.handleContactEmailInputChange})}),(0,f.jsx)("p",{className:"col-sm-5 m-0 input-tip",children:(0,m.AP)("Your notifications will be sent to this email.")})]}),(0,f.jsx)("button",{type:"submit",className:"btn btn-outline-primary offset-sm-1",disabled:!U,children:(0,m.AP)("Submit")})]})}}])}(r.Component),L=function(e){function t(e){var n;return(0,s.A)(this,t),(n=(0,i.A)(this,t,[e])).getAuthToken=function(){p.e.getAuthTokenBySession().then((function(e){n.setState({authToken:e.data.token})})).catch((function(e){var t=u.Aq.getErrorMsg(e);g.A.danger(t)}))},n.createAuthToken=function(){p.e.createAuthTokenBySession().then((function(e){n.setState({authToken:e.data.token,isAuthTokenVisible:!1}),g.A.success((0,m.AP)("Auth Token created"))})).catch((function(e){var t=u.Aq.getErrorMsg(e);g.A.danger(t)}))},n.deleteAuthToken=function(){p.e.deleteAuthTokenBySession().then((function(e){n.setState({authToken:"",isAuthTokenVisible:!1}),g.A.success((0,m.AP)("Auth Token deleted"))})).catch((function(e){var t=u.Aq.getErrorMsg(e);g.A.danger(t)}))},n.toggleAuthTokenVisible=function(){n.setState({isAuthTokenVisible:!n.state.isAuthTokenVisible})},n.onIconKeyDown=function(e){"Enter"!=e.key&&"Space"!=e.key||e.target.click()},n.state={authToken:"",isAuthTokenVisible:!1},n}return(0,o.A)(t,e),(0,a.A)(t,[{key:"componentDidMount",value:function(){this.getAuthToken()}},{key:"render",value:function(){var e=this.state,t=e.authToken,n=e.isAuthTokenVisible;return(0,f.jsx)(r.Fragment,{children:(0,f.jsxs)("div",{id:"get-auth-token",className:"setting-item",children:[(0,f.jsx)("h3",{className:"setting-item-heading",children:(0,m.AP)("Web API Auth Token")}),t?(0,f.jsxs)(r.Fragment,{children:[(0,f.jsxs)("div",{className:"d-flex align-items-center",children:[(0,f.jsx)("label",{className:"m-0 mr-2",htmlFor:"token",children:(0,m.AP)("Token:")}),(0,f.jsx)("input",{id:"token",className:"border-0 mr-1",type:"text",value:n?t:"****************************************",readOnly:!0,size:Math.max(t.length,10)}),(0,f.jsx)("span",{tabIndex:"0",role:"button","aria-label":n?(0,m.AP)("Hide"):(0,m.AP)("Show"),onKeyDown:this.onIconKeyDown,onClick:this.toggleAuthTokenVisible,className:"eye-icon sf3-font sf3-font-eye".concat(this.state.isAuthTokenVisible?"":"-slash")})]}),(0,f.jsx)("button",{className:"btn btn-outline-primary mt-2",onClick:this.deleteAuthToken,children:(0,m.AP)("Delete")})]}):(0,f.jsx)("button",{className:"btn btn-outline-primary",onClick:this.createAuthToken,children:(0,m.AP)("Generate")})]})})}}])}(r.Component),F=n(40866),_=n(14113),W=n(99308),q=n(48918),Y=n(85077),B=n(30038),z=n(18849),K=n(76115),G=n(85907),H=window.app.pageOptions,J=H.webdavSecretMinLength,Q=H.webdavSecretStrengthLevel,X=function(e){function t(e){var n;return(0,s.A)(this,t),(n=(0,i.A)(this,t,[e])).submit=function(){return 0===n.state.password.length?(n.setState({errMsg:(0,m.AP)("Please enter a password.")}),!1):n.state.password.length0?a[0]:"";return(0,f.jsx)("div",{className:"password-strength-check-container",children:(0,f.jsxs)("div",{className:"password-strength-check-box",children:[(0,f.jsxs)("div",{className:"password-strength-value",children:[(0,f.jsxs)("span",{children:[(0,m.AP)("Password strength"),": "]}),(0,f.jsx)("span",{className:l,children:(0,m.AP)(o)})]}),(0,f.jsx)(gt.A,{multi:!0,children:a.map((function(e,t){return(0,f.jsx)(gt.A,{bar:!0,className:e,value:"25"},t)}))}),(0,f.jsx)("div",{className:"password-strength-description",children:(0,f.jsx)("span",{children:(0,m.AP)("Password must be at least 8 characters long and contain different characters: uppercase letters, lowercase letters, numbers, and special symbols")})})]})})},xt=function(e){var t=e.value,n=e.labelValue,s=e.enableCheckStrength,a=e.onChangeValue,i=(0,r.useState)(t||""),o=(0,ht.A)(i,2),l=o[0],c=o[1],d=(0,r.useState)(!1),h=(0,ht.A)(d,2),m=h[0],p=h[1],g=(0,r.useState)(!1),A=(0,ht.A)(g,2),x=A[0],v=A[1];return(0,f.jsxs)(mt.A,{className:w()("password-input-container position-relative",{mobile:u.Fr}),children:[(0,f.jsx)(pt.A,{children:n}),(0,f.jsxs)(q.A,{className:"password",children:[(0,f.jsx)(Y.A,{type:m?"text":"password",value:t,onChange:function(e){var t=e.target.value;a(t),c(t)},onFocus:function(){s&&v(!0)},onBlur:function(){s&&v(!1)}}),x&&s&&(0,f.jsx)(At,{passwordValue:l}),(0,f.jsx)(B.A,{addonType:"append",children:(0,f.jsx)(z.A,{onClick:function(){return p(!m)},children:(0,f.jsx)("i",{className:"password-icon sf3-font sf3-font-eye".concat(m?"":"-slash")})})})]})]})};xt.defaultProps={enableCheckStrength:!0};var vt=xt,jt=n(71361),wt=function(e){var t=e.toggle,n=(0,r.useState)(""),s=(0,ht.A)(n,2),a=s[0],i=s[1],o=(0,r.useState)(""),l=(0,ht.A)(o,2),c=l[0],d=l[1],p=(0,r.useState)(""),A=(0,ht.A)(p,2),x=A[0],v=A[1],j=(0,r.useState)(!0),w=(0,ht.A)(j,2),b=w[0],P=w[1];return(0,f.jsxs)(h.A,{centered:!0,isOpen:!0,toggle:t,children:[(0,f.jsx)(_.A,{toggle:t,children:(0,m.AP)("Set password")}),(0,f.jsxs)(W.A,{children:[(0,f.jsxs)(ut.A,{children:[(0,f.jsx)(vt,{value:a,labelValue:(0,m.AP)("Password"),onChangeValue:i}),(0,f.jsx)(vt,{value:c,labelValue:(0,m.AP)("Confirm password"),onChangeValue:d,enableCheckStrength:!1})]}),x&&(0,f.jsx)(K.A,{color:"danger",children:x})]}),(0,f.jsxs)(G.A,{children:[(0,f.jsx)(z.A,{color:"secondary",onClick:t,children:(0,m.AP)("Cancel")}),(0,f.jsx)(z.A,{color:"primary",disabled:!b,onClick:function(){a?c?a===c?(0,u.Oj)(a)?(v(""),P(!1),jt.E.resetPassword(null,a).then((function(){g.A.success((0,m.AP)("Password set")),location.reload(),t()})).catch((function(e){var t=u.Aq.getErrorMsg(e);g.A.danger(t),P(!0)}))):v((0,m.AP)("Insufficient password strength")):v((0,m.AP)("Passwords don't match")):v((0,m.AP)("Please enter the password again")):v((0,m.AP)("Password cannot be blank"))},children:(0,m.AP)("Submit")})]})]})},bt=function(e){var t=e.toggle,n=(0,r.useState)(""),s=(0,ht.A)(n,2),a=s[0],i=s[1],o=(0,r.useState)(""),l=(0,ht.A)(o,2),c=l[0],d=l[1],p=(0,r.useState)(""),A=(0,ht.A)(p,2),x=A[0],v=A[1],j=(0,r.useState)(""),w=(0,ht.A)(j,2),b=w[0],P=w[1],k=(0,r.useState)(!0),C=(0,ht.A)(k,2),S=C[0],y=C[1];return(0,f.jsxs)(h.A,{centered:!0,isOpen:!0,toggle:t,children:[(0,f.jsx)(_.A,{toggle:t,children:(0,m.AP)("Update password")}),(0,f.jsxs)(W.A,{children:[(0,f.jsxs)(ut.A,{children:[(0,f.jsx)(vt,{value:a,labelValue:(0,m.AP)("Current password"),enableCheckStrength:!1,onChangeValue:i}),(0,f.jsx)(vt,{value:c,labelValue:(0,m.AP)("New password"),onChangeValue:d}),(0,f.jsx)(vt,{value:x,labelValue:(0,m.AP)("Confirm password"),onChangeValue:v,enableCheckStrength:!1})]}),b&&(0,f.jsx)(K.A,{color:"danger",children:b})]}),(0,f.jsxs)(G.A,{children:[(0,f.jsx)(z.A,{color:"secondary",onClick:t,children:(0,m.AP)("Cancel")}),(0,f.jsx)(z.A,{color:"primary",disabled:!S,onClick:function(){a?c?x?c===x?(a===c&&P((0,m.AP)("New password cannot be the same as old password")),(0,u.Oj)(c)?(P(""),y(!1),jt.E.resetPassword(a,c).then((function(){g.A.success((0,m.AP)("Password updated")),t()})).catch((function(e){var t=u.Aq.getErrorMsg(e);g.A.danger(t),y(!0)}))):P((0,m.AP)("Insufficient password strength"))):P((0,m.AP)("Passwords don't match")):P((0,m.AP)("Please enter the password again")):P((0,m.AP)("Password cannot be blank")):P((0,m.AP)("Current password cannot be blank"))},children:(0,m.AP)("Submit")})]})]})},Pt=(n(16322),n(18291),n(81848),n(30923),window.app.pageOptions),kt=Pt.canUpdatePassword,Ct=Pt.passwordOperationText,St=Pt.enableGetAuthToken,yt=Pt.enableWebdavSecret,Dt=Pt.enableAddressBook,Nt=Pt.twoFactorAuthEnabled,Ot=Pt.enableWechatWork,It=Pt.enableDingtalk,Mt=Pt.isOrgContext,Tt=Pt.enableADFS,Ut=Pt.enableMultiADFS,Et=Pt.enableDeleteAccount,Vt=Pt.userUnusablePassword,Rt=function(e){function t(e){var n;return(0,s.A)(this,t),(n=(0,i.A)(this,t,[e])).updateUserInfo=function(e){p.e.updateUserInfo(e).then((function(e){n.setState({userInfo:e.data}),g.A.success((0,m.AP)("User info updated"))})).catch((function(e){var t=u.Aq.getErrorMsg(e);g.A.danger(t)}))},n.handleContentScroll=function(e){var t=e.target.scrollTop,s=n.sideNavItems.filter((function(e,n){return e.show&&document.getElementById(e.href.substr(1)).offsetTop-45