1import{M as j}from"./MagazineService-muCZR2sY.js";import{S as ee,a as te,b as se}from"./snap_footer-B9eSqtLO.js";import{C as ne}from"./creator_banner-CeD4py9l.js";import{_ as ae,m as oe,r as Y,B as L,a as ie,o as le,A as re,p as ce,c as f,h as y,b as t,k as de,F as w,f as b,i as E,t as r,e as k,n as R,K as ue,u as fe,E as B,J as N,j as p,g as u}from"./index-GRB8Jcml.js";import{S as U}from"./Cafe24Service-JcfuYLwI.js";import"./UserService-B39Vk0W_.js";const he={name:"SnapMagazineDashboard",components:{SNAP_MENU:ee,SNAP_HEADER:te,SNAP_FOOTER:se,CREATOR_BANNER:ne},setup(){const e=oe({activeTab:"ì¡°íì",view_total_count:0,view_monthly_count:0,view_yesterday_count:0,view_today_count:0,daily_views:[],click_total_count:0,click_monthly_count:0,click_yesterday_count:0,click_today_count:0,daily_clicks:[],top_view_items:[],top_click_items:[],count_by_view:[],count_by_click:[],chartKey:0,review_panels:{is_doing:"",is_done:"",is_failed:""},projects:{waiting:"",ondoing:"",request_finish:"",finish_this_month:""},series:[{name:"ì¡°íì",data:[0,0,0,0,0,0,0,0],color:"#a367dc"},{name:"í´ë¦ì",data:[0,0,0,0,0,0,0,0],color:"#4ecdc4"}],chartOptions:{chart:{height:"400px",maxWidth:"100%",type:"bar",fontFamily:"Inter, sans-serif",toolbar:{show:!1},offsetY:10},plotOptions:{bar:{borderRadius:3,columnWidth:"70%",dataLabels:{position:"top"}}},grid:{show:!0,strokeDashArray:4,padding:{left:10,right:10,top:20,bottom:5}},xaxis:{categories:[],axisBorder:{show:!1},axisTicks:{show:!1},labels:{show:!0,style:{fontFamily:"Inter, sans-serif",cssClass:"text-xs font-normal fill-gray-500 dark:fill-gray-400"},rotateAlways:!1,hideOverlappingLabels:!0,trim:!0,maxHeight:120},tooltip:{enabled:!1}},yaxis:{show:!0,showAlways:!0,labels:{show:!0,align:"right",minWidth:0,maxWidth:160,style:{fontSize:"12px",fontFamily:"Inter, sans-serif",cssClass:"text-xs font-normal fill-gray-500 dark:fill-gray-400"},formatter:function(n){return n>=1e3?(n/1e3).toFixed(1)+"K":n.toFixed(0)},offsetY:-6,offsetX:0},axisBorder:{show:!0},axisTicks:{show:!0},min:0,forceNiceScale:!0,tickAmount:5,padding:10},margin:{top:20,right:20,bottom:20,left:20},dataLabels:{enabled:!1},tooltip:{enabled:!0,theme:"light",x:{show:!0},y:{formatter:function(n){return n.toLocaleString()+"í"}}}},initialChartData:{categories:[],ì¡°íì:[],í´ë¦ì:[]},banners:[],activeBanners:[],currentBannerIndex:0}),s=new Date,P=new Date(s.getTime()-29*24*60*60*1e3),c=Y([P,s]),V=fe(),F=L(()=>{switch(e.activeTab){case"ì¡°íì":return[e.series[0]];case"í´ë¦ì":return[e.series[1]];case"ê³µì ì":return[e.series[2]];default:return[]}}),D=L(()=>{const n=new Date,a=[];for(let i=1;i<=365;i++){const l=new Date(n);l.setDate(n.getDate()+i),a.push(l)}return a}),d=Y(null),A=()=>{e.chartOptions.xaxis.categories=e.initialChartData.categories,e.series[0].data=[...e.initialChartData.ì¡°íì],e.series[1].data=[...e.initialChartData.í´ë¦ì],e.activeTab==="ì¡°íì"?e.chartOptions.yaxis.max=e.initialChartData.viewsYAxisMax:e.activeTab==="í´ë¦ì"&&(e.chartOptions.yaxis.max=e.initialChartData.clicksYAxisMax),e.chartKey+=1,N(()=>{d.value&&d.value.chart&&(d.value.chart.updateOptions(e.chartOptions,!1,!0),d.value.chart.updateSeries(e.series,!0))})},S=n=>{if(n&&Array.isArray(n)&&n.length===2){let a=new URLSearchParams;const i=B(n[0]).format("YYYY-MM-DD"),l=B(n[1]).format("YYYY-MM-DD");a.append("period1",i),a.append("period2",l),g(a)}else A()},g=n=>{j.dashboardGraph(n).then(a=>{let i=a.data;e.daily_views=i.daily_views||[],e.daily_clicks=i.daily_clicks||[];const l=e.daily_views.map(m=>m.date);e.chartOptions.xaxis.categories=l;const _=e.daily_views.map(m=>m.count),O=e.daily_clicks.map(m=>m.count);e.series[0].data=[..._],e.series[1].data=[...O],e.activeTab==="ì¡°íì"?e.chartOptions.yaxis.max=o(_):e.activeTab==="í´ë¦ì"&&(e.chartOptions.yaxis.max=o(O)),e.chartKey+=1,N(()=>{d.value&&d.value.chart&&(d.value.chart.updateOptions(e.chartOptions,!1,!0),d.value.chart.updateSeries([{data:_},{data:O}],!0))})}).catch(a=>{console.log(a)}).finally(()=>{})};let I=n=>{const a=window.pageYOffset||document.documentElement.scrollTop;if(e.activeTab=n,n==="ì¡°íì"){const i=e.series[0].data,l=o(i);e.chartOptions.yaxis.max=l}else if(n==="í´ë¦ì"){const i=e.series[1].data,l=o(i);e.chartOptions.yaxis.max=l}e.chartKey+=1,N(()=>{window.scrollTo(0,a),d.value&&d.value.chart&&(d.value.chart.updateOptions(e.chartOptions,!1,!0),n==="ì¡°íì"?d.value.chart.updateSeries([{name:"ì¡°íì",data:[...e.series[0].data],color:"#a367dc"}],!0):n==="í´ë¦ì"&&d.value.chart.updateSeries([{name:"í´ë¦ì",data:[...e.series[1].data],color:"#4ecdc4"}],!0))})};function o(n,a=1.15){const i=Math.max(...n,0);if(i===0)return 10;let l=i*a;const _=Math.pow(10,Math.floor(Math.log10(l)));return i<10?l=Math.ceil(l*2)/2:i<100?l=Math.ceil(l/5)*5:l=Math.ceil(l/(_/10))*(_/10),l}let h=n=>{window.open(n)};async function M(){await U.storeInfo()}async function K(){U.insertProducts().then(n=>{console.log(n)}).catch(n=>{console.log(n)})}async function z(){try{const a=(await j.dashboardBanner()).data;e.activeBanners=a.filter(i=>i.is_active===1||i.is_active===!0),e.activeBanners.length>1&&setTimeout(()=>{C()},3e3)}catch(n){return console.error("ë°°ë ë¡ë ì¤í¨:",n),[]}}async function W(){try{const n=new Date,a=new Date(n.getTime()-29*24*60*60*1e3),i=B(a).format("YYYY-MM-DD"),l=B(n).format("YYYY-MM-DD");let _=new URLSearchParams;_.append("period1",i),_.append("period2",l),g(_)}catch(n){return console.error("ê·¸ëí ë¡ë ì¤í¨:",n),[]}}async function q(){try{j.widgetDashboard().then(n=>{let a=n.data;e.view_total_count=a.view_total_count,e.view_monthly_count=a.view_monthly_count,e.view_yesterday_count=a.view_yesterday_count,e.view_today_count=a.view_today_count,e.click_total_count=a.click_total_count,e.click_monthly_count=a.click_monthly_count,e.click_yesterday_count=a.click_yesterday_count,e.click_today_count=a.click_today_count,e.top_view_items=a.top_view_items||[],e.to
1p_click_items=a.top_click_items||[],e.review_panels=a.review_panels||e.review_panels,e.projects=a.projects||e.projects;const i=e.daily_views.map(l=>l.date);e.chartOptions.xaxis.categories=i}).catch(n=>{console.log(n)})}catch(n){return console.error("íµê³ ë°ì´í° ë¡ë ì¤í¨:",n),[]}}const T=()=>{if(e.activeBanners.length>1&&(e.currentBannerIndex=(e.currentBannerIndex+1)%e.activeBanners.length,e.activeBanners[e.currentBannerIndex])){const n=(e.currentBannerIndex+1)%e.activeBanners.length;if(e.activeBanners[n]&&e.activeBanners[n].image_url){const a=new Image;a.src=e.activeBanners[n].image_url}}},H=()=>{if(e.activeBanners.length>1&&(e.currentBannerIndex=e.currentBannerIndex===0?e.activeBanners.length-1:e.currentBannerIndex-1,e.activeBanners[e.currentBannerIndex])){const n=e.currentBannerIndex===0?e.activeBanners.length-1:e.currentBannerIndex-1;if(e.activeBanners[n]&&e.activeBanners[n].image_url){const a=new Image;a.src=e.activeBanners[n].image_url}}},G=()=>{x(),C()},v=Y(null),J=3e3,C=()=>{if(console.log("ìë ì¬ë¼ì´ë ìì",e.activeBanners.length),!e.activeBanners||e.activeBanners.length<=1){console.log("ë°°ëê° ìê±°ë íëë¿ì´ë¼ ìë ì¬ë¼ì´ë ììíì§ ìì");return}x(),T(),v.value=setInterval(()=>{T()},J)},x=()=>{v.value&&(clearInterval(v.value),v.value=null)},X=n=>{n!==e.currentBannerIndex&&(e.currentBannerIndex=n,G())},Q=n=>{const a=n.link;window.open(a,"_blank")};ie(()=>{x()}),le(()=>{console.log("mounted!"),re.getMallId()&&(M(),K()),z(),q(),W()});const Z=()=>{x()},$=()=>{C()};return{...ce(e),clickItem:h,setActiveTab:I,search_date:c,disabledDates:D,router:V,handleDateSelection:S,currentSeries:F,nextBanner:T,prevBanner:H,setCurrentBanner:X,toLink:Q,pauseAutoSlide:Z,resumeAutoSlide:$,autoSlideTimer:v}}},_e={class:"dashboard_body flex flex-col"},pe={class:"contents_box w-full flex justify-start grow"},ve={class:"contents_area grow p-8"},me={class:"con grow"},ye={class:"flex flex-col gap-5"},ge={class:"gap-4 grid grid-cols-2"},xe={class:"grid"},we={class:"box !p-0 overflow-hidden"},be={key:0,class:"preload-images"},ke=["src"],Be={key:1,class:"banner-indicators"},De=["onClick"],Ae={class:"gap-4 grid grid-cols-2"},Se={class:"box flex flex-col gap-5 font-bold"},Ie={class:"flex flex-col gap-4"},Me={class:"flex justify-between font-semibold"},Te={class:"flex justify-between font-semibold"},Ce={class:"flex justify-between font-semibold"},Oe={class:"box flex flex-col gap-5 font-bold"},je={class:"flex flex-col gap-4 font-semibold"},Ye={class:"flex justify-between"},Ee={class:"flex justify-between"},Re={class:"flex justify-between"},Ne={class:"flex justify-between"},Pe={class:"gap-4 grid grid-cols-4"},Ve={class:"box grid grid-cols-2 col-span-2"},Fe={class:"flex flex-col gap-5 pr-[30px] border-x border-l-0 border-solid border-gray-200"},Le={class:"flex flex-col gap-4 font-semibold mt-2"},Ue={class:"flex justify-between"},Ke={class:"flex justify-between"},ze={class:"flex justify-between"},We={class:"flex justify-between"},qe={class:"flex flex-col gap-5 pl-[30px]"},He={class:"flex flex-col gap-2.5 h-[125px] overflow-y-auto mt-2"},Ge=["href"],Je={class:"font-semibold"},Xe={class:"box grid grid-cols-2 col-span-2"},Qe={class:"flex flex-col gap-5 pr-[30px] border-x border-l-0 border-solid border-gray-200"},Ze={class:"flex flex-col gap-4 mt-2"},$e={class:"flex justify-between"},et={class:"flex justify-between"},tt={class:"flex justify-between"},st={class:"flex justify-between"},nt={class:"flex flex-col gap-5 pl-[30px]"},at={class:"flex flex-col gap-2.5 h-[125px] overflow-y-auto mt-2"},ot=["onClick"],it={class:"font-semibold"},lt={class:"box w-full flex flex-col gap-3"},rt={class:"flex items-center gap-6"},ct={class:"w-64 h-10 relative flex items-center"},dt={class:"inline-flex flex-wrap items-center text-sm font-medium text-center bg-gray-200 px-8 py-2 rounded-lg gap-3"},ut={class:"w-full bg-white relative"};function ft(e,s,P,c,V,F){const D=p("SNAP_HEADER"),d=p("SNAP_MENU"),A=p("CREATOR_BANNER"),S=p("VueDatePicker"),g=p("apexchart"),I=p("SNAP_FOOTER");return u(),f("div",_e,[y(D),t("div",pe,[y(d),t("div",ve,[t("div",me,[t("div",ye,[y(A),t("div",ge,[t("div",xe,[t("div",we,[e.activeBanners.length>0?(u(),f("div",{key:0,class:"banner-container",onMouseenter:s[1]||(s[1]=(...o)=>c.pauseAutoSlide&&c.pauseAutoSlide(...o)),onMouseleave:s[2]||(s[2]=(...o)=>c.resumeAutoSlide&&c.resumeAutoSlide(...o))},[(u(),f("div",{key:e.currentBannerIndex,class:"dash_banner",style:de({"background-image":`url(${e.activeBanners[e.currentBannerIndex].image_url})`,cursor:"pointer"}),onClick:s[0]||(s[0]=o=>c.toLink(e.activeBanners[e.currentBannerIndex]))},null,4)),e.activeBanners.length>1?(u(),f("div",be,[(u(!0),f(w,null,b(e.activeBanners,(o,h)=>(u(),f("img",{key:"preload-"+h,class:"preload-image",src:o.image_url,alt:"Preload Banner"},null,8,ke))),128))])):E("",!0),e.activeBanners.length>1?(u(),f("div",Be,[(u(!0),f(w,null,b(e.activeBanners,(o,h)=>(u(),f("span",{key:h,class:R(["indicator",{active:h===e.currentBannerIndex}]),onClick:M=>c.setCurrentBanner(h)},null,10,De))),128))])):E("",!0)],32)):E("",!0)])]),t("div",Ae,[t("div",Se,[s[11]||(s[11]=t("h2",null,"í¬ë¦¬ìì´í° ìº íì¸",-1)),t("div",Ie,[t("div",Me,[s[8]||(s[8]=t("h3",null,"ì§íì¤",-1)),t("h4",null,r(e.review_panels.is_doing),
11)]),t("div",Te,[s[9]||(s[9]=t("h3",null,"ìë£(ì´ë²ë¬)",-1)),t("h4",null,r(e.review_panels.is_done),1)]),t("div",Ce,[s[10]||(s[10]=t("h3",null,"ì¤í¨(ì´ë²ë¬)",-1)),t("h4",null,r(e.review_panels.is_failed),1)])])]),t("div",Oe,[s[16]||(s[16]=t("h2",null,"íë¡ì í¸",-1)),t("div",je,[t("div",Ye,[s[12]||(s[12]=t("h3",null,"íë¡ì í¸ ë기",-1)),t("h4",null,r(e.projects.waiting),1)]),t("div",Ee,[s[13]||(s[13]=t("h3",null,"ì§íì¤",-1)),t("h4",null,r(e.projects.ondoing),1)]),t("div",Re,[s[14]||(s[14]=t("h3",null,"ìë£ìì²",-1)),t("h4",null,r(e.projects.request_finish),1)]),t("div",Ne,[s[15]||(s[15]=t("h3",null,"ìë£(ì´ë²ë¬)",-1)),t("h4",null,r(e.projects.finish_this_month),1)])])])])]),t("div",Pe,[t("div",Ve,[t("div",Fe,[s[21]||(s[21]=t("h2",null,[k(" ìì ¯íµê³ "),t("span",{class:"text-gray-300 font-normal px-2"},"|"),k(" ì¡°íì ")],-1)),t("div",Le,[t("div",Ue,[s[17]||(s[17]=t("h3",null,"ëì ì¡°íì",-1)),t("h4",null,r(e.view_total_count),1)]),t("div",Ke,[s[18]||(s[18]=t("h3",null,"ìµê·¼ íë¬ ì¡°íì",-1)),t("h4",null,r(e.view_monthly_count),1)]),t("div",ze,[s[19]||(s[19]=t("h3",null,"ì ì¼ ì¡°íì",-1)),t("h4",null,r(e.view_yesterday_count),1)]),t("div",We,[s[20]||(s[20]=t("h3",null,"ê¸ì¼ ì¡°íì",-1)),t("h4",null,r(e.view_today_count),1)])])]),t("div",qe,[t("div",{div:"",class:"flex justify-between items-center",onClick:s[3]||(s[3]=o=>c.router.push("/snap-dashboard-detail?type=view"))},s[22]||(s[22]=[t("h2",null,"ìµê·¼ íë¬ ì¡°íì TOP 10",-1),t("a",{class:"text-gray-500 text-sm"},"ì 체보기",-1)])),t("div",He,[(u(!0),f(w,null,b(e.top_view_items,(o,h)=>(u(),f("div",{class:"flex justify-between gap-1",key:h},[t("a",{class:"truncate max-w-[75%]",href:o.url,target:"_blank",style:{"font-weight":"500"}},r(o.url),9,Ge),t("h4",Je,r(o.count),1)]))),128))])])]),t("div",Xe,[t("div",Qe,[s[27]||(s[27]=t("h2",null,[k(" ìì ¯íµê³ "),t("span",{class:"text-gray-300 font-normal px-2"},"|"),k(" í´ë¦ì ")],-1)),t("div",Ze,[t("div",$e,[s[23]||(s[23]=t("h3",null,"ëì í´ë¦ì",-1)),t("h4",null,r(e.click_total_count),1)]),t("div",et,[s[24]||(s[24]=t("h3",null,"ìµê·¼ íë¬ í´ë¦ì",-1)),t("h4",null,r(e.click_monthly_count),1)]),t("div",tt,[s[25]||(s[25]=t("h3",null,"ì ì¼ í´ë¦ì",-1)),t("h4",null,r(e.click_yesterday_count),1)]),t("div",st,[s[26]||(s[26]=t("h3",null,"ê¸ì¼ í´ë¦ì",-1)),t("h4",null,r(e.click_today_count),1)])])]),t("div",nt,[t("div",{class:"flex justify-between items-center font-bold",onClick:s[4]||(s[4]=o=>c.router.push("/snap-dashboard-detail?type=click"))},s[28]||(s[28]=[t("h2",null,"ìµê·¼ íë¬ í´ë¦ì TOP 10",-1),t("a",{class:"text-gray-500 text-sm",style:{"font-weight":"normal"}},"ì 체보기",-1)])),t("div",at,[(u(!0),f(w,null,b(e.top_click_items,(o,h)=>(u(),f("div",{class:"flex justify-between gap-1",key:h},[t("a",{class:"truncate max-w-[75%]",onClick:M=>c.clickItem(o.url),style:{cursor:"pointer"}},r(o.url),9,ot),t("h4",it,r(o.count),1)]))),128))])])])]),t("div",lt,[t("div",rt,[s[29]||(s[29]=t("h2",{style:{"font-weight":"bold"}},"ìì ¯ íµê³",-1)),t("div",ct,[y(S,{modelValue:c.search_date,"onUpdate:modelValue":[s[5]||(s[5]=o=>c.search_date=o),c.handleDateSelection],locale:"ko","enable-time-picker":!1,"model-auto":"",range:"","disabled-dates":c.disabledDates},null,8,["modelValue","disabled-dates","onUpdate:modelValue"])])]),t("div",null,[t("ul",dt,[t("li",null,[t("a",{href:"#",class:R(["inline-block px-8 py-1 rounded-md active:text-black",{"active-tab":e.activeTab==="ì¡°íì"}]),onClick:s[6]||(s[6]=o=>c.setActiveTab("ì¡°íì"))},"ì¡°íì",2)]),s[30]||(s[30]=t("li",null,[t("span",{class:"text-gray-300 font-normal"},"|")],-1)),t("li",null,[t("a",{href:"#",class:R(["inline-block px-8 py-1 rounded-md",{"active-tab":e.activeTab==="í´ë¦ì"}]),onClick:s[7]||(s[7]=o=>c.setActiveTab("í´ë¦ì"))},"í´ë¦ì",2)])])]),t("div",ut,[(u(),ue(g,{ref:"apexChart",key:e.chartKey,options:e.chartOptions,series:c.currentSeries,height:"400px"},null,8,["options","series"]))])])])]),y(I)])])])}const gt=ae(he,[["render",ft]]);export{gt as default};
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.