{"version":3,"sources":["material/Button.js","WebSocketFunc.js","material/ButtonBar.js","style/StyledA.js","App.js","reportWebVitals.js","index.js"],"names":["ButtonOutline","withStyles","palette","root","padding","FormControl","makeStyles","theme","createStyles","backgroundColor","primary","main","color","fontSize","minWidth","boxSizing","transition","fontFamily","fontWeight","lineHeight","borderRadius","letterSpacing","textTransform","boxShadow","dark","margin","FormHelperText","Button","props","children","other","variant","getCurrentVersion","textAlign","whiteSpace","spacing","osName","Ahover","styled","a","StyleA","StyleRoot","div","PassText","value","style","App","handleNext","handleBack","browserName","browserVersion","useState","machine","setMachine","version","setVersion","isLoading","setIsLoading","checkWebSocketVersion","params","url","onopen","onmessage","onerror","window","ws","WebSocket","alert","WebSocketTest","send","JSON","stringify","response","local_WebSocket_value","obj","parse","data","success","replace","close","error","readyState","useEffect","height","minHeight","display","alignItems","justifyContent","marginBottom","href","download","options","toolbar","paging","sorting","headerStyle","columns","title","field","cellStyle","item","status","pass","Number","size","onClick","CircularProgress","position","left","zIndex","top","bottom","width","reportWebVitals","onPerfEntry","Function","then","getCLS","getFID","getFCP","getLCP","getTTFB","ReactDOM","render","StrictMode","document","getElementById"],"mappings":"mRAiEaA,GA5DmBC,aAAW,cAAGC,QAAH,MAAmB,CAC1DC,KAAM,CACFC,QAAS,UAFeH,CAI5BI,KAEcC,aAAW,SAACC,GAAD,OAAWC,YAAa,CACjDL,KAAM,CACFM,gBAAiBF,EAAML,QAAQQ,QAAQC,KACvCC,MAAO,QACPR,QAAS,WACTS,SAAU,WACVC,SAAU,OACVC,UAAW,aACXC,WAAY,0JACZC,WAAY,6CACZC,WAAY,IACZC,WAAY,KACZC,aAAc,MACdC,cAAe,YACfC,cAAe,YACfC,UAAW,uGACX,UAAW,CACPd,gBAAiBF,EAAML,QAAQQ,QAAQc,KACvCD,UAAW,+GAUYtB,aAAW,cAAGC,QAAH,MAAmB,CAC7DC,KAAM,CACFsB,OAAQ,iBAFmBxB,CAI/ByB,KAQiBzB,YAAW,CAC5BE,K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Node, useEffect } from \"react\";\nimport { makeStyles, Theme, createStyles, Button, withStyles, ButtonProps, FormControl, FormHelperText } from '@material-ui/core';\n\n\n// style----------------------------------------------------\nexport const StyleFormControl = withStyles(({ palette, }) => ({\n root: {\n padding: \"5px\",\n },\n}))(FormControl);\n\nconst useStyles = makeStyles((theme) => createStyles({\n root: {\n backgroundColor: theme.palette.primary.main,\n color: \"white\",\n padding: \"6px 16px\",\n fontSize: \"0.875rem\",\n minWidth: \"64px\",\n boxSizing: \"border-box\",\n transition: \"background-color 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms,box-shadow 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms,border 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms\",\n fontFamily: \"'Roboto', 'Helvetica', 'Arial', sans-serif\",\n fontWeight: 500,\n lineHeight: 1.75,\n borderRadius: \"4px\",\n letterSpacing: \"0.02857em\",\n textTransform: \"uppercase\",\n boxShadow: \"0px 3px 1px -2px rgba(0,0,0,0.2), 0px 2px 2px 0px rgba(0,0,0,0.14), 0px 1px 5px 0px rgba(0,0,0,0.12)\",\n \"&:hover\": {\n backgroundColor: theme.palette.primary.dark,\n boxShadow: \"0px 2px 4px -1px rgba(0,0,0,0.2), 0px 4px 5px 0px rgba(0,0,0,0.14), 0px 1px 10px 0px rgba(0,0,0,0.12)\",\n }\n },\n}));\n\nexport const StyledSpanButton = props => {\n const classes = useStyles();\n return {props.text} \n}\n\nexport const StyleFormHelperText = withStyles(({ palette, }) => ({\n root: {\n margin: \"5px 14px 0\",\n }\n}))(FormHelperText);\n\n\n\n\n\n\n\nconst Style_Button = withStyles({\n root: {\n borderRadius: \"20px\",\n }\n})(Button)\n\nexport const ButtonContain = (props) => {\n const { children, ...other } = props\n return {children}\n}\nexport const ButtonContainO = (props) => {\n const { children, ...other } = props\n return \n}\nexport const ButtonOutline = (props) => {\n const { children, ...other } = props\n return \n}","// WebSocket 預設版號\nconst WebSocket_value_win = '1.3.3.4';\nconst beta_WebSocket_value_win = '1.3.3.4';\nconst WebSocket_value_mac = '1.2.3mac';\nconst beta_WebSocket_value_mac = '1.2.3mac';\n\n// 檢查支援 OS 系統\nexport const checkOS = (osName) => osName == 'Windows' || osName == 'Mac'\n\n// 給 OS 支援的版號\nexport const getCurrentVersion = (osName) => {\n if (osName == 'Windows') { return [WebSocket_value_win, beta_WebSocket_value_win] }\n else if (osName == 'Mac') { return [WebSocket_value_mac, beta_WebSocket_value_mac] }\n else { return [\"NVL\", \"NVL\"] }\n}\n\n//只有用判斷IE瀏覽器 < IE10 不能使用\nexport const checkBrowser = (browserName, browserVersion) => !(browserName === \"IE\" && Number(browserVersion) < 10)\n\n//檢查WebSocket版本 正式版 與 beta 都可以\nexport const versionOld = (local_WebSocket_value, osName) => (\n local_WebSocket_value < getCurrentVersion(osName)[0].replace('mac', '') &&\n local_WebSocket_value < getCurrentVersion(osName)[1].replace('mac', '')\n)\n\n\nexport const WebSocketTest = (url, onopen, onmessage, onerror) => {\n if (!(\"WebSocket\" in window)) {\n alert(\"This browser does not support WebSockets.\"); return;\n }\n var ws = new WebSocket('wss://localhost:9991/ws/' + url);\n // 成功找到元件,ws.send(JSON.stringify(params)) 發資料 會進入 onmessage\n ws.onopen = onopen(ws);\n ws.onmessage = onmessage(ws);\n // 找不到元件\n ws.onerror = onerror(ws);\n}\n","import React from 'react';\r\nimport { makeStyles, Theme, createStyles } from '@material-ui/core';\r\n\r\n\r\nconst useStyles = makeStyles((theme) =>\r\n createStyles({\r\n root: {\r\n textAlign: \"center\",\r\n padding: 12,\r\n whiteSpace: \"nowrap\",\r\n '& > *': {\r\n margin: theme.spacing(1),\r\n // borderRadius: \"20px\",\r\n fontSize: \"1.2em\",\r\n minWidth: 90,\r\n },\r\n },\r\n }),\r\n);\r\n\r\nexport const ButtonBar = props => {\r\n const classes = useStyles();\r\n return
{props.children}
\r\n}","import React from 'react';\r\nimport styled from 'styled-components';\r\n\r\n// style-------------------------------------------------------------------\r\nconst Ahover = styled.a`\r\n :hover {\r\n text-decoration: underline !important;\r\n color: blue !important;\r\n transition: color .15s;\r\n }\r\n`\r\n\r\n\r\n// component-------------------------------------------------------------------\r\nexport const StyleA = props => {\r\n const { children, ...other } = props;\r\n return {children}\r\n}\r\n\r\n\r\n// styled ---------------------------------------------\r\nexport const StyleRoot = styled.div`\r\n /* position: absolute;\r\n top: 10%;\r\n left: 50%;\r\n transform: translateX(-50%); */\r\n font-size: 1.2em;\r\n min-width: 350px;\r\n width: 60%;\r\n padding: 0 20px;\r\n .MuiStepper-root {\r\n background-color: rgb(247, 247, 247);\r\n }\r\n`;","import React, { useEffect } from 'react';\nimport { Button } from \"@material-ui/core\";\nimport { useState } from \"react\";\nimport { ButtonContain, ButtonContainO, ButtonOutline } from './material/Button';\nimport MaterialTable from 'material-table';\nimport { osName, browserName, browserVersion, } from 'react-device-detect';\nimport { ButtonBar } from './material/ButtonBar';\nimport { versionOld, checkOS, checkBrowser, WebSocketTest } from './WebSocketFunc';\nimport { StyleA,StyleRoot } from './style/StyledA';\nimport styled from \"styled-components\";\nimport CircularProgress from '@material-ui/core/CircularProgress';\n\n\n\n\n\n// component --------------------------------------------------------------------------\nconst PassText = value => {\n if (value)\n return 通過\n else\n return 未通過\n}\n\nconst App = (props) => {\n const { handleNext, handleBack, } = props;\n const [machine, setMachine] = useState(false);\n const [version, setVersion] = useState(\"\");\n const [isLoading, setIsLoading] = useState(false);\n\n const checkWebSocketVersion = () => { \n setIsLoading(true)\n const params = {}\n WebSocketTest(\"version\",\n ws => () => { ws.send(JSON.stringify(params)); },\n ws => response => {\n const obj = JSON.parse(response.data);\n const version = obj.data.version;\n\n // 啟用失敗(未測到此情況),或版本較舊,必須更新\n if (!obj.success || versionOld(version, osName)) {\n setMachine(false)\n }\n // 啟用成功\n else { setMachine(true) }\n // 關閉元件?\n ws.close();\n\n setVersion(version)\n setIsLoading(false)\n },\n ws => error => {\n // IE 於 readyState === 2 必進 error,但並不是 error\n if (browserName === \"IE\" && ws.readyState === 2) { return }\n setVersion(\"\")\n setMachine(false)\n setIsLoading(false)\n }\n )\n }\n\n useEffect(() => { checkWebSocketVersion() }, [])\n\n return (\n
\n\n \n
\n ※簽章元件檢測※
\n
\n
\n
簽章元件下載
\n
\n {!version ? \"未安裝或未啟動服務\" : `元件版本:${version}`}\n checkWebSocketVersion()}>重新檢測\n ,\n pass: <>{machine\n ? PassText(true)\n : 請下載、安裝簽章憑證元件\n },\n },\n ]} /> \n {isLoading && }\n
\n
\n );\n}\n\nexport default App;\n","const reportWebVitals = onPerfEntry => {\n if (onPerfEntry && onPerfEntry instanceof Function) {\n import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => {\n getCLS(onPerfEntry);\n getFID(onPerfEntry);\n getFCP(onPerfEntry);\n getLCP(onPerfEntry);\n getTTFB(onPerfEntry);\n });\n }\n};\n\nexport default reportWebVitals;\n","import React from 'react';\nimport ReactDOM from 'react-dom';\nimport './index.css';\nimport App from './App';\nimport reportWebVitals from './reportWebVitals';\n\nReactDOM.render(\n \n \n ,\n document.getElementById('root')\n);\n\n// If you want to start measuring performance in your app, pass a function\n// to log results (for example: reportWebVitals(console.log))\n// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals\nreportWebVitals();\n"],"sourceRoot":""}