Sid Gifari File Manager
🏠 Root
/
home2
/
meumer25
/
public_html
/
wp-content
/
plugins
/
all-in-one-seo-pack
/
dist
/
Lite
/
assets
/
js
/
Editing: GoogleSearchPreview.114c7833.js
import{z as F,a as d,A as N,B as q,C as V}from"./index.317ad629.js";import{C as H}from"./constants.bc5863fe.js";import{S as M}from"./Caret.cd869c5d.js";import{u as U}from"./Url.c2dcf147.js";import"./translations.e71e2202.js";import{u as j}from"./runtime-dom.esm-bundler.dc49ee3e.js";import{_ as z}from"./_plugin-vue_export-helper.eefbdd86.js";import{_ as g,b as L,a as A}from"./default-i18n.65d58dd6.js";import{a6 as B,o,c as n,_ as s,$ as a,a7 as R,F as v,af as w,a4 as h,l as P,ae as I,ah as O,ai as D}from"./runtime-core.esm-bundler.ce5add0b.js";const l="all-in-one-seo-pack",f={setup(){const{decodeUrl:e}=U();return{decodeUrl:e,sanitizeString:F}},components:{SvgCaret:M},props:{focusKeyphrase:String,device:{type:String,default:"desktop"},favicon:String,hostname:{type:String,default(){const e=d();return e.aioseo.data.siteName||e.aioseo.urls.domain}},url:{type:String,default(){return d().aioseo.urls.home}},title:String,description:String,richResults:Object},data(){return{strings:{free:g("Free",l),rating:g("Rating",l),prosCons:g("Pros and cons include",l),viewFullList:g("View full list",l)}}},computed:{faq(){var t;const e=((t=this.richResults)==null?void 0:t.faq)||[];return Array.isArray(e)&&e.length?e:[]},reviewSnippet(){var i;const t={...{bestRating:null,ratingValue:null,reviewCount:null,ratingCount:null,priceCurrency:null,price:null,priceFrom:null,priceTo:null,prosConsNotes:[]},...((i=this.richResults)==null?void 0:i.reviewSnippet)||{}};if(Object.values(t).every(c=>c===null)||!t.reviewCount&&!t.ratingCount)return{};for(const[c,p]of Object.entries(t))if(["bestRating","ratingValue"].includes(c)&&(5<p||p===null))return{};return t.price=isNaN(parseFloat(t.price))?null:parseFloat(t.price).toFixed(2),t.priceFrom=isNaN(parseFloat(t.priceFrom))?null:parseFloat(t.priceFrom).toFixed(2),t.priceTo=isNaN(parseFloat(t.priceTo))?null:parseFloat(t.priceTo).toFixed(2),t},yellowStarsWidth(){return`${this.reviewSnippet.ratingValue*100/5}%`},urlBreadcrumbs(){try{const e=new URL(this.url),t=this.decodeUrl(e.pathname);let i=e.hostname+t.replace(/\/$/,"");return i=i.substring(0,50).trim()+(50<i.length?"...":""),`${e.protocol}//`+i.replaceAll("/"," › ")}catch{return""}},parseFavicon(){var i;const e=d();let t=`https://www.google.com/s2/favicons?sz=64&domain=${e.aioseo.urls.domain}`;try{t=new URL(this.favicon||"").href}catch{(i=e.aioseo.data)!=null&&i.isDev&&(t=`${e.aioseo.urls.home}/favicon.ico`)}return t},parseDescription(){const e=F(N(this.description.substring(0,160).trim()+(160<this.description.length?" ...":""),!1));if(!this.focusKeyphrase)return e;const t=this.focusKeyphrase.split(" ").map(q),i=new RegExp("\\b"+t.join("\\b|\\b")+"\\b","gi");return e.replace(i,"<strong>$&</strong>")}},methods:{getReviewSnippetPriceLabel(){if(parseFloat(this.reviewSnippet.price)===0&&!this.reviewSnippet.priceTo)return this.strings.free;if(this.reviewSnippet.priceCurrency){const e=H.find(t=>t.value===this.reviewSnippet.priceCurrency)||{};return this.reviewSnippet.priceFrom&&this.reviewSnippet.priceTo?`${e==null?void 0:e.symbol}${this.reviewSnippet.priceFrom} - ${e==null?void 0:e.symbol}${this.reviewSnippet.priceTo}`:`${e==null?void 0:e.symbol}${this.reviewSnippet.price}`}return`$${this.reviewSnippet.price}`},getReviewSnippetCountLabel(){if(this.device==="desktop"){const e=this.reviewSnippet.ratingCount||this.reviewSnippet.reviewCount,t=this.reviewSnippet.ratingCount?L("vote","votes",e,l):L("review","reviews",e,l);return A(g("%1$s %2$s",l),e,t)}return`(${this.reviewSnippet.ratingCount||this.reviewSnippet.reviewCount})`},truncate:V}},k=()=>{j(e=>({"2e47ee92":e.yellowStarsWidth}))},x=f.setup;f.setup=x?(e,t)=>(k(),x(e,t)):k;const m=e=>(O("data-v-8ea5ae53"),e=e(),D(),e),E={class:"aioseo-google-search-preview__main"},K={class:"aioseo-google-search-preview__favicon"},W={class:"favicon-wrapper"},G=["src"],Y={class:"aioseo-google-search-preview__location"},J={class:"hostname text-truncate"},Q=["innerHTML"],X={class:"aioseo-google-search-preview__title"},Z=["innerHTML"],$={key:0,class:"aioseo-google-search-preview__pros-cons"},ee={class:"aioseo-google-search-preview__pros-cons__description"},te=m(()=>s("span",null," ",-1)),se=m(()=>s("span",{class:"bullet"},null,-1)),ie={class:"aioseo-google-search-preview__pros-cons__view-full-list"},re={key:1,class:"aioseo-google-search-preview__review-snippet"},oe=m(()=>s("div",{class:"aioseo-google-search-preview__review-snippet__stars"},[s("div")],-1)),ne={class:"aioseo-google-search-preview__review-snippet__rating"},ae={class:"aioseo-google-search-preview__review-snippet__count bullet"},ce={key:0,class:"aioseo-google-search-preview__review-snippet__price bullet"},le={key:2,class:"aioseo-google-search-preview__anchor"},pe={class:"aioseo-google-search-preview__anchor__link"},ue={key:0,class:"aioseo-google-search-preview__anchor__bullet"},_e={key:3,class:"aioseo-google-search-preview__faq"},he={class:"aioseo-google-search-preview__faq__question",role:"button"},ge=["innerHTML"],ve=["innerHTML"];function de(e,t,i,c,p,r){var S,y,C,b;const T=B("svg-caret");return o(),n("div",{class:I(["aioseo-google-search-preview",`aioseo-google-search-preview--${i.device}`])},[s("div",E,[s("div",K,[s("div",W,[s("img",{src:r.parseFavicon,alt:"Favicon",loading:"lazy",decoding:"async",height:"18",width:"18"},null,8,G)])]),s("div",Y,[s("div",J,a(i.hostname.replace(/^(m|www)\./,"")),1),s("div",{class:"url text-truncate",innerHTML:r.urlBreadcrumbs},null,8,Q)]),s("div",X,a(i.title.substring(0,70).trim()+(i.title.length>70?" ...":"")),1),s("div",{class:"aioseo-google-search-preview__description",innerHTML:r.parseDescription},null,8,Z)]),(S=r.reviewSnippet.prosConsNotes||[])!=null&&S.length?(o(),n("div",$,[R(a(p.strings.prosCons)+": ",1),(o(!0),n(v,null,w(r.reviewSnippet.prosConsNotes.slice(0,10),(u,_)=>(o(),n(v,{key:`pros-cons-${_}`},[s("span",ee,a(u),1),te,se],64))),128)),s("span",ie,a(p.strings.viewFullList),1)])):h("",!0),Object.values(r.reviewSnippet).length?(o(),n("div",re,[oe,s("div",ne,[s("span",null,a(p.strings.rating)+":",1),R(" "+a(parseFloat(r.reviewSnippet.ratingValue).toFixed(2)),1)]),s("div",ae,a(r.getReviewSnippetCountLabel()),1),((y=r.reviewSnippet)==null?void 0:y.price)!==null?(o(),n("div",ce,a(r.getReviewSnippetPriceLabel()),1)):h("",!0)])):h("",!0),(b=(C=i.richResults)==null?void 0:C.anchorLinks)!=null&&b.length?(o(),n("div",le,[(o(!0),n(v,null,w(i.richResults.anchorLinks,(u,_)=>(o(),n(v,{key:`anchor-${_}`},[s("span",pe,a(r.truncate(u,30)),1),_!==i.richResults.anchorLinks.length-1?(o(),n("span",ue," • ")):h("",!0)],64))),128))])):h("",!0),Object.values(r.faq).length?(o(),n("div",_e,[(o(!0),n(v,null,w(r.faq.slice(0,3),(u,_)=>(o(),n("details",{key:`faq-${_}`,class:"aioseo-google-search-preview__faq__container"},[s("summary",he,[s("span",{class:"text-truncate",innerHTML:r.truncate(c.sanitizeString(u.question),60)},null,8,ge),P(T,{width:"20"})]),s("span",{class:"aioseo-google-search-preview__faq__answer",innerHTML:c.sanitizeString(u.answer)},null,8,ve)]))),128))])):h("",!0)],2)}const Re=z(f,[["render",de],["__scopeId","data-v-8ea5ae53"]]);export{Re as C};
Save
Cancel