OwlCyberSecurity - MANAGER
Edit File: jetpack-carousel.min.js
/* Do not modify this file directly. It is compiled from other files. */ /* global wpcom, jetpackCarouselStrings, DocumentTouch */ jQuery(document).ready(function(e){"use strict";var t,a,i,o,r,n,s,l,c,d,u,p=e("body").css("overflow"),m=e("html").css("overflow"),h=85,f="",g=!1,w=function(){},v="undefined"!=typeof wpcom&&wpcom.carousel&&wpcom.carousel.stat?wpcom.carousel.stat:w,j="undefined"!=typeof wpcom&&wpcom.carousel&&wpcom.carousel.pageview?wpcom.carousel.pageview:w;function b(e){if(!g)switch(e.which){case 38:e.preventDefault(),i.scrollTop(i.scrollTop()-100);break;case 40:e.preventDefault(),i.scrollTop(i.scrollTop()+100);break;case 39:e.preventDefault(),W();break;case 37:case 8:e.preventDefault(),F();break;case 27:e.preventDefault(),N()}}function y(){g=!0}function x(){g=!1}function k(){if(d=110,window.innerWidth<=760){d=Math.round(window.innerWidth/760*110);var e="ontouchstart"in window||window.DocumentTouch&&document instanceof DocumentTouch;d<40&&e&&(d=0)}}function _(t){return t=(t=(t=(t=""+t).replace(/'/g,"’").replace(/'/g,"’").replace(/[\u2019]/g,"’")).replace(/"/g,"”").replace(/"/g,"”").replace(/"/g,"”").replace(/[\u201D]/g,"”")).replace(/([\w]+)=&#[\d]+;(.+?)&#[\d]+;/g,'$1="$2"'),e.trim(t)}function C(){var e=window.matchMedia&&!window.matchMedia("(prefers-reduced-motion: reduce)").matches;clearTimeout(s),s=setTimeout(function(){k(),B(U(a)),R(e),I(e)},200)}function I(e){var t={left:d+"px",right:d+"px"};e?o.animate(t):o.css(t)}function A(){if(!t){i=e(".jp-carousel-wrap"),t=i.find(".jp-carousel-overlay"),a=i.find(".jp-carousel"),n=i.find(".jp-carousel-caption"),o=i.find(".jp-carousel-info");var s=i.find(".jp-carousel-next-button"),l=i.find(".jp-carousel-previous-button");k(),I(!1),[e("#jp-carousel-comment-form-comment-field"),e("#jp-carousel-comment-form-email-field"),e("#jp-carousel-comment-form-author-field"),e("#jp-carousel-comment-form-url-field")].forEach(function(e){e.focus(y),e.blur(x)}),i.click(function(t){var r=e(t.target),n=r.parents().add(r).is(i.find(".jp-carousel-close-hint")),s=!!window.matchMedia("(max-device-width: 760px)").matches;r.is(a)?s?S(t):N():n?N():r.hasClass("jp-carousel-image-download")?v("download_original_click"):r.hasClass("jp-carousel-commentlink")?function(t){t.preventDefault(),t.stopPropagation(),y(),i.animate({scrollTop:parseInt(o.position().top,10)},"fast"),e("#jp-carousel-comment-form-submit-and-info-wrapper").slideDown("fast"),e("#jp-carousel-comment-form-comment-field").focus()}(t):r.hasClass("jp-carousel-comment-login")?function(t){var a=e(t.target).parents("div.jp-carousel-wrap").find("div.selected").data("attachment-id");window.location.href=jetpackCarouselStrings.login_url+"%23jp-carousel-"+a}(t):r.parents("#jp-carousel-comment-form-container").length?function(t){var a=e(t.target),i=a.parents("div.jp-carousel-wrap"),o=(i.data("carousel-extra")||{}).blog_id,r=i.find("div.selected").data("attachment-id"),n=e("#jp-carousel-comment-form-comment-field"),s=e("#jp-carousel-comment-form-email-field"),l=e("#jp-carousel-comment-form-author-field"),c=e("#jp-carousel-comment-form-url-field");if(n&&n.attr("id")===a.attr("id"))y(),e("#jp-carousel-comment-form-submit-and-info-wrapper").slideDown("fast");else if(a.is('input[type="submit"]')){t.preventDefault(),t.stopPropagation(),e("#jp-carousel-comment-form-spinner").show();var d={action:"post_attachment_comment",nonce:jetpackCarouselStrings.nonce,blog_id:o,id:r,comment:n.val()};if(!d.comment.length)return void Y("jp-carousel-comment-form-comment-field",jetpackCarouselStrings.no_comment_text);if(Number(1!==jetpackCarouselStrings.is_logged_in)&&(d.email=s.val(),d.author=l.val(),d.url=c.val(),Number(1===jetpackCarouselStrings.require_name_email))){if(!d.email.length||!d.email.match("@"))return void Y("jp-carousel-comment-form-email-field",jetpackCarouselStrings.no_comment_email);if(!d.author.length)return void Y("jp-carousel-comment-form-author-field",jetpackCarouselStrings.no_comment_author)}e.ajax({type:"POST",url:jetpackCarouselStrings.ajaxurl,data:d,dataType:"json",success:function(t){"approved"===t.comment_status?e("#jp-carousel-comment-post-results").slideUp("fast").html('<span class="jp-carousel-comment-post-success">'+jetpackCarouselStrings.comment_approved+"</span>").slideDown("fast"):"unapproved"===t.comment_status?e("#jp-carousel-comment-post-results").slideUp("fast").html('<span class="jp-carousel-comment-post-success">'+jetpackCarouselStrings.comment_unapproved+"</span>").slideDown("fast"):e("#jp-carousel-comment-post-results").slideUp("fast").html('<span class="jp-carousel-comment-post-error">'+jetpackCarouselStrings.comment_post_error+"</span>").slideDown("fast"),J(),Q(r,0,!0),e("#jp-carousel-comment-form-button-submit").val(jetpackCarouselStrings.post_comment),e("#jp-carousel-comment-form-spinner").hide()},error:function(){Y("jp-carousel-comment-form-comment-field",jetpackCarouselStrings.comment_post_error)}})}}(t):r.parents(".jp-carousel-info").length||(s?S(t):W())}),e(window).bind("keydown",b),i.bind("jp_carousel.afterOpen",function(){x(),e(window).bind("resize",C),a.opened=!0,C()}),i.bind("jp_carousel.beforeClose",function(){var t=e(window).scrollTop();y(),e(window).unbind("resize",C),e(window).scrollTop(t),e(".jp-carousel-previous-button").hide(),e(".jp-carousel-next-button").hide(),e("html").css("height","")}),i.bind("jp_carousel.afterClose",function(){window.location.hash&&history.back&&history.back(),f="",a.opened=!1}),i.on("transitionend.jp-carousel ",".jp-carousel-slide",function(t){if("transform"===t.originalEvent.propertyName){var a=(Date.now()-r)/1e3/t.originalEvent.elapsedTime;i.off("transitionend.jp-carousel"),a>=2&&e(".jp-carousel-transitions").removeClass("jp-carousel-transitions")}}),function(e){e=e||{};var t,a,i,o,r={root:document.body,threshold:150,restraint:100,allowedTime:300,wipeLeft:function(){},wipeRight:function(){},wipeUp:function(){},wipeDown:function(){}};for(var n in e)r[n]=e[n];function s(){r.root.removeEventListener("touchmove",l),t=null,i=!1}function l(e){if(i){var n=e.touches[0].pageX,l=e.touches[0].pageY,c=t-n,d=a-l;(new Date).getTime()-o<=r.allowedTime&&(Math.abs(c)>=r.threshold&&Math.abs(d)<=r.restraint?(s(),c>0?r.wipeLeft(e):r.wipeRight(e)):Math.abs(d)>=r.threshold&&Math.abs(c)<=r.restraint&&(s(),d>0?r.wipeDown(e):r.wipeUp(e)))}}"ontouchstart"in document.documentElement&&r.root.addEventListener("touchstart",function(e){1===e.touches.length&&(o=(new Date).getTime(),t=e.touches[0].pageX,a=e.touches[0].pageY,i=!0,r.root.addEventListener("touchmove",l,!1))},!1)}({root:i.get(0),wipeLeft:function(e){e.preventDefault(),W()},wipeRight:function(e){e.preventDefault(),F()}}),s.add(l).click(function(e){e.preventDefault(),e.stopPropagation(),s.is(this)?W():F()})}}function S(t){t.pageX<=70&&F(),e(window).width()-t.pageX<=70&&W()}function D(){e("a img[data-attachment-id]").each(function(){var t=e(this).parent();if(!t.parent(".gallery-icon").length&&void 0!==e(t).attr("href")){var a=!1;e(t).attr("href").split("?")[0]===e(this).attr("data-orig-file").split("?")[0]&&Number(1===jetpackCarouselStrings.single_image_gallery_media_file)&&(a=!0),e(t).attr("href")===e(this).attr("data-permalink")&&(a=!0),a&&(e(t).addClass("single-image-gallery"),e(t).data("carousel-extra",{blog_id:Number(jetpackCarouselStrings.blog_id)}))}})}function T(){return!(void 0===a||void 0===a.opened||!a.opened)}function M(e){var t=U(a),i=t.eq(e);0===i.length&&(i=t.eq(0)),$(i,!1)}function W(){O(E)}function F(){O(z)}function O(e){if(U(a).length<=1)return!1;var t=e(a);t&&(i.animate({scrollTop:0},"fast"),J(),$(t),v(["previous","view_image"]))}function H(e){return e.find(".selected")}function E(e){var t=U(e),a=H(e);return 0===a.length||t.length>2&&a.is(t.last())?t.first():a.next()}function z(e){var t=U(e),a=H(e);return 0===a.length||t.length>2&&a.is(t.first())?t.last():a.prev()}function N(){e("body").css("overflow",p),e("html").css("overflow",m),J(),i.trigger("jp_carousel.beforeClose"),i.fadeOut("fast",function(){i.trigger("jp_carousel.afterClose"),e(window).scrollTop(u)})}function P(e,t){r=Date.now(),e.css({transform:"translate3d("+t+"px,0,0)"})}function R(e){var t,r=H(a),n=a.width(),s=r.width(),l=z(a),u=E(a),p=l.prev(),m=u.next();P(r,Math.floor(.5*(n-s))),r.show(),t=q(H(a)),i.find(".jp-carousel-photo-info").css({left:Math.floor(.5*(o.width()-t.width)),width:Math.floor(t.width)}),1===(c.is(r.prevAll())?1:-1)?(m.is(l)||(P(m,n+u.width()),m.show()),p.is(u)||(P(p,-p.width()-s),p.show())):m.is(l)||(P(m,n+s),m.show()),P(l,Math.floor(-l.width()+.75*d)),l.show(),P(u,Math.ceil(n-.75*d)),u.show()}function $(t,o){(c=a.find(".selected")).removeClass("selected");var r,s,l,d,u=U(a),p=e(t),m=p.data("attachment-id"),h=z(a),g=E(a),w=h.prev(),v=g.next();u.css({position:"fixed"}),p.addClass("selected").css({position:"relative"}),K(p),n.hide(),0===g.length&&u.length<=2?e(".jp-carousel-next-button").hide():e(".jp-carousel-next-button").show(),0===h.length&&u.length<=2?e(".jp-carousel-previous-button").hide():e(".jp-carousel-previous-button").show(),r=function(t){return t.each(function(){var t=e(this);t.find("img").one("load",function(){B(t)})})}(p.add(h).add(w).add(g).add(v)),u.not(r).hide(),R(),i.trigger("jp_carousel.selectSlide",[p]),function(t){var a,i="",o="",r="";(a=e("div.jp-carousel-titleanddesc","div.jp-carousel-wrap")).hide(),i=G(t.title)||"",o=G(t.desc)||"",(i.length||o.length)&&(e("<div />").html(i).text()===e("<div />").html(o).text()&&(i=""),r=i.length?'<div class="jp-carousel-titleanddesc-title">'+i+"</div>":"",r+=o.length?'<div class="jp-carousel-titleanddesc-desc">'+o+"</div>":"",a.html(r).fadeIn("slow"));e("div#jp-carousel-comment-form-container").css("margin-top","20px"),e("div#jp-carousel-comments-loading").css("margin-top","20px")}({title:p.data("title"),desc:p.data("desc")}),function(t){if(!t||1!==Number(jetpackCarouselStrings.display_exif))return!1;var a=e("<ul class='jp-carousel-image-exif'></ul>");e.each(t,function(t,i){if(0!==parseFloat(i)&&i.length&&-1!==e.inArray(t,e.makeArray(jetpackCarouselStrings.meta_data))){switch(t){case"focal_length":i+="mm";break;case"shutter_speed":i=function(e){if(e>=1)return Math.round(10*e)/10+"s";return"1/"+Math.round(1/e)+"s"}(i);break;case"aperture":i="f/"+i}a.append("<li><h5>"+jetpackCarouselStrings[t]+"</h5>"+i+"</li>")}}),e("div.jp-carousel-image-meta ul.jp-carousel-image-exif").replaceWith(a)}(p.data("image-meta")),function(t){if(!t||!t.data)return!1;var a,i=t.data("orig-size").split(","),o=document.createElement("a");o.href=t.data("src").replace(/\?.+$/,""),a=null!==o.hostname.match(/^i[\d]{1}\.wp\.com$/i)?o.href:t.data("orig-file").replace(/\?.+$/,"");var r=e("<a>"+function(e,t){if(!e)return;if(!t)return e;return e.replace(/{(\d+)}/g,function(e,a){return void 0!==t[a]?t[a]:e})}(jetpackCarouselStrings.download_original,i)+"</a>").addClass("jp-carousel-image-download").attr("href",a).attr("target","_blank");e("div.jp-carousel-image-meta a.jp-carousel-image-download").replaceWith(r)}(p),1===Number(jetpackCarouselStrings.display_comments)&&(l=p.data("comments-opened"),d=i.find(".jp-carousel-comment-form-container"),1===parseInt(l,10)?(1===Number(jetpackCarouselStrings.is_logged_in)?e(".jp-carousel-commentlink").fadeIn("fast"):e(".jp-carousel-buttons").fadeIn("fast"),d.fadeIn("fast")):(1===Number(jetpackCarouselStrings.is_logged_in)?e(".jp-carousel-commentlink").fadeOut("fast"):e(".jp-carousel-buttons").fadeOut("fast"),d.fadeOut("fast")),Q(m,0,!0),e("#jp-carousel-comment-post-results").slideUp()),p.data("caption")?((s=e("<div />").text(p.data("caption")).html())===e("<div />").text(p.data("title")).html()&&e(".jp-carousel-titleanddesc-title").fadeOut("fast").empty(),s===e("<div />").text(p.data("desc")).html()&&e(".jp-carousel-titleanddesc-desc").fadeOut("fast").empty(),n.html(p.data("caption")).fadeIn("slow")):n.fadeOut("fast").empty(),jetpackCarouselStrings.stats&&((new Image).src=document.location.protocol+"//pixel.wp.com/g.gif?"+jetpackCarouselStrings.stats+"&post="+encodeURIComponent(m)+"&rand="+Math.random()),j(m),e(g).add(h).each(function(){K(e(this))}),window.location.hash=f="#jp-carousel-"+m}function U(e){return e.find(".jp-carousel-slide")}function L(){return{width:e(window).width()-2*d,height:Math.floor(e(window).height()/100*h-60)}}function q(t){var a,i,o=L(),r=function(t){var a=e(t).data("orig-size").split(",");return{width:parseInt(a[0],10),height:parseInt(a[1],10)}}(t),n=r.width/r.height,s=1,l=1;return r.width>o.width&&(s=o.width/r.width),r.height>o.height&&(l=o.height/r.height),s<l?(a=o.width,i=Math.floor(a/n)):l<s?(i=o.height,a=Math.floor(i*n)):(a=r.width,i=r.height),{width:a,height:i}}function B(t){return t.each(function(){var t=e(this),a=q(t),i=L();a.left=0,a.top=Math.floor(.5*(i.height-a.height))+40,t.css(a)})}function X(e,t,a){var i=a?e.replace(/.*=([\d]+%2C[\d]+).*$/,"$1"):e.replace(/.*-([\d]+x[\d]+)\..+$/,"$1"),o=i!==e?a?i.split("%2C"):i.split("x"):[t,0];return"9999"===o[0]&&(o[0]="0"),"9999"===o[1]&&(o[1]="0"),o}function G(e){return!e.match(" ")&&e.match("_")?"":e}function Q(t,a,o){if(clearInterval(l),t){(!a||a<1)&&(a=0);var r=e(".jp-carousel-comments"),n=e("#jp-carousel-comments-loading").show();o&&r.hide().empty(),e.ajax({type:"GET",url:jetpackCarouselStrings.ajaxurl,dataType:"json",data:{action:"get_attachment_comments",nonce:jetpackCarouselStrings.nonce,id:t,offset:a},success:function(s){o&&r.fadeOut("fast").empty(),e(s).each(function(){var i=e("<div></div>").addClass("jp-carousel-comment").attr("id","jp-carousel-comment-"+this.id).html('<div class="comment-gravatar">'+this.gravatar_markup+'</div><div class="comment-author">'+this.author_markup+'</div><div class="comment-date">'+this.date_gmt+'</div><div class="comment-content">'+this.content+"</div>");r.append(i),clearInterval(l),l=setInterval(function(){e(".jp-carousel-overlay").height()-150<e(".jp-carousel-wrap").scrollTop()+e(window).height()&&(Q(t,a+10,!1),clearInterval(l))},300)});var c=e(".jp-carousel div.selected");if(c&&c.data&&c.data("attachment-id")!==t)return r.fadeOut("fast"),void r.empty();e(".jp-carousel-overlay").height(e(window).height()+i.find(".jp-carousel-titleanddesc").height()+i.find(".jp-carousel-comment-form-container").height()+(r.height()>0?r.height():i.find(".jp-carousel-image-meta").height())+200),r.show(),n.hide()},error:function(){r.fadeIn("fast"),n.fadeOut("fast")}})}}function Y(t,a){t&&a&&(e("#jp-carousel-comment-post-results").slideUp("fast").html('<span class="jp-carousel-comment-post-error">'+a+"</span>").slideDown("fast"),e("#jp-carousel-comment-form-spinner").hide())}function J(){var t=e("#jp-carousel-comment-form-comment-field");t&&t.val("")}function K(t){var i=e(t),o=i.find("img:first");o.data("loaded")||(o.on("load.jetpack",function(){o.off("load.jetpack"),a.closest(".jp-carousel-slide").css("background-image","")}),!i.data("preview-image")||i.data("thumb-size")&&i.width()>i.data("thumb-size").width?o.attr("src",o.closest(".jp-carousel-slide").data("src")).attr("itemprop","image"):o.attr("src",i.data("preview-image")).attr("itemprop","image"),o.data("loaded",1))}function V(t,i){t.length<2?e(".jp-carousel-next-button, .jp-carousel-previous-button").hide():e(".jp-carousel-next-button, .jp-carousel-previous-button").show(),t.each(function(){var t,a=e(this),i=a.data("orig-size")||"",o=L(),r=i.split(","),n=a.data("medium-file")||"",s=a.data("large-file")||"";i={width:parseInt(r[0],10),height:parseInt(r[1],10)},t=void 0!==typeof wpcom&&wpcom.carousel&&wpcom.carousel.generateImgSrc?wpcom.carousel.generateImgSrc(a.get(0),o):function(e){if("object"!=typeof e&&(e={}),void 0===e.origFile)return"";if(void 0===e.origWidth||void 0===e.maxWidth)return e.origFile;if(void 0===e.mediumFile||void 0===e.largeFile)return e.origFile;var t=document.createElement("a");t.href=e.largeFile;var a=/^i[0-2]\.wp\.com$/i.test(t.hostname),i=X(e.mediumFile,e.origWidth,a),o=X(e.largeFile,e.origWidth,a),r=parseInt(o[0],10),n=parseInt(o[1],10),s=parseInt(i[0],10),l=parseInt(i[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),r>=e.maxWidth||n>=e.maxHeight)return e.largeFile;if(s>=e.maxWidth||l>=e.maxHeight)return e.mediumFile;if(a){var c=e.largeFile.lastIndexOf("?"),d=e.largeFile;return-1!==c&&(d=e.largeFile.substring(0,c),(e.origWidth>e.maxWidth||e.origHeight>e.maxHeight)&&(d+="?fit="+e.origMaxWidth+"%2C"+e.origMaxHeight)),d}return e.origFile}({origFile:t=a.data("orig-file"),origWidth:i.width,origHeight:i.height,maxWidth:o.width,maxHeight:o.height,mediumFile:n,largeFile:s}),e(this)[0].setAttribute("data-gallery-src",t)}),0!==i&&(e("<img/>")[0].src=e(t[i]).data("gallery-src"));var o=t.first().closest(".tiled-gallery.type-rectangular").length>0;t.each(function(t){var r=e(this),n=r.data("attachment-id")||0,s=r.data("comments-opened")||0,l=r.data("image-meta")||{},c=r.data("orig-size")||"",d=r.data("image-title")||"",u=r.data("image-description")||"",p=r.data("gallery-src")||"",m=r.data("medium-file")||"",h=r.data("large-file")||"",f=r.data("orig-file")||"",g=r.parents(".gallery-item").find(".gallery-caption").html()||"",w={width:r[0].naturalWidth,height:r[0].naturalHeight},v=r.parents("a").attr("href"),j=r.parents("div.tiled-gallery-item").find("div.tiled-gallery-caption").html();if(j&&(g=j),n&&c.length){d=_(d),u=_(u),g=_(g);var b=e("<img/>").attr("src","data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7").css("width","100%").css("height","100%"),y=e('<div class="jp-carousel-slide" itemprop="associatedMedia" itemscope itemtype="https://schema.org/ImageObject"></div>').hide().css({left:t<i?-1e3:a.width()}).append(b).appendTo(a).data("src",p).data("title",d).data("desc",u).data("caption",g).data("attachment-id",n).data("permalink",v).data("orig-size",c).data("comments-opened",s).data("image-meta",l).data("medium-file",m).data("large-file",h).data("orig-file",f).data("thumb-size",w);o&&y.data("preview-image",r.attr("src")).css({"background-image":'url("'+r.attr("src")+'")',"background-size":"100% 100%","background-position":"center center"}),B(y)}})}function Z(t,o){var r={items_selector:".gallery-item [data-attachment-id], .tiled-gallery-item [data-attachment-id], img[data-attachment-id]",startIndex:0},n=t.data("carousel-extra");if(n&&(A(),!T()))return p=e("body").css("overflow"),e("body").css("overflow","hidden"),m=e("html").css("overflow"),e("html").css("overflow","hidden"),u=e(window).scrollTop(),i.data("carousel-extra",n),v(["open","view_image"]),t.each(function(){o&&e.extend(r,o),-1===r.startIndex&&(r.startIndex=0),i.trigger("jp_carousel.beforeOpen"),i.fadeIn("fast",function(){i.trigger("jp_carousel.afterOpen"),V(t.find(r.items_selector),r.startIndex),M(r.startIndex)}),a.html("")})}e(document.body).on("click.jp-carousel","div.gallery, div.tiled-gallery, ul.wp-block-gallery, ul.blocks-gallery-grid, figure.blocks-gallery-grid, div.wp-block-jetpack-tiled-gallery, a.single-image-gallery",function(t){if(a=t.currentTarget,(i=e(a)).length&&i.data("carousel-extra")){var a,i;if(e(t.target).parents().eq(1).hasClass("wp-block-image")){var o=e(t.target).parent().attr("href");if(o.split("?")[0]!==e(t.target).attr("data-orig-file").split("?")[0]&&o!==e(t.target).attr("data-permalink"))return}e(t.target).parent().hasClass("gallery-caption")||e(t.target).parent().is("figcaption")||(e("html").css("height","auto"),t.preventDefault(),t.stopPropagation(),Z(e(this),{startIndex:e(this).find(".gallery-item, .tiled-gallery-item, .blocks-gallery-item, .tiled-gallery__item, .wp-block-image").index(e(t.target).parents(".gallery-item, .tiled-gallery-item, .blocks-gallery-item, .tiled-gallery__item, .wp-block-image"))}))}}),1===Number(jetpackCarouselStrings.single_image_gallery)&&(D(),e(document.body).on("post-load",function(){D()})),e(window).on("hashchange.jp-carousel",function(){var t,o,r,n=/jp-carousel-(\d+)/;window.location.hash&&n.test(window.location.hash)?window.location.hash===f&&a.opened||(window.location.hash&&a&&!a.opened&&history.back?history.back():(f=window.location.hash,t=window.location.hash.match(n),o=parseInt(t[1],10),e("div.gallery, div.tiled-gallery, a.single-image-gallery, ul.wp-block-gallery, div.wp-block-jetpack-tiled-gallery").each(function(t,a){if(e(a).find("img").each(function(t,i){if(e(i).data("attachment-id")===parseInt(o,10))return r={index:t,gallery:a},!1}),r)return i=e(r.gallery),n=r.index,T()?M(n):Z(i,{startIndex:n}),!1;var i,n}))):a&&a.opened&&i.jp_carousel("close")}),window.location.hash&&e(window).trigger("hashchange")});