!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},t=Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="4587964d-f6ed-49d1-9599-ce7bd0885f74",e._sentryDebugIdIdentifier="sentry-dbid-4587964d-f6ed-49d1-9599-ce7bd0885f74")}catch(e){}}(),(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4665],{22897:function(e,t,r){Promise.resolve().then(r.t.bind(r,65878,23)),Promise.resolve().then(r.bind(r,30574)),Promise.resolve().then(r.bind(r,92406))},12119:function(e,t,r){"use strict";Object.defineProperty(t,"$",{enumerable:!0,get:function(){return a}});let n=r(83079);function a(e){let{createServerReference:t}=r(6671);return t(e,n.callServer)}},92406:function(e,t,r){"use strict";var n=r(57437),a=r(12978),i=r(88178),c=r(99376),s=r(2265),o=r(32595);t.default=()=>{let[e,t]=(0,s.useState)(!1),[r,u]=(0,s.useState)(!1),l=(0,c.useRouter)(),d="w-80 h-16 py-2 px-4 font-semibold border rounded-custom-radius text-center transition ease-in duration-200 transform hover:-translate-y-1 active:translate-y-0 ".concat(r?"bg-shortbread-purple text-white hover:text-black border-shortbread-purple hover:bg-white hover:text-shortbread-purple hover:border-shortbread-purple":"bg-gray-400 text-white border-gray-400 cursor-not-allowed"),f=async()=>{if(r)try{t(!0),await (0,i.x)(),l.push("/projects")}catch(e){console.warn(e)}finally{t(!1)}};return e?(0,n.jsx)("div",{className:"p-8 rounded-lg shadow-md w-full text-center h-full flex flex-col justify-center items-center",children:(0,n.jsx)("div",{className:"w-10 h-10",children:(0,n.jsx)(o.Z,{})})}):(0,n.jsxs)("div",{className:"p-8 rounded-lg shadow-md text-center h-full w-full flex flex-col justify-center items-center",children:[(0,n.jsx)("h1",{className:"text-center text-2xl font-bold mb-6 text-white",children:"Sign in to your account"}),(0,n.jsx)("button",{className:d,disabled:!r,onClick:f,children:"Authenticate with Google"}),(0,n.jsxs)("div",{className:"flex items-center mt-2 gap-2",children:[(0,n.jsxs)("p",{className:"text-white text-sm md:text-base text-wrap w-60",children:["I agree with the"," ",(0,n.jsx)("a",{onClick:()=>l.push(a.Dz),className:"text-bold cursor-pointer",children:"Terms of Service"})," ","and"," ",(0,n.jsx)("a",{onClick:()=>l.push(a.$w),className:"text-bold cursor-pointer",children:"Privacy Policy."})]}),(0,n.jsx)("input",{type:"checkbox",checked:r,onChange:()=>u(!r)})]})]})}},32595:function(e,t,r){"use strict";var n=r(57437),a=r(69472);r(2265),t.Z=e=>{let{className:t}=e;return(0,n.jsx)("div",{className:"w-full h-full flex flex-row content-center justify-center items-center bg-black",children:(0,n.jsx)(a.Z,{size:24,className:t,color:"primary"})})}},12978:function(e,t,r){"use strict";r.d(t,{$w:function(){return u},Dz:function(){return o},Gj:function(){return s},bn:function(){return i},io:function(){return n},lK:function(){return a},no:function(){return c}});let n="/projects",a="/characters",i="/series",c="/admin",s="/about-me",o="https://shortbread.ai/terms",u="https://shortbread.ai/privacy"},88178:function(e,t,r){"use strict";r.d(t,{x:function(){return l},k:function(){return d}});var n=r(44752),a=r(46214);r(83079);var i=r(12119),c=(0,i.$)("dadd3e9041a7b8e43a18944d4d1abe722a1ce243"),s=(0,i.$)("7c8d2f0fa807d7075a5eec93dea3f6df12a55753");(0,i.$)("3d5c031e0a755da5f24b86967eaa143a3e8a5c85");var o=r(15734),u=r(19260);let l=async()=>{var e;let t=await (0,n.rh)(o.U_,o.Ap),r=await t.user.getIdToken();await (0,u.r4)(t.user.uid,t.user.email||""),await s(r),a.ZP.identify(null===(e=o.U_.currentUser)||void 0===e?void 0:e.uid)},d=async()=>{o.U_.signOut(),await c()}},15734:function(e,t,r){"use strict";r.d(t,{Af:function(){return p},Ap:function(){return l},J6:function(){return w},Kz:function(){return h},N5:function(){return y},Ph:function(){return P},ST:function(){return k},U_:function(){return u},WW:function(){return j},_N:function(){return x},gu:function(){return _},kz:function(){return b},n_:function(){return v},no:function(){return N},op:function(){return J},tO:function(){return f},u4:function(){return g},z9:function(){return m}});var n=r(738),a=r(44752),i=r(5978),c=r(60062);let s={apiKey:"".concat("AIzaSyCA-MwM7i5vMuooKhllMEOomGGZLiYdn4s"),authDomain:"".concat("shortbread-8be0a.firebaseapp.com"),projectId:"".concat("shortbread-8be0a"),storageBucket:"".concat("shortbread-8be0a.appspot.com"),messagingSenderId:"".concat("685308706118"),appId:"".concat("1:685308706118:web:4dc02fdaf840960e3ab947"),measurementId:"".concat("G-079EKJRW14")},o=(0,n.ZF)(s,"shortbread"),u=(0,a.v0)(o),l=new a.hJ,d=(0,i.LV)(o,{ignoreUndefinedProperties:!0});t.ZP=d;let f=(0,c.cF)(o),h=30,b="".concat("https://storage.googleapis.com/"+s.storageBucket,"/"),m="comicsSave",p="background_textures",w="editor_generation_outputs",y="users",x="shortbreadArtists",v="characters",g="characterNames",P="adminUsers",N="usersPublish",_="loraCreationJobs",j="characterTrainGenerationOutputs",k="comicSeries",J="comicEpisodes"},19260:function(e,t,r){"use strict";r.d(t,{B_:function(){return b},FA:function(){return s},O$:function(){return u},Pz:function(){return h},d5:function(){return c},o8:function(){return o},r4:function(){return d},sc:function(){return l},w0:function(){return i},zs:function(){return f}});var n=r(5978),a=r(15734);let i=async e=>{let t=(0,n.JU)(a.ZP,a.N5,e),r=await (0,n.QT)(t);return r.exists()&&r.data().email||null},c=async e=>{var t;let r=(0,n.JU)(a.ZP,a.N5,e);return(null===(t=(await (0,n.QT)(r)).data())||void 0===t?void 0:t.credits)||0},s=async(e,t)=>{var r;let i=(0,n.JU)(a.ZP,a.N5,e),c=(null===(r=(await (0,n.QT)(i)).data())||void 0===r?void 0:r.credits)||0;await (0,n.r7)(i,{credits:Math.max(c+t,0)})},o=async e=>{let t=(0,n.hJ)(a.ZP,a._N),r=(0,n.IO)(t,(0,n.ar)("email","==",await i(e)));return(await (0,n.PL)(r)).size>0},u=async e=>{var t;let r=(0,n.hJ)(a.ZP,a.Ph),i=(0,n.JU)(r,e),c=await (0,n.QT)(i),s=null===(t=(await (0,n.QT)((0,n.JU)((0,n.hJ)(a.ZP,a.N5),e))).data())||void 0===t?void 0:t.email;if(!s)return!1;let o=(0,n.IO)(r,(0,n.ar)("email","==",s)),u=await (0,n.PL)(o);return c.exists()||u.size>0},l=async e=>{let t=(0,n.hJ)(a.ZP,"comicSeries"),r=(0,n.IO)(t,(0,n.ar)("creatorIds","array-contains",e));return(await (0,n.PL)(r)).size>0},d=async(e,t)=>{let r=(0,n.JU)(a.ZP,a.N5,e);if((await (0,n.QT)(r)).exists())return;let i={email:t||"",displayName:(null==t?void 0:t.split("@")[0])||"user",createdAt:(0,n.Bt)(),recentlyOpenedComics:[],credits:100,uid:e};try{return await (0,n.pl)(r,i),console.log("User created successfully"),!0}catch(e){return console.error("Error creating user:",e),!1}},f=async e=>{let t=(0,n.hJ)(a.ZP,a.N5),r=(0,n.IO)(t,(0,n.ar)("email","==",e),(0,n.b9)(1)),i=await (0,n.PL)(r);return i.empty?null:i.docs[0].id},h=async e=>{let t=(0,n.JU)(a.ZP,a.N5,e);await (0,n.r7)(t,{uid:e})},b=async e=>{let t=(0,n.hJ)(a.ZP,a.N5),r=e.map(async e=>{let r=(0,n.JU)(t,e),a=await (0,n.QT)(r);return a.exists()?{...a.data(),uid:a.id}:null});return(await Promise.all(r)).filter(e=>null!==e)}},30574:function(e,t,r){"use strict";r.r(t),t.default={src:"/_next/static/media/logo.90025ac0.svg",height:88,width:394,blurWidth:0,blurHeight:0}}},function(e){e.O(0,[4358,8125,9472,1896,7765,2971,5878,5268,1744],function(){return e(e.s=22897)}),_N_E=e.O()}]);
//# sourceMappingURL=page-62e557f942515e6f.js.map