HEX
Server: Apache/2.4.6 (CentOS) OpenSSL/1.0.2k-fips PHP/7.4.30
System: Linux iZj6c1151k3ad370bosnmsZ 3.10.0-1160.76.1.el7.x86_64 #1 SMP Wed Aug 10 16:21:17 UTC 2022 x86_64
User: root (0)
PHP: 7.4.30
Disabled: NONE
Upload Files
File: /var/www/html/amberconcept/wp-content/plugins/jetpack/_inc/build/likes/queuehandler.min.js
/* Do not modify this file directly. It is compiled from other files. */
/* global wpcom_reblog */
var jetpackLikesWidgetBatch=[],jetpackLikesMasterReady=!1,jetpackLikesLookAhead=2e3,jetpackCommentLikesLoadedWidgets=[],jetpackLikesDocReadyPromise=new Promise(e=>{"loading"!==document.readyState?e():window.addEventListener("DOMContentLoaded",()=>e())});function JetpackLikesPostMessage(e,t){if("string"==typeof e)try{e=JSON.parse(e)}catch(e){return}if(t&&"function"==typeof t.postMessage)try{t.postMessage(JSON.stringify({type:"likesMessage",data:e}),"*")}catch(e){return}}function JetpackLikesBatchHandler(){const e=[];document.querySelectorAll("div.jetpack-likes-widget-unloaded").forEach(t=>{if(!(jetpackLikesWidgetBatch.indexOf(t.id)>-1)&&jetpackIsScrolledIntoView(t)){jetpackLikesWidgetBatch.push(t.id);var i,a=/like-(post|comment)-wrapper-(\d+)-(\d+)-(\w+)/.exec(t.id);a&&5===a.length&&(i={blog_id:a[2],width:t.width},"post"===a[1]?i.post_id=a[3]:"comment"===a[1]&&(i.comment_id=a[3]),i.obj_id=a[4],e.push(i))}}),e.length>0&&JetpackLikesPostMessage({event:"initialBatch",requests:e},window.frames["likes-master"])}function JetpackLikesMessageListener(e){let t=e&&e.data;if("string"==typeof t)try{t=JSON.parse(t)}catch(e){return}const i=t&&t.type,a=t&&t.data;if("likesMessage"!==i||void 0===a.event)return;if("https://widgets.wp.com"===e.origin)switch(a.event){case"masterReady":jetpackLikesDocReadyPromise.then(()=>{jetpackLikesMasterReady=!0;const e={event:"injectStyles"},t=document.querySelector(".sd-text-color"),i=document.querySelector(".sd-link-color"),a=t&&getComputedStyle(t)||{},o=i&&getComputedStyle(i)||{};if(document.querySelectorAll("iframe.admin-bar-likes-widget").length>0){JetpackLikesPostMessage({event:"adminBarEnabled"},window.frames["likes-master"]);const t=document.querySelector("#wpadminbar .quicklinks li#wp-admin-bar-wpl-like > a"),i=document.querySelector("#wpadminbar");e.adminBarStyles={background:t&&getComputedStyle(t).background,isRtl:i&&"rtl"===getComputedStyle(i).direction}}document.body.classList.contains("single")&&JetpackLikesPostMessage({event:"reblogsEnabled"},window.frames["likes-master"]),e.textStyles={color:a.color,fontFamily:a["font-family"],fontSize:a["font-size"],direction:a.direction,fontWeight:a["font-weight"],fontStyle:a["font-style"],textDecoration:a["text-decoration"]},e.linkStyles={color:o.color,fontFamily:o["font-family"],fontSize:o["font-size"],textDecoration:o["text-decoration"],fontWeight:o["font-weight"],fontStyle:o["font-style"]},JetpackLikesPostMessage(e,window.frames["likes-master"]),JetpackLikesBatchHandler()});break;case"showLikeWidget":case"showCommentLikeWidget":{const e=document.querySelector(`#${a.id} .likes-widget-placeholder`);e&&(e.style.display="none");break}case"killCommentLikes":document.querySelectorAll(".jetpack-comment-likes-widget-wrapper").forEach(e=>e.remove());break;case"clickReblogFlair":wpcom_reblog&&"function"==typeof wpcom_reblog.toggle_reblog_box_flair&&wpcom_reblog.toggle_reblog_box_flair(a.obj_id);break;case"showOtherGravatars":{const e=document.querySelector("#likes-other-gravatars");if(!e)break;const t=e.querySelector("ul");e.style.display="none",t.innerHTML="",e.querySelectorAll(".likes-text span").forEach(e=>e.textContent=a.total),(a.likers||[]).forEach(e=>{if("http"!==e.profile_URL.substr(0,4))return;const i=document.createElement("li");i.innerHTML=`\n\t\t\t\t\t<a href="${encodeURI(e.profile_URL)}" rel="nofollow" target="_parent" class="wpl-liker">\n\t\t\t\t\t\t<img src="${encodeURI(e.avatar_URL)}"\n\t\t\t\t\t\t\talt=""\n\t\t\t\t\t\t\tstyle="width: 30px; height: 30px; padding-right: 3px;" />\n\t\t\t\t\t</a>\n\t\t\t\t`,t.append(i),i.classList.add(e.css_class),i.querySelector("img").alt=e.name});const i=document.querySelector(`*[name='${a.parent}']`),o=i.getBoundingClientRect(),s=i.ownerDocument.defaultView,n={top:o.top+s.pageYOffset,left:o.left+s.pageXOffset};e.style.left=n.left+a.position.left-10+"px",e.style.top=n.top+a.position.top-33+"px";const l=Math.floor(a.width/37);let c=37*Math.ceil(a.likers.length/l)+13;c>204&&(c=204);const d=37*l-7;e.style.height=c+"px",e.style.width=d+"px";const r=37*l;t.style.width=r+"px",e.style.display="block";const k=t.offsetWidth-t.clientWidth;k>0&&(e.style.width=d+k+"px",t.style.width=r+k+"px")}}}function JetpackLikesWidgetQueueHandler(){var e;if(jetpackLikesMasterReady){jetpackUnloadScrolledOutWidgets();var t=jetpackGetUnloadedWidgetsInView();t.length>0&&JetpackLikesBatchHandler();for(var i=0,a=t.length;i<=a-1;i++)(e=t[i].id)&&jetpackLoadLikeWidgetIframe(e)}else setTimeout(JetpackLikesWidgetQueueHandler,500)}function jetpackLoadLikeWidgetIframe(e){if(void 0===e)return;const t=document.querySelector("#"+e);t.querySelectorAll("iframe").forEach(e=>e.remove());const i=t.querySelector(".likes-widget-placeholder");if(i&&i.classList.contains("post-likes-widget-placeholder")){const e=document.createElement("iframe");e.classList.add("post-likes-widget","jetpack-likes-widget"),e.name=t.dataset.name,e.src=t.dataset.src,e.height="55px",e.width="100%",e.frameBorder="0",e.scrolling="no",e.title=t.dataset.title,i.after(e)}if(i.classList.contains("comment-likes-widget-placeholder")){const e=document.createElement("iframe");e.class="comment-likes-widget-frame jetpack-likes-widget-frame",e.name=t.dataset.name,e.src=t.dataset.src,e.height="18px",e.width="100%",e.frameBorder="0",e.scrolling="no",t.querySelector(".comment-like-feedback").after(e),jetpackCommentLikesLoadedWidgets.push(e)}t.classList.remove("jetpack-likes-widget-unloaded"),t.classList.add("jetpack-likes-widget-loading"),t.querySelector("iframe").addEventListener("load",e=>{JetpackLikesPostMessage({event:"loadLikeWidget",name:e.target.name,width:e.target.width},window.frames["likes-master"]),t.classList.remove("jetpack-likes-widget-loading"),t.classList.add("jetpack-likes-widget-loaded")})}function jetpackGetUnloadedWidgetsInView(){return[...document.querySelectorAll("div.jetpack-likes-widget-unloaded")].filter(e=>jetpackIsScrolledIntoView(e))}function jetpackIsScrolledIntoView(e){const t=e.getBoundingClientRect().top,i=e.getBoundingClientRect().bottom;return t+jetpackLikesLookAhead>=0&&i<=window.innerHeight+jetpackLikesLookAhead}function jetpackUnloadScrolledOutWidgets(){for(let e=jetpackCommentLikesLoadedWidgets.length-1;e>=0;e--){const t=jetpackCommentLikesLoadedWidgets[e];if(!jetpackIsScrolledIntoView(t)){const i=t&&t.parentElement&&t.parentElement.parentElement;i.classList.remove("jetpack-likes-widget-loaded"),i.classList.remove("jetpack-likes-widget-loading"),i.classList.add("jetpack-likes-widget-unloaded"),i.querySelectorAll(".comment-likes-widget-placeholder").forEach(e=>e.style.display="block"),jetpackCommentLikesLoadedWidgets.splice(e,1),t.remove()}}}window.addEventListener("message",JetpackLikesMessageListener),document.addEventListener("click",e=>{const t=document.querySelector("#likes-other-gravatars");t&&!t.contains(e.target)&&(t.style.display="none")});var jetpackWidgetsDelayedExec=function(e,t){var i;return function(){clearTimeout(i),i=setTimeout(t,e)}},jetpackOnScrollStopped=jetpackWidgetsDelayedExec(250,JetpackLikesWidgetQueueHandler);JetpackLikesWidgetQueueHandler(),window.addEventListener("scroll",jetpackOnScrollStopped,!0);