(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[332],{5031:(e,t,n)=>{"use strict";e.exports=n(65114).style},5130:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>o});var i=n(53441);function r(e,t){void 0===t&&(t={});var n,i,r=(n=e)&&"j"===n[0]&&":"===n[1]?n.substr(2):n;if(void 0===(i=t.doNotParse)&&(i=!r||"{"!==r[0]&&"["!==r[0]&&'"'!==r[0]),!i)try{return JSON.parse(r)}catch(e){}return e}var s=function(){return(s=Object.assign||function(e){for(var t,n=1,i=arguments.length;n=0&&this.changeListeners.splice(t,1)},e}()},42936:(e,t,n)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/",function(){return n(67182)}])},53441:(e,t)=>{"use strict";t.q=function(e,t){if("string"!=typeof e)throw TypeError("argument str must be a string");for(var i={},r=e.split(";"),s=(t||{}).decode||n,o=0;o{var i=n(5130);i=i.default||i,e.exports=function(e,t){var n=e.req&&e.req.headers&&e.req.headers.cookie;return new i(n).getAll(t)}},65114:(e,t,n)=>{"use strict";var i=n(65364);n(72552);var r=n(14232),s=function(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}(r),o=void 0!==i&&i.env&&!0,a=function(e){return"[object String]"===Object.prototype.toString.call(e)},c=function(){function e(e){var t=void 0===e?{}:e,n=t.name,i=void 0===n?"stylesheet":n,r=t.optimizeForSpeed,s=void 0===r?o:r;u(a(i),"`name` must be a string"),this._name=i,this._deletedRulePlaceholder="#"+i+"-deleted-rule____{}",u("boolean"==typeof s,"`optimizeForSpeed` must be a boolean"),this._optimizeForSpeed=s,this._serverSheet=void 0,this._tags=[],this._injected=!1,this._rulesCount=0;var c=document.querySelector('meta[property="csp-nonce"]');this._nonce=c?c.getAttribute("content"):null}var t,n=e.prototype;return n.setOptimizeForSpeed=function(e){u("boolean"==typeof e,"`setOptimizeForSpeed` accepts a boolean"),u(0===this._rulesCount,"optimizeForSpeed cannot be when rules have already been inserted"),this.flush(),this._optimizeForSpeed=e,this.inject()},n.isOptimizeForSpeed=function(){return this._optimizeForSpeed},n.inject=function(){var e=this;if(u(!this._injected,"sheet already injected"),this._injected=!0,this._optimizeForSpeed){this._tags[0]=this.makeStyleTag(this._name),this._optimizeForSpeed="insertRule"in this.getSheet(),this._optimizeForSpeed||(o||console.warn("StyleSheet: optimizeForSpeed mode not supported falling back to standard mode."),this.flush(),this._injected=!0);return}this._serverSheet={cssRules:[],insertRule:function(t,n){return"number"==typeof n?e._serverSheet.cssRules[n]={cssText:t}:e._serverSheet.cssRules.push({cssText:t}),n},deleteRule:function(t){e._serverSheet.cssRules[t]=null}}},n.getSheetForTag=function(e){if(e.sheet)return e.sheet;for(var t=0;t>>0},d={};function h(e,t){if(!t)return"jsx-"+e;var n=String(t),i=e+n;return d[i]||(d[i]="jsx-"+l(e+"-"+n)),d[i]}function p(e,t){var n=e+t;return d[n]||(d[n]=t.replace(/__jsx-style-dynamic-selector/g,e)),d[n]}var m=function(){function e(e){var t=void 0===e?{}:e,n=t.styleSheet,i=void 0===n?null:n,r=t.optimizeForSpeed,s=void 0!==r&&r;this._sheet=i||new c({name:"styled-jsx",optimizeForSpeed:s}),this._sheet.inject(),i&&"boolean"==typeof s&&(this._sheet.setOptimizeForSpeed(s),this._optimizeForSpeed=this._sheet.isOptimizeForSpeed()),this._fromServer=void 0,this._indices={},this._instancesCounts={}}var t=e.prototype;return t.add=function(e){var t=this;void 0===this._optimizeForSpeed&&(this._optimizeForSpeed=Array.isArray(e.children),this._sheet.setOptimizeForSpeed(this._optimizeForSpeed),this._optimizeForSpeed=this._sheet.isOptimizeForSpeed()),this._fromServer||(this._fromServer=this.selectFromServer(),this._instancesCounts=Object.keys(this._fromServer).reduce(function(e,t){return e[t]=0,e},{}));var n=this.getIdAndRules(e),i=n.styleId,r=n.rules;if(i in this._instancesCounts){this._instancesCounts[i]+=1;return}var s=r.map(function(e){return t._sheet.insertRule(e)}).filter(function(e){return -1!==e});this._indices[i]=s,this._instancesCounts[i]=1},t.remove=function(e){var t=this,n=this.getIdAndRules(e).styleId;if(function(e,t){if(!e)throw Error("StyleSheetRegistry: "+t+".")}(n in this._instancesCounts,"styleId: `"+n+"` not found"),this._instancesCounts[n]-=1,this._instancesCounts[n]<1){var i=this._fromServer&&this._fromServer[n];i?(i.parentNode.removeChild(i),delete this._fromServer[n]):(this._indices[n].forEach(function(e){return t._sheet.deleteRule(e)}),delete this._indices[n]),delete this._instancesCounts[n]}},t.update=function(e,t){this.add(t),this.remove(e)},t.flush=function(){this._sheet.flush(),this._sheet.inject(),this._fromServer=void 0,this._indices={},this._instancesCounts={}},t.cssRules=function(){var e=this,t=this._fromServer?Object.keys(this._fromServer).map(function(t){return[t,e._fromServer[t]]}):[],n=this._sheet.cssRules();return t.concat(Object.keys(this._indices).map(function(t){return[t,e._indices[t].map(function(e){return n[e].cssText}).join(e._optimizeForSpeed?"":"\n")]}).filter(function(e){return!!e[1]}))},t.styles=function(e){var t,n;return t=this.cssRules(),void 0===(n=e)&&(n={}),t.map(function(e){var t=e[0],i=e[1];return s.default.createElement("style",{id:"__"+t,key:"__"+t,nonce:n.nonce?n.nonce:void 0,dangerouslySetInnerHTML:{__html:i}})})},t.getIdAndRules=function(e){var t=e.children,n=e.dynamic,i=e.id;if(n){var r=h(i,n);return{styleId:r,rules:Array.isArray(t)?t.map(function(e){return p(r,e)}):[p(r,t)]}}return{styleId:h(i),rules:Array.isArray(t)?t:[t]}},t.selectFromServer=function(){return Array.prototype.slice.call(document.querySelectorAll('[id^="__jsx-"]')).reduce(function(e,t){return e[t.id.slice(2)]=t,e},{})},e}(),f=r.createContext(null);f.displayName="StyleSheetContext";var g=s.default.useInsertionEffect||s.default.useLayoutEffect,v=new m;function y(e){var t=v||r.useContext(f);return t&&g(function(){return t.add(e),function(){t.remove(e)}},[e.id,String(e.dynamic)]),null}y.dynamic=function(e){return e.map(function(e){return h(e[0],e[1])}).join(" ")},t.style=y},67182:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>g});var i=n(37876),r=n(5031),s=n.n(r),o=n(14232),a=n(96390),c=n.n(a),u=n(60072),l=n.n(u),d=n(89099),h=n.n(d),p=n(87156),m=n.n(p);class f extends o.Component{static async getInitialProps(e){return{token:l()(e).token,customerID:l()(e).customerID,error:!1}}componentDidMount(){null!==this.state.token&&null!==this.state.customerID&&h().push("/inspectionHistory")}async handleChange(e){this.setState({[e.target.name]:e.target.value})}async handleSubmit(){this.setState({loading:!0});let{email:e,pw:t}=this.state;await c()("".concat("https://api-cs.neuronaware.net","/cs/signin"),{method:"POST",headers:{"Content-Type":"application/json",customerid:"NeuronAware","Access-Control-Allow-Origin":"*","Access-Control-Allow-Credentials":!0,"Access-Control-Allow-Headers":"Accept, Content-Type, Content-Length, Accept-Encoding, X-CSRF-Token, Authorization"},body:JSON.stringify({email:e,pw:t})}).then(e=>{if(200===e.status)return e.json();throw new(m())(e.json())}).then(e=>{if(console.log("body",e),e.customerName){let t=new Date;t.setTime(t.getTime()+864e5);let n=t.toGMTString();document.cookie="token=Bearer ".concat(e.token,"; expires=").concat(n),document.cookie="customerID=".concat(e.customerName,"; expires=").concat(n),document.cookie="customerId=".concat(e.customerId,"; expires=").concat(n),document.cookie="customerName=".concat(e.customerName,"; expires=").concat(n),h().push("/inspectionHistory")}else window.alert("customer is not found")}).catch(e=>{this.setState({signinerr:!0,loading:!1})})}async handleKeydown(e){13===e.keyCode&&this.handleSubmit()}render(){let{error:e,signinerr:t,loading:n}=this.state;return(0,i.jsx)("div",{children:!0===e?(0,i.jsx)(m(),{statusCode:500,msg:e}):(0,i.jsxs)("div",{className:"jsx-6d3a89e4ae3710d2 text-center login-container ",children:[(0,i.jsx)(s(),{id:"6d3a89e4ae3710d2",children:'.login-container.jsx-6d3a89e4ae3710d2{display:-webkit-box;display:-webkit-flex;display:-moz-box;display:-ms-flexbox;display:flex;-webkit-box-pack:center;-webkit-justify-content:center;-moz-box-pack:center;-ms-flex-pack:center;justify-content:center;-webkit-box-align:center;-webkit-align-items:center;-moz-box-align:center;-ms-flex-align:center;align-items:center;background-image:url("/landing_small.jpg");-webkit-background-size:cover;-moz-background-size:cover;-o-background-size:cover;background-size:cover;background-position:center;background-repeat:no-repeat;min-height:100vh;position:relative}.login-form-container.jsx-6d3a89e4ae3710d2{background-color:rgba(255,255,255,.9);padding:2rem;-webkit-border-radius:10px;-moz-border-radius:10px;border-radius:10px;margin-top:120px}'}),(0,i.jsx)("header",{className:"jsx-6d3a89e4ae3710d2 py-5",children:(0,i.jsx)("nav",{className:"jsx-6d3a89e4ae3710d2 navbar navbar-expand-lg p-2 fixed-top navbar-dark bg-dark text-center",children:(0,i.jsx)("div",{className:"jsx-6d3a89e4ae3710d2 container",children:(0,i.jsx)("h1",{className:"jsx-6d3a89e4ae3710d2 navbar-brand",children:"NVision 고객지원 사이트"})})})}),(0,i.jsxs)("div",{className:"jsx-6d3a89e4ae3710d2 container text-center d-flex flex-column align-items-center",children:[(0,i.jsxs)("div",{className:"jsx-6d3a89e4ae3710d2 p-5 shadow-lg w-50 bg-white ",children:[(0,i.jsx)("input",{type:"text",onChange:this.handleChange,name:"email",placeholder:"email",className:"jsx-6d3a89e4ae3710d2 form-control mb-2"}),(0,i.jsx)("input",{type:"password",onChange:this.handleChange,name:"pw",placeholder:"password",onKeyDown:this.handleKeydown,className:"jsx-6d3a89e4ae3710d2 form-control mb-2"})]}),!0===n&&(0,i.jsxs)("button",{type:"button",disabled:!0,className:"jsx-6d3a89e4ae3710d2 btn btn-light mt-5",children:[(0,i.jsx)("span",{role:"status","aria-hidden":"true",className:"jsx-6d3a89e4ae3710d2 spinner-border spinner-border-sm"}),"SignIn ..."]}),!1===n&&(0,i.jsx)("button",{type:"button",id:"submit",onClick:this.handleSubmit,className:"jsx-6d3a89e4ae3710d2 btn btn-outline-secondary bg-secondary text-white mr-2 p-2 mt-5",children:"로그인"}),!0===t&&(0,i.jsx)("p",{className:"jsx-6d3a89e4ae3710d2 text-justify text-center font-weight-bold text-danger",children:"아이디 또는 비밀번호가 틀렸습니다."})]})]})})}constructor(e){super(e),this.handleChange=this.handleChange.bind(this),this.handleSubmit=this.handleSubmit.bind(this),this.handleKeydown=this.handleKeydown.bind(this);let t=e.token||null,n=e.customerID||null;this.state={token:t,email:"",pw:"",customerID:n,error:!1,signinerr:!1,loading:!1}}}let g=f},72552:()=>{},87156:(e,t,n)=>{e.exports=n(99341)},96390:(e,t,n)=>{"use strict";var i=function(){if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if(void 0!==n.g)return n.g;throw Error("unable to locate global object")}();e.exports=t=i.fetch,i.fetch&&(t.default=i.fetch.bind(i)),t.Headers=i.Headers,t.Request=i.Request,t.Response=i.Response}},e=>{var t=t=>e(e.s=t);e.O(0,[636,593,792],()=>t(42936)),_N_E=e.O()}]);