1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[867],{18197:function(e,t,s){(window.__NEXT_P=window.__NEXT_P||[]).push(["/admin/analytics",function(){return s(60054)}])},26527:function(e,t,s){"use strict";s.d(t,{R:function(){return r}});var n=s(85893),a=s(83454);let r=[(0,n.jsxs)("span",{children:["Ship smarter with"," ",(0,n.jsx)("span",{"data-for":"analytics","data-tip":"analytics",className:"text-base-content font-medium underline decoration-accent decoration-dashed underline-offset-2 hover:decoration-solid duration-200 cursor-help",children:"analytics"})]},98345),"Collect emails",(0,n.jsxs)("span",{children:["Build trust with"," ",(0,n.jsx)("span",{"data-for":"stripe","data-tip":"stripe",className:"text-base-content font-medium underline decoration-accent decoration-dashed underline-offset-2 hover:decoration-solid duration-200 cursor-help",children:"Stripe revenue"})," "]},23894452),"Custom domain",(0,n.jsxs)("span",{children:["Compete for the"," ",(0,n.jsx)("span",{"data-for":"discover-intro-2","data-tip":"discover-intro-2",className:"text-base-content font-medium underline decoration-accent decoration-dashed underline-offset-2 hover:
1decoration-solid duration-200 cursor-help",children:"Leaderboards"})]},12340),"Search engines follow your links","28 themes and 9 fonts"],l={domainName:"indiepa.ge",supportEmail:"[email protected]",aws:{publicKey:a.env.AWS_PUBLIC_KEY,privateKey:a.env.AWS_PRIVATE_KEY,bucket:"indie-page",cdn:"https://d3m8mk7e1mf7xn.cloudfront.net"},stripe:{productPriceId:"price_1NkRmbBTEyL1hm1OKnJ2yswU",couponId:"ctA7XI8d",connectCliendId:"ca_PJR2ViednNF9JDsj9nkFqzTikgrkAhYf",coupon:{id:"ctA7XI8d",discount:"$30"},plans:[{priceId:"price_1OUoWuABD5JesnlmjXEG5dh4",name:"1-Year Pass",price:25,priceBefore:55},{priceId:"price_1OUoX4ABD5Jesnlm3Mpr27Al",name:"Lifetime Deal",price:45,priceBefore:75,isFeatured:!0}]},noOptimizedImagesDomains:["lh3.googleusercontent.com","pbs.twimg.com","abs.twimg.com"]};t.Z=l},94837:function(e,t,s){"use strict";function n(e){let{src:t}=e;return t.split("?")[0]}s.r(t),s.d(t,{default:function(){return n}})},60054:function(e,t,s){"use strict";s.r(t),s.d(t,{default:function(){return z}});var n=s(85893),a=s(67294),r=s(9008),l=s.n(r),i=s(81758),o=s(54373),d=s(34444);s(41664);var c=s(46464),u=s(64520),p=s(6008),x=s(55400),h=s(31486),m=s.n(h),v=s(30381),f=s.n(v),g=e=>{let{user:t,color:s,days:r=7}=e,{data:l,error:d,isLoading:h,mutate:v}=(0,i.ZP)("/user/analytics?days=".concat(r,"&type=pageview"),e=>o.Z.get(e),{revalidateOnFocus:!1}),[g,j]=(0,a.useState)(0),[b,y]=(0,a.useState)([]);return((0,a.useEffect)(()=>{if(null==l?void 0:l.events){let e=0;y([...Array(Number(r))].map((t,s)=>{let n=f()().subtract(r-1-s,"days").startOf("day"),a=f()().subtract(r-1-s,"days").endOf("day"),i=n.format("ddd D MMM"),o=[...new Map(l.events.filter(e=>{let t=f()(e.createdAt);return t>n&&t<a}).map(e=>[e.visitorId,e])).values()];return e+=o.length,{name:i,uv:o.length}})),j(e)}},[l,r]),h)?(0,n.jsx)("p",{children:"Loading..."}):(0,n.jsxs)("div",{className:"relative bg-base-200 rounded-3xl overflow-hidden select-none group md:basis-1/2 h-64",children:[(0,n.jsxs)("div",{className:"absolute left-4 top-4 z-10 ",children:[(0,n.jsxs)("span",{className:"flex gap-1 items-center text-base-content/80 text-sm group-hover:text-xs duration-200",children:[(0,n.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:"w-4 h-4 inline group-hover:w-3 group-hover:h-3 duration-200",children:[(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M2.036 12.322a1.012 1.012 0 010-.639C3.423 7.51 7.36 4.5 12 4.5c4.638 0 8.573 3.007 9.963 7.178.07.207.07.431 0 .639C20.577 16.49 16.64 19.5 12 19.5c-4.638 0-8.573-3.007-9.963-7.178z"}),(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"})]}),"Unique visitors"]}),(0,n.jsx)("span",{className:"stat-value group-hover:text-2xl duration-300",children:m()(g,{maxDecimals:1,separator:""})})]}),(0,n.jsx)(c.h,{width:"100%",height:"100%",children:(0,n.jsxs)(u.T,{data:b,margin:{top:16,right:0,left:0,bottom:16},children:[(0,n.jsx)("defs",{children:(0,n.jsxs)("linearGradient",{id:"colorUv",x1:"0",y1:"0",x2:"0",y2:"1",children:[(0,n.jsx)("stop",{offset:"5%",stopColor:s,stopOpacity:.8}),(0,n.jsx)("stop",{offset:"100%",stopColor:s,stopOpacity:0})]})}),(0,n.jsx)(p.u,{cursor:!0,wrapperStyle:{outline:"none"},content:e=>{var t,s,a,r;let{active:l,payload:i}=e;return l&&i&&null!=i&&i.length?(0,n.jsxs)("div",{className:"relative z-50 p-4 bg-neutral rounded-xl space-y-1 text-base-content/80 text-sm md:text-base",children:[(0,n.jsx)("div",{className:"font-semibold text-base-content",children:null===(s=i[0])||void 0===s?void 0:null===(t=s.payload)||void 0===t?void 0:t.name}),(0,n.jsxs)("div",{className:"",children:[(0,n.jsx)("span",{className:"font-semibold text-base-content",children:m()(null===(r=i[0])||void 0===r?void 0:null===(a=r.payload)||void 0===a?void 0:a.uv,{maxDecimals:1,separator:""})})," ","unique visitors"]})]}):(0,n.jsx)(n.Fragment,{})}}),(0,n.jsx)(x.u,{type:"monotone",dataKey:"uv",stroke:s,fillOpacity:1,fill:"url(#colorUv)"})]})})]})},j=s(9984),b=s(32294),y=e=>{let{user:t,color:s,days:r=7}=e,{data:l,error:d,isLoading:u,mutate:x}=(0,i.ZP)("/user/analytics?days=".concat(r,"&type=click"),e=>o.Z.get(e),{revalidateOnFocus:!1}),[h,v]=(0,a.useState)(0),[f,g]=(0,a.useState)([]);return((0,a.useEffect)(()=>
1{if(null==l?void 0:l.events){let e=0,s=t.startups.filter(e=>e.isShown).map((t,s)=>{let n=l.events.filter(e=>(null==e?void 0:e.to)===t.id);return e+=n.length,{name:t.name?t.name.replace("http://","").replace("https://",""):t.url.replace("http://","").replace("https://",""),uv:n.length}});v(e),g(s)}},[l,r]),u)?(0,n.jsx)("p",{children:"Loading..."}):(0,n.jsxs)("div",{className:"relative bg-base-200 rounded-3xl overflow-hidden select-none group md:basis-1/2 h-[26rem]",children:[(0,n.jsxs)("div",{className:"absolute left-4 top-4 z-10",children:[(0,n.jsxs)("span",{className:"flex gap-1 items-center text-base-content/80 text-sm group-hover:text-xs duration-200",children:[(0,n.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:"w-4 h-4 inline group-hover:w-3 group-hover:h-3 duration-200",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.042 21.672L13.684 16.6m0 0l-2.51 2.225.569-9.47 5.227 7.917-3.286-.672zM12 2.25V4.5m5.834.166l-1.591 1.591M20.25 10.5H18M7.757 14.743l-1.59 1.59M6 10.5H3.75m4.007-4.243l-1.59-1.59"})}),"Clicks"]}),(0,n.jsx)("span",{className:"stat-value group-hover:text-2xl duration-300",children:m()(h,{maxDecimals:1,separator:""})})]}),(0,n.jsx)(c.h,{width:"100%",height:"100%",children:(0,n.jsxs)(j.v,{data:f,margin:{top:16,right:0,left:0,bottom:16},maxBarSize:36,reverseStackOrder:!1,children:[(0,n.jsx)("defs",{children:(0,n.jsxs)("linearGradient",{id:"colorUv",x1:"0",y1:"0",x2:"0",y2:"1",children:[(0,n.jsx)("stop",{offset:"5%",stopColor:s,stopOpacity:.8}),(0,n.jsx)("stop",{offset:"100%",stopColor:s,stopOpacity:0})]})}),(0,n.jsx)(p.u,{cursor:t.startups.length>1&&{fill:"#ffffff10"},wrapperStyle:{outline:"none"},content:e=>{var t,s,a,r;let{active:l,payload:i}=e;return l&&i&&null!=i&&i.length?(0,n.jsxs)("div",{className:"p-4 bg-neutral rounded-xl space-y-1 text-base-content/80 text-sm md:text-base",children:[(0,n.jsx)("div",{className:"font-semibold text-base-content",children:null===(s=i[0])||void 0===s?void 0:null===(t=s.payload)||void 0===t?void 0:t.name}),(0,n.jsxs)("div",{className:"",children:[(0,n.jsx)("span",{className:"font-semibold text-base-content",children:m()(null===(r=i[0])||void 0===r?void 0:null===(a=r.payload)||void 0===a?void 0:a.uv,{maxDecimals:1,separator:""})})," ","Clicks"]})]}):(0,n.jsx)(n.Fragment,{})}}),(0,n.jsx)(b.$,{dataKey:"uv",background:!1,label:e=>{let{x:s,y:a,stroke:r,value:l,name:i,height:o,viewBox:d}=e,c=t.startups.length;return(0,n.jsx)("text",{x:s+(null==d?void 0:d.width)/2,y:406,fill:"#e5e7eb",fontSize:10,textAnchor:"middle",children:c<=4?"".concat(i):c<8?"".concat(i.slice(0,10)):"".concat(i.slice(0,6))})},fillOpacity:1,fill:"url(#colorUv)"})]})})]})},w=s(25615),N=s(88793),k=s(16244),O=s(26527);let S=e=>{if("t.co"===e||"twitter.com"===e)return"Twitter";if(e===O.Z.domainName)return"Indie Page";if(e.includes("google"))return"Google";if(e.includes("instagram"))return"Instagram";if(e.includes("youtube")||e.includes("youtu"))return"YouTube";if(e.includes("linkedin"))return"LinkedIn";if(e.includes("facebook"))return"Facebook";else if(e.includes("github"))return"GitHub";else return e};var C=e=>{let{user:t,color:s,days:r=7}=e,{data:l,error:d,isLoading:u,mutate:x}=(0,i.ZP)("/user/analytics?days=".concat(r,"&type=pageview"),e=>o.Z.get(e),{revalidateOnFocus:!1}),[h,v]=(0,a.useState)([]);return((0,a.useEffect)(()=>{if(null==l?void 0:l.events){let e=new Map;l.events.forEach(t=>{let s,n;try{s=new URL(null==t?void 0:t.referrer),n=k.get(s.hostname)}catch(e){}if(n){let s=S(n),a=e.get(s),r=(null==a?void 0:a.domains)||[];r.includes(n)||r.push(n),e.set(s,{domains:r,events:[...(null==a?void 0:a.events)||[],t.visitorId]})}else{let s=e.get("Direct/None");e.set("Direct/None",{domains:[],events:[...(null==s?void 0:s.events)||[],t.visitorId]})}});let t=[];e.forEach((e,s)=>t.push({name:s,uv:[...new Set(e.events)].length,domain:e.domains[0]})),v(t.sort((e,t)=>t.uv-e.uv).slice(0,10))}},[l,r]),u)?(0,n.jsx)("p",{children:"Loading..."}):(0,n.jsxs)("div",{className:"relative bg-base-200 rounded-3xl overflow-hidden select-none group md:basis-1/2 h-[26rem]",children:[(0,n.jsx)("div",{className:"absolute left-4 top-4 z-10 ",children:(0,n.jsxs)("span",{className:"flex gap-1 items-center text-base-content/80 text-sm group-hover:text-xs duration-200",children:[(0,n.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:"w-4 h-4 inline group-hover:w-3 group-hover:h-3 duration-200",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.75 9V5.25A2.25 2.25 0 0013.5 3h-6a2.25 2.25 0 00-2.25 2.25v13.5A2.25 2.25 0 007.5 21h6a2.25 2.25 0 002.25-2.25V15M12 9l-3 3m0 0l3 3m-3-3h12.75"})}),"Source"]})}),(0,n.jsx)("div",{className:"absolute right-4 top-4 z-10 ",children:(0,n.jsx)("span",{className:"flex gap-1 items-center text-base-content/80 text-sm group-hover:text-xs duration-200",children:"Visitors"})}),(0,n.jsx)(c.h,{width:"100%",height:"100%",children:(0,n.jsxs)(j.v,{data:h,margin:{top:48,right:16,left:16,bottom:16},barSize:36,layout:"vertical",children:[(0,n.jsx)("defs",{children:(0,n.jsxs)("linearGradient",{id:"colorUvVer",x1:"1",y1:"0",x2:"0",y2:"0",children:[(0,n.jsx)("stop",{offset:"5%",
1stopColor:s,stopOpacity:.8}),(0,n.jsx)("stop",{offset:"100%",stopColor:s,stopOpacity:0})]})}),(0,n.jsx)(p.u,{cursor:{fill:"#ffffff10"},wrapperStyle:{outline:"none"},content:e=>{let{active:t,payload:s}=e;if(!t||!s||null==s||!s.length)return(0,n.jsx)(n.Fragment,{});{var a,r,l,i,o;let e=null===(a=s[0])||void 0===a?void 0:a.payload;return(0,n.jsxs)("div",{className:"p-4 bg-neutral rounded-xl space-y-1 text-base-content/80 text-sm md:text-base",children:[(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(null==e?void 0:e.domain)&&(0,n.jsx)("img",{src:"https://".concat(null==e?void 0:e.domain,"/favicon.ico"),className:"w-5 h-5",alt:"".concat(null==e?void 0:e.name," logo")}),(0,n.jsx)("div",{className:"font-semibold text-base-content",children:null===(l=s[0])||void 0===l?void 0:null===(r=l.payload)||void 0===r?void 0:r.name})]}),(0,n.jsxs)("div",{className:"",children:[(0,n.jsx)("span",{className:"font-semibold text-base-content",children:m()(null===(o=s[0])||void 0===o?void 0:null===(i=o.payload)||void 0===i?void 0:i.uv,{maxDecimals:1,separator:""})})," ","Unique visitors"]})]})}}}),(0,n.jsx)(w.K,{type:"number",hide:!0}),(0,n.jsx)(N.B,{type:"category",hide:!0}),(0,n.jsx)(b.$,{dataKey:"uv",background:!1,label:e=>{var t;let{x:s,y:a,stroke:r,value:l,name:i,width:o,height:d,viewBox:c}=e,u=null===(t=h.find(e=>e.name===i))||void 0===t?void 0:t.domain;return(0,n.jsx)("g",{children:(0,n.jsx)("foreignObject",{x:16,y:a,width:"100%",height:30,children:(0,n.jsxs)("div",{className:"flex flex-row items-center h-full text-sm text-base-content",children:[u?(0,n.jsx)("img",{src:"https://".concat(u,"/favicon.ico"),className:"w-[18px] h-[18px]",alt:"".concat(i," logo")}):(0,n.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"#e5e7eb",className:"w-[18px] h-[18px]",children:[(0,n.jsx)("path",{d:"M12.232 4.232a2.5 2.5 0 013.536 3.536l-1.225 1.224a.75.75 0 001.061 1.06l1.224-1.224a4 4 0 00-5.656-5.656l-3 3a4 4 0 00.225 5.865.75.75 0 00.977-1.138 2.5 2.5 0 01-.142-3.667l3-3z"}),(0,n.jsx)("path",{d:"M11.603 7.963a.75.75 0 00-.977 1.138 2.5 2.5 0 01.142 3.667l-3 3a2.5 2.5 0 01-3.536-3.536l1.225-1.224a.75.75 0 00-1.061-1.06l-1.224 1.224a4 4 0 105.656 5.656l3-3a4 4 0 00-.225-5.865z"})]}),(0,n.jsx)("span",{className:"ml-4",children:i}),(0,n.jsx)("span",{className:"ml-auto mr-8 font-medium",children:m()(l,{maxDecimals:1,separator:""})})]})})})},fillOpacity:1,fill:"url(#colorUvVer)"})]})})]})},L=e=>{var t;let{user:s,color:r,days:l=7}=e,{data:d,error:h,isLoading:v,mutate:g}=(0,i.ZP)("/user/analytics/subscribers?days=".concat(l),e=>o.Z.get(e),{revalidateOnFocus:!1}),[j,b]=(0,a.useState)([]);return((0,a.useEffect)(()=>{if(null==d?void 0:d.subscribers){let e=0;b([...Array(Number(l))].map((t,s)=>{let n=f()().subtract(l-1-s,"days").startOf("day"),a=f()().subtract(l-1-s,"days").endOf("day"),r=n.format("ddd D MMM"),i=d.subscribers.filter(e=>{let t=f()(e.createdAt);return 0===s?t<a:t>n&&t<a}),o=i.length+e;return e+=i.length,{name:r,uv:o}}))}},[d,l]),v)?(0,n.jsx)("p",{children:"Loading..."}):(0,n.jsxs)("div",{className:"relative bg-base-200 rounded-3xl overflow-hidden select-none group md:basis-1/2 h-64",children:[(0,n.jsxs)("div",{className:"absolute left-4 top-4 z-10 ",children:[(0,n.jsxs)("span",{className:"flex gap-1 items-center text-base-content/80 text-sm group-hover:text-xs duration-200",children:[(0,n.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:"w-4 h-4 inline group-hover:w-3 group-hover:h-3 duration-200",children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21.75 6.75v10.5a2.25 2.25 0 01-2.25 2.25h-15a2.25 2.25 0 01-2.25-2.25V6.75m19.5 0A2.25 2.25 0 0019.5 4.5h-15a2.25 2.25 0 00-2.25 2.25m19.5 0v.243a2.25 2.25 0 01-1.07 1.916l-7.5 4.615a2.25 2.25 0 01-2.36 0L3.32 8.91a2.25 2.25 0 01-1.07-1.916V6.75"})}),"Subscribers",!s.subscribersEnabled&&(0,n.jsx)("span",{className:"text-warning font-medium ml-2",children:"â ï¸ Not activated"})]}),(0,n.jsx)("span",{className:"stat-value group-hover:text-2xl duration-300",children:m()(null==d?void 0:null===(t=d.subscribers)||void 0===t?void 0:t.length,{maxDecimals:1,separator:""})})]}),(0,n.jsx)(c.h,{width:"100%",height:"100%",children:(0,n.jsxs)(u.T,{data:j,margin:{top:36,right:0,left:0,bottom:16},children:[(0,n.jsx)("defs",{children:(0,n.jsxs)("linearGradient",{id:"colorUvSubs",x1:"0",y1:"0",x2:"0",y2:"1",children:[(0,n.jsx)("stop",{offset:"5%",
1stopColor:r,stopOpacity:.8}),(0,n.jsx)("stop",{offset:"100%",stopColor:r,stopOpacity:0})]})}),(0,n.jsx)(p.u,{cursor:!0,wrapperStyle:{outline:"none"},content:e=>{var t,s,a,r;let{active:l,payload:i}=e;return l&&i&&null!=i&&i.length?(0,n.jsxs)("div",{className:"relative z-50 p-4 bg-neutral rounded-xl space-y-1 text-base-content/80 text-sm md:text-base",children:[(0,n.jsx)("div",{className:"font-semibold text-base-content",children:null===(s=i[0])||void 0===s?void 0:null===(t=s.payload)||void 0===t?void 0:t.name}),(0,n.jsxs)("div",{className:"",children:[(0,n.jsx)("span",{className:"font-semibold text-base-content",children:null===(r=i[0])||void 0===r?void 0:null===(a=r.payload)||void 0===a?void 0:a.uv})," ","Email subscribers"]})]}):(0,n.jsx)(n.Fragment,{})}}),(0,n.jsx)(x.u,{type:"monotone",dataKey:"uv",stroke:r,fillOpacity:1,fill:"url(#colorUvSubs)"})]})})]})},M=s(3889),_=s(28886);let E="#bd93f9",A=()=>{let{data:e,error:t,isLoading:s,mutate:r}=(0,i.ZP)("/user",e=>o.Z.get(e),{revalidateOnFocus:!1}),[c,u]=(0,a.useState)(7);return s?(0,n.jsx)(_.Z,{}):(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(l(),{children:(0,n.jsx)("title",{children:"Indie Page Analytics"})}),(0,n.jsxs)("main",{className:"mb-24",children:[(0,n.jsx)(d.h,{user:e.user}),(0,n.jsxs)("div",{className:"max-w-6xl mx-auto p-4 space-y-4",children:[(0,n.jsx)("div",{className:"flex justify-end",children:(0,n.jsxs)("select",{className:"select select-sm md:select-md",defaultValue:"7",onChange:e=>u(e.target.value),children:[(0,n.jsx)("option",{value:"7",children:"7 days"}),(0,n.jsx)("option",{value:"14",children:"14 days"}),(0,n.jsx)("option",{value:"30",children:"1 month"})]})}),(0,n.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 lg:gap-8",children:[(0,n.jsx)(L,{user:e.user,color:"#ff79c6",days:c}),(0,n.jsx)(g,{user:e.user,color:E,days:c}),(0,n.jsx)(y,{user:e.user,color:E,days:c}),(0,n.jsx)(C,{user:e.user,color:E,days:c})]})]})]})]})};var z=A;A.getLayout=function(e){return(0,n.jsx)(M.Z,{children:e})}}},function(e){e.O(0,[885,664,675,902,154,758,823,57,321,259,336,888,774,179],function(){return e(e.s=18197)}),_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.