1!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.JetpackScriptDataModule=t():e.JetpackScriptDataModule=t()}(globalThis,()=>(()=>{"use strict";var e={729(e,t,r){r.d(t,{$8:()=>n.$8,IT:()=>n.IT,KS:()=>n.KS,L2:()=>n.L2,Sy:()=>n.Sy,au:()=>n.au,d_:()=>n.d_,e5:()=>n.e5,hT:()=>n.hT,lI:()=>n.lI,mH:()=>n.mH,oQ:()=>n.oQ,sV:()=>n.sV});var n=r(336)},336(e,t,r){function n(){return window.JetpackScriptData}function o(){return n()?.site}function i(e=""){return`${n()?.site.admin_url}${e}`}function a(e=""){return i(`admin.php?page=jetpack${e}`)}function u(e=""){return i(`admin.php?page=my-jetpack${e}`)}function p(){return n()?.site.plan?.features?.active??[]}function c(e){return-1!==p().indexOf(e)}function s(){return"wpcom"===n()?.site?.host}function f(){return"woa"===n()?.site?.host}function d(){return n()?.site?.is_wpcom_platform}function l(){return"unknown"===n()?.site?.host}function S(){return s()?"simple":f()?"woa":"jetpack"}function m(e){return n()?.user.current_user.capabilities[e]}r.d(t,{$8:()=>d,IT:()=>c,KS:()=>S,L2:()=>l,Sy:()=>s,au:()=>n,d_:()=>m,e5:()=>u,hT:()=>i,lI:()=>f,mH:()=>p,oQ:()=>a,sV:()=>o})}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var i=t[n]={exports:{}};return e[n](i,i.exports,r),i.exports}r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var n={};r.r(n),r.d(n,{currentUserCan:()=>o.d_,getActiveFeatures:()=>o.mH,getAdminUrl:()=>o.hT,getJetpackAdminPageUrl:()=>o.oQ,getMyJetpackUrl:()=>o.e5,getScriptData:()=>o.au,getSiteData:()=>o.sV,getSiteType:()=>o.KS,isJetpackSelfHostedSite:()=>o.L2,isSimpleSite:()=>o.Sy,isWoASite:()=>o.lI,isWpcomPlatformSite:()=>o.$8,siteHasFeature:()=>o.IT});var o=r(729);return n})());; 2!function(){"use strict";var e,t={noop:function(){},texturize:function(e){return(e=(e=(e=(e+="").replace(/'/g,"’").replace(/'/g,"’")).replace(/"/g,"”").replace(/"/g,"”").replace(/"/g,"”").replace(/[\u201D]/g,"”")).replace(/([\w]+)=&#[\d]+;(.+?)&#[\d]+;/g,'$1="$2"')).trim()},applyReplacements:function(e,t){if(e)return t?e.replace(/{(\d+)}/g,function(e,r){return void 0!==t[r]?t[r]:e}):e},getBackgroundImage:function(e){var t=document.createElement("canvas"),r=t.getContext&&t.getContext("2d");if(e){r.filter="blur(20px) ",r.drawImage(e,0,0);var o=t.toDataURL("image/png");return t=null,o}}},r=function(){function e(e,t){return Element.prototype.matches?e.matches(t):Element.prototype.msMatchesSelector?e.msMatchesSelector(t):void 0}function r(e,t,r,o){if(!e)return o();e.jpCarouselCancelFade&&e.jpCarouselCancelFade(),e.classList.remove("jp-carousel-fade"),e.style.removeProperty("display"),e.style.opacity=t,e.style.pointerEvents="none",e.offsetWidth,e.classList.add("jp-carousel-fade"),e.style.opacity=r;var a=1e3*parseFloat(getComputedStyle(e).transitionDuration)||0,i=setTimeout(function(){e.jpCarouselCancelFade=null,e.style.removeProperty("pointer-events"),o()},a+50);e.jpCarouselCancelFade=function(){clearTimeout(i),e.jpCarouselCancelFade=null}}return{closest:function(t,r){if(t.closest)return t.closest(r);var o=t;do{if(e(o,r))return o;o=o.parentElement||o.parentNode}while(null!==o&&1===o.nodeType);return null},matches:e,hide:function(e){e&&(e.style.display="none")},show:function(e){e&&(e.style.display="block")},fadeIn:function(e,o){r(e,0,1,o=o||t.noop)},fadeOut:function(e,o){o=o||t.noop,r(e,1,0,function(){e&&(e.style.display="none"),o()})},scrollToElement:function(e,t,r){if(!e||!t)return r?r():void 0;var o=t.querySelector(".jp-carousel-info-extra");o&&(o.style.minHeight=window.innerHeight-64+"px");var a=!0,i=Date.now(),n=t.scrollTop,l=Math.max(0,e.offsetTop-Math.max(0,window.innerHeight-function(e){var t=e.querySelector(".jp-carousel-info-footer"),r=e.querySelector(".jp-carousel-info-extra"),o=e.querySelector(".jp-carousel-info-content-wrapper");if(t&&r&&o){var a=window.getComputedStyle(r),i=parseInt(a.paddingTop,10)+parseInt(a.paddingBottom,10);return i=isNaN(i)?0:i,o.offsetHeight+t.offsetHeight+i}return 0}(t)))-t.scrollTop;function s(){a=!1}
2l=Math.min(l,t.scrollHeight-window.innerHeight),t.addEventListener("wheel",s),function e(){var c,u=Date.now(),d=(c=(u-i)/300)<.5?2*c*c:1-Math.pow(-2*c+2,2)/2,p=(d=d>1?1:d)*l;if(t.scrollTop=n+p,u<=i+300&&a)return requestAnimationFrame(e);r&&r(),o&&(o.style.minHeight=""),a=!1,t.removeEventListener("wheel",s)}()},getJSONAttribute:function(e,t){if(e&&e.hasAttribute(t))try{return JSON.parse(e.getAttribute(t))}catch{return}},convertToPlainText:function(e){var t=document.createElement("div");return t.textContent=e,t.innerHTML},stripHTML:function(e){var t=document.createElement("div");return t.innerHTML=e.replace(/<[^>]*>?/gm,""),t.textContent},emitEvent:function(e,t,r){var o;try{o=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:r||null})}catch{(o=document.createEvent("CustomEvent")).initCustomEvent(t,!0,!0,r||null)}e.dispatchEvent(o)},isTouch:function(){return"ontouchstart"in window||window.DocumentTouch&&document instanceof DocumentTouch}}}();function o(){var o,a,i,n,l="",s=!1,c="div.gallery, div.tiled-gallery, ul.wp-block-gallery, ul.blocks-gallery-grid, figure.wp-block-gallery.has-nested-images, div.wp-block-jetpack-tiled-gallery, a.single-image-gallery",u=".gallery-item, .tiled-gallery-item, .blocks-gallery-item, .tiled-gallery__item",d=u+", .wp-block-image",p={},m="undefined"!=typeof wpcom&&wpcom.carousel&&wpcom.carousel.stat?wpcom.carousel.stat:t.noop,g="undefined"!=typeof wpcom&&wpcom.carousel&&wpcom.carousel.pageview?wpcom.carousel.pageview:t.noop;function h(t){if(!s)switch(t.which){case 38:t.preventDefault(),p.overlay.scrollTop-=100;break;case 40:t.preventDefault(),p.overlay.scrollTop+=100;break;case 39:t.preventDefault(),e.slideNext();break;case 37:case 8:t.preventDefault(),e.slidePrev();break;case 27:t.preventDefault(),x()}}function f(){s=!0}function v(){s=!1}function y(e){e.role="button",e.tabIndex=0,e.ariaLabel=jetpackCarouselStrings.image_label}function w(){p.overlay||(p.overlay=document.querySelector(".jp-carousel-overlay"),p.container=p.overlay.querySelector(".jp-carousel-wrap"),p.gallery=p.container.querySelector(".jp-carousel"),p.info=p.overlay.querySelector(".jp-carousel-info"),p.caption=p.info.querySelector(".jp-carousel-caption"),p.commentField=p.overlay.querySelector("#jp-carousel-comment-form-comment-field"),p.emailField=p.overlay.querySelector("#jp-carousel-comment-form-email-field"),p.authorField=p.overlay.querySelector("#jp-carousel-comment-form-author-field"),p.urlField=p.overlay.querySelector("#jp-carousel-comment-form-url-field"),window.innerWidth<=760&&Math.round(window.innerWidth/760*110)<40&&r.isTouch(),[p.commentField,p.emailField,p.authorField,p.urlField].forEach(function(e){e&&(e.addEventListener("focus",f),e.addEventListener("blur",v))}),p.overlay.addEventListener("click",function(e){var t,o,a=e.target,i=!!r.closest(a,".jp-carousel-close-hint"),n=!!window.matchMedia("(max-device-width: 760px)").matches;a===p.overlay?n||x():i?x():a.classList.contains("jp-carousel-image-download")?m("download_original_click"):a.classList.contains("jp-carousel-comment-login")?(t=p.currentSlide,o=t?t.attrs.attachmentId:"0",window.location.href=jetpackCarouselStrings.login_url+"%23jp-carousel-"+o):r.closest(a,"#jp-carousel-comment-form-container")?function(e){var t=e.target,o=r.getJSONAttribute(p.container,"data-carousel-extra")||{},a=p.currentSlide.attrs.attachmentId,i=document.querySelector("#jp-carousel-comment-form-submit-and-info-wrapper"),n=document.querySelector("#jp-carousel-comment-form-spinner"),l=document.querySelector("#jp-carousel-comment-form-button-submit"),s=document.querySelector("#jp-carousel-comment-form");if(p.commentField&&p.commentField.getAttribute("id")===t.getAttribute("id"))f(),r.show(i);else if(r.matches(t,'input[type="submit"]')){e.preventDefault(),e.stopPropagation(),r.show(n),s.classList.add("jp-carousel-is-disabled");var c={action:"post_attachment_comment",nonce:jetpackCarouselStrings.nonce,blog_id:o.blog_id,id:a,comment:p.commentField.value};if(!c.comment.length)return void j(jetpackCarouselStrings.no_comment_text,!1);if(1!==Number(jetpackCarouselStrings.is_logged_in)&&(c.email=p.emailField.value,c.author=p.authorField.value,c.url=p.urlField.value,1===Number(jetpackCarouselStrings.require_name_email))){if(!c.email.length||!c.email.match("@"))return void j(jetpackCarouselStrings.no_comment_email,!1);if(!c.author.length)return void j(jetpackCarouselStrings.no_comment_author,!1)}var u=new XMLHttpRequest;u.open("POST",jetpackCarouselStrings.ajaxurl,!0),u.setRequestHeader("X-Requested-With","XMLHttpRequest"),u.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8"),u.onreadystatechange=function(){if(this.readyState===XMLHttpRequest.DONE&&this.status>=200&&this.status<300){var e;try{e=JSON.parse(this.response)}catch{return void j(jetpackCarouselStrings.comment_post_error,!1)}"approved"===e.comment_status?j(jetpackCarouselStrings.comment_approved,!0):"unapproved"===e.comment_status?j(jetpackCarouselStrings.comment_unapproved,!0):j(jetpackCarouselStrings.comment_post_error,!1),H(),q(a),l.value=jetpackCarouselStrings.post_comment,r.hide(n),s.classList.remove("jp-carousel-is-disabled")}else j(jetpackCarouselStrings.comment_post_error,!1)};var d=[];for(var m in c)if(m){var g=encodeURIComponent(m)+"="+encodeURIComponent(c[m]);d.push(g.replace(/%20/g,"+"))}var h=d.join("&");u.send(h)}}(e):(r.closest(a,".jp-carousel-photo-icons-container")||a.classList.contains("jp-carousel-photo-title"))&&function(e){e.preventDefault();var t=e.target,o=p.info.querySelector(".jp-carousel-info-extra"),a=p.info.querySelector(".jp-carousel-image-meta"),i=p.info.querySelector(".jp-carousel-comments-wrapper"),n=p.info.querySelector(".jp-carousel-icon-info"),l=p.info.querySelector(".jp-carousel-icon-comments");function s(){l&&l.classList.remove("jp-carousel-selected"),n.classList.toggle("jp-carousel-selected"),i&&i.classList.remove("jp-carousel-show"),a&&(a.classList.toggle("jp-carousel-show"),a.classList.contains("jp-carousel-show")?o.classList.add("jp-carousel-show"):o.classList.remove("jp-carousel-show"))}function c(){n&&n.classList.remove("jp-carousel-selected"),l.classList.toggle("jp-carousel-selected"),a&&a.classList.remove("jp-carousel-show"),i&&(i.classList.toggle("jp-carousel-show"),i.classList.contains("jp-carousel-show")?o.classList.add("jp-carousel-show"):o.classList.remove("jp-carousel-show"))}(r.closest(t,".jp-carousel-icon-info")||t.classList.contains("jp-carousel-photo-title"))&&(a&&a.classList.contains("jp-carousel-show")?r.scrollToElement(p.overlay,p.overlay,s):(s(),r.scrollToElement(p.info,p.overlay))),r.closest(t,".jp-carousel-icon-comments")&&(i&&i.classList.contains("jp-carousel-show")?r.scrollToElement(p.overlay,p.overlay,c):(c(),r.scrollToElement(p.info,p.overlay)))}(e)}),window.addEventListener("keydown",h),p.overlay.addEventListener("jp_carousel.afterOpen",function(){v(),p.slides.length<=1||(p.slides.length<=5?r.show(p.info.querySelector(".jp-swiper-pagination")):r.show(p.info.querySelector(".jp-carousel-pagination")))}),p.overlay.addEventListener("jp_carousel.beforeClose",function(){f(),document.documentElement.style.removeProperty("height"),e&&e.enable(),r.hide(p.info.querySelector(".jp-swiper-pagination")),r.hide(p.info.querySelector(".jp-carousel-pagination"))}),p.overlay.addEventListener("jp_carousel.afterClose",function(){window.history.pushState?history.pushState("",document.title,window.location.pathname+window.location.search):window.location.href="",l="",p.isOpen=!1}),p.overlay.addEventListener("touchstart",function(e){e.touches.length>1&&e.preventDefault()}))}function j(e,t){var o=p.overlay.querySelector("#jp-carousel-comment-post-results"),a="jp-carousel-comment-post-"+(t?"success":"error");o.innerHTML='<span class="'+a+'">'+e+"</span>",r.hide(p.overlay.querySelector("#jp-carousel-comment-form-spinner")),p.overlay.querySelector("#jp-carousel-comment-form").classList.remove("jp-carousel-is-disabled"),r.show(o)}function b(){var e=document.querySelectorAll("a img[data-attachment-id]");Array.prototype.forEach.call(e,function(e){var t=e.parentElement,o=t.parentElement;if(!o.classList.contains("gallery-icon")&&!r.closest(o,u)&&t.hasAttribute("href")){var a=!1;t.getAttribute("href").split("?")[0]===e.getAttribute("data-orig-file").split("?")[0]&&1===Number(jetpackCarouselStrings.single_image_gallery_media_file)&&(a=!0),t.getAttribute("href")===e.getAttribute("data-permalink")&&(a=!0),a&&(y(e),t.classList.add("single-image-gallery"),t.setAttribute("data-carousel-extra",JSON.stringify({blog_id:Number(jetpackCarouselStrings.blog_id)})))}})}function S(t,r){p.isOpen?(L(r),e.slideTo(r+1)):M(t,{startIndex:r})}function L(e){(!e||e<0||e>p.slides.length)&&(e=0),p.currentSlide=p.slides[e];var o,a,i=p.currentSlide,n=i.attrs.attachmentId;A(p.slides[e]),function(e){var t=[],r=p.slides.length;if(r>1){var o=e>0?e-1:r-1;t.push(o);var a=e<r-1?e+1:0;t.push(a)}t.forEach(function(e){var t=p.slides[e];t&&(A(t),1!==Number(jetpackCarouselStrings.display_background_image)||t.backgroundImage||_(t))})}(e),1!==Number(jetpackCarouselStrings.display_background_image)||p.slides[e].backgroundImage||_(p.slides[e]),r.hide(p.caption),function(e){var t,o,a,i,n,l,s;if(i=p.overlay.querySelector(".jp-carousel-photo-caption"),n=p.overlay.querySelector(".jp-carousel-caption"),l=p.overlay.querySelector(".jp-carousel-photo-title"),s=p.overlay.querySelector(".jp-carousel-photo-description"),r.hide(i),r.hide(n),r.hide(l),r.hide(s),t=E(e.caption)||"",o=E(e.title)||"",a=E(e.desc)||"",(t||o||a)&&(t&&(i.innerHTML=t,n.innerHTML=t,r.show(i),r.show(n)),r.stripHTML(t)===r.stripHTML(o)&&(o=""),r.stripHTML(t)===r.stripHTML(a)&&(a=""),r.stripHTML(o)===r.stripHTML(a)&&(a=""),a&&(s.innerHTML=a,r.show(s),o||t||(i.textContent=r.stripHTML(a),r.show(i))),o)){var c=r.stripHTML(o);l.textContent=c,t||(i.textContent=c,n.textContent=c,r.show(i)),r.show(l)}}
2({caption:i.attrs.caption,title:i.attrs.title,desc:i.attrs.desc}),function(e){if(!e||1!==Number(jetpackCarouselStrings.display_exif))return!1;var t=p.info.querySelector(".jp-carousel-image-meta");if(!t)return!1;var r="";for(var o in e){var a=e[o],i=jetpackCarouselStrings.meta_data||[];if(0!==parseFloat(a)&&a.length&&-1!==i.indexOf(o)){switch(o){case"focal_length":a+="mm";break;case"shutter_speed":a=C(a);break;case"aperture":a="f/"+a}r+="<li><h5>"+jetpackCarouselStrings[o]+"</h5>"+a+"</li>"}}var n=t.querySelector("ul.jp-carousel-image-exif");if(""!==r){if(!n){(n=document.createElement("ul")).className="jp-carousel-image-exif";var l=t.querySelector(".jp-carousel-title-and-caption");l&&l.nextSibling?t.insertBefore(n,l.nextSibling):t.insertBefore(n,t.firstChild)}n.innerHTML=r,n.style.removeProperty("display")}else n&&n.parentNode.removeChild(n)}(p.slides[e].attrs.imageMeta),function(e){if(!e)return!1;var r,o=[e.attrs.origWidth,e.attrs.origHeight],a=document.createElement("a");a.href=e.attrs.src.replace(/\?.+$/,""),r=null!==a.hostname.match(/^i[\d]{1}\.wp\.com$/i)?a.href:e.attrs.origFile.replace(/\?.+$/,"");var i=p.info.querySelector(".jp-carousel-download-text"),n=p.info.querySelector(".jp-carousel-image-download");i.innerHTML=t.applyReplacements(jetpackCarouselStrings.download_original,o),n.setAttribute("href",r),n.style.removeProperty("display")}(i),1===Number(jetpackCarouselStrings.display_comments)&&(o=p.slides[e].attrs.commentsOpened,a=p.info.querySelector("#jp-carousel-comment-form-container"),1===parseInt(o,10)?r.fadeIn(a):r.fadeOut(a),q(n),r.hide(p.info.querySelector("#jp-carousel-comment-post-results")));var s=p.info.querySelector(".jp-carousel-pagination");if(s&&p.slides.length>5){var c=e+1;s.innerHTML="<span>"+c+" / "+p.slides.length+"</span>"}jetpackCarouselStrings.stats&&p.isOpen&&((new Image).src=document.location.protocol+"//pixel.wp.com/g.gif?"+jetpackCarouselStrings.stats+"&post="+encodeURIComponent(n)+"&rand="+Math.random()),p.isOpen&&g(n),l="#jp-carousel-"+n,window.location.hash=l}function x(){document.body.style.overflow=a,document.documentElement.style.overflow=i,H(),f(),r.emitEvent(p.overlay,"jp_carousel.beforeClose"),window.scrollTo(window.scrollX||window.pageXOffset||0,n||0),p.isOpen=!1,e.destroy(),p.slides=[],p.currentSlide=void 0,p.gallery.innerHTML="",r.fadeOut(p.overlay,function(){r.emitEvent(p.overlay,"jp_carousel.afterClose")})}function k(e){if("object"!=typeof e&&(e={}),void 0===e.origFile)return"";if(void 0===e.origWidth||void 0===e.maxWidth)return e.origFile;if(!e.largeFile)return e.origFile;var t=document.createElement("a");t.href=e.largeFile;var r=/^i[0-2]\.wp\.com$/i.test(t.hostname),o=function(e,t,r){var o,a=r?e.replace(/.*=([\d]+%2C[\d]+).*$/,"$1"):e.replace(/.*-([\d]+x[\d]+)\..+$/,"$1");return"9999"===(o=a!==e?r?a.split("%2C"):a.split("x"):[t,0])[0]&&(o[0]="0"),"9999"===o[1]&&(o[1]="0"),o}(e.largeFile,e.origWidth,r),a=parseInt(o[0],10),i=parseInt(o[1],10);if(e.origMaxWidth=e.maxWidth,e.origMaxHeight=e.maxHeight,void 0!==window.devicePixelRatio&&window.devicePixelRatio>1&&(e.maxWidth=e.maxWidth*window.devicePixelRatio,e.maxHeight=e.maxHeight*window.devicePixelRatio),a>=e.maxWidth||i>=e.maxHeight)return e.largeFile;if(r){if(-1===e.largeFile.lastIndexOf("?"))return e.largeFile;var n=function(e){var t;try{t=new URL(e)}catch(t){return e}var r=["quality","ssl","filter","brightness","contrast","colorize","smooth"],o=Array.from(t.searchParams.entries());return t.search="",o.forEach(([e,o])=>{r.includes(e)&&t.searchParams.append(e,o)}),t}(e.largeFile);return(e.origWidth>e.maxWidth||e.origHeight>e.maxHeight)&&(e.origMaxWidth=2*e.maxWidth,e.origMaxHeight=2*e.maxHeight,n.searchParams.set("fit",e.origMaxWidth+","+e.origMaxHeight)),n.toString()}return e.origFile}function C(e){return e>=1?Math.round(10*e)/10+"s":"1/"+Math.round(1/e)+"s"}function E(e){return!e.match(" ")&&e.match("_")?"":e}function q(e,t){var a=void 0===t,i=p.info.querySelector(".jp-carousel-icon-comments .jp-carousel-has-comments-indicator");if(i.classList.remove("jp-carousel-show"),clearInterval(o),e){(!t||t<1)&&(t=0);var n=p.info.querySelector(".jp-carousel-comments"),l=p.info.querySelector("#jp-carousel-comments-loading");r.show(l),a&&(r.hide(n),n.innerHTML="");var s=new XMLHttpRequest,c=jetpackCarouselStrings.ajaxurl+"?action=get_attachment_comments&nonce="+jetpackCarouselStrings.nonce+"&id="+e+"&offset="+t;s.open("GET",c),s.setRequestHeader("X-Requested-With","XMLHttpRequest");var u=function(){r.fadeIn(n),r.fadeOut(l)};s.onload=function(){if(p.currentSlide&&p.currentSlide.attrs.attachmentId===e){var c,d=s.status>=200&&s.status<300;try{c=JSON.parse(s.responseText)}catch{}if(!d||!c||!Array.isArray(c))return u();a&&(n.innerHTML="");for(var m=0;m<c.length;m++){var g=c[m],h=document.createElement("div");h.classList.add("jp-carousel-comment"),h.setAttribute("id","jp-carousel-comment-"+g.id),h.innerHTML='<div class="comment-gravatar">'+g.gravatar_markup+'</div><div class="comment-content"><div class="comment-author">'+g.author_markup+'</div><div class="comment-date">'+g.date_gmt+"</div>"+g.content+"</div>",n.appendChild(h),clearInterval(o),o=setInterval(function(){p.container.scrollTop+150>window.innerHeight&&(q(e,t+10),clearInterval(o))},300)}c.length>0&&(r.show(n),i.innerText=c.length,i.classList.add("jp-carousel-show")),r.hide(l)}},s.onerror=u,s.send()}}function A(e){var t=e.attrs,r=e.el.querySelector("img");if(!r.hasAttribute("data-loaded"))if(r.setAttribute("itemprop","image"),r.setAttribute("data-loaded",1),t.previewImage&&t.previewImage!==t.src){r.src=t.previewImage,r.style.filter="blur(8px)";var o=new window.Image;o.addEventListener("load",function(){r.src=t.src,r.style.filter=""},{once:!0}),o.addEventListener("error",function(){r.style.filter=""},{once:!0}),o.src=t.src}else r.src=t.src}function _(e){var t=e.attrs.originalElement;if(t)if(t.complete&&0!==t.naturalHeight)T(e,t);else{var r=function(){t.removeEventListener("error",o),T(e,t)},o=function(){t.removeEventListener("load",r)};t.addEventListener("load",r,{once:!0}),t.addEventListener("error",o,{once:!0})}}
2function T(e,r){var o=t.getBackgroundImage(r);o&&(e.backgroundImage=o,e.el.style.backgroundImage="url("+o+")",e.el.style.backgroundSize="cover",e.el.style.backgroundPosition="center")}function H(){p.commentField&&(p.commentField.value="")}function I(e,o){p.slides=[];var a={width:window.innerWidth,height:window.innerHeight-64};0!==o&&null!==e[o].getAttribute("data-gallery-src")&&((new Image).src=e[o].getAttribute("data-gallery-src")),Array.prototype.forEach.call(e,function(e,o){var i=r.closest(e,"a"),n=e.getAttribute("data-orig-file")||e.getAttribute("src-orig"),l=e.getAttribute("data-attachment-id")||e.getAttribute("data-id")||"0",s=document.querySelector('img[data-attachment-id="'+l+'"] + figcaption');s=s?s.innerHTML:e.getAttribute("data-image-caption");var c={originalElement:e,attachmentId:l,commentsOpened:e.getAttribute("data-comments-opened")||"0",imageMeta:r.getJSONAttribute(e,"data-image-meta")||{},title:e.getAttribute("data-image-title")||"",desc:e.getAttribute("data-image-description")||"",largeFile:e.getAttribute("data-large-file")||"",origFile:n||"",thumbSize:{width:e.naturalWidth,height:e.naturalHeight},caption:s||"",permalink:i&&i.getAttribute("href"),src:n||e.getAttribute("src")||""},u=r.closest(e,".tiled-gallery-item"),d=u&&u.querySelector(".tiled-gallery-caption"),m=d&&d.innerHTML;m&&(c.caption=m);var g=function(e){var t=e.getAttribute("data-orig-size")||"";if(t){var r=t.split(",");return{width:parseInt(r[0],10),height:parseInt(r[1],10)}}return{width:e.getAttribute("data-original-width")||e.getAttribute("width")||void 0,height:e.getAttribute("data-original-height")||e.getAttribute("height")||void 0}}(e);if(c.origWidth=g.width||c.thumbSize.width,c.origHeight=g.height||c.thumbSize.height,"undefined"!=typeof wpcom&&wpcom.carousel&&wpcom.carousel.generateImgSrc?c.src=wpcom.carousel.generateImgSrc(e,a):c.src=k({origFile:c.src,origWidth:c.origWidth,origHeight:c.origHeight,maxWidth:a.width,maxHeight:a.height,largeFile:c.largeFile}),e.setAttribute("data-gallery-src",c.src),"0"!==c.attachmentId){c.title=t.texturize(c.title),c.desc=t.texturize(c.desc),c.caption=t.texturize(c.caption);var h=new Image,f=document.createElement("div");f.classList.add("swiper-slide"),f.setAttribute("itemprop","associatedMedia"),f.setAttribute("itemscope",""),f.setAttribute("itemtype","https://schema.org/ImageObject");var v=document.createElement("div");v.classList.add("swiper-zoom-container"),p.gallery.appendChild(f),f.appendChild(v),v.appendChild(h),f.setAttribute("data-attachment-id",c.attachmentId),f.setAttribute("data-permalink",c.permalink),f.setAttribute("data-orig-file",c.origFile),c.previewImage=e.currentSrc||e.getAttribute("src")||"";var y={el:f,attrs:c,index:o};p.slides.push(y)}})}function M(e,t){if(!window.JetpackSwiper){var o=document.querySelector("#jp-carousel-loading-overlay");r.show(o);var a=document.createElement("script");return a.id="jetpack-carousel-swiper-js",a.src=window.jetpackSwiperLibraryPath.url,a.async=!0,a.onload=function(){r.hide(o),F(e,t)},a.onerror=function(){r.hide(o)},void document.head.appendChild(a)}F(e,t)}function F(t,o){var l,s={imgSelector:".gallery-item [data-attachment-id], .tiled-gallery-item [data-attachment-id], img[data-attachment-id], img[data-id]",startIndex:0},c=r.getJSONAttribute(t,"data-carousel-extra");if(!c)return;const u=t.querySelectorAll(s.imgSelector);if(u.length&&(w(),!p.isOpen)){for(var d in p.isOpen=!0,a=getComputedStyle(document.body).overflow,document.body.style.overflow="hidden",i=getComputedStyle(document.documentElement).overflow,document.documentElement.style.overflow="hidden",n=window.scrollY||window.pageYOffset||0,p.container.setAttribute("data-carousel-extra",JSON.stringify(c)),m(["open","view_image"]),o||{})s[d]=o[d];-1===s.startIndex&&(s.startIndex=0),r.emitEvent(p.overlay,"jp_carousel.beforeOpen"),p.gallery.innerHTML="",p.overlay.style.opacity=1,p.overlay.style.display="block",I(u,s.startIndex),(e=new window.JetpackSwiper(".jp-carousel-swiper-container",{centeredSlides:!0,zoom:!0,loop:p.slides.length>1,enabled:p.slides.length>1,pagination:{el:".jp-swiper-pagination",clickable:!0},navigation:{nextEl:".jp-swiper-button-next",prevEl:".jp-swiper-button-prev"},initialSlide:s.startIndex,on:{init:function(){L(s.startIndex)}},preventClicks:!1,preventClicksPropagation:!1,preventInteractionOnTransition:!r.isTouch(),threshold:5})).on("slideChange",function(e){p.isOpen&&(L(e.realIndex),p.overlay.classList.remove("jp-carousel-hide-control
2s"))}),e.on("zoomChange",function(e,t){t>1&&p.overlay.classList.add("jp-carousel-hide-controls"),1===t&&p.overlay.classList.remove("jp-carousel-hide-controls")}),e.on("doubleTap",function(e){if(clearTimeout(l),1===e.zoom.scale)var t=setTimeout(function(){p.overlay.classList.remove("jp-carousel-hide-controls"),clearTimeout(t)},150)}),e.on("tap",function(){e.zoom.scale>1&&(l=setTimeout(function(){p.overlay.classList.toggle("jp-carousel-hide-controls")},150))}),r.fadeIn(p.overlay,function(){r.emitEvent(p.overlay,"jp_carousel.afterOpen")})}}function O(e){if("click"!==e.type){if("keydown"===e.type){const t=document.activeElement.parentElement,r=t&&t.classList.contains("tiled-gallery__item");" "!==e.key&&"Enter"!==e.key||!r||R(e)}}else R(e)}function N(e){return(e||"").split("?")[0].replace(/\/$/,"")}function W(e){"A"===e.tagName&&(e=e.querySelector("img")||e);var t=e.parentElement,o=t?t.parentElement:null,a=null;if(o&&o.classList.contains("wp-block-image")?a=t.getAttribute("href"):t&&t.classList.contains("wp-block-image")&&t.querySelector(":scope > a")&&(a=t.querySelector(":scope > a").getAttribute("href")),a){var i=N(a),n=N(e.getAttribute("data-orig-file")),l=N(e.getAttribute("data-permalink"));if(i!==n&&i!==l)return!1}return!(t&&t.classList.contains("gallery-caption")||r.matches(t,"figcaption"))}function R(e){if(window.CSS&&window.CSS.supports&&window.CSS.supports("display","grid")){var t,o=e.target,a=r.closest(o,c);if(a){if(!(t=a)||!t.getAttribute("data-carousel-extra"))return;if(!W(o))return;document.documentElement.style.height="auto",e.preventDefault(),e.stopPropagation();var i=r.closest(o,d),n=Array.prototype.indexOf.call(a.querySelectorAll(d),i);M(a,{startIndex:n})}}}document.body.addEventListener("click",O),document.body.addEventListener("keydown",O),document.querySelectorAll(u+"img").forEach(function(e){W(e)&&y(e)}),1===Number(jetpackCarouselStrings.single_image_gallery)&&(b(),document.body.addEventListener("is.post-load",function(){b()})),window.addEventListener("hashchange",function(){var e=/jp-carousel-(\d+)/;if(window.location.hash&&e.test(window.location.hash)){if(window.location.hash!==l||!p.isOpen)if(window.location.hash&&p.gallery&&!p.isOpen&&history.back)history.back();else{l=window.location.hash;for(var t=window.location.hash.match(e),r=parseInt(t[1],10),o=document.querySelectorAll(c),a=0;a<o.length;a++){for(var i,n=o[a],s=n.querySelectorAll("img"),u=0;u<s.length;u++)if(parseInt(s[u].getAttribute("data-attachment-id"),10)===r||parseInt(s[u].getAttribute("data-id"),10)===r){i=u;break}if(void 0!==i){S(n,i);break}}}}else p.isOpen&&x()}),window.location.hash&&r.emitEvent(window,"hashchange")}"loading"!==document.readyState?o():document.addEventListener("DOMContentLoaded",o)}();; 3/** 4 * Observe how the user enters content into the comment form in order to determine whether it's a bot or not. 5 * 6 * Note that no actual input is being saved here, only counts and timings between events. 7 */ 8 9( function() { 10 // Passive event listeners are guaranteed to never call e.preventDefault(), 11 // but they're not supported in all browsers. Use this feature detection 12 // to determine whether they're available for use. 13 var supportsPassive = false; 14 15 try { 16 var opts = Object.defineProperty( {}, 'passive', { 17 get : function() { 18 supportsPassive = true; 19 } 20 } ); 21 22 window.addEventListener( 'testPassive', null, opts ); 23 window.removeEventListener( 'testPassive', null, opts ); 24 } catch ( e ) {} 25 26 function init() { 27 var input_begin = ''; 28 29 var keydowns = {}; 30 var lastKeyup = null; 31 var lastKeydown = null; 32 var keypresses = []; 33 34 var modifierKeys = []; 35 var correctionKeys = []; 36 37 var lastMouseup = null; 38 var lastMousedown = null; 39 var mouseclicks = []; 40 var mouseclickCoordinates = []; 41 42 var mousemoveTimer = null; 43 var lastMousemoveX = null; 44 var lastMousemoveY = null; 45 var lastMousemoveTime = null; 46 var mousemoveStart = null; 47 var mousemoves = []; 48 var intervalsBetweenMousemovesAndClicks = []; 49 50 var touchmoveCountTimer = null; 51 var touchmoveCount = 0; 52 53 var lastTouchEnd = null; 54 var lastTouchStart = null; 55 var touchEvents = []; 56 57 var scrollCountTimer = null; 58 var scrollCount = 0; 59 60 var correctionKeyCodes = [ 'Backspace', 'Delete', 'ArrowUp', 'ArrowDown', 'ArrowLeft', 'ArrowRight', 'Home', 'End', 'PageUp', 'PageDown' ]; 61 var modifierKeyCodes = [ 'Shift', 'CapsLock' ]; 62 63 var forms = document.querySelectorAll( 'form[method=post]' ); 64 65 for ( var i = 0; i < forms.length; i++ ) { 66 var form = forms[i]; 67 68 var formAction = form.getAttribute( 'action' ); 69 70 // Ignore forms that POST directly to other domains; these could be things like payment forms. 71 if ( formAction ) { 72 // Check that the form is posting to an external URL, not a path. 73 if ( formAction.indexOf( 'http://' ) == 0 || formAction.indexOf( 'https://' ) == 0 ) { 74 if ( formAction.indexOf( 'http://' + window.location.hostname + '/' ) != 0 && formAction.indexOf( 'https://' + window.location.hostname + '/' ) != 0 ) { 75 continue; 76 } 77 } 78 } 79 80 form.addEventListener( 'submit', function () { 81 var ak_bkp = prepare_array_for_request( keypresses ); 82 var ak_bmc = prepare_array_for_request( mouseclicks ); 83 var ak_bte = prepare_array_for_request( touchEvents ); 84 var ak_bmm = prepare_array_for_request( mousemoves ); 85 var ak_bcc = prepare_array_for_request( mouseclickCoordinates ); 86 var ak_bibmac = intervalsBetweenMousemovesAndClicks.slice( 0, 100 ).join( ';' ); 87 88 var input_fields = { 89 // When did the user begin entering any input? 90 'bib': input_begin, 91 92 // When was the form submitted? 93 'bfs': Date.now(), 94 95 // How many keypresses did they make? 96 'bkpc': keypresses.length, 97
98 // How quickly did they press a sample of keys, and how long between them? 99 'bkp': ak_bkp, 100 101 // How quickly did they click the mouse, and how long between clicks? 102 'bmc': ak_bmc, 103 104 // How many mouseclicks did they make? 105 'bmcc': mouseclicks.length, 106 107 // When did they press modifier keys (like Shift or Capslock)? 108 'bmk': modifierKeys.join( ';' ), 109 110 // When did they correct themselves? e.g., press Backspace, or use the arrow keys to move the cursor back 111 'bck': correctionKeys.join( ';' ), 112 113 // How many times did they move the mouse? 114 'bmmc': mousemoves.length, 115 116 // How many times did they move around using a touchscreen? 117 'btmc': touchmoveCount, 118 119 // How many times did they scroll? 120 'bsc': scrollCount, 121 122 // How quickly did they perform touch events, and how long between them? 123 'bte': ak_bte, 124 125 // How many touch events were there? 126 'btec' : touchEvents.length, 127 128 // How quickly did they move the mouse, and how long between moves? 129 'bmm' : ak_bmm, 130 131 // Click coordinates 132 'bcc' : ak_bcc, 133 134 // Milliseconds between last mouse movement and each click 135 'bibmac' : ak_bibmac 136 }; 137 138 var akismet_field_prefix = 'ak_'; 139 140 if ( this.getElementsByClassName ) { 141 // Check to see if we've used an alternate field name prefix. We store this as an attribute of the container around some of the Akismet fields. 142 var possible_akismet_containers = this.getElementsByClassName( 'akismet-fields-container' ); 143 144 for ( var containerIndex = 0; containerIndex < possible_akismet_containers.length; containerIndex++ ) { 145 var container = possible_akismet_containers.item( containerIndex ); 146 147 if ( container.getAttribute( 'data-prefix' ) ) { 148 akismet_field_prefix = container.getAttribute( 'data-prefix' ); 149 break; 150 } 151 } 152 } 153 154 for ( var field_name in input_fields ) { 155 var field = document.createElement( 'input' ); 156 field.setAttribute( 'type', 'hidden' ); 157 field.setAttribute( 'name', akismet_field_prefix + field_name ); 158 field.setAttribute( 'value', input_fields[ field_name ] ); 159 this.appendChild( field ); 160 } 161 }, supportsPassive ? { passive: true } : false ); 162 163 form.addEventListener( 'keydown', function ( e ) { 164 // If you hold a key down, some browsers send multiple keydown events in a row. 165 // Ignore any keydown events for a key that hasn't come back up yet. 166 if ( e.key in keydowns ) { 167 return; 168 } 169 170 var keydownTime = ( new Date() ).getTime(); 171 keydowns[ e.key ] = [ keydownTime ]; 172 173 if ( ! input_begin ) { 174 input_begin = keydownTime; 175 } 176 177 // In some situations, we don't want to record an interval since the last keypress -- for example, 178 // on the first keypress, or on a keypress after focus has changed to another element. Normally, 179 // we want to record the time between the last keyup and this keydown. But if they press a 180 // key while already pressing a key, we want to record the time between the two keydowns. 181 182 var lastKeyEvent = Math.max( lastKeydown, lastKeyup ); 183 184 if ( lastKeyEvent ) { 185 keydowns[ e.key ].push( keydownTime - lastKeyEvent ); 186 } 187 188 lastKeydown = keydownTime; 189 }, supportsPassive ? { passive: true } : false ); 190 191 form.addEventListener( 'keyup', function ( e ) { 192 if ( ! ( e.key in keydowns ) ) { 193 // This key was pressed before this script was loaded, or a mouseclick happened during the keypress, or... 194 return; 195 } 196 197 var keyupTime = ( new Date() ).getTime(); 198 199 if ( 'TEXTAREA' === e.target.nodeName || 'INPUT' === e.target.nodeName ) { 200 if ( -1 !== modifierKeyCodes.indexOf( e.key ) ) { 201 modifierKeys.push( keypresses.length - 1 ); 202 } else if ( -1 !== correctionKeyCodes.indexOf( e.key ) ) { 203 correctionKeys.push( keypresses.length - 1 ); 204 } else { 205 // ^ Don't record timings for keys like Shift or backspace, since they 206 // typically get held down for longer than regular typing. 207 208 var keydownTime = keydowns[ e.key ][0]; 209 210 var keypress = []; 211 212 // Keypress duration. 213 keypress.push( keyupTime - keydownTime ); 214 215 // Amount of time between this keypress and the previous keypress. 216 if ( keydowns[ e.key ].length > 1 ) { 217 keypress.push( keydowns[ e.key ][1] ); 218 } 219 220 keypresses.push( keypress ); 221 } 222 } 223
224 delete keydowns[ e.key ]; 225 226 lastKeyup = keyupTime; 227 }, supportsPassive ? { passive: true } : false ); 228 229 form.addEventListener( "focusin", function ( e ) { 230 lastKeydown = null; 231 lastKeyup = null; 232 keydowns = {}; 233 }, supportsPassive ? { passive: true } : false ); 234 235 form.addEventListener( "focusout", function ( e ) { 236 lastKeydown = null; 237 lastKeyup = null; 238 keydowns = {}; 239 }, supportsPassive ? { passive: true } : false ); 240 } 241 242 document.addEventListener( 'mousedown', function ( e ) { 243 lastMousedown = ( new Date() ).getTime(); 244 245 if ( lastMousemoveTime ) { 246 intervalsBetweenMousemovesAndClicks.push( lastMousedown - lastMousemoveTime ); 247 } 248 249 var mouseclickCoordinate = []; 250 251 var rect = e.target.getBoundingClientRect(); 252 var relativeX = e.clientX - rect.left; 253 var relativeY = e.clientY - rect.top; 254 255 // Pixel offset of the click within the target element. 256 mouseclickCoordinate.push( Math.round( relativeX ) ); 257 mouseclickCoordinate.push( Math.round( relativeY ) ); 258 259 // Percentage offset of the click within the target element. 260 mouseclickCoordinate.push( rect.width > 0 ? Math.round( relativeX / rect.width * 100 ) : 0 ); 261 mouseclickCoordinate.push( rect.height > 0 ? Math.round( relativeY / rect.height * 100 ) : 0 ); 262 263 mouseclickCoordinates.push( mouseclickCoordinate ); 264 }, supportsPassive ? { passive: true } : false ); 265 266 document.addEventListener( 'mouseup', function ( e ) { 267 if ( ! lastMousedown ) { 268 // If the mousedown happened before this script was loaded, but the mouseup happened after... 269 return; 270 } 271 272 var now = ( new Date() ).getTime(); 273 274 var mouseclick = []; 275 mouseclick.push( now - lastMousedown ); 276 277 if ( lastMouseup ) { 278 mouseclick.push( lastMousedown - lastMouseup ); 279 } 280 281 mouseclicks.push( mouseclick ); 282 283 lastMouseup = now; 284 285 // If the mouse has been clicked, don't record this time as an interval between keypresses. 286 lastKeydown = null; 287 lastKeyup = null; 288 keydowns = {}; 289 }, supportsPassive ? { passive: true } : false ); 290 291 document.addEventListener( 'mousemove', function ( e ) { 292 lastMousemoveTime = ( new Date() ).getTime(); 293 294 if ( mousemoveTimer ) { 295 clearTimeout( mousemoveTimer ); 296 mousemoveTimer = null; 297 } 298 else { 299 mousemoveStart = lastMousemoveTime; 300 lastMousemoveX = e.offsetX; 301 lastMousemoveY = e.offsetY; 302 } 303 304 mousemoveTimer = setTimeout( function ( theEvent, originalMousemoveStart ) { 305 var now = ( new Date() ).getTime() - 500; // To account for the timer delay. 306 307 var mousemove = []; 308 mousemove.push( now - originalMousemoveStart ); 309 mousemove.push( 310 Math.round( 311 Math.sqrt( 312 Math.pow( theEvent.offsetX - lastMousemoveX, 2 ) + 313 Math.pow( theEvent.offsetY - lastMousemoveY, 2 ) 314 ) 315 ) 316 ); 317 318 if ( mousemove[1] > 0 ) { 319 // If there was no measurable distance, then it wasn't really a move. 320 mousemoves.push( mousemove ); 321 } 322 323 mousemoveStart = null; 324 mousemoveTimer = null; 325 }, 500, e, mousemoveStart ); 326 }, supportsPassive ? { passive: true } : false ); 327 328 document.addEventListener( 'touchmove', function ( e ) { 329 if ( touchmoveCountTimer ) { 330 clearTimeout( touchmoveCountTimer ); 331 } 332 333 touchmoveCountTimer = setTimeout( function () { 334 touchmoveCount++; 335 }, 500 ); 336 }, supportsPassive ? { passive: true } : false ); 337 338 document.addEventListener( 'touchstart', function ( e ) { 339 lastTouchStart = ( new Date() ).getTime(); 340 }, supportsPassive ? { passive: true } : false ); 341 342 document.addEventListener( 'touchend', function ( e ) { 343 if ( ! lastTouchStart ) { 344 // If the touchstart happened before this script was loaded, but the touchend happened after... 345 return; 346 } 347 348 var now = ( new Date() ).getTime(); 349 350 var touchEvent = []; 351 touchEvent.push( now - lastTouchStart ); 352 353 if ( lastTouchEnd ) { 354 touchEvent.push( lastTouchStart - lastTouchEnd ); 355 } 356 357 touchEvents.push( touchEvent ); 358 359 lastTouchEnd = now; 360 361 // Don't record this time as an interval between keypresses. 362 lastKeydown = null; 363 lastKeyup = null; 364 keydowns = {}; 365 }, supportsPassive ? { passive: true } : false ); 366 367 document.addEventListener( 'scroll', function ( e ) {
368 if ( scrollCountTimer ) { 369 clearTimeout( scrollCountTimer ); 370 } 371 372 scrollCountTimer = setTimeout( function () { 373 scrollCount++; 374 }, 500 ); 375 }, supportsPassive ? { passive: true } : false ); 376 } 377 378 /** 379 * For the timing/coordinate data that is collected, don't send more than `limit` data points in the request. 380 * Choose a random slice and send those, with each batch separated by semicolons and the items in each batch 381 * separated by commas. 382 */ 383 function prepare_array_for_request( a, limit ) { 384 if ( ! limit ) { 385 limit = 100; 386 } 387 388 var rv = ''; 389 390 if ( a.length > 0 ) { 391 var random_starting_point = Math.max( 0, Math.floor( Math.random() * a.length - limit ) ); 392 393 for ( var i = 0; i < limit && i < a.length; i++ ) { 394 var entry = a[ random_starting_point + i ]; 395 rv += entry.join( ',' ) + ';'; 396 } 397 } 398 399 return rv; 400 } 401 402 if ( document.readyState !== 'loading' ) { 403 init(); 404 } else { 405 document.addEventListener( 'DOMContentLoaded', init ); 406 } 407})();; 408( function () { 409 'use strict'; 410 411 if ( typeof window.wpcom === 'undefined' ) { 412 window.wpcom = {}; 413 } 414 415 if ( window.wpcom.carousel ) { 416 return; 417 } 418 419 var prebuilt_widths = jetpackCarouselStrings.widths; 420 var pageviews_stats_args = jetpackCarouselStrings.stats_query_args; 421 422 var findFirstLargeEnoughWidth = function ( original_w, original_h, dest_w, dest_h ) { 423 var inverse_ratio = original_h / original_w; 424 425 for ( var i = 0; i < prebuilt_widths.length; ++i ) { 426 if ( prebuilt_widths[ i ] >= dest_w || prebuilt_widths[ i ] * inverse_ratio >= dest_h ) { 427 return prebuilt_widths[ i ]; 428 } 429 } 430 431 return original_w; 432 }; 433 434 var removeResizeFromImageURL = function ( url ) { 435 return removeArgFromURL( url, 'resize' ); 436 }; 437 438 var removeArgFromURL = function ( url, arg ) { 439 var re = new RegExp( '[\\?&]' + arg + '(=[^?&]+)?' ); 440 if ( url.match( re ) ) { 441 return url.replace( re, '' ); 442 } 443 return url; 444 }; 445 446 var addWidthToImageURL = function ( url, width ) { 447 width = parseInt( width, 10 ); 448 // Give devices with a higher devicePixelRatio higher-res images (Retina display = 2, Android phones = 1.5, etc) 449 if ( 'undefined' !== typeof window.devicePixelRatio && window.devicePixelRatio > 1 ) { 450 width = Math.round( width * window.devicePixelRatio ); 451 } 452 url = addArgToURL( url, 'w', width ); 453 url = addArgToURL( url, 'h', '' ); 454 return url; 455 }; 456 457 var addArgToURL = function ( url, arg, value ) { 458 var re = new RegExp( arg + '=[^?&]+' ); 459 if ( url.match( re ) ) { 460 return url.replace( re, arg + '=' + value ); 461 } else { 462 var divider = url.indexOf( '?' ) !== -1 ? '&' : '?'; 463 return url + divider + arg + '=' + value; 464 } 465 }; 466 467 var stat = function ( names ) { 468 if ( typeof names !== 'string' ) { 469 names = names.join( ',' ); 470 } 471 472 new Image().src = window.location.protocol + 473 '//pixel.wp.com/g.gif?v=wpcom-no-pv' + 474 '&x_carousel=' + names + 475 '&baba=' + Math.random(); 476 }; 477 478 var lastTrackedPostId = null; 479 480 var pageview = function ( post_id ) { 481 // Prevent duplicate tracking of the same post during slide transitions 482 if ( post_id === lastTrackedPostId ) { 483 return; 484 } 485 486 lastTrackedPostId = post_id; 487 488 new Image().src = window.location.protocol + 489 '//pixel.wp.com/g.gif?host=' + encodeURIComponent( window.location.host ) + 490 '&ref=' + encodeURIComponent( document.referrer ) + 491 '&rand=' + Math.random() + 492 '&' + pageviews_stats_args + 493 '&post=' + encodeURIComponent( post_id ); 494 }; 495 496 var generateImgSrc = function ( srcItem, max ) { 497 var origSize = srcItem.getAttribute( 'data-orig-size' ) || ''; 498 499 var src = srcItem.getAttribute( 'src' ) || srcItem.getAttribute( 'original' ) || srcItem.getAttribute( 'data-original' ) || srcItem.getAttribute( 'data-lazy-src' ); 500 if ( src.indexOf( 'imgpress' ) !== -1 ) { 501 src = srcItem.getAttribute( 'data-orig-file' ); 502 } 503 // Square/Circle galleries use a resize param that needs to be removed. 504 src = removeResizeFromImageURL( src ); 505 src = addWidthToImageURL( 506 src, 507 findFirstLargeEnoughWidth( origSize.width, origSize.height, max.width, max.height ) 508 ); 509 510 return src; 511 }; 512 513 window.wpcom.carousel = { 514 findFirstLargeEnoughWidth: findFirstLargeEnoughWidth, 515 removeResizeFromImageURL: removeResizeFromImageURL, 516 addWidthToImageURL: addWidthToImageURL, 517 stat: stat, 518 pageview: pageview, 519 generateImgSrc: generateImgSrc 520 }; 521 522} )(); 523;
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.