(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[522],{324:(e,n,r)=>{"use strict";r.d(n,{Sidebar:()=>y});var o=r(4568),s=r(7541),i=r(1284),t=r(6987),l=r(6763),a=r(6262),d=r(5431),c=r(3775),h=r(1084),b=r(2278),u=r(2775),m=r(812),v=r(1166),P=r(2010),x=r(1441),p=r(3791),g=r(7740),f=r(1037);function y(){var e,n,r,y,j,k;let A=(0,s.useRouter)(),M=(0,s.usePathname)(),{t:w}=(0,g.s9)(),C=[{key:"dashboard",path:"/dashboard",label:null!=(e=w("nav.dashboard"))?e:"Dashboard",icon:(0,o.jsx)(h.A,{})},{key:"meetings",path:"/meetings",label:null!=(n=w("nav.meetings"))?n:"Meetings",icon:(0,o.jsx)(b.A,{})},{key:"record",path:"/record",label:null!=(r=w("nav.record"))?r:"Record",icon:(0,o.jsx)(u.A,{})},{key:"teams",path:"/teams",label:null!=(y=w("nav.teams"))?y:"Teams",icon:(0,o.jsx)(m.A,{})},{key:"billing",path:"/billing",label:null!=(j=w("nav.billing"))?j:"Billing",icon:(0,o.jsx)(v.A,{})}];async function _(){let e=(0,f.c)();await e.auth.signOut(),A.replace("/login")}return(0,o.jsxs)(i.default,{sx:{width:240,minHeight:"100vh",bgcolor:p.sM.bg.sidebar,borderRight:"1px solid ".concat(p.sM.border.default),display:"flex",flexDirection:"column"},children:[(0,o.jsx)(i.default,{sx:{p:3,borderBottom:"1px solid ".concat(p.sM.border.default)},children:(0,o.jsx)(x.Rk,{variant:"heading",children:"D3RO VOICE"})}),(0,o.jsx)(t.A,{sx:{flex:1,py:2},children:C.map(e=>{let n=M===e.path||M.startsWith("".concat(e.path,"/"));return(0,o.jsx)(l.Ay,{disablePadding:!0,children:(0,o.jsxs)(a.A,{selected:n,onClick:()=>A.push(e.path),sx:{"&.Mui-selected":{bgcolor:p.sM.bg.inset,borderLeft:"3px solid ".concat(p.sM.accent.amber)}},children:[(0,o.jsx)(d.A,{sx:{color:n?p.sM.accent.amber:p.sM.text.label},children:e.icon}),(0,o.jsx)(c.A,{primary:e.label,primaryTypographyProps:{color:n?p.sM.text.primary:p.sM.text.secondary}})]})},e.key)})}),(0,o.jsx)(t.A,{sx:{borderTop:"1px solid ".concat(p.sM.border.default)},children:(0,o.jsx)(l.Ay,{disablePadding:!0,children:(0,o.jsxs)(a.A,{onClick:()=>void _(),children:[(0,o.jsx)(d.A,{sx:{color:p.sM.text.label},children:(0,o.jsx)(P.A,{})}),(0,o.jsx)(c.A,{primary:null!=(k=w("nav.logout"))?k:"Logout",primaryTypographyProps:{color:p.sM.text.secondary}})]})})})]})}},1441:(e,n,r)=>{"use strict";r.d(n,{Rk:()=>s.PhosphorText,Uu:()=>o.MetalCard}),r(4070),r(9006),r(5281),r(6652);var o=r(9502),s=r(215);r(2517),r(1459),r(984)},3320:(e,n,r)=>{"use strict";r.d(n,{CheckoutButton:()=>h});var o=r(4568),s=r(7620),i=r(1284),t=r(2622),l=r(5663),a=r(6032),d=r(1037),c=r(459);function h(e){let{tier:n}=e,[r,h]=(0,s.useState)(!1),[b,u]=(0,s.useState)(null);async function m(){u(null),h(!0);try{let e=(0,d.c)(),{data:{session:r}}=await e.auth.getSession();if(!r)return void u("로그인이 필요합니다");let o=await fetch("".concat(c.env.NEXT_PUBLIC_SUPABASE_URL,"/functions/v1/stripe-checkout"),{method:"POST",headers:{Authorization:"Bearer ".concat(r.access_token),"Content-Type":"application/json"},body:JSON.stringify({tier:n,success_url:"".concat(window.location.origin,"/billing?success=1"),cancel_url:"".concat(window.location.origin,"/billing?canceled=1")})});if(!o.ok){let e=await o.text();throw Error("Checkout 시작 실패: ".concat(o.status," ").concat(e))}let s=await o.json();s.url?window.location.href=s.url:u("Checkout URL을 받지 못했습니다")}catch(e){u(e instanceof Error?e.message:"Unknown error")}finally{h(!1)}}return(0,o.jsxs)(i.default,{children:[(0,o.jsx)(t.A,{fullWidth:!0,variant:"contained",size:"large",onClick:()=>void m(),disabled:r,startIcon:r?(0,o.jsx)(l.A,{size:16,color:"inherit"}):null,children:"업그레이드"}),b&&(0,o.jsx)(a.A,{severity:"error",variant:"outlined",sx:{mt:1,fontSize:11},children:b})]})}},5246:(e,n,r)=>{Promise.resolve().then(r.bind(r,3320)),Promise.resolve().then(r.bind(r,324)),Promise.resolve().then(r.bind(r,1284)),Promise.resolve().then(r.bind(r,7960)),Promise.resolve().then(r.bind(r,7301)),Promise.resolve().then(r.bind(r,8613)),Promise.resolve().then(r.bind(r,9746)),Promise.resolve().then(r.bind(r,1379)),Promise.resolve().then(r.bind(r,1774)),Promise.resolve().then(r.bind(r,8448)),Promise.resolve().then(r.bind(r,7273)),Promise.resolve().then(r.bind(r,5608)),Promise.resolve().then(r.bind(r,1238)),Promise.resolve().then(r.bind(r,4590)),Promise.resolve().then(r.bind(r,3174)),Promise.resolve().then(r.bind(r,2421)),Promise.resolve().then(r.bind(r,8758)),Promise.resolve().then(r.bind(r,9969)),Promise.resolve().then(r.bind(r,8356)),Promise.resolve().then(r.bind(r,5845)),Promise.resolve().then(r.bind(r,3292)),Promise.resolve().then(r.bind(r,2406)),Promise.resolve().then(r.bind(r,2105)),Promise.resolve().then(r.bind(r,1374)),Promise.resolve().then(r.bind(r,1580)),Promise.resolve().then(r.bind(r,850)),Promise.resolve().then(r.bind(r,6310)),Promise.resolve().then(r.bind(r,984)),Promise.resolve().then(r.bind(r,4070)),Promise.resolve().then(r.bind(r,9006)),Promise.resolve().then(r.bind(r,5281)),Promise.resolve().then(r.bind(r,9502)),Promise.resolve().then(r.bind(r,2517)),Promise.resolve().then(r.bind(r,215)),Promise.resolve().then(r.bind(r,6652)),Promise.resolve().then(r.bind(r,1459))},7960:(e,n,r)=>{"use strict";r.r(n),r.d(n,{default:()=>l});var o=r(9969),s=r(8613),i=r(5120),t=r(1774);let l=(0,o.default)({createStyledComponent:(0,s.default)("div",{name:"MuiGrid",slot:"Root",overridesResolver:(e,n)=>{let{ownerState:r}=e;return[n.root,r.container&&n.container]}}),componentName:"MuiGrid",useThemeProps:e=>(0,i.b)({props:e,name:"MuiGrid"}),useTheme:t.default})}},e=>{e.O(0,[385,77,988,189,949,473,746,605,32,791,803,910,587,18,358],()=>e(e.s=5246)),_N_E=e.O()}]);