1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5516],{76489:function(e,t){"use strict";/*! 2 * cookie 3 * Copyright(c) 2012-2014 Roman Shtylman 4 * Copyright(c) 2015 Douglas Christopher Wilson 5 * MIT Licensed 6 */t.parse=function(e,t){if("string"!=typeof e)throw TypeError("argument str must be a string");for(var r={},o=(t||{}).decode||i,s=0;s<e.length;){var a=e.indexOf("=",s);if(-1===a)break;var n=e.indexOf(";",s);if(-1===n)n=e.length;else if(n<a){s=e.lastIndexOf(";",a-1)+1;continue}var c=e.slice(s,a).trim();if(void 0===r[c]){var l=e.slice(a+1,n).trim();34===l.charCodeAt(0)&&(l=l.slice(1,-1)),r[c]=function(e,t){try{return t(e)}catch(t){return e}}(l,o)}s=n+1}return r},t.serialize=function(e,t,i){var a=i||{},n=a.encode||s;if("function"!=typeof n)throw TypeError("option encode is invalid");if(!o.test(e))throw TypeError("argument name is invalid");var c=n(t);if(c&&!o.test(c))throw TypeError("argument val is invalid");var l=e+"="+c;if(null!=a.maxAge){var u=a.maxAge-0;if(isNaN(u)||!isFinite(u))throw TypeError("option maxAge is invalid");l+="; Max-Age="+Math.floor(u)}if(a.domain){if(!o.test(a.domain))throw TypeError("option domain is invalid");l+="; Domain="+a.domain}if(a.path){if(!o.test(a.path))throw TypeError("option path is invalid");l+="; Path="+a.path}if(a.expires){var d=a.expires;if("[object Date]"!==r.call(d)&&!(d instanceof Date)||isNaN(d.valueOf()))throw TypeError("option expires is invali
6d");l+="; Expires="+d.toUTCString()}if(a.httpOnly&&(l+="; HttpOnly"),a.secure&&(l+="; Secure"),a.partitioned&&(l+="; Partitioned"),a.priority)switch("string"==typeof a.priority?a.priority.toLowerCase():a.priority){case"low":l+="; Priority=Low";break;case"medium":l+="; Priority=Medium";break;case"high":l+="; Priority=High";break;default:throw TypeError("option priority is invalid")}if(a.sameSite)switch("string"==typeof a.sameSite?a.sameSite.toLowerCase():a.sameSite){case!0:case"strict":l+="; SameSite=Strict";break;case"lax":l+="; SameSite=Lax";break;case"none":l+="; SameSite=None";break;default:throw TypeError("option sameSite is invalid")}return l};var r=Object.prototype.toString,o=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/;function i(e){return -1!==e.indexOf("%")?decodeURIComponent(e):e}function s(e){return encodeURIComponent(e)}},47041:function(e,t,r){"use strict";var o=this&&this.__assign||function(){return(o=Object.assign||function(e){for(var t,r=1,o=arguments.length;r<o;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)},i=this&&this.__rest||function(e,t){var r={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&0>t.indexOf(o)&&(r[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var i=0,o=Object.getOwnPropertySymbols(e);i<o.length;i++)0>t.indexOf(o[i])&&Object.prototype.propertyIsEnumerable.call(e,o[i])&&(r[o[i]]=e[o[i]]);return r};Object.defineProperty(t,"__esModule",{value:!0}),t.hasCookie=t.deleteCookie=t.setCookie=t.getCookie=t.getCookies=void 0;var s=r(76489),a=function(){return"undefined"!=typeof window},n=function(e){return!!e&&"getAll"in e&&"set"in e&&"function"==typeof e.getAll&&"function"==typeof e.set},c=function(e){return!!(null==e?void 0:e.req)&&"cookies"in e.req&&n(null==e?void 0:e.req.cookies)||!!(null==e?void 0:e.res)&&"cookies"in e.res&&n(null==e?void 0:e.res.cookies)||!!(null==e?void 0:e.cookies)&&n(e.cookies())},l=function(e){var t={};return e.getAll().forEach(function(e){var r=e.name,o=e.value;t[r]=o}),t},u=function(e){try{if("string"==typeof e)return e;return JSON.stringify(e)}catch(t){return e}};t.getCookies=function(e){if(c(e)){if(null==e?void 0:e.req)return l(e.req.cookies);if(null==e?void 0:e.cookies)return l(e.cookies())}if(e&&(t=e.req),!a())return t&&t.cookies?t.cookies:t&&t.headers.cookie?(0,s.parse)(t.headers.cookie):{};for(var t,r={},o=document.cookie?document.cookie.split("; "):[],i=0,n=o.length;i<n;i++){var u=o[i].split("="),d=u.slice(1).join("=");r[u[0]]=d}return r},t.getCookie=function(e,r){var o=(0,t.getCookies)(r)[e];if(void 0!==o)return o?o.replace(/(%[0-9A-Z]{2}
6)+/g,decodeURIComponent):o},t.setCookie=function(e,t,r){if(c(r)){var n,l,d,p=r.req,f=r.res,g=r.cookies,h=i(r,["req","res","cookies"]),m=o({name:e,value:u(t)},h);p&&p.cookies.set(m),f&&f.cookies.set(m),g&&g().set(m);return}if(r){var p=r.req,f=r.res,y=i(r,["req","res"]);l=p,d=f,n=y}var v=(0,s.serialize)(e,u(t),o({path:"/"},n));if(a())document.cookie=v;else if(d&&l){var k=d.getHeader("Set-Cookie");if(Array.isArray(k)||(k=k?[String(k)]:[]),d.setHeader("Set-Cookie",k.concat(v)),l&&l.cookies){var w=l.cookies;""===t?delete w[e]:w[e]=u(t)}if(l&&l.headers&&l.headers.cookie){var w=(0,s.parse)(l.headers.cookie);""===t?delete w[e]:w[e]=u(t),l.headers.cookie=Object.entries(w).reduce(function(e,t){return e.concat("".concat(t[0],"=").concat(t[1],";"))},"")}}},t.deleteCookie=function(e,r){return(0,t.setCookie)(e,"",o(o({},r),{maxAge:-1}))},t.hasCookie=function(e,r){return!!e&&(0,t.getCookies)(r).hasOwnProperty(e)}},4453:function(e,t,r){(window.__NEXT_P=window.__NEXT_P||[]).push(["/auth-middleware",function(){return r(27281)}])},84304:function(e,t,r){"use strict";function o(e){return e?e.replace(/[\s\/!@#$%^&*()=+{}[\]|\\:;'"<>,.?~%]+/g,"-").replace(/\.+/g,"-").replace(/--+/g,"-").replace(/^-+|-+$/g,"").toLowerCase():""}r.d(t,{q:function(){return o}})},34798:function(e,t,r){"use strict";r.d(t,{D:function(){return o}});let o=()=>"https://api.cypherscribe.com"},80908:function(e,t,r){"use strict";r.d(t,{DB:function(){return s},dg:function(){return i},m5:function(){return a}});var o=r(47041);let i=(e,t)=>{let r=new Date;return r.setDate(r.getDate()+30),(0,o.setCookie)(e,t,{expires:r,sameSite:"None",secure:!0})},s=e=>(0,o.getCookie)(e),a=()=>{for(var e=document.cookie.split(";"),t=0;t<e.length;t++){var r=e[t],o=r.indexOf("="),i=o>-1?r.substr(0,o):r;document.cookie=i+"=;expires=Thu, 01 Jan 1970 00:00:00 GMT;path=/"}}},27281:function(e,t,r){"use strict";r.r(t),r.d(t,{default:function(){return m}});var o=r(85893),i=r(33299),s=r(67294),a=r(11163),n=r(74304),c=r(59923);function l(e){let{className:t,...r}=e;return(0,o.jsx)("div",{className:(0,c.cn)("animate-pulse rounded-md bg-slate-100 dark:bg-slate-800",t),...r})}var u=r(49364),d=r(70342),p=r(80908),f=r(87066),g=r(84304),h=r(34798),m=()=>{var e;let{data:t,status:r}=(0,i.useSession)(),c=(0,a.useRouter)(),{toast:m}=(0,n.pm)(),[v,k]=(0,s.useState)({loading:!1,error:!1,success:!1});(0,s.useEffect)(()=>{if(c.query.error){m({title:"Authentication failed",description:"Please try again with Google sign in"});return}},[c.query.error]),(0,s.useEffect)(()=>{if("unauthenticated"===r){c.push("/");return}let e=async()=>{var e;if("authenticated"===r&&(null==t?void 0:null===(e=t.user)||void 0===e?void 0:e.id)&&!v.error)try{k({loading:!0,error:!1,success:!1});let e=await w(t.user.id);e.success?(k({loading:!1,error:!1,success:!0}),c.push(e.route)):(m({title:"Failed to retrieve user data"}),k({loading:!1,error:!0,success:!1}))}catch(e){console.error("Error fetching user data:",e),m({title:"Error retrieving user data",description:"Please try again"}),k({loading:!1,error:!0,success:!1})}};"authenticated"===r&&e()},[r,null==t?void 0:null===(e=t.user)||void 0===e?void 0:e.id]);let w=async e=>new Promise(async(r,o)=>{try{let o=await f.Z.get("".concat((0,h.D)(),"/send-data-post-login/").concat(e),{headers:{Accept:"application/json","Content-Type":"application/json"}});if(o.data.success){if(o.data.user.docsContent.pages_content.length>1)await u.Z.setItem("pageIDsWithNames",{pages_content:o.data.user.docsContent.pages_content,pages_hierarchy:o.data.user.docsContent.pages_hierarchy}),localStorage.setItem("numberOfPages",o.data.user.docsContent.pages_hierarchy.length);else if(1===o.data.user.docsContent.pages_hierarchy.length&&"3914060c-7190-4bce-b68d-a496bf2e5306"!==o.data.user.docsContent.pages_hierarchy[0].id)await u.Z.setItem("pageIDsWithNames",{pages_content:o.data.user.docsContent.pages_content,pages_hierarchy:o.data.user.docsContent.pages_hierarchy}),localStorage.setItem("numberOfPages",o.data.user.docsContent.pages_hierarchy.length);else{var i;await u.Z.setItem("pageIDsWithNames",d.M),(0,p.dg)("cypherDomain","".concat((0,g.q)(null==t?void 0:null===(i=t.user)||void 0===i?void 0:i.email.split("@")[0]),"-free.cypherscribe.com")),(0,p.dg)("pt","free"),localStorage.setItem("numberOfPages",1)}localStorage.setItem("workspaceDeatils",JSON.stringify(o.data.user.workspace)),(0,p.dg)("pt",o.data.user.planType),(0,p.dg)("cypherDomain",o.data.user.workspace.cypherDomain),o.data.user.workspace.customDomain&&(0,p.dg)("customDomain",o.data.user.workspace.customDomain),localStorage.setItem("templateChoices",JSON.stringify(o.data.user["style-and-themes"].templates)),localStorage.setItem("cusTheme",o.data.user["style-and-themes"].theme),localStorage.setItem("savedColors",JSON.stringify(o.data.user["style-and-themes"].colors.LP)),localStorage.setItem("savedColorsToc",JSON.stringify(o.data.user["style-and-themes"].colors.toc)),localStorage.setItem("savedColorsKB",JSON.stringify(o.data.user["style-and-themes"].colors.kb.colors)),localStorage.setItem("savedCustomTextKB",JSON.stringify(o.data.user["style-and-themes"].colors.kb.text)),localStorage.setItem("kbGradientInfo",JSON.stringify({isGradient:o.data.user["style-and-themes"].colors.kb.colors.isGradient,gradinetTemplate:o.data.user["style-and-themes"].colors.kb.colors.gradinetTemplate})),r(o.data.user.docsContent.pages_content.length>1?{success:!0,route:"/workspace"}:1===o.data.user.docsContent.pages_hierarchy.length&&"3914060c-7190-4bce-b68d-a496bf2e5306"!==o.data.user.docsContent.pages_hierarchy[0].id?{success:!0,route:"/workspace"}:{success:!0,route:"/onboarding"})}}catch(e){console.error("Error in retrieveUserDataPostGoogleLogin:",e),o(!1)}});return"loading"===r?(0,o.jsx)("div",{className:"h-screen flex items-center justify-center",children:(0,o.jsx)("div",{className:"grid grid-cols-3 gap-12 gap-x-40",children:Array.from({length:15}).map((e,t)=>(0,o.jsxs)("div",{className:"flex items-center space-x-4",children:[(0,o.jsx)(l,{className:"h-12 w-12 rounded-full"}),(0,o.jsxs)("div",{className:"space-y-2",children:[(0,o.jsx)(l,{className:"h-4 w-[250px]"}),(0,o.jsx)(l,{className:"h-4 w-[200px]"})]})]},t))})}):r?void 0:(0,o.jsx)(y,{})};let y=(0,s.memo)(()=>(0,o.jsx)("div",{className:"h-screen flex items-center justify-center",children:(0,o.jsx)(v,{})}));y.displayName="LoggingOutComp";let v=()=>(0,o.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"35",height:"35",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",children:(0,o.jsx)("path",{d:"M21 12a9 9 0 1 1-6.219-8.56"})})},11163:function(e,t,r){e.exports=r(73035)}},function(e){e.O(0,[9483,7066,9408,2888,9774,179],function(){return e(e.s=4453)}),_N_E=e.O()}]);
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.