PageSourceSearch

https://inblog.ai/_next/static/chunks/pages/dashboard/author/[subdomain]-e4d3cc5a6153412a.js

js inblog.ai collected 2026-10-01 12:05:01 UTC 33,028 bytes, 17 lines download raw bytes

1!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._posthogChunkIds=e._posthogChunkIds||{},e._posthogChunkIds[n]="01a0f74f-5924-7e12-8e6a-9e8bb802d053")}catch(e){}}();(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[87879],{703:(e,t,a)=>{"use strict";a.d(t,{Ay:()=>M});var r=a(37876),s=a(48230),i=a.n(s),n=a(48155),o=a(4172),l=a(5259),d=a(57363),c=a(70828),u=a(16017),m=a(22702),h=a(95429),p=a(57044),g=a(40171),f=a(89099),b=a(64404);let x={ko:"한국어",en:"English",ja:"日本語",es:"Espa\xf1ol","zh-CN":"中文",fr:"Fran\xe7ais",de:"Deutsch","pt-BR":"Portugu\xeas",ru:"Русский"},_=()=>{let e=(0,f.useRouter)(),{i18n:t}=(0,h.Bd)(["subdomain-common"]);return(0,r.jsxs)(g.l6,{value:t.language,onValueChange:t=>{t!==e.locale&&(document.cookie=`NEXT_LOCALE=${t}; path=/; max-age=31536000`,e.push(e.asPath,e.asPath,{locale:t}))},children:[(0,r.jsxs)(g.bq,{className:"w-fit h-11 sm:h-auto border-none bg-transparent shadow-none focus:ring-0 flex items-center gap-1 text-sm hover:bg-gray-50 rounded px-2 py-1",children:[(0,r.jsx)(b.A,{className:"text-zinc-500 h-4 w-4"}),(0,r.jsx)("span",{className:"sr-only sm:not-sr-only text-zinc-500 font-medium",children:x[t.language]??"English"})]}),(0,r.jsxs)(g.gC,{children:[(0,r.jsx)(g.eb,{value:"ko",children:"한국어"}),(0,r.jsx)(g.eb,{value:"en",children:"English"}),(0,r.jsx)(g.eb,{value:"ja",children:"日本語"}),(0,r.jsx)(g.eb,{value:"es",children:"Espa\xf1ol"}),(0,r.jsx)(g.eb,{value:"zh-CN",children:"中文"}),(0,r.jsx)(g.eb,{value:"fr",children:"Fran\xe7ais"}),(0,r.jsx)(g.eb,{value:"de",children:"Deutsch"}),(0,r.jsx)(g.eb,{value:"pt-BR",children:"Portugu\xeas"}),(0,r.jsx)(g.eb,{value:"ru",children:"Русский"})]})]})};var w=a(946),y=a(52947),v=a(99233),j=a(36936),k=a(33350),N=a(14232),S=a(54587),C=a.n(S),$=a(75656),A=a(19074),D=a(24614),I=a(65314),E=a(59345),T=a(20807),z=a(48727),L=a(43562);let R=["bg-blue-500","bg-emerald-500","bg-amber-500","bg-violet-500","bg-rose-500","bg-cyan-500","bg-orange-500","bg-indigo-500"],F=({blog:e})=>{let t=e.logo;return t?.url?(0,r.jsx)(C(),{width:16,height:16,alt:"",src:t.url,className:"size-4 shrink-0 rounded-[5px] border-[0.5px] border-zinc-200 object-contain"}):(0,r.jsx)("span",{className:`size-4 shrink-0 rounded-[5px] ${(e=>{let t=0;for(let a=0;a<e.length;a++)t=31*t+e.charCodeAt(a)|0;return R[Math.abs(t)%R.length]})(e.subdomain)}`,"aria-hidden":"true"})},O=({subdomain:e,userId:t})=>{let{t:a}=(0,h.Bd)(["subdomain-common"]),s=(0,f.useRouter)(),[i,o]=(0,N.useState)(!1),[d,c]=(0,N.useState)(""),[u]=(0,I.u)("dashboardBlogs",null,{scope:t,version:2}),{data:m}=(0,$.Ay)(i&&t?["/api/dashboard/blogs",t]:null,async()=>{let e=await fetch("/api/dashboard/blogs");if(!e.ok)throw Error(`Failed to load dashboard blogs (${e.status})`);let t=await e.json();if(!Array.isArray(t.blogs))throw Error("Invalid dashboard blogs response");return t.blogs});(0,N.useEffect)(()=>{let e=e=>{var t;(e.metaKey||e.ctrlKey)&&"k"===e.key&&((t=e.target)instanceof HTMLElement&&("INPUT"===t.tagName||"TEXTAREA"===t.tagName||t.isContentEditable)||(e.preventDefault(),o(e=>!e)))};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[]);let p=m??u?.data,g=!p,{visibleBlogs:b,hiddenCount:x}=(0,N.useMemo)(()=>{if(!p)return{visibleBlogs:[],hiddenCount:0};let e=d.trim().toLowerCase(),a=p.filter(e=>t===E.Pl||(0,L.wD)(e.permission,(0,T.U)(e).isPaidBlog)).filter(t=>""===e||t.subdomain.toLowerCase().includes(e)||(t.title??"").toLowerCase().includes(e)).sort((e,t)=>new Date(t.updated_at??0).getTime()-new Date(e.updated_at??0).getTime());return{visibleBlogs:a.slice(0,15),hiddenCount:Math.max(0,a.length-15)}},[p,d,t]),_=()=>{o(!1),c("")};return(0,r.jsxs)(D.AM,{open:i,onOpenChange:e=>{o(e),e||c("")},children:[(0,r.jsx)(D.Wv,{asChild:!0,children:(0,r.jsxs)(n.$,{variant:"ghost",role:"combobox","aria-expanded":i,"aria-label":a("Switch blog"),className:"hidden sm:flex items-center gap-1 p-1 min-w-0 font-normal",children:[(0,r.jsx)("span",{className:"truncate text-sm md:text-base",children:e}),(0,r.jsx)(l.D3D,{className:"size-4 shrink-0 text-zinc-500"})]})}),(0,r.jsx)(D.hl,{align:"start",className:"w-80 p-0 z-[60] rounded-[10px]",children:(0,r.jsxs)(A.uB,{shouldFilter:!1,children:[(0,r.jsxs)("div",{className:"relative",children:[(0,r.jsx)(A.G7,{placeholder:a("Search blogs"),value:d,onValueChange:c}),(0,r.jsx)("kbd",{className:"pointer-events-none absolute right-3 top-1/2 -translate-y-1/2 roun
1ded border border-zinc-200 bg-zinc-50 px-1.5 py-0.5 text-[10px] font-medium text-zinc-400",children:"⌘K"})]}),(0,r.jsxs)(A.oI,{children:[g?(0,r.jsx)("div",{className:"flex justify-center py-6",role:"status",children:(0,r.jsx)("div",{className:"size-4 animate-spin rounded-full border-2 border-zinc-200 border-t-zinc-600","aria-hidden":"true"})}):0===b.length?(0,r.jsx)("p",{className:"py-6 text-center text-sm text-zinc-500",children:a("No blogs found")}):(0,r.jsx)(A.L$,{heading:""===d.trim()?a("Recently updated"):void 0,className:"[&_[cmdk-group-heading]]:text-[11px] [&_[cmdk-group-heading]]:font-semibold [&_[cmdk-group-heading]]:text-zinc-600",children:b.map(t=>(0,r.jsxs)(A.h_,{value:`${t.subdomain}-${t.id}`,onSelect:()=>{_(),t.subdomain!==e&&s.push((0,z.C)(t))},className:"gap-2",children:[(0,r.jsx)(F,{blog:t}),(0,r.jsx)("span",{className:"shrink-0 max-w-[45%] truncate text-sm",children:t.subdomain}),t.title&&(0,r.jsx)("span",{className:"min-w-0 truncate text-xs text-zinc-500",children:t.title}),t.subdomain===e&&(0,r.jsx)(l.Srz,{className:"ml-auto size-4 shrink-0"})]},t.id))}),(0,r.jsx)(A.fx,{}),(0,r.jsx)(A.L$,{children:(0,r.jsxs)(A.h_,{value:"view-all-blogs",onSelect:()=>{_(),s.push("/dashboard")},className:"justify-between text-sm",children:[(0,r.jsx)("span",{className:"text-zinc-400",children:x>0?a("{{remaining}} more blogs",{remaining:x}):""}),(0,r.jsxs)("span",{className:"text-zinc-600",children:[a("View all blogs")," →"]})]})})]})]})})]})},P=e=>null===e||"string"==typeof e,B=async e=>{try{let t=await fetch(`/api/rest/blogs?subdomain=${encodeURIComponent(e)}`);
1if(!t.ok)return;let a=await t.json();if(!(a&&"object"==typeof a&&"string"==typeof a.subdomain&&a.subdomain.length>0&&P(a.custom_domain)&&P(a.custom_domain_type)&&(null===a.custom_domain_verified||"boolean"==typeof a.custom_domain_verified)&&P(a.custom_subdirectory)&&P(a.custom_trial_ends_at)&&P(a.subscription_created_at)&&P(a.plan))||a.subdomain!==e)return;let r=`${(0,m.p)({blog:a})}?traffic_type=internal`;window.open(r,"_blank","noopener,noreferrer")}catch(e){console.error("Failed to open blog",e)}},M=({subdomain:e})=>{let t=(0,j.v)(),{profile:a}=(0,p.x)({supabase:t}),{isMobileOpen:s,toggleMobileNavigation:m}=(0,k.O)(),g=async()=>{e&&await B(e)},{t:f}=(0,h.Bd)(["subdomain-common"]);return(0,r.jsx)(r.Fragment,{children:(0,r.jsx)("nav",{className:"sticky top-0 left-0 right-0 z-50 bg-white border-b-[0.5px] h-12",children:(0,r.jsxs)("div",{className:"max-w-screen-5xl flex justify-between items-center gap-2 mx-auto px-3 md:px-6 h-full bg-white",children:[(0,r.jsxs)("div",{className:"flex flex-1 flex-row items-center min-w-0",children:[e&&(0,r.jsx)(n.$,{id:"dashboard-mobile-navigation-trigger",type:"button",variant:"ghost",size:"icon",className:"mr-1 size-11 shrink-0 sm:hidden","aria-label":f(s?"Close navigation":"Open navigation"),"aria-controls":"dashboard-side-navigation","aria-expanded":s,onClick:m,children:s?(0,r.jsx)(w.A,{className:"size-5 text-zinc-600"}):(0,r.jsx)(y.A,{className:"size-5 text-zinc-600"})}),(0,r.jsx)(i(),{href:"/dashboard",className:"pr-2 flex-shrink-0",children:(0,r.jsx)(d.wE,{})}),e?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(l.Fb4,{className:"w-4 h-auto text-[#cecece] flex-shrink-0 mr-1"}),(0,r.jsxs)(n.$,{onClick:g,variant:"ghost",className:"min-w-0 text-sm md:text-base sm:hidden text-left p-1",children:[(0,r.jsx)("span",{className:"truncate",children:e}),(0,r.jsx)(v.A,{strokeWidth:2.5,className:"text-zinc-600 size-3 shrink-0 mb-2","aria-hidden":"true"})]}),(0,r.jsx)(O,{subdomain:e,userId:a?.id}),(0,r.jsx)(o.Bc,{children:(0,r.jsxs)(o.m_,{delayDuration:0,children:[(0,r.jsx)(o.k$,{asChild:!0,children:(0,r.jsx)(n.$,{variant:"outline",className:"ml-3 items-center text-xs text-zinc-600 rounded-full h-7 px-3 hidden sm:flex",onClick:g,children:(0,r.jsx)("p",{children:f("View blog")})})}),(0,r.jsx)(o.ZI,{className:"z-[9999] max-w-[200px]",children:(0,r.jsx)("p",{children:f("Considered internal and not counted in traffic.")})})]})})]}):(0,r.jsx)(r.Fragment,{})]}),(0,r.jsxs)("div",{className:"flex shrink-0 items-center gap-1 sm:gap-3",children:[(0,r.jsx)(_,{}),(0,r.jsx)(i(),{href:"/dashboard/my",className:"flex flex-row justify-between items-center rounded-full",children:(0,r.jsx)(c.e,{src:a?.custom_avatar_url??a?.avatar_url??void 0,name:(0,u.L)(a),width:32})})]})]})})})}},9261:(e,t,a)=>{"use strict";a.d(t,{b:()=>i,u:()=>s});var r=a(38883);let s={social_login_clicked:"social_login_clicked",email_signup_clicked:"email_signup_clicked",signup_completed:"signup_completed",blog_new_button_clicked:"blog_new_button_clicked",blog_type_selected:"blog_type_selected",blog_created:"blog_created",tutorial_started:"tutorial_started",tutorial_continue_clicked:"tutorial_continue_clicked",checkout_initiated:"checkout_initiated",checkout_completed:"checkout_completed",checkout_closed:"checkout_closed",subscription_created:"subscription_created",service_intro_pdf_downloaded:"service_intro_pdf_downloaded",webinar_pdf_downloaded:"webinar_pdf_downloaded"};function i({goal:e,params:t}){try{let a={};if(t)for(let[e,r]of Object.entries(t).slice(0,10)){if(!e)continue;let t=e.toLowerCase().replace(/[^a-z0-9_-]/g,"").slice(0,32);if(!t)continue;let s=String(r).slice(0,255);a[t]=s}(0,r.eE)(e,Object.keys(a).length?a:void 0),window?.datafast?.(e,Object.keys(a).length?a:void 0)}catch(e){}}},20960:(e,t,a)=>{"use strict";a.d(t,{R:()=>s});var r=a(14232);let s=e=>{let t=(0,r.useRef)(!1);(0,r.useEffect)(()=>{{let a=JSON.parse(sessionStorage.getItem("inblog.scroll")??"{}"),r=async()=>{0===window.scrollY||e&&(await new Promise(e=>setTimeout(e,1e4)),sessionStorage.setItem("inblog.scroll",JSON.stringify({...a,[e]:window.scrollY<100?0:window.scrollY})))};if(!t.current){if(!e)return;window.scrollTo(0,a[e]??0),t.current=!0}return window.addEventListener("scroll",r),()=>{window.removeEventListener("scroll",r),window.scrollTo(0,0)}}},[])}},28268:(e,t,a)=>{"use strict";a.d(t,{PT:()=>i,dX:()=>n,qY:()=>o});var r=a(82355),s=a(79041);let i=18e5,n=e=>{try{let t=JSON.parse(sessionStorage.getItem(e)??"null");if("boolean"==typeof t?.show&&"number"==typeof t.checkedAt&&t.checkedAt<=Date.now()&&Date.now()-t.checkedAt<i)return t}catch{}},o=(e,t)=>{let a={show:(0,s.Ox)(t),checkedAt:Date.now()};try{sessionStorage.setItem(e,JSON.stringify(a))}catch{}(0,r.j)(e,a,!1)}},38732:(e,t,a)=>{"use strict";a.d(t,{GC:()=>s,Ws:()=>n,_8:()=>r,aj:()=>l,vu:()=>o,wj:()=>i});let r="x-inblog-password-recovery",s=e=>{if("string"!=typeof e||!e.startsWith("/"))return"/dashboard";try{let t="https://inblog.internal",a=new URL(e,t);if(a.origin!==t)return"/dashboard";return`${a.pathname}${a.search}${a.hash}`}catch{return"/dashboard"}},i=e=>{if(e)try{let t=new URL(e);return t.searchParams.set("type","recovery"),t.toString()}catch{return e}},n=e=>`/auth?type=recovery&next=${encodeURIComponent(s(e))}`,o=e=>`/auth?type=forgotten_password&next=${encodeURIComponent(s(e))}`,l=(e,t)=>
1{let a=new URLSearchParams(e.replace(/^#/,""));if("recovery"===a.get("type"))return`/auth-recovery?error=invalid&next=${encodeURIComponent(s(t))}`;return"otp_expired"!==a.get("error_code")?null:`/auth-callback?auth_error=expired&next=${encodeURIComponent(s(t))}`}},39370:(e,t,a)=>{"use strict";a.d(t,{$:()=>n,_:()=>o});let r=new Set(["config_unavailable","domain_status_unavailable","config_api_error","domain_api_error","response_too_large","max_attempts_exceeded","transient_verification_failure"]),s=new Set(["dns_misconfigured","domain_not_verified","verification_error"]),i=new Set(["timeout","fetch_error"]),n={inconclusive:"We couldn't finish the connection check on our side. Your settings are likely fine — we check again automatically.",httpsPending:"Your DNS records are confirmed. The HTTPS certificate is issued automatically and usually takes a few minutes. You don't need to do anything. If this status lasts more than 24 hours, contact us.",dns:"Your DNS records don't match what inblog expects. Open domain settings to compare them.",ownership:"Domain ownership still needs to be confirmed with the TXT record shown in domain settings.",takenByAnotherBlog:"This domain is already connected to another blog. Contact support to move it.",metaMismatch:"{{target}} is serving another blog ({{found}}) instead of this one. Check which blog your reverse proxy points to.",metaMissing:"{{target}} responded, but the page it returned isn't served by this blog. Check your reverse proxy rules.",httpError:"{{target}} returned HTTP {{statusCode}}. This warning clears automatically once it responds normally again.",unreachable:"We couldn't reach {{target}}. This warning clears automatically once it responds normally again.",forbidden:"{{target}} answered our check with HTTP 403. A firewall or bot protection may be filtering it.",fallback:"We couldn't confirm the latest connection check. Your settings may still be fine — we check again automatically."};function o({reason:e,target:t,foundSubdomain:a,statusCode:l}){return e&&r.has(e)?{key:n.inconclusive}:"https_not_ready"===e?{key:n.httpsPending}:e&&s.has(e)?{key:n.dns}:"blog_ownership_challenge_required"===e?{key:n.ownership}:"domain_already_verified"===e?{key:n.takenByAnotherBlog}:t?"meta_mismatch"===e&&a?{key:n.metaMismatch,params:{target:t,found:a}}:"meta_mismatch"===e||"meta_missing"===e?{key:n.metaMissing,params:{target:t}}:"http_error"===e&&"number"==typeof l?{key:n.httpError,params:{target:t,statusCode:l}}:"forbidden_needs_client_fallback"===e?{key:n.forbidden,params:{target:t}}:"http_error"===e||e&&i.has(e)?{key:n.unreachable,params:{target:t}}:{key:n.fallback}:{key:n.fallback}}},48245:(e,t,a)=>{"use strict";a.r(t),a.d(t,{__N_SSP:()=>E,default:()=>T});var r=a(37876),s=a(97991),i=a(14232),n=a(95429),o=a(14e3),l=a(75656),d=a(81256),c=a(36936),u=a(20960),m=a(51496),h=a(77328),p=a.n(h),g=a(89099),f=a(61285),b=a(703);let x=({children:e})=>{let t=(0,g.useRouter)().query.subdomain;return(0,r.jsxs)(f.Ay,{children:[(0,r.jsx)(p(),{children:(0,r.jsx)("meta",{name:"robots",content:"noindex, nofollow"})}),(0,r.jsx)(b.Ay,{subdomain:t}),(0,r.jsx)("main",{className:"min-h-[calc(100vh-48px)] bg-white",children:e})]})};var _=a(76559),w=a(35160),y=a(25218),v=a(92898),j=a(72718),k=a(48155),N=a(5259),S=a(4172),C=a(57131),$=a(55421),A=a(77803);let D=({blog:e,userId:t,canViewDashboard:a=!0})=>{let s=(0,g.useRouter)(),h=(0,o.usePathname)();(0,u.R)(h);let{t:p}=(0,n.Bd)(["subdomain","subdomain-common"]),f=e.subdomain,b=(0,c.v)(),D=(e.timezone_diff??0)*36e5,I=new Date,E=new Date(new Date(I.getTime()+6e4*I.getTimezoneOffset()).getTime()+D),T=new Date(E.getFullYear(),E.getMonth()-6,E.getDate());
1T.setHours(0,0,0,0);let[z,L]=(0,i.useState)({from:T,to:E}),R=e.id,F=z.from?.toISOString().slice(0,10),O=z.to?.toISOString().slice(0,10),P=!a,{data:B,isLoading:M}=(0,d.A)(`postMetrics${F}-${O}-${R}`,async()=>{if(P)return[];let{error:e,data:t}=await b.rpc("get_post_metric_list_agg",{p_blog_id:R,p_start_date:z.from.toLocaleString("en-US",{year:"numeric",month:"2-digit",day:"2-digit"}),p_end_date:z.to.toLocaleString("en-US",{year:"numeric",month:"2-digit",day:"2-digit"})});return e?(console.error(e),[]):t.map(e=>({post_id:e.post_id,visits:e.visits,clicks:e.clicks,organic:e.organic,cvr:0===e.visits?0:e.clicks/e.visits*100}))}),{data:q,isLoading:U,isValidating:Y}=(0,l.Ay)(`author-${t}-${R}`,async()=>{let{data:e,error:a}=await b.from("guest_profiles_posts").select(`post_id (
2            id,
3            slug,
4            title,
5            description,
6            published,
7            published_at,
8            pin_priority,
9            content_type,
10            cta_link,
11            cta_text,
12            created_at,
13            profiles_posts (*, profile: profiles (*)),
14            image,
15            posts_tags (*, tag: tags (*))
16          )`).match({profile_id:t,blog_id:R});return e?.map(e=>e.post_id)??[]},{keepPreviousData:!0}),J=(0,m.m)(e.profiles_blogs),[H,V]=(0,i.useState)("none"),[W,G]=(0,i.useState)(""),[X,Q]=(0,i.useState)(y.C),Z=(0,i.useMemo)(()=>{if(!q||!B)return[];let e=q;return X.authors.length>0&&(e=e.filter(e=>X.authors.some(t=>"others"===t?e.profiles_posts?.length===0:e.profiles_posts?.some(e=>e.profile_id===t)))),""!==W.trim()&&void 0!==W&&(e=e.filter(e=>e.title?.toLowerCase().includes(W.trim().toLowerCase()))),X.statuses.length>0&&(e=e.filter(e=>X.statuses.includes((e=>{if(!e.published)return"draft";let t=e.published_at?new Date(e.published_at):null;return t&&t>new Date?"scheduled":"published"})(e)))),X.categories.length>0&&(e=e.filter(e=>Array.isArray(e.posts_tags)&&e.posts_tags.some(e=>X.categories.includes(String(e.tag?.id))))),e.sort({visits:(e,t)=>(B.find(e=>e.post_id===t.id)?.visits??0)-(B.find(t=>t.post_id===e.id)?.visits??0),clicks:(e,t)=>(B.find(e=>e.post_id===t.id)?.clicks??0)-(B.find(t=>t.post_id===e.id)?.clicks??0),cvr:(e,t)=>(B.find(e=>e.post_id===t.id)?.cvr??0)-(B.find(t=>t.post_id===e.id)?.cvr??0),organic:(e,t)=>(B.find(e=>e.post_id===t.id)?.organic??0)-(B.find(t=>t.post_id===e.id)?.organic??0),none:(e,t)=>{let a=e.pin_priority||0,r=t.pin_priority||0;if(r!==a)return r-a;let s=e.published_at?new Date(e.published_at).getTime():0;return(t.published_at?new Date(t.published_at).getTime():0)-s},latest:(e,t)=>{let a=e.published_at?new Date(e.published_at).getTime():0;return(t.published_at?new Date(t.published_at).getTime():0)-a},oldest:(e,t)=>(e.published_at?new Date(e.published_at).getTime():0)-(t.published_at?new Date(t.published_at).getTime():0)}[H])},[B,H,X,q,W]),[K,ee]=(0,i.useState)(!1),et=e?.preset_colors?.find(e=>e.is_primary)?.id,ea=async()=>{if(!e||!e.id||K)return;ee(!0);let{status:t,postId:a}=await (0,A.Z)({blogId:e.id,formId:e.forms?.[0]?.id,primaryPresetColorId:et,supabase:b,isCreating:K,setIsCreating:ee});"created"===t&&await s.push(`/dashboard/author/${f}/${a}`)};return(0,r.jsxs)(x,{children:[(0,r.jsx)($.A,{title:`Dashboard | ${f} | inblog`,description:"inblog Dashboard"}),(0,r.jsx)("div",{className:"flex flex-grow h-full min-h-[calc(100vh-48px)] bg-white",children:(0,r.jsxs)("div",{className:"relative flex flex-col w-full max-w-[1440px] mx-auto",children:[P?null:(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{className:"w-full px-12 lg:px-20 mt-14",children:(0,r.jsx)(_.A,{blog:e,blogCreatedAt:e?.created_at??void 0,dateRangeValue:z,setDateRangeValue:L})}),(0,r.jsx)("div",{className:"h-10"})]}),U||M?(0,r.jsx)("div",{className:"w-full px-12 lg:px-20 mt-4",children:(0,r.jsx)("div",{className:"flex flex-col space-y-4 mt-2",children:(0,r.jsx)(j.E,{className:"h-40 w-full bg-gray-100 rounded-md"})})}):Z.length>0?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{className:"w-full px-12 lg:px-20",children:(0,r.jsx)(w.A,{isValidating:Y,postCount:Z?.length??0,blog:e,isLoadingPostMetrics:M,editorProfiles:J,postMetrics:B,filter:X,onFilterChange:Q,searchQuery:W,setSearchQuery:G,sortByOption:H,setSortByOption:V,disableAnalytics:P})}),(0,r.jsx)("div",{className:"w-full px-12 lg:px-20",children:Z.map(t=>(0,r.jsx)(v.t,{post:t,blog:e,subdomain:f,dateRangeValue:z,hideAnalytics:P},t.id))})]}):(0,r.jsx)(r.Fragment,{children:P&&(0,r.jsxs)("div",{className:"flex flex-col justify-center items-center gap-4 h-[calc(100vh-300px)] w-full mt-4",children:[(0,r.jsx)("p",{className:"text-zinc-700 font-medium text-lg",children:p("Start creating content.")}),(0,r.jsx)(k.$,{variant:"outline",disableLoadingAnimation:!0,className:"w-[200px] h-10 bg-[#FDF4EA] border-[#ffb3a2] text-[#EC5533] hover:bg-[#fff2e2]",onClick:ea,disabled:K,children:(0,r.jsxs)("div",{className:"flex w-full items-center justify-between",children:[(0,r.jsxs)("div",{className:"flex items-center",children:[(0,r.jsx)(N.WhT,{className:"mr-2.5 h-4 w-4"}),(0,r.jsx)("span",{className:"font-medium",children:p("New post")})]}),K?(0,r.jsx)("div",{className:"animate-spin inline-block w-4 h-4 border-[2px] border-current border-t-gray-500 text-white rounded-full",role:"status","aria-label":p("Loading..."),children:(0,r.jsx)("span",{className:"sr-only",children:p("Loading...")})}):(0,r.jsx)(N.c11,{className:"h-4 w-4"})]})})]})}),(0,r.jsx)("div",{className:"h-10"})]})}),(0,r.jsx)("div",{className:"fixed bottom-24 right-6 z-10",children:(0,r.jsx)(S.Bc,{children:(0,r.jsxs)(S.m_,{delayDuration:0,
16children:[(0,r.jsx)(S.k$,{asChild:!0,children:(0,r.jsx)("button",{onClick:ea,disabled:K,className:"flex items-center justify-center bg-[#EC5533] hover:bg-[#d94a2b] text-white rounded-full size-[60px] shadow-lg transition-all duration-200 hover:shadow-xl","aria-label":p("Create new post"),children:K?(0,r.jsx)("div",{className:"animate-spin inline-block w-6 h-6 border-[3px] border-current border-t-white rounded-full",role:"status","aria-label":p("Loading..."),children:(0,r.jsx)("span",{className:"sr-only",children:p("Loading...")})}):(0,r.jsx)(C.A,{className:"h-8 w-8"})})}),(0,r.jsx)(S.ZI,{side:"left",align:"center",children:(0,r.jsx)("p",{children:p("New post",{ns:"subdomain-common"})})})]})})})]})};var I=a(8763),E=!0;let T=({subdomain:e,userId:t})=>(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(s.Q,{subdomain:e,accessLevel:"author",renderPageComponent:(e,a,s)=>(0,r.jsx)(D,{blog:e,userId:t,canViewDashboard:s})}),(0,r.jsx)(I.A,{})]})},48727:(e,t,a)=>{"use strict";a.d(t,{C:()=>s});var r=a(20807);let s=e=>"author"===e.permission?`/dashboard/author/${e.subdomain}`:(0,r.U)(e).isPaidBlog&&"READY"!==e.tutorial_stage&&null===e.tutorial_skipped_at?`/dashboard/${e.subdomain}/tutorial`:`/dashboard/${e.subdomain}`},61285:(e,t,a)=>{"use strict";a.d(t,{Ay:()=>k});var r=a(37876),s=a(89099),i=a(14232),n=a(31791),o=a(59345),l=a(8763),d=a(16017),c=a(5068);async function u(e){try{return(await c.A.post("/api/mailchimp/subscribe",{email:e.email,lang:e.onboarding_form?.lang?.split("-")[0]})).data}catch(e){throw console.error("Mailchimp 구독 오류:",e),e}}var m=a(93546);let h=null,p=async(e,t,a)=>{let{data:r,error:s}=await e.from("profiles").update(a).eq("id",t).select().single().overrideTypes();return{profile:r,error:s}},g=async(e,t,a)=>{let r=await fetch("/api/geo"),s=await r.json();if(!s.success)return null;let{profile:i,error:n}=await p(e,t,{onboarding_form:{...a,ip:s.success&&s.ip||null,country:s.success&&s.country||null,timezone:s.success&&s.timezone||null,lang:navigator.language}});return n?(console.error(n),null):i};var f=a(59688),b=a(36936),x=a(38732),_=a(9261),w=a(38883);let y=["/auth","/auth-callback"],v="/dashboard/mfa",j=async({runOnboarding:e,redirect:t})=>{e().catch(e=>{console.error("Post-sign-in onboarding failed:",e)}),await t()},k=({children:e})=>{let t=(0,s.useRouter)(),a=(0,b.v)(),c=(0,i.useCallback)((e,t)=>{n.YH.configure(o.c9,{autoload:!1}),n.YH.setTokenId(t),n.YH.user.setEmail(e.email||"");let a=(0,d.L)(e);a&&n.YH.user.setNickname(a);let r=e.custom_avatar_url||e.avatar_url;r&&n.YH.user.setAvatar(r)},[]),p=(0,i.useCallback)(async e=>{let{profile:t,error:r}=await function(e,t,a=Date.now){let r=a();if(h&&h.userId===e&&r-h.at<5e3)return h.promise;let s=t(),i={userId:e,at:r,promise:s};h=i;let n=()=>{h===i&&(h=null)};return s.then(e=>{(e.error||!e.profile)&&n()},n),s}(e,()=>(0,m.a)(a,e));if(r)return console.error("Failed to load signed-in profile:",r),{status:"unavailable",profile:null};if(!t){f.oR.error("Failed to sign in. Please try again."),(0,w.p3)();try{await a.auth.signOut({scope:"local"})}catch(e){console.warn("SignOut failed:",e)}return{status:"missing",profile:null}}return{status:"found",profile:t}},[a]),k=(0,i.useCallback)(e=>{let t=new Date(e);return Date.now()-t.getTime()<1e4},[]),N=(0,i.useCallback)(async(e,t,r)=>{let s=t?.user.id;if(!s)return;let i=`onboarding-form-processed-${s}`,n=sessionStorage.getItem(i),o=e.onboarding_form;if(o?.ip||n)return;let l=await g(a,e.id,o);if(!(!l||l.email?.includes("@fcyeicaipay.com"))){if(await u(l),r)try{(0,_.b)({goal:_.u.signup_completed,params:{user_id:s,provider:String(t?.user.app_metadata.provider||""),email:e.email||""}})}catch{}sessionStorage.setItem(i,"true")}},[a]),S=(0,i.useCallback)(async()=>{try{let{data:e,error:r}=await a.auth.mfa.getAuthenticatorAssuranceLevel();if(r)return console.error("AAL check failed:",r),!1;if("aal2"!==e.currentLevel&&"aal2"===e.nextLevel){let e=(0,x.GC)(t.query.next),a=`${v}?next=${encodeURIComponent(e)}`;return window.location.href=a,!0}return!1}catch(e){return console.error("AAL check error:",e),!1}},[t,a.auth]),C=(0,i.useCallback)(async()=>
16{if(!y.includes(t.pathname))return;let e=null;for(let t=0;t<3;t++){let{data:r}=await a.auth.getSession();if(e=r.session)break;t<2&&await new Promise(e=>setTimeout(e,200))}if(!e)return void console.warn("Session not found after retries");if(await S())return;if("recovery"===t.query.type){let e=(0,x.Ws)(t.query.next);window.location.href=e;return}let r=(0,x.GC)(t.query.next);window.location.href=r},[t,a.auth,S]),$=(0,i.useCallback)(async e=>{var r;let s=(r=t.pathname,"/auth"!==r&&e?r===v?"skip":"continue":"reset");if("reset"===s)return void(0,w.p3)();if("skip"===s)return;let i=e;for(let e=0;e<10;e++){let{data:t}=await a.auth.getSession();if(t.session?.access_token){i=t.session;break}e<9&&await new Promise(e=>setTimeout(e,200))}if(!i?.access_token)return void console.warn("Initial session not available after retries");if(await S())return;let n=await p(i.user.id);"found"===n.status&&((0,w.gm)({id:i.user.id,email:n.profile.email}),c(n.profile,i.user.id))},[t.pathname,a.auth,p,c,S]),A=(0,i.useCallback)(async e=>{let t=e?.user.id;if(!t)return;let r=e;for(let e=0;e<10;e++){let{data:t}=await a.auth.getSession();if(t.session?.access_token){r=t.session;break}e<9&&await new Promise(e=>setTimeout(e,200))}if(!r?.access_token){console.error("Session not available after retries"),f.oR.error("Authentication failed. Please try again.");return}let s=await p(t);if("missing"===s.status)return;if("unavailable"===s.status)return void await C();(0,w.gm)({id:t,email:s.profile.email});let i=k(s.profile.created_at||"");await j({runOnboarding:()=>N(s.profile,r,i),redirect:C})},[a.auth,p,k,N,C,t]),D=(0,i.useCallback)(()=>{"recovery"===t.query.type&&t.replace((0,x.GC)(t.query.next))},[t]);return(0,i.useEffect)(()=>{let{data:e}=a.auth.onAuthStateChange((e,t)=>{setTimeout(async()=>{switch(e){case"INITIAL_SESSION":await $(t);break;case"SIGNED_IN":await A(t);break;case"SIGNED_OUT":(0,w.p3)();break;case"USER_UPDATED":D()}},0)});return()=>{e?.subscription?.unsubscribe()}},[$,A,D,a.auth]),(0,r.jsxs)(r.Fragment,{children:[e,(0,r.jsx)(l.A,{})]})}},65314:(e,t,a)=>{"use strict";a.d(t,{u:()=>s});var r=a(14232);function s(e,t,a){let{namespace:s="inblog",scope:i,version:n=1,serializer:o=JSON.stringify,deserializer:l=JSON.parse}=a||{},d=`${s}:${e}${i?`:${i}`:""}:v${n}`,c=void 0!==window.localStorage,[u,m]=(0,r.useState)(t),h=(0,r.useRef)(!1);return(0,r.useEffect)(()=>{if(c)try{let e=localStorage.getItem(d);if(null!=e){let t=l(e);m(t)}else m(t)}catch{m(t)}finally{h.current=!0}},[d]),(0,r.useEffect)(()=>{if(c&&h.current)try{localStorage.setItem(d,o(u))}catch{}},[d,u,c,o]),[u,m]}},66273:(e,t,a)=>{"use strict";function r({subdomain:e,custom_domain_type:t,custom_domain:a,custom_subdirectory:s}){let i=`${e}.inblog.io`;return"Subdirectory"===t&&s===i||"Subdomain"===t&&a===i}a.d(t,{v:()=>r})},75609:(e,t,a)=>{"use strict";a.d(t,{C5:()=>x,MJ:()=>f,Rr:()=>b,eI:()=>p,lR:()=>g,lV:()=>d,zB:()=>u});var r=a(37876),s=a(14232),i=a(82987),n=a(88992),o=a(82705),l=a(74947);let d=n.Op,c=s.createContext({}),u=({...e})=>(0,r.jsx)(c.Provider,{value:{name:e.name},children:(0,r.jsx)(n.xI,{...e})}),m=()=>{let e=s.useContext(c),t=s.useContext(h),{getFieldState:a,formState:r}=(0,n.xW)(),i=a(e.name,r);if(!e)throw Error("useFormField should be used within <FormField>");let{id:o}=t;return{id:o,name:e.name,formItemId:`${o}-form-item`,formDescriptionId:`${o}-form-item-description`,formMessageId:`${o}-form-item-message`,...i}},h=s.createContext({}),p=s.forwardRef(({className:e,...t},a)=>{let i=s.useId();return(0,r.jsx)(h.Provider,{value:{id:i},children:(0,r.jsx)("div",{ref:a,className:(0,o.cn)("space-y-2",e),...t})})});p.displayName="FormItem";let g=s.forwardRef(({className:e,disableDestructive:t=!0,...a},s)=>{let{error:i,formItemId:n}=m();return(0,r.jsx)(l.J,{ref:s,className:(0,o.cn)(i&&!t&&"text-destructive",e),htmlFor:n,...a})});g.displayName="FormLabel";let f=s.forwardRef(({...e},t)=>{let{error:a,formItemId:s,formDescriptionId:n,formMessageId:o}=m();return(0,r.jsx)(i.DX,{ref:t,id:s,"aria-describedby":a?`${n} ${o}`:`${n}`,"aria-invalid":!!a,...e})});f.displayName="FormControl";let b=s.forwardRef(({className:e,...t},a)=>{let{formDescriptionId:s}=m();return(0,r.jsx)("p",{ref:a,id:s,className:(0,o.cn)("text-[0.8rem] text-muted-foreground",e),...t})});b.displayName="FormDescription";let x=s.forwardRef(({className:e,children:t,...a},s)=>{let{error:i,formMessageId:n}=m(),l=i?String(i?.message):t;return l?(0,r.jsx)("p",{ref:s,id:n,className:(0,o.cn)("text-[0.8rem] font-medium text-destructive",e),...a,children:l}):null});x.displayName="FormMessage"},77803:(e,t,a)=>{"use strict";a.d(t,{Z:()=>l});var r=a(66870),s=a(47419);let i=["title","content_html","description","meta_title","meta_description","canonical_url","cta_text","cta_link","cta_text_color","notion_url","notion_recordmap","image","custom_og","external_forms","published_at","published_version","pin_priority"],n={published:!1,noindex:!1,cta_color:"#000000",cta_text_color_type:"default",doc_version:0},o=async({blogId:e,supabase:t})=>{let{data:{session:a}}=await t.auth.getSession();if(!a?.user)return null;let r=t.from("posts").select("id, profiles_posts!inner(profile_id)").eq("blog_id",e).eq("profiles_posts.profile_id",a.user.id);for(let e of i)r=r.is(e,null);for(let[e,t]of Object.entries(n))r=r.eq(e,t);let{data:s,error:o}=await r.order("created_at",{ascending:!1}).limit(1).maybeSingle();return o?(console.error("Failed to look up a reusable blank draft:",o),null):s?s.id:null},l=async({blogId:e,formId:t,primaryPresetColorId:a,supabase:i,isCreating:n,setIsCreating:l})=>
16{if(n)return{status:"creating"};l(!0);let d=await o({blogId:e,supabase:i});if(d){let{error:s}=await i.from("posts").update({form_id:t??null,cta_preset_color_id:a??null,cta_color_type:a?"preset":"custom"}).eq("id",d);return s&&console.error("Failed to refresh the reused blank draft:",s),await i.from("blogs").update({updated_at:new Date().toISOString()}).eq("id",e),await (0,r.k)(d),l(!1),{status:"created",postId:d}}let c=`temp-${Date.now()}-${Math.random().toString(36).substring(2,8)}`,{data:u,error:m}=await i.rpc("create_blog_post_draft",{p_blog_id:e,p_slug:c,p_form_id:t,p_cta_preset_color_id:a});if(m||!u||"object"!=typeof u)return l(!1),{status:"duplicated_slug"};let h=!1,p=0;for(;!h&&p<5;){p++;let e=(0,s.J)({id:u.id.toString(),title:u.title??void 0}),t=p>1?`${e}-${Math.random().toString(36).substring(2,8)}`:e,{error:a}=await i.from("posts").update({slug:t}).eq("id",u.id);a?p>=5&&(console.error("Failed to update slug after max attempts:",a),h=!0):h=!0}return await (0,r.k)(u.id),l(!1),{status:"created",postId:u.id}}},78769:(e,t,a)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/dashboard/author/[subdomain]",function(){return a(48245)}])},79041:(e,t,a)=>{"use strict";a.d(t,{Ox:()=>i,QJ:()=>s,eF:()=>n,vQ:()=>o});var r=a(59345);let s=(e,t,a)=>!!e&&t&&(e===r.Pl||"owner"===a||"admin"===a),i=e=>!0===e.custom_domain_verified&&"verified"===e.verification_status&&!0!==e.health_warning&&!1===e.via_inblog_proxy,n=(e,t)=>`proxy-notice:${JSON.stringify([e,t])}`,o=(e,t)=>`inblog:proxy-notice-dismissed:v1:${e}:${t}`},83767:(e,t,a)=>{"use strict";a.d(t,{R:()=>n});var r=a(14232),s=a(75656);async function i(e){let t=await fetch(e);if(!t.ok)throw Error("Failed to load Search Console setup");return await t.json()}function n(e,t=!0){let a=t?`/api/googleSearch/setup?blogId=${e}`:null,{data:o,error:l,isLoading:d,mutate:c}=(0,s.Ay)(a,i,{revalidateOnFocus:!1}),u=(0,r.useCallback)(async({action:t,propertyUrl:r})=>{if(!a)throw Error("Search Console setup is unavailable");let s=await fetch("/api/googleSearch/setup",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({blogId:e,action:t,propertyUrl:r})}),i=await s.json();if(i.setup&&await c(i,{revalidate:!1}),!s.ok){let e=Error(i.error??i.message??"Setup failed");throw e.code=i.error,e}return i.setup},[e,a,c]);return{setup:o?.setup??null,error:l,isLoading:d,mutate:c,run:u}}}},e=>{e.O(0,[25587,86212,49886,49509,12697,72517,20722,54587,64455,75372,94615,5068,61354,69619,51802,83229,13810,93487,89572,23266,59848,30435,28288,94345,60404,90664,18133,44742,91718,94515,27388,29537,29548,81905,3349,25482,42645,27602,90636,46593,38792],()=>e(e.s=78769)),_N_E=e.O()}]);
17//# chunkId=01a0f74f-5924-7e12-8e6a-9e8bb802d053

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.