관리-도구
편집 파일: Statistic.cmciac16.js
import{b as I}from"./_baseClone.n1l9l19s.js";import{d as L}from"./vue-router.eypfdvl5.js";import{u as x,m as P,i as T,v as g}from"./index.ba51ghj9.js";import{g as _,o as l,c as w,G as m,a as h,v as k,k as v,b as y,x as D,t as R,l as C,C as V}from"./runtime-dom.esm-bundler.h3clfjuw.js";import{D as M}from"./datetime.hyfm7zez.js";import{n as c}from"./numbers.busvl4mt.js";import"./translations.b896ab1m.js";import{a as i,_ as p,b as u}from"./default-i18n.hohxoesu.js";import{C as A}from"./Tooltip.i4md1nj9.js";import{_ as N}from"./_plugin-vue_export-helper.oebm7xum.js";var E=4;function nt(e){return I(e,E)}const it=(e={})=>{const{processFilterTable:o,showUpsell:t}=e,a=_("clicks"),d=_("desc"),s=_(10),n=L(),S=f=>{n.push({name:"post-detail",query:{postId:f.objectId,previousRoute:n.currentRoute.value.name}})},B=x(),F=P();return{openPostDetail:S,orderBy:a,orderDir:d,processFilter:f=>{t.value=(!B.isPro||F.isUnlicensed)&&f.slug!=="all",o(f)},resultsPerPage:s}},O="all-in-one-seo-pack",U=()=>({formatStatistic:(o,t)=>o==="ctr"?`${Math.abs(t)}%`:o==="position"?Math.abs(t).toFixed(0):o==="decay"?i(p("%1$s Points",O),c.numberFormat(t,0)):o==="decayPercent"?`${t}%`:(t=Math.abs(t),c.compactNumber(t))}),H={props:{direction:{type:String,default(){return"down"}}}},Z=h("path",{d:"M0.25 5.07812L5.25 0.078125L10.25 5.07812H0.25Z",fill:"currentColor"},null,-1),b=[Z];function q(e,o,t,a,d,s){return l(),w("svg",{viewBox:"0 0 11 6",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:m(["aioseo-caret-solid","aioseo-caret-solid--"+t.direction])},b,2)}const G=N(H,[["render",q]]),r="all-in-one-seo-pack",j={setup(){const{formatStatistic:e}=U();return{formatStatistic:e,rootStore:x(),searchStatisticsStore:T()}},components:{CoreTooltip:A,SvgCaretSolid:G},props:{total:[Number,String],difference:[Number,String],showCurrent:{type:Boolean,default(){return!0}},showDifference:{type:Boolean,default(){return!0}},showZeroValues:{type:Boolean,default(){return!1}},type:{type:String,required:!0},tooltipOffset:{type:String,default(){return"0,0"}}},computed:{differenceRounded(){return this.type==="position"?parseInt(Math.round(this.difference))*-1:this.difference}},methods:{compareDescription(e,o){const t=o==="up"?p("Up",r):p("Down",r),a=this.searchStatisticsStore.shouldShowSampleReports?M.now().minus({days:14}).toFormat("yyyy-MM-dd"):this.searchStatisticsStore.range.compareStart,d=this.searchStatisticsStore.shouldShowSampleReports?M.now().minus({days:7}).toFormat("yyyy-MM-dd"):this.searchStatisticsStore.range.compareEnd,s=new Date(`${a} 00:00:00`),n=new Date(`${d} 00:00:00`);return i(p("%1$s %2$s %3$s compared to the previous period (%4$s - %5$s)",r),t,"<strong>"+this.points(e)+"</strong>",this.type==="position"?p("in search results",r):"","<strong>"+g(s,this.rootStore.aioseo.data.dateFormat)+"</strong>","<strong>"+g(n,this.rootStore.aioseo.data.dateFormat)+"</strong>")},points(e){switch(this.type){case"clicks":return i(u("%s click","%s clicks",parseInt(this.formatStatistic("clicks",e)),r),c.compactNumber(e));case"impressions":return i(u("%s impression","%s impressions",parseInt(this.formatStatistic("impressions",e)),r),c.compactNumber(e));case"ctr":return this.formatStatistic("ctr",e);case"position":return e=parseInt(Math.round(e)),i(u("%s spot","%s spots",parseInt(this.formatStatistic("position",e)),r),e);case"keywords":return i(u("%s keyword","%s keywords",parseInt(this.formatStatistic("keywords",e)),r),c.compactNumber(e));case"decay":case"diffDecay":return i(u("%s point","%s points",parseInt(this.formatStatistic("keywords",e)),r),c.compactNumber(e));default:return""}}}},z={key:0},Y=["innerHTML"];function J(e,o,t,a,d,s){const n=k("svg-caret-solid"),S=k("core-tooltip");return l(),w("div",{class:m(["statistic",[{"no-margin":!t.showCurrent},`statistic-${t.type}`]])},[t.showCurrent&&(t.total||t.showZeroValues)?(l(),w("span",z,[h("span",{class:m(["statistic-direction",{up:0<t.total,down:0>t.total}])},[t.total!==0&&t.type==="decayPercent"?(l(),v(n,{key:0,direction:0<t.total?"up":"down"},null,8,["direction"])):y("",!0),D(" "+R(a.formatStatistic(t.type,t.total)),1)],2)])):y("",!0),t.showDifference&&s.differenceRounded!==0?(l(),v(S,{key:1,offset:t.tooltipOffset},{tooltip:C(()=>[h("span",{innerHTML:s.compareDescription(Math.abs(s.differenceRounded),0<s.differenceRounded?"up":"down")},null,8,Y)]),default:C(()=>[h("span",{class:m(["statistic-direction",{up:0<s.differenceRounded,down:0>=s.differenceRounded}])},[V(n,{direction:0<s.differenceRounded?"up":"down"},null,8,["direction"]),D(" "+R(a.formatStatistic(t.type,s.differenceRounded)),1)],2)]),_:1},8,["offset"])):y("",!0)],2)}const ct=N(j,[["render",J]]);export{ct as S,it as a,nt as c,U as u};