VaKeR CYBER ARMY
Logo of a company Server : Apache/2.4.41 (Ubuntu)
System : Linux absol.cf 5.4.0-198-generic #218-Ubuntu SMP Fri Sep 27 20:18:53 UTC 2024 x86_64
User : www-data ( 33)
PHP Version : 7.4.33
Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Directory :  /opt/mattermost/client/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //opt/mattermost/client/1241.ba3fa460d3b18e04f257.js.map
{"version":3,"file":"1241.ba3fa460d3b18e04f257.js","mappings":"mLAMO,SAASA,EAAYC,GACxB,MAAO,CAACC,EAAUC,KACd,MAAMC,GAAgBC,EAAAA,EAAAA,IAAiBF,KAEvC,OAAOD,EAASI,EAAAA,GAA0BF,GAAe,EAAMH,GAAM,CAE7E,CAEO,SAASM,IACZ,MAAO,CAACL,EAAUC,KACd,MAAMC,GAAgBC,EAAAA,EAAAA,IAAiBF,KAEvC,OAAOD,EAASI,EAAAA,GAA0BF,GAAe,GAAO,CAExE,CAEO,SAASI,IACZ,MAAO,CAACN,EAAUC,KACd,MAAMC,GAAgBC,EAAAA,EAAAA,IAAiBF,KAEvC,OAAOD,EAASI,EAAAA,GAA8BF,GAAe,CAErE,C,yHCLA,MAAMK,EAAaC,IAAmD,IAAlD,IAACC,EAAG,UAAEC,EAAS,QAAEC,GAAeH,EAChD,MAAM,cAACI,IAAiBC,EAAAA,EAAAA,WAExB,OACIC,IAAAA,cAAA,OAAKJ,UAAWK,IAAW,gBAAiBL,IACxCI,IAAAA,cAACE,EAAAA,KA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IAAG,YAC7B4E,OAAQA,IACJvE,IAAAA,cAAC8B,EAAO,cAWpD,EACHY,EAhGoBqD,EAAa,aAlB9BkB,SAAQxG,IAAAA,MAAA,CAJRyG,OAAMzG,IAAAA,OAAA4E,aAAAA,WAKN8B,SAAQ1G,IAAAA,KACR+F,IAAG/F,IAAAA,KAAA4E,WACHY,gCAA+BxF,IAAAA,KAAA4E,WAC/BV,iCAAgClE,IAAAA,KAAA4E,WAKhC2B,MAAKvG,IAAAA,MAAA,CACDd,IAAGc,IAAAA,OAAA4E,aAAAA,aCPX,SAAeG,EAAAA,EAAAA,UAff,SAAyB7B,GACrB,MAAMyD,GAAUC,EAAAA,EAAAA,IAAW1D,GACrB8B,GAASC,EAAAA,EAAAA,IAAU/B,GAMzB,MAAO,CACH6C,IALwB,SAAhBY,EAAQE,IAMhBrB,gCAL+E,SAA3CR,EAAO8B,gCAM3C5C,iCALiF,SAA5Cc,EAAOG,iCAOpD,GAEA,CAAwCG,E,qECpBzB,SAASW,IACpB,MAAM,cAAC5G,IAAiBC,EAAAA,EAAAA,WACxB,OACIC,IAAAA,cAAA,KACIJ,UAAU,yBACVS,MAAOP,EAAc,CAACM,GAAI,uBAAwBE,eAAgB,iBAG9E,C","sources":["webpack://mattermost-webapp/./src/actions/views/mfa.js","webpack://mattermost-webapp/./src/components/common/back_button.tsx","webpack://mattermost-webapp/./src/components/localized_placeholder_input.tsx","webpack://mattermost-webapp/./src/components/mfa/confirm.tsx","webpack://mattermost-webapp/./src/components/mfa/setup/setup.tsx","webpack://mattermost-webapp/./src/components/mfa/setup/index.ts","webpack://mattermost-webapp/./src/components/mfa/mfa_controller/mfa_controller.tsx","webpack://mattermost-webapp/./src/components/mfa/mfa_controller/index.ts","webpack://mattermost-webapp/./src/components/widgets/icons/fa_logout_icon.tsx"],"sourcesContent":["// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.\n// See LICENSE.txt for license information.\n\nimport * as UserActions from 'mattermost-redux/actions/users';\nimport {getCurrentUserId} from 'mattermost-redux/selectors/entities/users';\n\nexport function activateMfa(code) {\n    return (dispatch, getState) => {\n        const currentUserId = getCurrentUserId(getState());\n\n        return dispatch(UserActions.updateUserMfa(currentUserId, true, code));\n    };\n}\n\nexport function deactivateMfa() {\n    return (dispatch, getState) => {\n        const currentUserId = getCurrentUserId(getState());\n\n        return dispatch(UserActions.updateUserMfa(currentUserId, false));\n    };\n}\n\nexport function generateMfaSecret() {\n    return (dispatch, getState) => {\n        const currentUserId = getCurrentUserId(getState());\n\n        return dispatch(UserActions.generateMfaSecret(currentUserId));\n    };\n}\n\n","// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.\n// See LICENSE.txt for license information.\n\nimport classNames from 'classnames';\nimport React from 'react';\nimport {FormattedMessage, useIntl} from 'react-intl';\nimport {Link} from 'react-router-dom';\n\ntype Props = {\n\n    /**\n     * URL to return to\n     */\n    url: string;\n\n    className?: string;\n\n    /**\n     * onClick handler when user clicks back button\n     */\n    onClick?: React.EventHandler<React.MouseEvent>;\n}\n\nconst BackButton = ({url, className, onClick}: Props): JSX.Element => {\n    const {formatMessage} = useIntl();\n\n    return (\n        <div className={classNames('signup-header', className)}>\n            <Link\n                data-testid='back_button'\n                onClick={onClick}\n                to={url}\n            >\n                <span\n                    id='back_button_icon'\n                    className='fa fa-1x fa-angle-left'\n                    title={formatMessage({id: 'generic_icons.back', defaultMessage: 'Back Icon'})}\n                />\n                <FormattedMessage\n                    id='web.header.back'\n                    defaultMessage='Back'\n                />\n            </Link>\n        </div>\n    );\n};\nBackButton.defaultProps = {\n    url: '/',\n};\n\nexport default BackButton;\n","// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.\n// See LICENSE.txt for license information.\n\nimport React from 'react';\nimport {useIntl, type MessageDescriptor} from 'react-intl';\n\ntype Props = {\n    placeholder: MessageDescriptor;\n} & Omit<React.InputHTMLAttributes<HTMLInputElement>, 'placeholder'>;\n\nconst LocalizedPlaceholderInput = React.forwardRef<HTMLInputElement, Props>(({placeholder, ...otherProps}, ref) => {\n    const intl = useIntl();\n\n    return (\n        <input\n            ref={ref}\n            placeholder={intl.formatMessage(placeholder)}\n            {...otherProps}\n        />\n    );\n});\n\nLocalizedPlaceholderInput.displayName = 'LocalizedPlaceholderInput';\n\nexport default LocalizedPlaceholderInput;\n","// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.\n// See LICENSE.txt for license information.\n\nimport React, {useEffect} from 'react';\nimport {FormattedMessage} from 'react-intl';\n\nimport {redirectUserToDefaultTeam} from 'actions/global_actions';\n\nimport Constants from 'utils/constants';\nimport {isKeyPressed} from 'utils/keyboard';\n\nconst KeyCodes = Constants.KeyCodes;\n\nconst submit = (e: KeyboardEvent | React.FormEvent<HTMLFormElement>): void => {\n    e.preventDefault();\n    redirectUserToDefaultTeam();\n};\n\nconst onKeyPress = (e: React.KeyboardEvent<HTMLFormElement>| KeyboardEvent) => {\n    if (isKeyPressed(e as KeyboardEvent, KeyCodes.ENTER)) {\n        submit(e);\n    }\n};\n\nexport default function Confirm() {\n    useEffect(() => {\n        document.body.addEventListener('keydown', onKeyPress);\n\n        return () => {\n            document.body.removeEventListener('keydown', onKeyPress);\n        };\n    }, []);\n\n    return (\n        <div>\n            <form\n                onSubmit={submit}\n                onKeyPress={onKeyPress}\n                className='form-group'\n            >\n                <strong>\n                    <FormattedMessage\n                        id='mfa.confirm.complete'\n                        defaultMessage='Set up complete!'\n                    />\n                </strong>\n                <p>\n                    <FormattedMessage\n                        id='mfa.confirm.secure'\n                        defaultMessage='Your account is now secure. Next time you sign in, you will be asked to enter a code from the Google Authenticator app on your phone.'\n                    />\n                </p>\n                <button\n                    type='submit'\n                    className='btn btn-primary'\n                >\n                    <FormattedMessage\n                        id='mfa.confirm.okay'\n                        defaultMessage='Okay'\n                    />\n                </button>\n            </form>\n        </div>\n    );\n}\n","// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.\n// See LICENSE.txt for license information.\n\nimport React from 'react';\nimport {defineMessage, FormattedMessage} from 'react-intl';\n\nimport type {UserProfile} from '@mattermost/types/users';\n\nimport LocalizedPlaceholderInput from 'components/localized_placeholder_input';\n\ntype MFAControllerState = {\n    enforceMultifactorAuthentication: boolean;\n};\n\ntype Props = {\n\n    /*\n     * Object containing enforceMultifactorAuthentication\n     */\n    state: MFAControllerState;\n\n    /*\n     * Function that updates parent component with state props\n     */\n    updateParent: (state: MFAControllerState) => void;\n\n    currentUser: UserProfile;\n    siteName?: string;\n    enforceMultifactorAuthentication: boolean;\n    actions: {\n        activateMfa: (code: string) => Promise<{\n            error?: {\n                server_error_id: string;\n                message: string;\n            };\n        }>;\n        generateMfaSecret: () => Promise<{\n            data: {\n                secret: string;\n                qr_code: string;\n            };\n            error?: {\n                message: string;\n            };\n        }>;\n    };\n    history: {\n        push(path: string): void;\n    };\n}\n\ntype State = {\n    secret: string;\n    qrCode: string;\n    error: React.ReactNode;\n    serverError?: string;\n}\n\nexport default class Setup extends React.PureComponent<Props, State> {\n    input: React.RefObject<HTMLInputElement>;\n\n    public constructor(props: Props) {\n        super(props);\n\n        this.state = {\n            error: undefined,\n            secret: '',\n            qrCode: '',\n        };\n\n        this.input = React.createRef();\n    }\n\n    public componentDidMount(): void {\n        const user = this.props.currentUser;\n        if (!user || user.mfa_active) {\n            this.props.history.push('/');\n            return;\n        }\n\n        this.props.actions.generateMfaSecret().then(({data, error}) => {\n            if (error) {\n                this.setState({\n                    serverError: error.message,\n                });\n                return;\n            }\n\n            this.setState({\n                secret: data.secret,\n                qrCode: data.qr_code,\n            });\n        });\n    }\n\n    submit = (e: React.FormEvent<HTMLFormElement>): void => {\n        e.preventDefault();\n        const code = this.input?.current?.value.replace(/\\s/g, '');\n        if (!code || code.length === 0) {\n            this.setState({\n                error: (\n                    <FormattedMessage\n                        id='mfa.setup.codeError'\n                        defaultMessage='Please enter the code from Google Authenticator.'\n                    />\n                ),\n            });\n            return;\n        }\n\n        this.setState({error: null});\n\n        this.props.actions.activateMfa(code).then(({error}) => {\n            if (error) {\n                if (error.server_error_id === 'ent.mfa.activate.authenticate.app_error') {\n                    this.setState({\n                        error: (\n                            <FormattedMessage\n                                id='mfa.setup.badCode'\n                                defaultMessage='Invalid code. If this issue persists, contact your System Administrator.'\n                            />\n                        ),\n                    });\n                } else {\n                    this.setState({\n                        error: error.message,\n                    });\n                }\n                return;\n            }\n\n            this.props.history.push('/mfa/confirm');\n        });\n    };\n\n    public render(): JSX.Element {\n        let formClass = 'form-group';\n        let errorContent;\n        if (this.state.error) {\n            errorContent = <div className='form-group has-error'><label className='control-label'>{this.state.error}</label></div>;\n            formClass += ' has-error';\n        }\n\n        let mfaRequired;\n        if (this.props.enforceMultifactorAuthentication) {\n            mfaRequired = (\n                <p>\n                    <FormattedMessage\n                        id='mfa.setup.required_mfa'\n                        defaultMessage='<strong>Multi-factor authentication is required on {siteName}.</strong>'\n                        values={{\n                            siteName: this.props.siteName,\n                            strong: (chunks: React.ReactNode) => <strong>{chunks}</strong>,\n                        }}\n                    />\n                </p>\n            );\n        }\n\n        return (\n            <div>\n                <form\n                    onSubmit={this.submit}\n                    className={formClass}\n                >\n                    {mfaRequired}\n                    <p>\n                        <FormattedMessage\n                            id='mfa.setup.step1'\n                            defaultMessage='1. Scan the QR code below using an authenticator app of your choice, such as Google Authenticator, Microsoft Authenticator app, or 1Password.'\n                        />\n                    </p>\n                    <p>\n                        <FormattedMessage\n                            id='mfa.setup.step2_secret'\n                            defaultMessage='Alternatively, enter the secret key displayed below into the authenticator app manually.'\n                        />\n                    </p>\n                    <div className='form-group'>\n                        <div className='col-sm-12'>\n                            <img\n                                alt={'qr code image'}\n                                style={style.qrCode}\n                                src={'data:image/png;base64,' + this.state.qrCode}\n                            />\n                        </div>\n                    </div>\n                    <br/>\n                    <div className='form-group'>\n                        <p className='col-sm-12'>\n                            <FormattedMessage\n                                id='mfa.setup.secret'\n                                defaultMessage='Secret: {secret}'\n                                values={{\n                                    secret: this.state.secret,\n                                }}\n                            />\n                        </p>\n                    </div>\n                    <p>\n                        <FormattedMessage\n                            id='mfa.setup.step3_code'\n                            defaultMessage='2. Enter the code generated by the authenticator app in the field below.'\n                            values={{\n                                strong: (chunks: React.ReactNode) => <strong>{chunks}</strong>,\n                            }}\n                        />\n                    </p>\n                    <p>\n                        <LocalizedPlaceholderInput\n                            ref={this.input}\n                            className='form-control'\n                            placeholder={defineMessage({id: 'mfa.setup.code', defaultMessage: 'MFA Code'})}\n                            autoFocus={true}\n                        />\n                    </p>\n                    {errorContent}\n                    <button\n                        type='submit'\n                        className='btn btn-primary'\n                    >\n                        <FormattedMessage\n                            id='mfa.setup.save'\n                            defaultMessage='Save'\n                        />\n                    </button>\n                </form>\n            </div>\n        );\n    }\n}\n\nconst style = {\n    qrCode: {maxHeight: 170},\n};\n","// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.\n// See LICENSE.txt for license information.\n\nimport {connect} from 'react-redux';\nimport {bindActionCreators} from 'redux';\nimport type {Dispatch} from 'redux';\n\nimport type {GlobalState} from '@mattermost/types/store';\n\nimport {getConfig} from 'mattermost-redux/selectors/entities/general';\nimport {getCurrentUser} from 'mattermost-redux/selectors/entities/users';\n\nimport {activateMfa, generateMfaSecret} from 'actions/views/mfa';\n\nimport Setup from './setup';\n\nfunction mapStateToProps(state: GlobalState) {\n    const config = getConfig(state);\n\n    const siteName = config.SiteName;\n    const enforceMultifactorAuthentication = config.EnforceMultifactorAuthentication === 'true';\n\n    return {\n        currentUser: getCurrentUser(state),\n        siteName,\n        enforceMultifactorAuthentication,\n    };\n}\n\nfunction mapDispatchToProps(dispatch: Dispatch) {\n    return {\n        actions: bindActionCreators({\n            activateMfa,\n            generateMfaSecret,\n        }, dispatch),\n    };\n}\n\nexport default connect(mapStateToProps, mapDispatchToProps)(Setup);\n","// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.\n// See LICENSE.txt for license information.\n\nimport React from 'react';\nimport {FormattedMessage} from 'react-intl';\nimport {Route, Switch} from 'react-router-dom';\nimport type {RouteComponentProps} from 'react-router-dom';\n\nimport {emitUserLoggedOutEvent} from 'actions/global_actions';\n\nimport BackButton from 'components/common/back_button';\nimport LogoutIcon from 'components/widgets/icons/fa_logout_icon';\n\nimport logoImage from 'images/logo.png';\n\nimport Confirm from '../confirm';\nimport Setup from '../setup';\n\ntype Location = {\n    search: string;\n}\n\ntype Props = {\n    location: Location;\n    children?: React.ReactNode;\n    mfa: boolean;\n    enableMultifactorAuthentication: boolean;\n    enforceMultifactorAuthentication: boolean;\n\n    /*\n     * Object from react-router\n     */\n    match: {\n        url: string;\n    };\n}\n\ntype State = {\n    enforceMultifactorAuthentication: boolean;\n}\n\nexport default class MFAController extends React.PureComponent<Props & RouteComponentProps, State> {\n    public constructor(props: Props & RouteComponentProps) {\n        super(props);\n\n        this.state = {enforceMultifactorAuthentication: props.enableMultifactorAuthentication};\n    }\n\n    public componentDidMount(): void {\n        document.body.classList.add('sticky');\n        document.getElementById('root')!.classList.add('container-fluid');\n\n        if (!this.props.enableMultifactorAuthentication) {\n            this.props.history.push('/');\n        }\n    }\n\n    public componentWillUnmount(): void {\n        document.body.classList.remove('sticky');\n        document.getElementById('root')!.classList.remove('container-fluid');\n    }\n\n    public handleOnClick = (e: React.MouseEvent<HTMLButtonElement, MouseEvent>): void => {\n        e.preventDefault();\n        emitUserLoggedOutEvent('/login');\n    };\n\n    public updateParent = (state: State): void => {\n        this.setState(state);\n    };\n\n    public render(): JSX.Element {\n        let backButton;\n        if (this.props.mfa && this.props.enforceMultifactorAuthentication) {\n            backButton = (\n                <div className='signup-header'>\n                    <button\n                        className='style--none color--link'\n                        onClick={this.handleOnClick}\n                    >\n                        <LogoutIcon/>\n                        <FormattedMessage\n                            id='web.header.logout'\n                            defaultMessage='Logout'\n                        />\n                    </button>\n                </div>\n            );\n        } else {\n            backButton = (<BackButton/>);\n        }\n\n        return (\n            <div className='inner-wrap'>\n                <div className='row content'>\n                    <div>\n                        {backButton}\n                        <div className='col-sm-12'>\n                            <div className='signup-team__container'>\n                                <h3>\n                                    <FormattedMessage\n                                        id='mfa.setupTitle'\n                                        defaultMessage='Multi-factor Authentication Setup'\n                                    />\n                                </h3>\n                                <img\n                                    alt={'signup team logo'}\n                                    className='signup-team-logo'\n                                    src={logoImage}\n                                />\n                                <div id='mfa'>\n                                    <Switch>\n                                        <Route\n                                            path={`${this.props.match.url}/setup`}\n                                            render={(props) => (\n                                                <Setup\n                                                    state={this.state}\n                                                    updateParent={this.updateParent}\n                                                    {...props}\n                                                />\n                                            )}\n                                        />\n                                        <Route\n                                            path={`${this.props.match.url}/confirm`}\n                                            render={() => (\n                                                <Confirm/>\n                                            )}\n                                        />\n                                    </Switch>\n                                </div>\n                            </div>\n                        </div>\n                    </div>\n                </div>\n            </div>\n        );\n    }\n}\n","// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.\n// See LICENSE.txt for license information.\n\nimport {connect} from 'react-redux';\n\nimport {getConfig, getLicense} from 'mattermost-redux/selectors/entities/general';\n\nimport type {GlobalState} from 'types/store';\n\nimport MFAController from './mfa_controller';\n\nfunction mapStateToProps(state: GlobalState) {\n    const license = getLicense(state);\n    const config = getConfig(state);\n\n    const mfa = license.MFA === 'true';\n    const enableMultifactorAuthentication = config.EnableMultifactorAuthentication === 'true';\n    const enforceMultifactorAuthentication = config.EnforceMultifactorAuthentication === 'true';\n\n    return {\n        mfa,\n        enableMultifactorAuthentication,\n        enforceMultifactorAuthentication,\n    };\n}\n\nexport default connect(mapStateToProps)(MFAController);\n","// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.\n// See LICENSE.txt for license information.\n\nimport React from 'react';\nimport {useIntl} from 'react-intl';\n\nexport default function LogoutIcon() {\n    const {formatMessage} = useIntl();\n    return (\n        <i\n            className='fa fa-1x fa-angle-left'\n            title={formatMessage({id: 'generic_icons.logout', defaultMessage: 'Logout Icon'})}\n        />\n    );\n}\n"],"names":["activateMfa","code","dispatch","getState","currentUserId","getCurrentUserId","UserActions","deactivateMfa","generateMfaSecret","BackButton","_ref","url","className","onClick","formatMessage","useIntl","React","classNames","Link","to","id","title","defaultMessage","FormattedMessage","propTypes","_pt","defaultProps","LocalizedPlaceholderInput","ref","placeholder","otherProps","_objectWithoutProperties","_excluded","intl","Object","assign","displayName","KeyCodes","Constants","submit","e","preventDefault","redirectUserToDefaultTeam","onKeyPress","isKeyPressed","ENTER","Confirm","useEffect","document","body","addEventListener","removeEventListener","onSubmit","type","Setup","constructor","props","super","_defineProperty","_this$input","_this$input$current","this","input","current","value","replace","length","setState","error","actions","then","server_error_id","message","history","push","state","undefined","secret","qrCode","componentDidMount","user","currentUser","mfa_active","_ref2","data","serverError","qr_code","render","errorContent","mfaRequired","formClass","enforceMultifactorAuthentication","values","siteName","strong","chunks","alt","style","src","defineMessage","autoFocus","isRequired","updateParent","maxHeight","connect","config","getConfig","SiteName","EnforceMultifactorAuthentication","getCurrentUser","bindActionCreators","MFAController","emitUserLoggedOutEvent","enableMultifactorAuthentication","classList","add","getElementById","componentWillUnmount","remove","backButton","mfa","handleOnClick","LogoutIcon","logoImage","Switch","Route","path","concat","match","location","search","children","license","getLicense","MFA","EnableMultifactorAuthentication"],"sourceRoot":""}

VaKeR 2022