1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2164],{94896:function(e,t,a){a.r(t),a.d(t,{DashboardInsights:function(){return k}});var s=a(57437),l=a(2265),r=a(30166),n=a(16030),i=a(47625),o=a(16488),d=a(97059),c=a(62994),u=a(20039),x=a(31699),m=a(23263),h=a(91748);let f=(0,r.default)(()=>Promise.all([a.e(968),a.e(2640)]).then(a.bind(a,82640)).then(e=>e.CountryMap),{loadableGenerated:{webpack:()=>[82640]},ssr:!1}),v=["ì¼","ì","í","ì","목","ê¸","í "];function p(e){return e>=1e6?"".concat((e/1e6).toFixed(1),"M"):e>=1e3?"".concat((e/1e3).toFixed(1),"K"):e.toLocaleString("ko-KR")}let g=[{key:0,label:"ì¡°íì",isRate:!1},{key:1,label:"ì¬ì©ì",isRate:!1},{key:2,label:"ì¸ì
",isRate:!1},{key:3,label:"ì°¸ì¬ì¨",isRate:!0}];function b(e){let{data:t}=e,[a,r]=(0,l.useState)(0),n=g[a],h=(0,l.useMemo)(()=>{var e,s,l,r,n;return parseFloat((null===(n=t.thisWeekKpi)||void 0===n?void 0:null===(r=n.rows)||void 0===r?void 0:null===(l=r[0])||void 0===l?void 0:null===(s=l.metricValues)||void 0===s?void 0:null===(e=s[a])||void 0===e?void 0:e.value)||"0")},[t.thisWeekKpi,a]),f=(0,l.useMemo)(()=>{var e;let s=(null===(e=t.dailyTrends)||void 0===e?void 0:e.rows)||[];if(0===s.length)return[];let l=["ì¼","ì","í","ì","목","ê¸","í "],r=t.dailyArticleCounts||{},n=new Map;s.forEach(e=>{var t,a;let s=(null===(a=e.dimensionValues)||void 0===a?void 0:null===(t=a[0])||void 0===t?void 0:t.value)||"";n.set(s,e)});let i=new Date(Date.now()+324e5),o=new Date(Date.UTC(i.getUTCFullYear(),i.getUTCMonth(),i.getUTCDate()-1)),d=e=>"".concat(e.getUTCFullYear()).concat(String(e.getUTCMonth()+1).padStart(2,"0")).concat(String(e.getUTCDate()).padStart(2,"0")),c=[];for(let e=6;e>=0;e--)c.push(new Date(Date.UTC(o.getUTCFullYear(),o.getUTCMonth(),o.getUTCDate()-e)));return c.map(e=>{var t,s;let i=d(e),o=n.get(i),c=e.getUTCDate(),u=e.getUTCMonth()+1;return{day:"".concat(u,"/").concat(c,"(").concat(l[e.getUTCDay()],")"),metric:parseFloat((null==o?void 0:null===(s=o.metricValues)||void 0===s?void 0:null===(t=s[a])||void 0===t?void 0:t.value)||"0"),articleCount:r[i]||0}})},[t.dailyTrends,t.dailyArticleCounts,a]);if(0===f.length)return(0,s.jsxs)("div",{className:"bg-[--card-background] rounded-lg border border-[--border] p-4 sm:p-6 h-full flex flex-col",children:[(0,s.jsxs)("div",{className:"flex items-start justify-between mb-4 gap-2",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("span",{className:"text-sm font-semibold",children:n.label}),(0,s.jsx)("div",{className:"flex items-baseline gap-2 mt-1",children:(0,s.jsx)("span",{className:"text-xl font-bold",children:"-"})})]}),(0,s.jsx)("span",{className:"text-[10px] text-muted-foreground mt-1",children:"ìµê·¼ 7ì¼"})]}),(0,s.jsx)("div",{className:"flex-1 min-h-[200px] flex items-center justify-center",children:(0,s.jsx)("p",{className:"text-sm text-muted-foreground",children:"ë°ì´í°ê° ììµëë¤."})})]});let v=n.isRate?"".concat((100*h).toFixed(1),"%"):p(Math.round(h)),b=Math.max(...f.map(e=>e.articleCount),1);return(0,s.jsxs)("div",{className:"bg-[--card-background] rounded-lg border border-[--border] p-4 sm:p-6 h-full flex flex-col",children:[(0,s.jsxs)("div",{className:"flex items-start justify-between mb-4 gap-2",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("select",{value:a,onChange:e=>r(Number(e.target.value)),className:"text-sm font-semibold bg-transparent border-none p-0 pr-5 cursor-pointer focus:outline-none focus:ring-0 appearance-none",style:{backgroundImage:"url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E\")",backgroundRepeat:"no-repeat",backgroundPosition:"right center"},children:g.map(e=>(0,s.jsx)("option",{value:e.key,children:e.label},e.key))}),(0,s.jsx)("div",{className:"flex items-baseline gap-2 mt-1",children:(0,s.jsx)("span",{className:"text-xl font-bold",children:v})})]}),(0,s.jsx)("span",{className:"text-[10px] text-muted-foreground mt-1",children:"ìµê·¼ 7ì¼"})]}),(0,s.jsx)("div",{className:"flex-1 min-h-[200px]",children:(0,s.jsx)(i.h,{width:"100%",height:"100%",children:(0,s.jsxs)(o.c,{data:f,margin:{top:5,right:5,bottom:10,left:-10},children:[(0,s.jsx)("defs",{children:(0,s.jsxs)("linearGradient",{id:"colorMetric",x1:"0",y1:"0",x2:"0",y2:"1",children:[(0,s.jsx)("stop",{offset:"5%",
1stopColor:"#f9ab00",stopOpacity:.3}),(0,s.jsx)("stop",{offset:"95%",stopColor:"#f9ab00",stopOpacity:0})]})}),(0,s.jsx)(d.K,{dataKey:"day",axisLine:!1,tickLine:!1,interval:"preserveStartEnd",padding:{left:5,right:5},tick:{fontSize:10,fill:"#9ca3af"}}),(0,s.jsx)(c.B,{yAxisId:"left",tick:{fontSize:10,fill:"#9ca3af"},axisLine:!1,tickLine:!1,width:40,tickFormatter:e=>n.isRate?"".concat((100*e).toFixed(0),"%"):p(e)}),(0,s.jsx)(c.B,{yAxisId:"right",orientation:"right",tick:{fontSize:10,fill:"#9ca3af"},axisLine:!1,tickLine:!1,width:30,domain:[0,Math.ceil(1.2*b)],allowDecimals:!1}),(0,s.jsx)(u.u,{contentStyle:{backgroundColor:"rgba(255,255,255,0.95)",borderRadius:"8px",border:"none",boxShadow:"0 4px 12px rgba(0,0,0,0.1)",fontSize:"12px"},formatter:(e,t)=>"metric"===t?[n.isRate?"".concat((100*e).toFixed(1),"%"):e.toLocaleString(),n.label]:["".concat(e,"ê±´"),"ê¸°ì¬ ì"]}),(0,s.jsx)(x.$,{yAxisId:"right",dataKey:"articleCount",fill:"#4285f4",opacity:.3,radius:[2,2,0,0],name:"articleCount"}),(0,s.jsx)(m.u,{yAxisId:"left",type:"monotone",dataKey:"metric",stroke:"#f9ab00",strokeWidth:2,fill:"url(#colorMetric)",name:"metric"})]})})}),(0,s.jsxs)("div",{className:"flex items-center gap-4 mt-2 text-xs text-muted-foreground justify-center",children:[(0,s.jsxs)("span",{className:"flex items-center gap-1.5",children:[(0,s.jsx)("span",{className:"inline-block w-4 h-0.5 bg-[#f9ab00] rounded"})," ",n.label]}),(0,s.jsxs)("span",{className:"flex items-center gap-1.5",children:[(0,s.jsx)("span",{className:"inline-block w-3 h-3 bg-[#4285f4] opacity-30 rounded-sm"})," ê¸°ì¬ ì"]})]})]})}function j(e){var t,a,r;let{data:n}=e,i=(0,l.useMemo)(()=>({countryData:n.geoData}),[n.geoData]),o=(null!==(r=null===(a=n.geoData)||void 0===a?void 0:null===(t=a.rows)||void 0===t?void 0:t.length)&&void 0!==r?r:0)>0;return(0,s.jsxs)("div",{className:"bg-[--card-background] rounded-lg border border-[--border] p-4 sm:p-6 h-full flex flex-col",children:[(0,s.jsx)("h3",{className:"text-sm font-semibold mb-4",children:"방문ì ë¶í¬ (7ì¼)"}),o?(0,s.jsx)("div",{className:"flex-1 min-h-[240px] rounded-lg overflow-hidden",children:(0,s.jsx)(f,{data:i})}):(0,s.jsx)("div",{className:"flex-1 min-h-[240px] flex items-center justify-center",children:(0,s.jsx)("p",{className:"text-sm text-muted-foreground",children:"ì§ë¦¬ ë°ì´í°ê° ììµëë¤."})})]})}function y(e){let t,{data:a}=e,[r,n]=(0,l.useState)(null),{grid:i,maxVal:o}=(0,l.useMemo)(()=>{var e;let t=(null===(e=a.hourlyHeatmap)||void 0===e?void 0:e.rows)||[],s=Array.from({length:7},()=>Array(24).fill(0)),l=0;return t.forEach(e=>{var t,a,r,n,i,o;let d=parseInt((null===(a=e.dimensionValues)||void 0===a?void 0:null===(t=a[0])||void 0===t?void 0:t.value)||"0"),c=parseInt((null===(n=e.dimensionValues)||void 0===n?void 0:null===(r=n[1])||void 0===r?void 0:r.value)||"0"),u=parseInt((null===(o=e.metricValues)||void 0===o?void 0:null===(i=o[0])||void 0===i?void 0:i.value)||"0");d>=0&&d<7&&c>=0&&c<24&&(s[d][c]+=u,s[d][c]>l&&(l=s[d][c]))}),{grid:s,maxVal:l}},[a.hourlyHeatmap]),d=Array.from({length:24},(e,t)=>t);return(0,s.jsxs)("div",{className:"bg-[--card-background] rounded-lg border border-[--border] p-4 sm:p-6 h-full flex flex-col relative",children:[(0,s.jsx)("h3",{className:"text-sm font-semibold mb-4",children:"ìê°ëë³ ë°©ë¬¸ í¨í´ (4주)"}),(0,s.jsxs)("div",{className:"grid gap-[2px] flex-1",style:{gridTemplateColumns:"20px repeat(7, 1fr)",gridTemplateRows:"16px repeat(24, minmax(0, 14px))"},children:[(0,s.jsx)("div",{}),[1,2,3,4,5,6,0].map(e=>(0,s.jsx)("div",{className:"text-[10px] text-muted-foreground text-center flex items-end justify-center",children:v[e]},"d-".concat(e))),d.map(e=>(0,s.jsxs)(l.Fragment,{children:[(0,s.jsx)("div",{className:"text-[10px] text-muted-foreground flex items-center justify-end pr-1",children:e%3==0?e:""}),[1,2,3,4,5,6,0].map(t=>{let a=i[t][e],l=o>0?Math.max(.06,a/o):.06;return(0,s.jsx)("div",{className:"rounded-[3px] cursor-default transition-transform hover:scale-110",style:{backgroundColor:"rgba(249, 171, 0, ".concat(l,")")},onMouseEnter:s=>n({dow:t,hour:e,val:a,x:s.clientX,y:s.clientY}),onMouseMove:e=>n(t=>t?{...t,x:e.clientX,y:e.clientY}:null),onMouseLeave:()=>n(null)},"c-".concat(t,"-").concat(e))})]},"row-".concat(e)))]}),r&&(0,s.jsxs)("div",{className:"fixed z-[9999] pointer-events-none bg-white dark:bg-gray-800 rounded-lg shadow-2xl px-3 py-2 text-xs border border-gray-200 dark:border-gray-700",style:{left:r.x+12,top:r.y+12},children:[(0,s.jsxs)("div",{className:"font-semibold mb-1",children:[v[r.dow],"ìì¼ ",r.hour,"ì"]}),(0,s.jsxs)("div",{className:"flex items-center justify-between gap-4",children:[(0,s.jsx)("span",{className:"text-muted-foreground",children:"방문ì"}),(0,s.jsxs)("span",{className:"font-bold text-[#f9ab00]",children:[r.val.toLocaleStr
1ing(),"ëª
"]})]}),(0,s.jsxs)("div",{className:"flex items-center justify-between gap-4",children:[(0,s.jsx)("span",{className:"text-muted-foreground",children:"ê°ë"}),(0,s.jsxs)("span",{className:"font-medium",children:[(t=r.val,o>0?Math.round(t/o*100):0),"%"]})]})]})]})}function N(e){var t;let{data:a}=e,r=null===(t=a.errors)||void 0===t?void 0:t.some(e=>"topArticles"===e.report),i=(0,l.useMemo)(()=>{var e;return((null===(e=a.topArticles)||void 0===e?void 0:e.rows)||[]).filter(e=>{var t,a;let s=null===(a=e.dimensionValues)||void 0===a?void 0:null===(t=a[0])||void 0===t?void 0:t.value;return s&&"(not set)"!==s}).slice(0,10).map((e,t)=>{var a,s,l,r,n,i,o,d;return{rank:t+1,title:(null===(s=e.dimensionValues)||void 0===s?void 0:null===(a=s[0])||void 0===a?void 0:a.value)||"",articleId:(null===(r=e.dimensionValues)||void 0===r?void 0:null===(l=r[1])||void 0===l?void 0:l.value)||"",views:parseInt((null===(i=e.metricValues)||void 0===i?void 0:null===(n=i[0])||void 0===n?void 0:n.value)||"0"),users:parseInt((null===(d=e.metricValues)||void 0===d?void 0:null===(o=d[1])||void 0===o?void 0:o.value)||"0")}})},[a.topArticles]);return(0,s.jsxs)("div",{className:"bg-[--card-background] rounded-lg border border-[--border] p-4 sm:p-6",children:[(0,s.jsx)("h3",{className:"text-sm font-semibold mb-4",children:"ì¸ê¸° ê¸°ì¬ Top 10 (7ì¼)"}),r?(0,s.jsxs)("div",{className:"py-4 text-center",children:[(0,s.jsx)("p",{className:"text-sm text-muted-foreground",children:"GA4 ë§ì¶¤ 측ì 기ì¤ì´ ì¤ì ëì§ ìì ì¸ê¸° ê¸°ì¬ ë°ì´í°ë¥¼ ë¶ë¬ì¬ ì ììµëë¤."}),(0,s.jsxs)(n.default,{href:"/admin/statistics/integration-guide",className:"inline-flex items-center gap-1 mt-3 text-xs text-blue-500 hover:text-blue-600",children:[(0,s.jsx)("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})}),"ë§ì¶¤ ì§í ì¤ì ê°ì´ë 보기"]})]}):0===i.length?(0,s.jsx)("p",{className:"text-sm text-muted-foreground py-4 text-center",children:"ë°ì´í°ê° ììµëë¤."}):(0,s.jsx)("div",{className:"-mx-2",children:i.map(e=>(0,s.jsxs)(n.default,{href:e.articleId?"/admin/articles/edit/".concat(e.articleId):"#",className:"flex items-center gap-3 py-2.5 px-2 rounded hover:bg-gray-100 dark:hover:bg-gray-800 transition-colors",children:[(0,s.jsx)("span",{className:"text-xs font-bold w-6 text-center flex-shrink-0 ".concat(e.rank<=3?"text-[#f9ab00]":"text-muted-foreground"),children:e.rank}),(0,s.jsx)("span",{className:"text-sm truncate flex-1 min-w-0",children:e.title}),(0,s.jsx)("span",{className:"text-xs text-muted-foreground flex-shrink-0 tabular-nums",children:p(e.views)})]},e.articleId||e.rank))})]})}function k(e){let{data:t,isLoading:a,error:l}=e;return a?(0,s.jsx)(h.L,{}):l?(0,s.jsxs)("div",{className:"bg-[--card-background] rounded-lg border border-[--border] p-6 text-center",children:[(0,s.jsx)("p",{className:"text-sm text-red-500",children:"ì¸ì¬ì´í¸ ë°ì´í°ë¥¼ ë¶ë¬ì¤ë ì¤ ì¤ë¥ê° ë°ìíìµëë¤."}),(0,s.jsx)("p",{className:"text-xs text-muted-foreground mt-2",children:"GA4 ë§ì¶¤ 측ì 기ì¤ì´ ì¤ì ëì§ ììì ì ììµëë¤."}),(0,s.jsxs)(n.default,{href:"/admin/statistics/integration-guide",className:"inline-flex items-center gap-1 mt-3 text-xs text-blue-500 hover:text-blue-600",children:[(0,s.jsx)("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})}),"ë§ì¶¤ ì§í ì¤ì ê°ì´ë 보기"]})]}):t?(0,s.jsx)("div",{className:"space-y-4",children:(0,s.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-2 2xl:grid-cols-4 gap-4",children:[(0,s.jsx)(b,{data:t}),(0,s.jsx)(j,{data:t}),(0,s.jsx)(y,{data:t}),(0,s.jsx)(N,{data:t})]})}):null}},61994:function(e,t,a){function s(){for(var e,t,a=0,s="",l=arguments.length;a<l;a++)(e=arguments[a])&&(t=function e(t){var a,s,l="";if("string"==typeof t||"number"==typeof t)l+=t;else if("object"==typeof t){if(Array.isArray(t)){var r=t.length;for(a=0;a<r;a++)t[a]&&(s=e(t[a]))&&(l&&(l+=" "),l+=s)}else for(s in t)t[s]&&(l&&(l+=" "),l+=s)}return l}(e))&&(s&&(s+=" "),s+=t);return s}a.d(t,{W:function(){return s}}),t.Z=s}}]);
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.