{"version":3,"sources":["containers/BotModuleAuthSuccessPage/index.js","components/Copyright/Copyright.js","services/index.js","components/SocialLoginButtons/Line/Buttons.js","components/LoginForm/Form.js","containers/LogInPage/index.js","containers/ErrorPage/index.js","containers/BotModuleAttachPage/index.js","App.js","serviceWorker.js","index.js"],"names":["SuccessVerificationImg","window","location","origin","SuccessVerificationImg2x","SuccessVerificationImg3x","Container","styled","div","SuccessImage","img","Title","Description","RedirectButton","Button","isProduction","host","includes","urlParams","URLSearchParams","search","hasCallbackUrl","has","callbackUrl","get","dashboardUrl","BotModuleAuthSuccessPage","setTimeout","href","src","srcSet","onClick","CopyrightTypography","withStyles","root","color","fontSize","Typography","Copyright","variant","align","Date","getFullYear","Link","responseHandler","res","a","text","response","length","JSON","parse","ok","Error","stringify","status","login","username","password","form","FormData","append","fetch","method","body","then","getLineAuthLoginLink","url","ButtonBase","ButtonItem","ButtonItemLeft","ButtonItemRight","LineIcon","LineLoginButton","alt","SubmitButton","backgroundColor","width","TextField","transform","height","padding","MaterialTextField","Form","InputArea","StatementArea","SubmitArea","initialValidation","usernameError","passwordError","usernameMessage","passwordMessage","LoginForm","useState","setUsername","setPassword","validation","setValidation","checkValidation","useCallback","newValidation","valid","firstUpdate","useRef","useLayoutEffect","current","onClickLogin","replace","redirect","autoFocus","error","fullWidth","id","type","value","label","InputLabelProps","shrink","placeholder","helperText","margin","name","onChange","e","target","disableElevation","MainContainer","paddingLeft","paddingRight","CenterBox","Hr","HrItem","Login","style","marginTop","className","flex","Head","span","Content","PageError","props","state","pathname","title","content","pagenum","redirectURL","BotModuleAttachPage","setpagenum","useEffect","document","load","getElementById","onload","scrolling","App","exact","path","Boolean","hostname","match","ReactDOM","render","StrictMode","StylesProvider","injectFirst","navigator","serviceWorker","ready","registration","unregister","catch","console","message"],"mappings":"ujDAIA,IAAMA,EACJC,OAAOC,SAASC,OAAS,uCACrBC,EACJH,OAAOC,SAASC,OAAS,0CACrBE,EACJJ,OAAOC,SAASC,OAAS,0CAErBG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,GAAG,QACHnF,IAlCW,oHAmCXgD,MAAM,OACNG,OAAO,OACP2E,UAAU,MANZ,8BCSSC,OApCf,WACE,OACE,kBAAC,IAAD,KACE,kBAAC,IAAD,KACE,kBAAC,IAAD,CAAOC,OAAK,EAACC,KAAK,KAChB,kBAAClB,GAAD,OAEF,kBAAC,IAAD,CAAOiB,OAAK,EAACC,KAAK,QAChB,kBAAClB,GAAD,OAEF,kBAAC,IAAD,CAAOiB,OAAK,EAACC,KAAK,QAChB,kBAAClB,GAAD,OAEF,kBAAC,IAAD,CAAOiB,OAAK,EAACC,KAAK,QAChB,kBAAClB,GAAD,OAEF,kBAAC,IAAD,CAAOiB,OAAK,EAACC,KAAK,QAChB,kBAAClB,GAAD,OAEF,kBAAC,IAAD,CAAOiB,OAAK,EAACC,KAAK,UAChB,kBAAC1B,GAAD,OAEF,kBAAC,IAAD,CAAOyB,OAAK,EAACC,KAAK,iBAChB,kBAAC,EAAD,OAEF,kBAAC,IAAD,CAAOD,OAAK,EAACC,KAAK,2BAChB,kBAAC,EAAD,OAEF,kBAAC,IAAD,CAAOD,OAAK,EAACC,KAAK,qBAChB,kBAAC,GAAD,UCzBUC,QACW,cAA7B9J,OAAOC,SAAS8J,UAEe,UAA7B/J,OAAOC,SAAS8J,UAEhB/J,OAAOC,SAAS8J,SAASC,MACvB,2DCXNC,IAASC,OACP,kBAAC,IAAMC,WAAP,KACE,kBAACC,EAAA,EAAD,CAAgBC,aAAW,GACzB,kBAAC,GAAD,QAGJf,SAASE,eAAe,SDsHpB,kBAAmBc,WACrBA,UAAUC,cAAcC,MACrBxG,MAAK,SAAAyG,GACJA,EAAaC,gBAEdC,OAAM,SAAA9D,GACL+D,QAAQ/D,MAAMA,EAAMgE,c","file":"static/js/main.ebd07074.chunk.js","sourcesContent":["import React from 'react';\nimport styled from 'styled-components';\nimport Button from '@material-ui/core/Button';\n\nconst SuccessVerificationImg =\n window.location.origin + '/img/img-successful-verification.png';\nconst SuccessVerificationImg2x =\n window.location.origin + '/img/img-successful-verification@2x.png';\nconst SuccessVerificationImg3x =\n window.location.origin + '/img/img-successful-verification@3x.png';\n\nconst Container = styled.div`\n display: flex;\n flex-direction: column;\n align-items: center;\n @media screen and (max-width: 426px) {\n margin: 0 16px;\n }\n`;\n\nconst SuccessImage = styled.img`\n margin-top: 100px;\n max-width: 300px;\n @media screen and (max-width: 426px) {\n max-width: 180px;\n }\n`;\n\nconst Title = styled.div`\n margin-top: 40px;\n font-size: 28px;\n line-height: 1.6;\n letter-spacing: 0.08px;\n text-align: center;\n @media screen and (max-width: 426px) {\n margin: 40px 8px 0 8px;\n }\n`;\n\nconst Description = styled.div`\n margin-top: 16px;\n font-size: 16px;\n line-height: 1.58;\n letter-spacing: 0.3px;\n text-align: center;\n color: rgba(0, 0, 0, 0.87);\n @media screen and (max-width: 426px) {\n margin: 16px 8px 0 8px;\n }\n`;\n\nconst RedirectButton = styled(Button)`\n margin-top: 40px;\n background-color: #3d61d7;\n &:hover {\n background-color: #5469d4;\n }\n color: white;\n font-size: 16px;\n font-weight: 500;\n line-height: 1.71;\n letter-spacing: 0.3px;\n color: white;\n max-width: 320px;\n @media screen and (max-width: 426px) {\n width: 100%;\n }\n`;\n\nconst isProduction = window.location.host.includes('auth.alleypin.cc');\nconst urlParams = new URLSearchParams(window.location.search);\n\n// 獲取單個參數的值\nconst hasCallbackUrl = urlParams.has('callbackUrl');\nconst callbackUrl = urlParams.get('callbackUrl');\nconst dashboardUrl = isProduction ? 'https://dashboard.alleypin.cc' : 'http://dashboard-dev.alleypin.cc';\n\nconst BotModuleAuthSuccessPage = () => {\n setTimeout(() => {\n window.location.href = hasCallbackUrl\n ? callbackUrl\n : dashboardUrl;\n }, 3000);\n\n const handleClick = () => {\n window.location.href = hasCallbackUrl\n ? callbackUrl\n : dashboardUrl;\n };\n\n return (\n \n \n 驗證成功!\n \n 3 秒後自動跳轉登入畫面,或點擊下方按鈕跳轉後登入\n \n 點擊跳轉登入畫面\n \n );\n};\n\nexport default BotModuleAuthSuccessPage;\n","import '../../assets/colors.css';\n\nimport { Link, Typography, withStyles } from '@material-ui/core';\n\nimport React from 'react';\n\nconst CopyrightTypography = withStyles({\n root: {\n color: 'var(--body-38)',\n fontSize: '12px',\n },\n})(Typography);\n\nexport default function Copyright() {\n return (\n \n ※ 建議使用 Chrome 瀏覽器,以享最佳的顯示結果\n {'Copyright © '}\n {' '}\n {new Date().getFullYear()}\n {' '}\n \n 翔評互動股份有限公司\n \n \n );\n}\n","const responseHandler = async (res) => {\n const text = await res.text();\n const response = text.length ? JSON.parse(text) : {};\n if (!res.ok) {\n throw new Error(JSON.stringify({\n status: res.status,\n response,\n }));\n }\n return response;\n};\n\nexport const login = (username, password) => {\n const form = new FormData();\n form.append('username', username);\n form.append('password', password);\n return fetch(`/api/login${window.location.search}`, {\n method: 'post',\n body: form,\n }).then(responseHandler);\n};\n\nexport const getLineAuthLoginLink = () => {\n const url = `/line/connection${window.location.search}`;\n return fetch(url, {\n method: 'GET',\n }).then(responseHandler);\n};\n","import React from 'react';\nimport styled from 'styled-components';\nimport { getLineAuthLoginLink } from '../../../services';\n\nconst ButtonBase = styled.div`\n display: flex;\n width: 320px;\n height: 40px;\n padding: 0px;\n @media screen and (max-width: 321px) {\n width: 100%;\n }\n border: none;\n text-decoration: none;\n`;\n\nconst ButtonItem = styled.div`\n flex-direction: row;\n align-items: center;\n display: flex;\n justify-content: center;\n color: #ffffff;\n height: 40px;\n font-family: Roboto;\n font-size: 15px;\n`;\n\nconst ButtonItemLeft = styled(ButtonItem)`\n border-bottom-left-radius: 8px;\n border-top-left-radius: 8px;\n background-color: #00c300;\n`;\n\nconst ButtonItemRight = styled(ButtonItem)`\n border-bottom-right-radius: 8px;\n border-top-right-radius: 8px;\n border-left: 2px solid #00b300;\n flex-basis: 100%;\n background-color: #00c300;\n`;\n\nconst LineIcon = styled.img`\n width: 40px;\n`;\nexport const LineLoginButton = () => {\n const onClick = async () => {\n const res = await getLineAuthLoginLink();\n window.location.href = res.url;\n };\n\n return (\n \n \n \n \n 使用LINE登入\n \n );\n};\n","import '../../assets/colors.css';\n\nimport {\n Button,\n Link,\n TextField as MaterialTextField,\n withStyles,\n} from '@material-ui/core';\nimport React, {\n useCallback, useLayoutEffect, useRef, useState,\n} from 'react';\n\nimport styled from 'styled-components';\nimport { login } from '../../services';\n\nconst SubmitButton = withStyles({\n root: {\n backgroundColor: 'var(--blue-500-primary)',\n width: '100%',\n color: '#ffffff',\n },\n})(Button);\n\nconst TextField = withStyles({\n root: {\n '& label': {\n transform: 'translate(8px, 13px)',\n },\n '& input': {\n height: '40px',\n padding: '0px 8px 0px 8px',\n },\n },\n})(MaterialTextField);\n\nconst Form = styled.div`\n display: flex;\n flex-direction: column;\n width: 100%;\n color: var(--secondary);\n font-weight: normal;\n font-stretch: normal;\n font-style: normal;\n line-height: 1.43;\n letter-spacing: 0.1px;\n`;\n\nconst InputArea = styled.div`\n margin: 8px 0px;\n`;\n\nconst StatementArea = styled.div`\n display: flex;\n margin: 8px 0px;\n font-size: 12px;\n text-align: center;\n`;\n\nconst SubmitArea = styled.div`\n display: flex;\n justify-content: center;\n align-items: center;\n margin-top: 24px;\n`;\n\nconst initialValidation = {\n usernameError: false,\n passwordError: false,\n usernameMessage: '',\n passwordMessage: '',\n};\n// export default class LoginForm extends React.Component {\nexport const LoginForm = () => {\n const [username, setUsername] = useState('');\n const [password, setPassword] = useState('');\n const [validation, setValidation] = useState(initialValidation);\n\n const checkValidation = useCallback(() => {\n const newValidation = { ...initialValidation };\n let valid = true;\n if (password === '') {\n newValidation.passwordError = true;\n newValidation.passwordMessage = '請勿空白';\n valid = false;\n }\n if (username === '') {\n newValidation.usernameError = true;\n newValidation.usernameMessage = '請勿空白';\n valid = false;\n }\n setValidation(newValidation);\n return valid;\n }, [username, password]);\n\n const firstUpdate = useRef(true);\n useLayoutEffect(() => {\n if (firstUpdate.current) {\n firstUpdate.current = false;\n return;\n }\n checkValidation();\n }, [username, password, checkValidation]);\n\n const onClickLogin = async () => {\n if (!checkValidation()) {\n return;\n }\n try {\n const res = await login(username, password);\n window.location.replace(res.redirect);\n } catch (err) {\n setValidation({\n usernameError: true,\n passwordError: true,\n usernameMessage: '帳號或密碼錯誤',\n passwordMessage: '',\n });\n }\n };\n\n const handlePassword = (e) => {\n setPassword(e.target.value);\n };\n const handleUserName = (e) => {\n setUsername(e.target.value);\n };\n\n return (\n
\n \n \n \n \n \n \n \n \n 當按下登入,即代表您已了解我並同意AlleyPin的\n 服務條款\n 與\n 隱私權政策\n 。\n \n \n \n \n 登入\n \n \n
\n );\n};\n","import { Container, withStyles } from '@material-ui/core';\nimport React from 'react';\nimport styled from 'styled-components';\nimport Copyright from '../../components/Copyright/Copyright';\nimport { LineLoginButton } from '../../components/SocialLoginButtons/Line/Buttons';\nimport { LoginForm } from '../../components/LoginForm/Form';\n\nconst MainContainer = withStyles({\n root: {\n paddingLeft: '8px',\n paddingRight: '8px',\n width: '321px',\n },\n})(Container);\n\nconst CenterBox = styled.div`\n flex-direction: column;\n align-items: center;\n display: flex;\n @media screen and (max-width: 321px) {\n width: 100%;\n }\n`;\n\nconst Hr = styled.div`\n display: flex;\n align-items: center;\n width: 100%;\n`;\n\nconst HrItem = styled.div`\n display: flex;\n flex-direction: row;\n align-items: center;\n flex: 1;\n font-family: PingFangTC;\n font-size: 16px;\n padding: 1px 11px;\n`;\n\nexport default function Login() {\n return (\n \n \n \n \n \n \n \n \n
\n \n \n \n \n
\n \n \n \n \n \n \n
\n );\n}\n","import { Container } from '@material-ui/core';\nimport React from 'react';\nimport styled from 'styled-components';\n\nconst CenterBox = styled.div`\n margin-top: 162px;\n flex-direction: column;\n align-items: center;\n display: flex;\n`;\n\nconst Head = styled.img`\n height: 300px;\n width: 300px;\n`;\n\nconst Title = styled.span`\n width: 226px;\n height: 24px;\n font-family: NotoSansCJKtc;\n font-size: 16px;\n font-weight: bold;\n font-stretch: normal;\n font-style: normal;\n line-height: 1.5;\n letter-spacing: 0.09px;\n text-align: center;\n color: rgba(0, 0, 0, 0.87);\n margin-top: 40px;\n margin-bottom: 16px;\n`;\n\nconst Content = styled.span`\n width: 320px;\n height: 19px;\n font-family: NotoSansCJKtc;\n font-size: 12px;\n font-weight: normal;\n font-stretch: normal;\n font-style: normal;\n line-height: 1.58;\n letter-spacing: 0.3px;\n text-align: center;\n color: rgba(0, 0, 0, 0.87);\n`;\n\nexport default function PageError(props) {\n const state = {};\n\n switch (window.location.pathname) {\n case '/400':\n state.title = '抱歉!您造訪的頁面已不存在...';\n state.content = '您可以嘗試重新整理頁面';\n state.img = 'img/img-400.svg';\n break;\n case '/403':\n state.title = '抱歉!您似乎沒有登入權限...';\n state.content = '請嘗試聯繫帳號管理員來取得聯繫';\n state.img = 'img/img-403.svg';\n break;\n case '/404':\n state.title = '抱歉!您造訪的頁面已不存在...';\n state.content = '您可能輸入錯誤的網址,或是該頁面已不存在';\n state.img = 'img/img-404.svg';\n break;\n case '/500':\n state.title = '這個網頁無法正常運作!';\n state.content = '我們在正在儘速搶修中!請稍待!';\n state.img = 'img/img-500.svg';\n break;\n default:\n state.title = '抱歉!您造訪的頁面已不存在...';\n state.content = '您可能輸入錯誤的網址,或是該頁面已不存在';\n state.img = 'img/img-404.svg';\n break;\n }\n\n return (\n \n \n \n {state.title}\n {state.content}\n \n \n );\n}\n","import React, { useEffect, useState } from 'react';\nimport styled from 'styled-components';\n\nconst SHEET_PAGE_NUM = 2; // base on link below;\nconst SHEET_LINK = 'https://docs.google.com/forms/d/e/1FAIpQLSe7eejkmP4NZcNStkHgCp8o6w8lB9nAJE8knmlW0l4ifUdxKg/viewform?embedded=true';\nconst Container = styled.div`\n height: ${(props) => (props.pagenum > 1 ? '1660px' : '1170px')};\n @media screen and (max-width: 425px) {\n height: ${(props) => (props.pagenum > 1 ? '1750px' : '1640px')};\n }\n @media screen and (max-width: 375px) {\n height: ${(props) => (props.pagenum > 1 ? '1770px' : '1660px')};\n }\n`;\n\nconst isProduction = window.location.host.includes('auth.alleypin.cc');\nconst redirectURL = `https://${\n isProduction ? 'auth.alleypin.cc' : 'auth-staging.alleypin.cc'\n}/api/botmodule/login`;\nconst BotModuleAttachPage = () => {\n const [pagenum, setpagenum] = useState(0);\n useEffect(() => {\n document.title = '申請 - AlleyPin 服務模組';\n let load = 0;\n document.getElementById('gform').onload = function () {\n // eslint-disable-next-line no-plusplus\n load++;\n setpagenum(load);\n if (load > SHEET_PAGE_NUM) {\n document.location = redirectURL;\n }\n };\n }, []);\n return (\n \n \n 載入中…\n \n \n );\n};\n\nexport default BotModuleAttachPage;\n","import { Route, BrowserRouter as Router, Switch } from 'react-router-dom';\n\nimport AuthSuccess from './containers/BotModuleAuthSuccessPage';\nimport Login from './containers/LogInPage';\nimport PageError from './containers/ErrorPage';\nimport React from 'react';\nimport BotModuleAttachPage from './containers/BotModuleAttachPage';\n\nfunction App() {\n return (\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n );\n}\n\nexport default App;\n","// This optional code is used to register a service worker.\n// register() is not called by default.\n\n// This lets the app load faster on subsequent visits in production, and gives\n// it offline capabilities. However, it also means that developers (and users)\n// will only see deployed updates on subsequent visits to a page, after all the\n// existing tabs open on the page have been closed, since previously cached\n// resources are updated in the background.\n\n// To learn more about the benefits of this model and instructions on how to\n// opt-in, read https://bit.ly/CRA-PWA\n\nconst isLocalhost = Boolean(\n window.location.hostname === 'localhost' ||\n // [::1] is the IPv6 localhost address.\n window.location.hostname === '[::1]' ||\n // 127.0.0.0/8 are considered localhost for IPv4.\n window.location.hostname.match(\n /^127(?:\\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/\n )\n);\n\nexport function register(config) {\n if (process.env.NODE_ENV === 'production' && 'serviceWorker' in navigator) {\n // The URL constructor is available in all browsers that support SW.\n const publicUrl = new URL(process.env.PUBLIC_URL, window.location.href);\n if (publicUrl.origin !== window.location.origin) {\n // Our service worker won't work if PUBLIC_URL is on a different origin\n // from what our page is served on. This might happen if a CDN is used to\n // serve assets; see https://github.com/facebook/create-react-app/issues/2374\n return;\n }\n\n window.addEventListener('load', () => {\n const swUrl = `${process.env.PUBLIC_URL}/service-worker.js`;\n\n if (isLocalhost) {\n // This is running on localhost. Let's check if a service worker still exists or not.\n checkValidServiceWorker(swUrl, config);\n\n // Add some additional logging to localhost, pointing developers to the\n // service worker/PWA documentation.\n navigator.serviceWorker.ready.then(() => {\n console.log(\n 'This web app is being served cache-first by a service ' +\n 'worker. To learn more, visit https://bit.ly/CRA-PWA'\n );\n });\n } else {\n // Is not localhost. Just register service worker\n registerValidSW(swUrl, config);\n }\n });\n }\n}\n\nfunction registerValidSW(swUrl, config) {\n navigator.serviceWorker\n .register(swUrl)\n .then(registration => {\n registration.onupdatefound = () => {\n const installingWorker = registration.installing;\n if (installingWorker == null) {\n return;\n }\n installingWorker.onstatechange = () => {\n if (installingWorker.state === 'installed') {\n if (navigator.serviceWorker.controller) {\n // At this point, the updated precached content has been fetched,\n // but the previous service worker will still serve the older\n // content until all client tabs are closed.\n console.log(\n 'New content is available and will be used when all ' +\n 'tabs for this page are closed. See https://bit.ly/CRA-PWA.'\n );\n\n // Execute callback\n if (config && config.onUpdate) {\n config.onUpdate(registration);\n }\n } else {\n // At this point, everything has been precached.\n // It's the perfect time to display a\n // \"Content is cached for offline use.\" message.\n console.log('Content is cached for offline use.');\n\n // Execute callback\n if (config && config.onSuccess) {\n config.onSuccess(registration);\n }\n }\n }\n };\n };\n })\n .catch(error => {\n console.error('Error during service worker registration:', error);\n });\n}\n\nfunction checkValidServiceWorker(swUrl, config) {\n // Check if the service worker can be found. If it can't reload the page.\n fetch(swUrl, {\n headers: { 'Service-Worker': 'script' },\n })\n .then(response => {\n // Ensure service worker exists, and that we really are getting a JS file.\n const contentType = response.headers.get('content-type');\n if (\n response.status === 404 ||\n (contentType != null && contentType.indexOf('javascript') === -1)\n ) {\n // No service worker found. Probably a different app. Reload the page.\n navigator.serviceWorker.ready.then(registration => {\n registration.unregister().then(() => {\n window.location.reload();\n });\n });\n } else {\n // Service worker found. Proceed as normal.\n registerValidSW(swUrl, config);\n }\n })\n .catch(() => {\n console.log(\n 'No internet connection found. App is running in offline mode.'\n );\n });\n}\n\nexport function unregister() {\n if ('serviceWorker' in navigator) {\n navigator.serviceWorker.ready\n .then(registration => {\n registration.unregister();\n })\n .catch(error => {\n console.error(error.message);\n });\n }\n}\n","import React from 'react';\nimport ReactDOM from 'react-dom';\nimport { StylesProvider } from \"@material-ui/core/styles\";\nimport './index.css';\nimport App from './App';\nimport * as serviceWorker from './serviceWorker';\n\nReactDOM.render(\n \n \n \n \n ,\n document.getElementById('root')\n);\n\n// If you want your app to work offline and load faster, you can change\n// unregister() to register() below. Note this comes with some pitfalls.\n// Learn more about service workers: https://bit.ly/CRA-PWA\nserviceWorker.unregister();\n"],"sourceRoot":""}