1_N_E=(window.webpackJsonp_N_E=window.webpackJsonp_N_E||[]).push([[17],{"/0+H":function(e,t,n){"use strict";t.__esModule=!0,t.isInAmpMode=i,t.useAmp=function(){return i(o.default.useContext(a.AmpStateContext))};var r,o=(r=n("q1tI"))&&r.__esModule?r:{default:r},a=n("lwAK");function i(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.ampFirst,n=void 0!==t&&t,r=e.hybrid,o=void 0!==r&&r,a=e.hasQuery,i=void 0!==a&&a;return n||o&&i}},"7W2i":function(e,t,n){var r=n("SksO");e.exports=function(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&r(e,t)}},"8Kt/":function(e,t,n){"use strict";n("lSNA");t.__esModule=!0,t.defaultHead=f,t.default=void 0;var r,o=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==typeof e&&"function"!==typeof e)return{default:e};var t=s();if(t&&t.has(e))return t.get(e);var n={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){var a=r?Object.getOwnPropertyDescriptor(e,o):null;a&&(a.get||a.set)?Object.defineProperty(n,o,a):n[o]=e[o]}n.default=e,t&&t.set(e,n);return n}(n("q1tI")),a=(r=n("Xuae"))&&r.__esModule?r:{default:r},i=n("lwAK"),c=n("FYa8"),u=n("/0+H");function s(){if("function"!==typeof WeakMap)return null;var e=new WeakMap;return s=function(){return e},e}function f(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=[o.default.createElement("meta",{charSet:"utf-8"})];return e||t.push(o.default.createElement("meta",{name:"viewport",content:"width=device-width"})),t}function l(e,t){return"string"===typeof t||"number"===typeof t?e:t.type===o.default.Fragment?e.concat(o.default.Children.toArray(t.props.children).reduce((function(e,t){return"string"===typeof t||"number"===typeof t?e:e.concat(t)}),[])):e.concat(t)}var d=["name","httpEquiv","charSet","itemProp"];function p(e,t){return e.reduce((function(e,t){var n=o.default.Children.toArray(t.props.children);return e.concat(n)}),[]).reduce(l,[]).reverse().concat(f(t.inAmpMode)).filter(function(){var e=new Set,t=new Set,n=new Set,r={};return function(o){var a=!0;if(o.key&&"number"!==typeof o.key&&o.key.indexOf("$")>0){var i=o.key.slice(o.key.indexOf("$")+1);e.has(i)?a=!1:e.add(i)}switch(o.type){case"title":case"base":t.has(o.type)?a=!1:t.add(o.type);break;case"meta":for(var c=0,u=d.length;c<u;c++){var s=d[c];if(o.props.hasOwnProperty(s))if("charSet"===s)n.has(s)?a=!1:n.add(s);else{var f=o.props[s],l=r[s]||new Set;l.has(f)?a=!1:(l.add(f),r[s]=l)}}}return a}}()).reverse().map((function(e,t){var n=e.key||t;return o.default.cloneElement(e,{key:n})}))}function b(e){var t=e.children,n=(0,o.useContext)(i.AmpStateContext),r=(0,o.useContext)(c.HeadManagerContext);return o.default.createElement(a.default,{reduceComponentsToState:p,headManager:r,inAmpMode:(0,u.isInAmpMode)(n)},t)}b.rewind=function(){};var h=b;t.default=h},"9/5/":function(e,t,n){(function(t){var n=/^\s+|\s+$/g,r=/^[-+]0x[0-9a-f]+$/i,o=/^0b[01]+$/i,a=/^0o[0-7]+$/i,i=parseInt,c="object"==typeof t&&t&&t.Object===Object&&t,u="object"==typeof self&&self&&self.Object===Object&&self,s=c||u||Function("return this")(),f=Object.prototype.toString,l=Math.max,d=Math.min,p=function(){return s.Date.now()};function b(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function h(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&"[object Symbol]"==f.call(e)}(e))return NaN;if(b(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=b(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(n,"");var c=o.test(e);return c||a.test(e)?i(e.slice(2),c?2:8):r.test(e)?NaN:+e}e.exports=function(e,t,n){var r,o,a,i,c,u,s=0,f=!1,m=!1,v=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function j(t){var n=r,a=o;return r=o=void 0,s=t,i=e.apply(a,n)}function g(e){return s=e,c=setTimeout(x,t),f?j(e):i}function y(e){var n=e-u;return void 0===u||n>=t||n<0||m&&e-s>=a}function x(){var e=p();if(y(e))return O(e);c=setTimeout(x,function(e){var n=t-(e-u);return m?d(n,a-(e-s)):n}(e))}function O(e){return c=void 0,v&&r?j(e):(r=o=void 0,i)}function w(){var e=p(),n=y(e);if(r=arguments,o=this,u=e,n){if(void 0===c)return g(u);
1if(m)return c=setTimeout(x,t),j(u)}return void 0===c&&(c=setTimeout(x,t)),i}return t=h(t)||0,b(n)&&(f=!!n.leading,a=(m="maxWait"in n)?l(h(n.maxWait)||0,t):a,v="trailing"in n?!!n.trailing:v),w.cancel=function(){void 0!==c&&clearTimeout(c),s=0,r=u=o=c=void 0},w.flush=function(){return void 0===c?i:O(p())},w}}).call(this,n("yLpj"))},Bnag:function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}},EbDI:function(e,t){e.exports=function(e){if("undefined"!==typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}},FI7Y:function(e,t,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/enter",function(){return n("ZnzD")}])},FYa8:function(e,t,n){"use strict";var r;t.__esModule=!0,t.HeadManagerContext=void 0;var o=((r=n("q1tI"))&&r.__esModule?r:{default:r}).default.createContext({});t.HeadManagerContext=o},Ijbi:function(e,t,n){var r=n("WkPL");e.exports=function(e){if(Array.isArray(e))return r(e)}},Nsbk:function(e,t){function n(t){return e.exports=n=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},n(t)}e.exports=n},PJYZ:function(e,t){e.exports=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}},RIqP:function(e,t,n){var r=n("Ijbi"),o=n("EbDI"),a=n("ZhPi"),i=n("Bnag");e.exports=function(e){return r(e)||o(e)||a(e)||i()}},Xuae:function(e,t,n){"use strict";var r=n("RIqP"),o=n("lwsE"),a=n("W8MJ"),i=(n("PJYZ"),n("7W2i")),c=n("a1gu"),u=n("Nsbk");function s(e){var t=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=u(e);if(t){var o=u(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return c(this,n)}}t.__esModule=!0,t.default=void 0;var f=n("q1tI"),l=function(e){i(n,e);var t=s(n);function n(e){var a;return o(this,n),(a=t.call(this,e))._hasHeadManager=void 0,a.emitChange=function(){a._hasHeadManager&&a.props.headManager.updateHead(a.props.reduceComponentsToState(r(a.props.headManager.mountedInstances),a.props))},a._hasHeadManager=a.props.headManager&&a.props.headManager.mountedInstances,a}return a(n,[{key:"componentDidMount",value:function(){this._hasHeadManager&&this.props.headManager.mountedInstances.add(this),this.emitChange()}},{key:"componentDidUpdate",value:function(){this.emitChange()}},{key:"componentWillUnmount",value:function(){this._hasHeadManager&&this.props.headManager.mountedInstances.delete(this),this.emitChange()}},{key:"render",value:function(){return null}}]),n}(f.Component);t.default=l},Ya7B:function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n("q1tI"),o=Object(r.createContext)({user:null,username:null})},ZnzD:function(e,t,n){"use strict";n.r(t),n.d(t,"default",(function(){return p}));var r=n("o0o1"),o=n.n(r),a=n("HaE+"),i=n("nKUr"),c=n("U6Mw"),u=n("Ya7B"),s=n("xzsl"),f=n("q1tI"),l=n("9/5/"),d=n.n(l);function p(e){var t=Object(f.useContext)(u.a),n=t.user,r=t.username;return Object(i.jsxs)("main",{children:[Object(i.jsx)(s.a,{title:"Enter",description:"Sign up for this amazing app!"}),n?r?Object(i.jsx)(h,{}):Object(i.jsx)(m,{}):Object(i.jsx)(b,{})]})}function b(){var e=function(){var e=Object(a.a)(o.a.mark((function e(){return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,c.b.signInWithPopup(c.e);case 2:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();return Object(i.jsxs)(i.Fragment,{children:[Object(i.jsxs)("button",{className:"btn-google",onClick:e,children:[Object(i.jsx)("img",{src:"/google.png",width:"30px"})," Sign in with Google"]}),Object(i.jsx)("button",{onClick:function(){return c.b.signInAnonymously()},children:"Sign in Anonymously"})]})}function h(){return Object(i.jsx)("button",{onClick:function(){return c.b.signOut()},children:"Sign Out"})}function m(){var e=Object(f.useState)(""),t=e[0],n=e[1],r=Object(f.useState)(!1),s=r[0],l=r[1],p=Object(f.useState)(!1),b=p[0],h=p[1],m=Object(f.useContext)(u.a),j=m.user,g=m.username,y=function(){var e=Object(a.a)(o.a.mark((function e(n){var r,a,i;return o.a.wrap((function(e){for(;;
1)switch(e.prev=e.next){case 0:return n.preventDefault(),r=c.c.doc("users/".concat(j.uid)),a=c.c.doc("usernames/".concat(t)),(i=c.c.batch()).set(r,{username:t,photoURL:j.photoURL,displayName:j.displayName}),i.set(a,{uid:j.uid}),e.next=8,i.commit();case 8:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();Object(f.useEffect)((function(){x(t)}),[t]);var x=Object(f.useCallback)(d()(function(){var e=Object(a.a)(o.a.mark((function e(t){var n,r,a;return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(t.length>=3)){e.next=9;break}return n=c.c.doc("usernames/".concat(t)),e.next=4,n.get();case 4:r=e.sent,a=r.exists,console.log("Firestore read executed!"),l(!a),h(!1);case 9:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),500),[]);return!g&&Object(i.jsxs)("section",{children:[Object(i.jsx)("h3",{children:"Choose Username"}),Object(i.jsxs)("form",{onSubmit:y,children:[Object(i.jsx)("input",{name:"username",placeholder:"myname",value:t,onChange:function(e){var t=e.target.value.toLowerCase();t.length<3&&(n(t),h(!1),l(!1)),/^(?=[a-zA-Z0-9._]{3,15}$)(?!.*[_.]{2})[^_.].*[^_.]$/.test(t)&&(n(t),h(!0),l(!1))}}),Object(i.jsx)(v,{username:t,isValid:s,loading:b}),Object(i.jsx)("button",{type:"submit",className:"btn-green",disabled:!s,children:"Choose"}),Object(i.jsx)("h3",{children:"Debug State"}),Object(i.jsxs)("div",{children:["Username: ",t,Object(i.jsx)("br",{}),"Loading: ",b.toString(),Object(i.jsx)("br",{}),"Username Valid: ",s.toString()]})]})]})}function v(e){var t=e.username,n=e.isValid;return e.loading?Object(i.jsx)("p",{children:"Checking..."}):n?Object(i.jsxs)("p",{className:"text-success",children:[t," is available!"]}):t&&!n?Object(i.jsx)("p",{className:"text-danger",children:"That username is taken!"}):Object(i.jsx)("p",{})}},a1gu:function(e,t,n){var r=n("cDf5"),o=n("PJYZ");e.exports=function(e,t){return!t||"object"!==r(t)&&"function"!==typeof t?o(e):t}},g4pe:function(e,t,n){e.exports=n("8Kt/")},lSNA:function(e,t){e.exports=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}},lwAK:function(e,t,n){"use strict";var r;t.__esModule=!0,t.AmpStateContext=void 0;var o=((r=n("q1tI"))&&r.__esModule?r:{default:r}).default.createContext({});t.AmpStateContext=o},xzsl:function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n("nKUr"),o=n("g4pe"),a=n.n(o);function i(e){var t=e.title,n=void 0===t?"Charcha | Believe, Blog, Bewitch ":t,o=e.description,i=void 0===o?"A blogging platform":o,c=e.image,u=void 0===c?"https://fireship.io/courses/react-next-firebase/img/featured.png":c;return Object(r.jsxs)(a.a,{children:[Object(r.jsx)("title",{children:n}),Object(r.jsx)("meta",{name:"twitter:card",content:"summary"}),Object(r.jsx)("meta",{name:"twitter:site",content:"@theankitsanghvi"}),Object(r.jsx)("meta",{name:"twitter:title",content:n}),Object(r.jsx)("meta",{name:"twitter:description",content:i}),Object(r.jsx)("meta",{name:"twitter:image",content:u}),Object(r.jsx)("meta",{property:"og:title",content:n}),Object(r.jsx)("meta",{property:"og:description",content:i}),Object(r.jsx)("meta",{property:"og:image",content:u})]})}}},[["FI7Y",0,2,5,6,1,4]]]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.