1var _____WB$wombat$assign$function_____=function(name){return (self._wb_wombat && self._wb_wombat.local_init && self._wb_wombat.local_init(name))||self[name];};if(!self.__WB_pmw){self.__WB_pmw=function(obj){this.__WB_source=obj;return this;}}{ 2let window = _____WB$wombat$assign$function_____("window"); 3let self = _____WB$wombat$assign$function_____("self"); 4let document = _____WB$wombat$assign$function_____("document"); 5let location = _____WB$wombat$assign$function_____("location"); 6let top = _____WB$wombat$assign$function_____("top"); 7let parent = _____WB$wombat$assign$function_____("parent"); 8let frames = _____WB$wombat$assign$function_____("frames"); 9let opens = _____WB$wombat$assign$function_____("opens"); 10/* Detect-zoom 11 * ----------- 12 * Cross Browser Zoom and Pixel Ratio Detector 13 * Version 1.0.4 | Apr 1 2013 14 * dual-licensed under the WTFPL and MIT license 15 * Maintained by https://github/tombigel 16 * Original developer https://github.com/yonran 17 */ 18 19//AMD and CommonJS initialization copied from https://github.com/zohararad/audio5js 20(function (root, ns, factory) { 21 "use strict"; 22 23 if (typeof (module) !== 'undefined' && module.exports) { // CommonJS 24 module.exports = factory(ns, root); 25 } else if (typeof (define) === 'function' && define.amd) { // AMD 26 define("factory", function () { 27 return factory(ns, root); 28 }); 29 } else { 30 root[ns] = factory(ns, root); 31 } 32 33}(window, 'detectZoom', function () { 34 35 /** 36 * Use devicePixelRatio if supported by the browser 37 * @return {Number} 38 * @private 39 */ 40 var devicePixelRatio = function () { 41 return window.devicePixelRatio || 1; 42 }; 43 44 /** 45 * Fallback function to set default values 46 * @return {Object} 47 * @private 48 */ 49 var fallback = function () { 50 return { 51 zoom: 1, 52 devicePxPerCssPx: 1 53 }; 54 }; 55 /** 56 * IE 8 and 9: no trick needed! 57 * TODO: Test on IE10 and Windows 8 RT 58 * @return {Object} 59 * @private 60 **/ 61 var ie8 = function () { 62 var zoom = Math.round((screen.deviceXDPI / screen.logicalXDPI) * 100) / 100; 63 return { 64 zoom: zoom, 65 devicePxPerCssPx: zoom * devicePixelRatio() 66 }; 67 }; 68 69 /** 70 * For IE10 we need to change our technique again... 71 * thanks https://github.com/stefanvanburen 72 * @return {Object} 73 * @private 74 */ 75 var ie10 = function () { 76 var zoom = Math.round((document.documentElement.offsetHeight / window.innerHeight) * 100) / 100; 77 return { 78 zoom: zoom, 79 devicePxPerCssPx: zoom * devicePixelRatio() 80 }; 81 }; 82 83 /** 84 * Mobile WebKit 85 * the trick: window.innerWIdth is in CSS pixels, while 86 * screen.width and screen.height are in system pixels. 87 * And there are no scrollbars to mess up the measurement. 88 * @return {Object} 89 * @private 90 */ 91 var webkitMobile = function () { 92 var deviceWidth = (Math.abs(window.orientation) == 90) ? screen.height : screen.width; 93 var zoom = deviceWidth / window.innerWidth; 94 return { 95 zoom: zoom, 96 devicePxPerCssPx: zoom * devicePixelRatio() 97 }; 98 }; 99 100 /** 101 * Desktop Webkit 102 * the trick: an element's clientHeight is in CSS pixels, while you can 103 * set its line-height in system pixels using font-size and 104 * -webkit-text-size-adjust:none. 105 * device-pixel-ratio: http://www.webkit.org/blog/55/high-dpi-web-sites/ 106 * 107 * Previous trick (used before http://trac.webkit.org/changeset/100847): 108 * documentElement.scrollWidth is in CSS pixels, while 109 * document.width was in system pixels. Note that this is the 110 * layout width of the document, which is slightly different from viewport 111 * because document width does not include scrollbars and might be wider 112 * due to big elements. 113 * @return {Object} 114 * @private 115 */ 116 var webkit = function () { 117 var important = function (str) { 118 return str.replace(/;/g, " !important;"); 119 }; 120 121 var div = document.createElement('div'); 122 div.innerHTML = "1<br>2<br>3<br>4<br>5<br>6<br>7<br>8<br>9<br>0"; 123 div.setAttribute('style', important('font: 100px/1em sans-serif; -webkit-text-size-adjust: none; text-size-adjust: none; height: auto; width: 1em; padding: 0; overflow: visible;')); 124 125 // The container exists so that the div will be laid out in its own flow 126 // while not impacting the layout, viewport size, or display of the 127 // webpage as a whole. 128 // Add !important and relevant CSS rule resets 129 // so that other rules cannot affect the results. 130 var container = document.createElement('div'); 131 container.setAttribute('style', important('width:0; height:0; overflow:hidden; visibility:hidden; position: absolute;')); 132 container.appendChild(div); 133 134 document.body.appendChild(container); 135 var zoom = 1000 / div.clientHeight; 136 zoom = Math.round(zoom * 100) / 100; 137 document.body.removeChild(container); 138 139 return{ 140 zoom: zoom, 141 devicePxPerCssPx: zoom * devicePixelRatio() 142 }; 143 }; 144 145 /** 146 * no real trick; device-pixel-ratio is the ratio of device dpi / css dpi. 147 * (Note that this is a different interpretation than Webkit's device 148 * pixel ratio, which is the ratio device dpi / system dpi). 149 * 150 * Also, for Mozilla, there is no difference between the zoom factor and the device ratio. 151 * 152 * @return {Object} 153 * @private 154 */ 155 var firefox4 = function () { 156 var zoom = mediaQueryBinarySearch('min--moz-device-pixel-ratio', '', 0, 10, 20, 0.0001); 157 zoom = Math.round(zoom * 100) / 100; 158 return { 159 zoom: zoom, 160 devicePxPerCssPx: zoom 161 }; 162 }; 163 164 /** 165 * Firefox 18.x
166 * Mozilla added support for devicePixelRatio to Firefox 18, 167 * but it is affected by the zoom level, so, like in older 168 * Firefox we can't tell if we are in zoom mode or in a device 169 * with a different pixel ratio 170 * @return {Object} 171 * @private 172 */ 173 var firefox18 = function () { 174 return { 175 zoom: firefox4().zoom, 176 devicePxPerCssPx: devicePixelRatio() 177 }; 178 }; 179 180 /** 181 * works starting Opera 11.11 182 * the trick: outerWidth is the viewport width including scrollbars in 183 * system px, while innerWidth is the viewport width including scrollbars 184 * in CSS px 185 * @return {Object} 186 * @private 187 */ 188 var opera11 = function () { 189 var zoom = window.top.outerWidth / window.top.innerWidth; 190 zoom = Math.round(zoom * 100) / 100; 191 return { 192 zoom: zoom, 193 devicePxPerCssPx: zoom * devicePixelRatio() 194 }; 195 }; 196 197 /** 198 * Use a binary search through media queries to find zoom level in Firefox 199 * @param property 200 * @param unit 201 * @param a 202 * @param b 203 * @param maxIter 204 * @param epsilon 205 * @return {Number} 206 */ 207 var mediaQueryBinarySearch = function (property, unit, a, b, maxIter, epsilon) { 208 var matchMedia; 209 var head, style, div; 210 if (window.matchMedia) { 211 matchMedia = window.matchMedia; 212 } else { 213 head = document.getElementsByTagName('head')[0]; 214 style = document.createElement('style'); 215 head.appendChild(style); 216 217 div = document.createElement('div'); 218 div.className = 'mediaQueryBinarySearch'; 219 div.style.display = 'none'; 220 document.body.appendChild(div); 221 222 matchMedia = function (query) { 223 style.sheet.insertRule('@media ' + query + '{.mediaQueryBinarySearch ' + '{text-decoration: underline} }', 0); 224 var matched = getComputedStyle(div, null).textDecoration == 'underline'; 225 style.sheet.deleteRule(0); 226 return {matches: matched}; 227 }; 228 } 229 var ratio = binarySearch(a, b, maxIter); 230 if (div) { 231 head.removeChild(style); 232 document.body.removeChild(div); 233 } 234 return ratio; 235 236 function binarySearch(a, b, maxIter) { 237 var mid = (a + b) / 2; 238 if (maxIter <= 0 || b - a < epsilon) { 239 return mid; 240 } 241 var query = "(" + property + ":" + mid + unit + ")"; 242 if (matchMedia(query).matches) { 243 return binarySearch(mid, b, maxIter - 1); 244 } else { 245 return binarySearch(a, mid, maxIter - 1); 246 } 247 } 248 }; 249 250 /** 251 * Generate detection function 252 * @private 253 */ 254 var detectFunction = (function () { 255 var func = fallback; 256 //IE8+ 257 if (!isNaN(screen.logicalXDPI) && !isNaN(screen.systemXDPI)) { 258 func = ie8; 259 } 260 // IE10+ / Touch 261 else if (window.navigator.msMaxTouchPoints) { 262 func = ie10; 263 } 264 //Mobile Webkit 265 else if ('orientation' in window && typeof document.body.style.webkitMarquee === 'string') { 266 func = webkitMobile; 267 } 268 //WebKit 269 else if (typeof document.body.style.webkitMarquee === 'string') { 270 func = webkit; 271 } 272 //Opera 273 else if (navigator.userAgent.indexOf('Opera') >= 0) { 274 func = opera11; 275 } 276 //Last one is Firefox 277 //FF 18.x 278 else if (window.devicePixelRatio) { 279 func = firefox18; 280 } 281 //FF 4.0 - 17.x 282 else if (firefox4().zoom > 0.001) { 283 func = firefox4; 284 } 285 286 return func; 287 }()); 288 289 290 return ({ 291 292 /** 293 * Ratios.zoom shorthand 294 * @return {Number} Zoom level 295 */ 296 zoom: function () { 297 return detectFunction().zoom; 298 }, 299 300 /** 301 * Ratios.devicePxPerCssPx shorthand 302 * @return {Number} devicePxPerCssPx level 303 */ 304 device: function () { 305 return detectFunction().devicePxPerCssPx; 306 } 307 }); 308})); 309 310var wpcom_img_zoomer = { 311 clientHintSupport: { 312 gravatar: false, 313 files: false, 314 photon: false, 315 mshots: false, 316 staticAssets: false, 317 latex: false, 318 imgpress: false, 319 }, 320 useHints: false, 321 zoomed: false, 322 timer: null, 323 interval: 1000, // zoom polling interval in millisecond 324 325 // Should we apply width/height attributes to control the image size? 326 imgNeedsSizeAtts: function( img ) {
327 // Do not overwrite existing width/height attributes. 328 if ( img.getAttribute('width') !== null || img.getAttribute('height') !== null ) 329 return false; 330 // Do not apply the attributes if the image is already constrained by a parent element. 331 if ( img.width < img.naturalWidth || img.height < img.naturalHeight ) 332 return false; 333 return true; 334 }, 335 336 hintsFor: function( service ) { 337 if ( this.useHints === false ) { 338 return false; 339 } 340 if ( this.hints() === false ) { 341 return false; 342 } 343 if ( typeof this.clientHintSupport[service] === "undefined" ) { 344 return false; 345 } 346 if ( this.clientHintSupport[service] === true ) { 347 return true; 348 } 349 return false; 350 }, 351 352 hints: function() { 353 try { 354 var chrome = window.navigator.userAgent.match(/\sChrome\/([0-9]+)\.[.0-9]+\s/) 355 if (chrome !== null) { 356 var version = parseInt(chrome[1], 10) 357 if (isNaN(version) === false && version >= 46) { 358 return true 359 } 360 } 361 } catch (e) { 362 return false 363 } 364 return false 365 }, 366 367 init: function() { 368 var t = this; 369 try{ 370 t.zoomImages(); 371 t.timer = setInterval( function() { t.zoomImages(); }, t.interval ); 372 } 373 catch(e){ 374 } 375 }, 376 377 stop: function() { 378 if ( this.timer ) 379 clearInterval( this.timer ); 380 }, 381 382 getScale: function() { 383 var scale = detectZoom.device(); 384 // Round up to 1.5 or the next integer below the cap. 385 if ( scale <= 1.0 ) scale = 1.0; 386 else if ( scale <= 1.5 ) scale = 1.5; 387 else if ( scale <= 2.0 ) scale = 2.0; 388 else if ( scale <= 3.0 ) scale = 3.0; 389 else if ( scale <= 4.0 ) scale = 4.0; 390 else scale = 5.0; 391 return scale; 392 }, 393 394 shouldZoom: function( scale ) { 395 var t = this; 396 // Do not operate on hidden frames. 397 if ( "innerWidth" in window && !window.innerWidth ) 398 return false; 399 // Don't do anything until scale > 1 400 if ( scale == 1.0 && t.zoomed == false ) 401 return false; 402 return true; 403 }, 404 405 zoomImages: function() { 406 var t = this; 407 var scale = t.getScale(); 408 if ( ! t.shouldZoom( scale ) ){ 409 return; 410 } 411 t.zoomed = true; 412 // Loop through all the <img> elements on the page. 413 var imgs = document.getElementsByTagName("img"); 414 415 for ( var i = 0; i < imgs.length; i++ ) { 416 // Wait for original images to load 417 if ( "complete" in imgs[i] && ! imgs[i].complete ) 418 continue; 419 420 // Skip images that have srcset attributes. 421 if ( imgs[i].hasAttribute('srcset') ) { 422 continue; 423 } 424 425 // Skip images that don't need processing. 426 var imgScale = imgs[i].getAttribute("scale"); 427 if ( imgScale == scale || imgScale == "0" ) 428 continue; 429 430 // Skip images that have already failed at this scale 431 var scaleFail = imgs[i].getAttribute("scale-fail"); 432 if ( scaleFail && scaleFail <= scale ) 433 continue; 434 435 // Skip images that have no dimensions yet. 436 if ( ! ( imgs[i].width && imgs[i].height ) ) 437 continue; 438 439 // Skip images from Lazy Load plugins 440 if ( ! imgScale && imgs[i].getAttribute("data-lazy-src") && (imgs[i].getAttribute("data-lazy-src") !== imgs[i].getAttribute("src"))) 441 continue; 442 443 if ( t.scaleImage( imgs[i], scale ) ) { 444 // Mark the img as having been processed at this scale. 445 imgs[i].setAttribute("scale", scale); 446 } 447 else { 448 // Set the flag to skip this image. 449 imgs[i].setAttribute("scale", "0"); 450 } 451 } 452 }, 453 454 scaleImage: function( img, scale ) { 455 var t = this; 456 var newSrc = img.src; 457 458 var isFiles = false; 459 var isLatex = false; 460 var isPhoton = false; 461 462 // Skip slideshow images 463 if ( img.parentNode.className.match(/slideshow-slide/) ) 464 return false; 465 466 // Skip CoBlocks Lightbox images 467 if ( img.parentNode.className.match(/coblocks-lightbox__image/) ) 468 return false; 469 470 // Scale gravatars that have ?s= or ?size= 471 if ( img.src.match( /^https?:\/\/([^\/]*\.)?gravatar\.com\/.+[?&](s|size)=/ ) ) { 472 if ( this.hintsFor( "gravatar" ) === true ) { 473 return false;
474 } 475 newSrc = img.src.replace( /([?&](s|size)=)(\d+)/, function( $0, $1, $2, $3 ) { 476 // Stash the original size 477 var originalAtt = "originals", 478 originalSize = img.getAttribute(originalAtt); 479 if ( originalSize === null ) { 480 originalSize = $3; 481 img.setAttribute(originalAtt, originalSize); 482 if ( t.imgNeedsSizeAtts( img ) ) { 483 // Fix width and height attributes to rendered dimensions. 484 img.width = img.width; 485 img.height = img.height; 486 } 487 } 488 // Get the width/height of the image in CSS pixels 489 var size = img.clientWidth; 490 // Convert CSS pixels to device pixels 491 var targetSize = Math.ceil(img.clientWidth * scale); 492 // Don't go smaller than the original size 493 targetSize = Math.max( targetSize, originalSize ); 494 // Don't go larger than the service supports 495 targetSize = Math.min( targetSize, 512 ); 496 return $1 + targetSize; 497 }); 498 } 499 500 // Scale mshots that have width 501 else if ( img.src.match(/^https?:\/\/([^\/]+\.)*(wordpress|wp)\.com\/mshots\/.+[?&]w=\d+/) ) { 502 if ( this.hintsFor( "mshots" ) === true ) { 503 return false; 504 } 505 newSrc = img.src.replace( /([?&]w=)(\d+)/, function($0, $1, $2) { 506 // Stash the original size 507 var originalAtt = 'originalw', originalSize = img.getAttribute(originalAtt); 508 if ( originalSize === null ) { 509 originalSize = $2; 510 img.setAttribute(originalAtt, originalSize); 511 if ( t.imgNeedsSizeAtts( img ) ) { 512 // Fix width and height attributes to rendered dimensions. 513 img.width = img.width; 514 img.height = img.height; 515 } 516 } 517 // Get the width of the image in CSS pixels 518 var size = img.clientWidth; 519 // Convert CSS pixels to device pixels 520 var targetSize = Math.ceil(size * scale); 521 // Don't go smaller than the original size 522 targetSize = Math.max( targetSize, originalSize ); 523 // Don't go bigger unless the current one is actually lacking 524 if ( scale > img.getAttribute("scale") && targetSize <= img.naturalWidth ) 525 targetSize = $2; 526 if ( $2 != targetSize ) 527 return $1 + targetSize; 528 return $0; 529 }); 530 531 // Update height attribute to match width 532 newSrc = newSrc.replace( /([?&]h=)(\d+)/, function($0, $1, $2) { 533 if ( newSrc == img.src ) { 534 return $0; 535 } 536 // Stash the original size 537 var originalAtt = 'originalh', originalSize = img.getAttribute(originalAtt); 538 if ( originalSize === null ) { 539 originalSize = $2; 540 img.setAttribute(originalAtt, originalSize); 541 } 542 // Get the height of the image in CSS pixels 543 var size = img.clientHeight; 544 // Convert CSS pixels to device pixels 545 var targetSize = Math.ceil(size * scale); 546 // Don't go smaller than the original size 547 targetSize = Math.max( targetSize, originalSize ); 548 // Don't go bigger unless the current one is actually lacking 549 if ( scale > img.getAttribute("scale") && targetSize <= img.naturalHeight ) 550 targetSize = $2; 551 if ( $2 != targetSize ) 552 return $1 + targetSize; 553 return $0; 554 }); 555 } 556 557 // Scale simple imgpress queries (s0.wp.com) that only specify w/h/fit 558 else if ( img.src.match(/^https?:\/\/([^\/.]+\.)*(wp|wordpress)\.com\/imgpress\?(.+)/) ) { 559 if ( this.hintsFor( "imgpress" ) === true ) { 560 return false; 561 } 562 var imgpressSafeFunctions = ["zoom", "url", "h", "w", "fit", "filter", "brightness", "contrast", "colorize", "smooth", "unsharpmask"]; 563 // Search the query string for unsupported functions. 564 var qs = RegExp.$3.split('&'); 565 for ( var q in qs ) { 566 q = qs[q].split('=')[0]; 567 if ( imgpressSafeFunctions.indexOf(q) == -1 ) { 568 return false; 569 } 570 } 571 // Fix width and height attributes to rendered dimensions. 572 img.width = img.width; 573 img.height = img.height; 574 // Compute new src 575 if ( scale == 1 ) 576 newSrc = img.src.replace(/\?(zoom=[^&]+&)?/, '?'); 577 else 578 newSrc = img.src.replace(/\?(zoom=[^&]+&)?/, '?zoom=' + scale + '&'); 579 } 580 581 // Scale files.wordpress.com, LaTeX, or Photon images (i#.wp.com) 582 else if ( 583 ( isFiles = img.src.match(/^https?:\/\/([^\/]+)\.files\.wordpress\.com\/.+[?&][wh]=/) ) || 584 ( isLatex = img.src.match(/^https?:\/\/([^\/.]+\.)*(wp|wordpress)\.com\/latex\.php\?(latex|zoom)=(.+)/) ) || 585 ( isPhoton = img.src.match(/^https?:\/\/i[\d]{1}\.wp\.com\/(.+)/) ) 586 ) { 587 if ( false !== isFiles && this.hintsFor( "files" ) === true ) { 588 return false 589 } 590 if ( false !== isLatex && this.hintsFor( "latex" ) === true ) { 591 return false 592 } 593 if ( false !== isPhoton && this.hintsFor( "photon" ) === true ) { 594 return false 595 } 596 // Fix width and height attributes to rendered dimensions. 597 img.width = img.width;
598 img.height = img.height; 599 // Compute new src 600 if ( scale == 1 ) { 601 newSrc = img.src.replace(/\?(zoom=[^&]+&)?/, '?'); 602 } else { 603 newSrc = img.src; 604 605 var url_var = newSrc.match( /([?&]w=)(\d+)/ ); 606 if ( url_var !== null && url_var[2] ) { 607 newSrc = newSrc.replace( url_var[0], url_var[1] + img.width ); 608 } 609 610 url_var = newSrc.match( /([?&]h=)(\d+)/ ); 611 if ( url_var !== null && url_var[2] ) { 612 newSrc = newSrc.replace( url_var[0], url_var[1] + img.height ); 613 } 614 615 var zoom_arg = '&zoom=2'; 616 if ( !newSrc.match( /\?/ ) ) { 617 zoom_arg = '?zoom=2'; 618 } 619 img.setAttribute( 'srcset', newSrc + zoom_arg + ' ' + scale + 'x' ); 620 } 621 } 622 623 // Scale static assets that have a name matching *-1x.png or *@1x.png 624 else if ( img.src.match(/^https?:\/\/[^\/]+\/.*[-@]([12])x\.(gif|jpeg|jpg|png)(\?|$)/) ) { 625 if ( this.hintsFor( "staticAssets" ) === true ) { 626 return false; 627 } 628 // Fix width and height attributes to rendered dimensions. 629 img.width = img.width; 630 img.height = img.height; 631 var currentSize = RegExp.$1, newSize = currentSize; 632 if ( scale <= 1 ) 633 newSize = 1; 634 else 635 newSize = 2; 636 if ( currentSize != newSize ) 637 newSrc = img.src.replace(/([-@])[12]x\.(gif|jpeg|jpg|png)(\?|$)/, '$1'+newSize+'x.$2$3'); 638 } 639 640 else { 641 return false; 642 } 643 644 // Don't set img.src unless it has changed. This avoids unnecessary reloads. 645 if ( newSrc != img.src ) { 646 // Store the original img.src 647 var prevSrc, origSrc = img.getAttribute("src-orig"); 648 if ( !origSrc ) { 649 origSrc = img.src; 650 img.setAttribute("src-orig", origSrc); 651 } 652 // In case of error, revert img.src 653 prevSrc = img.src; 654 img.onerror = function(){ 655 img.src = prevSrc; 656 if ( img.getAttribute("scale-fail") < scale ) 657 img.setAttribute("scale-fail", scale); 658 img.onerror = null; 659 }; 660 // Finally load the new image 661 img.src = newSrc; 662 } 663 664 return true; 665 } 666}; 667 668wpcom_img_zoomer.init(); 669; 670( function() { 671 var cookieValue = document.cookie.replace( /(?:(?:^|.*;\s*)eucookielaw\s*\=\s*([^;]*).*$)|^.*$/, '$1' ); 672 var overlay = document.querySelector( '#eu-cookie-law' ); 673 var container = document.querySelector( '.widget_eu_cookie_law_widget' ); 674 var initialScrollPosition, scrollFunction; 675 676 function remove( el ) { 677 return el && el.parentElement && el.parentElement.removeChild( el ); 678 } 679 680 function triggerDismissEvent() { 681 try { 682 const dismissEvent = new Event( 'eucookielaw-dismissed' ); 683 document.dispatchEvent( dismissEvent ); 684 } catch ( err ) { } 685 } 686 687 function removeOverlay() { 688 remove( overlay ); 689 triggerDismissEvent(); 690 } 691 692 function fade( el, type, fn ) { 693 var duration = 400; 694 695 el.style.display = 'block'; 696 el.style.transitionProperty = 'opacity'; 697 el.style.transitionDuration = duration + 'ms'; 698 el.style.opacity = type === 'in' ? 0 : 1; 699 700 // Double rAF to ensure styles are applied cross-browser. 701 requestAnimationFrame( function () { 702 requestAnimationFrame( function() { 703 el.style.opacity = type === 'in' ? 1 : 0; 704 // Wait for animation. 705 setTimeout( function () { 706 // Clean up. 707 el.style.removeProperty( 'opacity' ); 708 el.style.removeProperty( 'transition-property' ); 709 el.style.removeProperty( 'transition-duration' ); 710 711 if ( type === 'out' ) { 712 el.style.display = 'none'; 713 } 714 715 if ( typeof fn === 'function' ) { 716 fn(); 717 } 718 }, duration + 50 ); 719 } ); 720 } ); 721 } 722 723 function appendWidget() { 724 document.body.appendChild( container ); 725 overlay.style.display = 'block'; 726 fade( container, 'in' ); 727 } 728 729 if ( typeof wp !== 'undefined' && !! wp.customize ) { 730 appendWidget(); 731 return; 732 } 733 734 if ( ! overlay || ! container ) { 735 return; 736 } 737 738 if ( overlay.classList.contains( 'ads-active' ) ) { 739 var adsCookieValue = document.cookie.replace( /(?:(?:^|.*;\s*)personalized-ads-consent\s*\=\s*([^;]*).*$)|^.*$/, '$1' ); 740 if ( cookieValue !== '' && adsCookieValue !== '' ) { 741 removeOverlay(); 742 } 743 } else if ( cookieValue !== '' ) { 744 removeOverlay(); 745 } 746 747 appendWidget(); 748 749 overlay.querySelector( 'form' ).addEventListener( 'submit', accept ); 750 751 if ( overlay.classList.contains( 'hide-on-scroll' ) ) { 752 initialScrollPosition = window.pageYOffset; 753 754 scrollFunction = function() { 755 if ( Math.abs( window.pageYOffset - initialScrollPosition ) > 50 ) { 756 accept(); 757 } 758 }; 759 760 window.addEventListener( 'scroll', scrollFunction ); 761 } else if ( overlay.classList.contains( 'hide-on-time' ) ) { 762 var timeout = parseInt( overlay.getAttribute( 'data-hide-timeout' ), 10 ) || 0; 763 setTimeout( accept, timeout * 1000 ); 764 } 765 766 var accepted = false;
767 function accept( event ) { 768 if ( accepted ) { 769 return; 770 } 771 accepted = true; 772 773 if ( event && event.preventDefault ) { 774 event.preventDefault(); 775 } 776 777 if ( overlay.classList.contains( 'hide-on-scroll' ) ) { 778 window.removeEventListener( 'scroll', scrollFunction ); 779 } 780 781 var expireTime = new Date(); 782 var consentExpiration = parseInt( overlay.getAttribute( 'data-consent-expiration' ), 10 ) || 0; 783 expireTime.setTime( expireTime.getTime() + ( consentExpiration * 24 * 60 * 60 * 1000 ) ); 784 785 document.cookie = 'eucookielaw=' + expireTime.getTime() + ';path=/;expires=' + expireTime.toGMTString(); 786 if ( overlay.classList.contains( 'ads-active' ) && overlay.classList.contains( 'hide-on-button' ) ) { 787 document.cookie = 'personalized-ads-consent=' + expireTime.getTime() + ';path=/;expires=' + expireTime.toGMTString(); 788 } 789 790 fade( overlay, 'out', function() { 791 removeOverlay(); 792 remove( container ); 793 } ); 794 } 795} )(); 796; 797(function(){var __webpack_exports__={};(function(){var Scroller,ajaxurl,stats,type,text,totop,loading_text,isIE=-1!=navigator.userAgent.
797search("MSIE");if(isIE){var IEVersion=navigator.userAgent.match(/MSIE\s?(\d+)\.?\d*;/);IEVersion=parseInt(IEVersion[1])}function fullscreenState(){return document.fullscreenElement||document.mozFullScreenElement||document.webkitFullscreenElement||document.msFullscreenElement?1:0}"https:"==document.location.protocol&&(infiniteScroll.settings.ajaxurl=infiniteScroll.settings.ajaxurl.replace("http://","https://")),Scroller=function(e){var t=this;this.id=e.id,this.body=document.body,this.window=window,this.element=document.getElementById(e.id),this.wrapperClass=e.wrapper_class,this.ready=!0,this.disabled=!1,this.page=1,this.offset=e.offset,this.currentday=e.currentday,this.order=e.order,this.throttle=!1,this.click_handle=e.click_handle,this.google_analytics=e.google_analytics,this.history=e.history,this.origURL=window.location.href,this.handle=document.createElement("div"),this.handle.setAttribute("id","infinite-handle"),this.handle.innerHTML="<span><button>"+text.replace("\\","")+"</button></span>",this.footer={el:document.getElementById("infinite-footer"),wrap:e.footer},this.checkViewportOnLoadBound=t.checkViewportOnLoad.bind(this),this.wpMediaelement=null,"scroll"==type?(this.window.addEventListener("scroll",(function(){t.throttle=!0})),t.gotop(),setInterval((function(){t.throttle&&(t.throttle=!1,t.thefooter(),t.refresh(),t.determineURL())}),250),t.ensureFilledViewport(),this.body.addEventListener("is.post-load",t.checkViewportOnLoadBound)):"click"==type&&(this.click_handle&&this.element.appendChild(this.handle),this.handle.addEventListener("click",(function(){t.click_handle&&t.handle.parentNode.removeChild(t.handle),t.refresh()}))),this.body.addEventListener("is.post-load",t.initializeMejs)},Scroller.prototype.getScrollTop=function(){return window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0},Scroller.prototype.extend=function(e){e=e||{};for(var t=1;t<arguments.length;t++)if(arguments[t])for(var n in arguments[t])arguments[t].hasOwnProperty(n)&&(e[n]=arguments[t][n]);return e},Scroller.prototype.check=function(){return this.measure(this.element,[this.wrapperClass]).bottom<2*this.window.innerHeight},Scroller.prototype.render=function(e){var t=Array.prototype.slice.call(e.fragment.childNodes);for(this.body.classList.add("infinity-success");t.length>0;){var n=t.shift();this.element.appendChild(n)}this.trigger(this.body,"is.post-load",{jqueryEventName:"post-load",data:e}),this.ready=!0},Scroller.prototype.query=function(){return{page:this.page+this.offset,currentday:this.currentday,order:this.order,scripts:window.infiniteScroll.settings.scripts,styles:window.infiniteScroll.settings.styles,query_args:window.infiniteScroll.settings.query_args,query_before:window.infiniteScroll.settings.query_before,last_post_date:window.infiniteScroll.settings.last_post_date}},Scroller.prototype.animate=function(e,t){var n=performance.now();requestAnimationFrame((function i(o){var r=Math.min(1,(o-n)/t);e(r),r<1&&requestAnimationFrame(i)}))},Scroller.prototype.gotop=function(){var e=document.getElementById("infinity-blog-title"),t=this;e&&(e.setAttribute("title",totop),e.addEventListener("click",(function(e){var n=t.window.pageYOffset;e.preventDefault(),t.animate((function(e){var t=n-n*e;document.documentElement.scrollTop=document.body.scrollTop=t}),200)})))},Scroller.prototype.thefooter=function(){var e,t,n,i,o=this;if(this.footer&&this.footer.el){if("string"==typeof this.footer.wrap){try{t=(t=document.getElementById(this.footer.wrap).getBoundingClientRect()).width}catch(e){t=0}t>479&&(e=this.footer.el.querySelector(".container"))&&(e.style.width=t+"px")}n=parseInt(o.footer.el.style.bottom||-50,10),i=this.window.pageYOffset>=350?0:-50,n!==i&&o.animate((function(e){var t=n+(i-n)*e;o.footer.el.style.bottom=t+"px",1===e&&(n=i)}),200)}},Scroller.prototype.urlEncodeJSON=function(e,t){var n,i,o=[];for(var r in e)n=encodeURIComponent(r),i=t?t+"["+n+"]":n,"object"==typeof e[r]?!Array.isArray(e[r])||e[r].length>0?o.push(this.urlEncodeJSON(e[r],i)):o.push(i+"[]="):o.push(i+"="+encodeURIComponent(e[r]));return o.join("&")},Scroller.prototype.refresh=function(){var self=this,query,xhr,loader,customized;if(!this.disabled&&this.ready&&this.check())return this.ready=!1,this.click_handle&&(loader||(document.getElementById("infinite-aria").textContent=loading_text,loader=document.createElement("div"),loader.classList.add("infinite-loader"),loader.setAttribute("role","progress"),loader.innerHTML='<div class="spinner"><div class="spinner-inner"><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div></div></div>'),this.element.appendChild(loader)),query=self.extend({action:"infinite_scroll"},this.query()),"undefined"!=typeof wp&&wp.customize&&wp.customize.settings.theme&&(customized={},query.wp_customize="on",query.theme=wp.customize.settings.theme.stylesheet,wp.customize.each((function(e){e._dirty&&(customized[e.id]=e())})),query.customized=JSON.stringify(customized),query.nonce=wp.customize.settings.nonce.preview),xhr=new XMLHttpRequest,xhr.open("POST",infiniteScroll.
797settings.ajaxurl,!0),xhr.setRequestHeader("X-Requested-With","XMLHttpRequest"),xhr.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8"),xhr.send(self.urlEncodeJSON(query)),xhr.onerror=function(){self.click_handle&&loader.parentNode&&loader.parentNode.removeChild(loader),self.ready=!0},xhr.onload=function(){var response=JSON.parse(xhr.responseText),httpCheck=xhr.status>=200&&xhr.status<300,responseCheck=void 0!==response.html;if(response&&httpCheck&&responseCheck){if(self.click_handle&&loader.parentNode&&loader.parentNode.removeChild(loader),response.scripts&&Array.isArray(response.scripts)&&response.scripts.forEach((function(e){var t=e.footer?"body":"head";window.infiniteScroll.settings.scripts.push(e.handle),e.extra_data&&self.appendInlineScript(e.extra_data,t),e.before_handle&&self.appendInlineScript(e.before_handle,t);var n=document.createElement("script");n.type="text/javascript",n.src=e.src,n.id=e.handle,n.async=!1,e.after_handle&&(n.onload=function(){self.appendInlineScript(e.after_handle,t)}),"wp-mediaelement"===e.handle&&self.body.removeEventListener("is.post-load",self.initializeMejs),"wp-mediaelement"===e.handle&&"undefined"==typeof mejs?(self.wpMediaelement={},self.wpMediaelement.tag=n,self.wpMediaelement.element=t,setTimeout(self.maybeLoadMejs.bind(self),250)):document.getElementsByTagName(t)[0].appendChild(n)})),response.styles&&Array.isArray(response.styles)&&response.styles.forEach((function(item){window.infiniteScroll.settings.styles.push(item.handle);var style=document.createElement("link");style.rel="stylesheet",style.href=item.src,style.id=item.handle+"-css",!item.conditional||isIE&&eval(item.conditional.replace(/%ver/g,IEVersion))||(style=!1),style&&document.getElementsByTagName("head")[0].appendChild(style)})),response.fragment=document.createElement("div"),response.fragment.innerHTML=response.html,self.page++,stats&&((new Image).src=document.location.protocol+"https://pixel.wp.com/g.gif?"+stats+"&post=0&baba="+Math.random()),"object"==typeof response.postflair&&"object"==typeof WPCOM_sharing_counts&&(WPCOM_sharing_counts=self.extend(WPCOM_sharing_counts,response.postflair)),self.render.call(self,response),"click"==type?(infiniteScroll.settings.wrapper&&document.querySelector("#infinite-view-"+(self.page+self.offset-1)+" a:first-of-type").focus({preventScroll:!0}),response.lastbatch?self.click_handle?(self.body.classList.add("infinity-end"),self.body.classList.remove("infinity-success")):self.trigger(this.body,"infinite-scroll-posts-end"):self.click_handle?self.element.appendChild(self.handle):self.trigger(this.body,"infinite-scroll-posts-more")):response.lastbatch&&(self.disabled=!0,self.body.classList.add("infinity-end"),self.body.classList.remove("infinity-success")),response.currentday&&(self.currentday=response.currentday),self.google_analytics){var ga_url=self.history.path.replace(/%d/,self.page);"object"==typeof _gaq&&_gaq.push(["_trackPageview",ga_url]),"function"==typeof ga&&ga("send","pageview",ga_url)}}else self.click_handle&&loader.parentNode&&loader.parentNode.removeChild(loader)},xhr},Scroller.prototype.appendInlineScript=function(e,t){var n=document.createElement("script"),i=document.createTextNode("//<![CDATA[ \n"+e+"\n//]]>");n.type="text/javascript",n.appendChild(i),document.getElementsByTagName(t)[0].appendChild(n)},Scroller.prototype.maybeLoadMejs=function(){null!==this.wpMediaelement&&("undefined"==typeof mejs?setTimeout(this.maybeLoadMejs.bind(this),250):(document.getElementsByTagName(this.wpMediaelement.element)[0].appendChild(this.wpMediaelement.tag),this.wpMediaelement=null,this.body.addEventListener("is.post-load",this.initializeMejs)))},Scroller.prototype.initializeMejs=function(e){if(e.detail&&e.detail.html&&(-1!==e.detail.html.indexOf("wp-audio-shortcode")||-1!==e.detail.html.indexOf("wp-video-shortcode"))&&"undefined"!=typeof mejs){var t,n={};"undefined"!=typeof _wpmejsSettings&&(n.pluginPath=_wpmejsSettings.pluginPath),n.success=function(e){var t=e.attributes.autoplay&&"false"!==e.attributes.autoplay;"flash"===e.pluginType&&t&&e.addEventListener("canplay",(function(){e.play()}),!1)},t=document.querySelectorAll(".wp-audio-shortcode, .wp-video-shortcode"),t=(t=Array.prototype.slice.call(t)).filter((function(e){for(;e.parentNode;){if(e.classList.contains("mejs-container"))return!1;e=e.parentNode}return!0}));for(var i=0;i<t.length;i++)new MediaElementPlayer(t[i],n)}},Scroller.prototype.measure=function(e,t){t=t||[];for(var n,i,o,r=Array.prototype.slice.call(e.children),s=Number.MAX_VALUE,l=0;r.length>0;){for(n=r.shift(),o=0;o<t.length;o++)if(n.classList.contains(t[o])){r=r.concat(Array.prototype.slice.call(n.children));break}i=n.getBoundingClientRect(),s=Math.min(s,i.top),l=Math.max(l,i.bottom)}var a=Math.round(window.innerHeight/2),d=s<=a&&l>=a;return{top:s,bottom:l,height:l-s,factor:(Math.min(l,a)-Math.max(s,0))/a,isActive:d}},Scroller.prototype.ensureFilledViewport=function(){var e=this,t=e.window.innerHeight,n=e.measure(e.element,[e.wrapperClass]);e.body.removeEventListener("is.post-load",e.checkViewportOnLoadBound),0!==n.bottom&&n.bottom<t&&(e.ready=!0,e.refresh())},Scroller.prototype.checkViewportOnLoad=function(){this.ensureFilledViewport()};var previousFullScrenState=fullscreenState();Scroller.prototype.determineURL=function(){var e,t=this,n=-1,i=fullscreenState(),o=0;if(previousFullScrenState^i)previousFullScrenState=i;else{previousFullScrenState=i,e=document.querySelectorAll("."+t.wrapperClass);for(var r=0;r<e.length;r++){var s=t.measure(e[r]);if(s.isActive){n=parseInt(e[r].dataset.pageNum,10);break}s.factor>o&&(n=parseInt(e[r].dataset.pageNum,10),o=s.factor)}t.updateURL(n)}},Scroller.prototype.updateURL=function(e){if(window.history.pushState){var t=this,n=t.origURL;-1!==e&&(n=window.location.protocol+"//"+t.history.host+t.history.path.replace(/%d/,e)+t.history.parameters),window.location.href!=n&&history.pushState(null,null,n)}},Scroller.prototype.pause=function(){this.disabled=!0},Scroller.prototype.resume=function(){this.disabled=!1},Scroller.prototype.trigger=function(e,t,n){var i;(n=n||{}).jqueryEventName&&"undefined"!=typeof jQuery&&jQuery(e).trigger(n.jqueryEventName,n.data||null);try{i=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:n.data||null})}catch(e){(i=document.createEvent("CustomEvent")).initCustomEvent(t,!0,!0,n.data||null)}e.dispatchEvent(i)};
797var jetpackInfinityModule=function(){var e=infiniteScroll.settings.body_class.split(" ");if("object"==typeof infiniteScroll&&(e.forEach((function(e){e&&document.body.classList.add(e)})),ajaxurl=infiniteScroll.settings.ajaxurl,stats=infiniteScroll.settings.stats,type=infiniteScroll.settings.type,text=infiniteScroll.settings.text,totop=infiniteScroll.settings.totop,loading_text=infiniteScroll.settings.loading_text,infiniteScroll.scroller=new Scroller(infiniteScroll.settings),"click"==type)){var t=null;window.addEventListener("scroll",(function(){t||(t=setTimeout((function(){infiniteScroll.scroller.determineURL(),t=null}),250))}))}};"interactive"===document.readyState||"complete"===document.readyState?jetpackInfinityModule():document.addEventListener("DOMContentLoaded",jetpackInfinityModule)})()})();; 798/** 799 * navigation.js 800 * 801 * Handles toggling the navigation menu for small screens and enables tab 802 * support for dropdown menus. 803 */ 804( function() { 805 var container, button, menu, links, subMenus; 806 807 container = document.getElementById( 'site-navigation' ); 808 if ( ! container ) { 809 return; 810 } 811 812 button = container.getElementsByTagName( 'button' )[0]; 813 if ( 'undefined' === typeof button ) { 814 return; 815 } 816 817 menu = container.getElementsByTagName( 'ul' )[0]; 818 socialMenu = container.getElementsByTagName( 'ul' )[1]; 819 820 // Hide menu toggle button if both menus are empty and return early. 821 if ( 'undefined' === typeof menu && 'undefined' === typeof socialMenu ) { 822 button.style.display = 'none'; 823 return; 824 } 825 826 menu.setAttribute( 'aria-expanded', 'false' ); 827 if ( -1 === menu.className.indexOf( 'nav-menu' ) ) { 828 menu.className += ' nav-menu'; 829 } 830 831 button.onclick = function() { 832 if ( -1 !== container.className.indexOf( 'toggled' ) ) { 833 container.className = container.className.replace( ' toggled', '' ); 834 button.setAttribute( 'aria-expanded', 'false' ); 835 menu.setAttribute( 'aria-expanded', 'false' ); 836 socialMenu.setAttribute( 'aria-expanded', 'false' ); 837 } else { 838 container.className += ' toggled'; 839 button.setAttribute( 'aria-expanded', 'true' ); 840 menu.setAttribute( 'aria-expanded', 'true' ); 841 socialMenu.setAttribute( 'aria-expanded', 'true' ); 842 } 843 }; 844 845 // Get all the link elements within the menu. 846 links = menu.getElementsByTagName( 'a' ); 847 subMenus = menu.getElementsByTagName( 'ul' ); 848 849 // Set menu items with submenus to aria-haspopup="true". 850 for ( var i = 0, len = subMenus.length; i < len; i++ ) { 851 subMenus[i].parentNode.setAttribute( 'aria-haspopup', 'true' ); 852 } 853 854 // Each time a menu link is focused or blurred, toggle focus. 855 for ( i = 0, len = links.length; i < len; i++ ) { 856 links[i].addEventListener( 'focus', toggleFocus, true ); 857 links[i].addEventListener( 'blur', toggleFocus, true ); 858 } 859 860 /** 861 * Sets or removes .focus class on an element. 862 */ 863 function toggleFocus() { 864 var self = this; 865 866 // Move up through the ancestors of the current link until we hit .nav-menu. 867 while ( -1 === self.className.indexOf( 'nav-menu' ) ) { 868 869 // On li elements toggle the class .focus. 870 if ( 'li' === self.tagName.toLowerCase() ) { 871 if ( -1 !== self.className.indexOf( 'focus' ) ) { 872 self.className = self.className.replace( ' focus', '' ); 873 } else { 874 self.className += ' focus'; 875 } 876 } 877 878 self = self.parentElement; 879 } 880 } 881 882 // Fix child menus for touch devices. 883 function fixMenuTouchTaps( container ) { 884 var touchStartFn, 885 parentLink = container.querySelectorAll( '.menu-item-has-children > a, .page_item_has_children > a' ); 886 887 if ( 'ontouchstart' in window ) { 888 touchStartFn = function( e ) { 889 var menuItem = this.parentNode; 890 891 if ( ! menuItem.classList.contains( 'focus' ) ) { 892 e.preventDefault(); 893 for( var i = 0; i < menuItem.parentNode.children.length; ++i ) { 894 if ( menuItem === menuItem.parentNode.children[i] ) { 895 continue; 896 } 897 menuItem.parentNode.children[i].classList.remove( 'focus' ); 898 } 899 menuItem.classList.add( 'focus' ); 900 } else { 901 menuItem.classList.remove( 'focus' ); 902 } 903 }; 904 905 for ( var i = 0; i < parentLink.length; ++i ) { 906 parentLink[i].addEventListener( 'touchstart', touchStartFn, false ) 907 } 908 } 909 } 910 911 fixMenuTouchTaps( container ); 912} )(); 913; 914( function() { 915 var is_webkit = navigator.userAgent.toLowerCase().indexOf( 'webkit' ) > -1, 916 is_opera = navigator.userAgent.toLowerCase().indexOf( 'opera' ) > -1, 917 is_ie = navigator.userAgent.toLowerCase().indexOf( 'msie' ) > -1; 918 919 if ( ( is_webkit || is_opera || is_ie ) && document.getElementById && window.addEventListener ) { 920 window.addEventListener( 'hashchange', function() { 921 var id = location.hash.substring( 1 ), 922 element; 923 924 if ( ! ( /^[A-z0-9_-]+$/.test( id ) ) ) { 925 return; 926 } 927 928 element = document.getElementById( id ); 929 930 if ( element ) { 931 if ( ! ( /^(?:a|select|input|button|textarea)$/i.test( element.tagName ) ) ) { 932 element.tabIndex = -1; 933 } 934 935 element.focus(); 936 } 937 }, false ); 938 } 939})(); 940; 941/* global FB, jpfbembed */ 942( function ( window ) { 943 var facebookEmbed = function () { 944 var fbroot, src, newScript, firstScript; 945 946 if ( 'undefined' !== typeof FB && FB.XFBML ) {
947 FB.XFBML.parse(); 948 } else { 949 fbroot = document.createElement( 'div' ); 950 fbroot.id = 'fb-root'; 951 document.getElementsByTagName( 'body' )[ 0 ].appendChild( fbroot ); 952 953 src = 'https://connect.facebook.net/' + jpfbembed.locale + '/sdk.js#xfbml=1'; 954 if ( jpfbembed.appid ) { 955 src += '&appId=' + jpfbembed.appid; 956 } 957 src += '&version=v2.3'; 958 959 newScript = document.createElement( 'script' ); 960 newScript.setAttribute( 'src', src ); 961 firstScript = document.querySelector( 'script' ); 962 firstScript.parentNode.insertBefore( newScript, firstScript ); 963 } 964 }; 965 966 window.fbAsyncInit = function () { 967 FB.init( { 968 appId: jpfbembed.appid, 969 version: 'v2.3', 970 } ); 971 972 FB.XFBML.parse(); 973 }; 974 975 if ( 'undefined' !== typeof infiniteScroll ) { 976 document.body.addEventListener( 'post-load', facebookEmbed ); 977 } 978 979 facebookEmbed(); 980} )( window ); 981; 982! ( function ( d, s, id ) { 983 var js, 984 fjs = d.getElementsByTagName( s )[ 0 ], 985 p = /^http:/.test( d.location ) ? 'http' : 'https'; 986 if ( ! d.getElementById( id ) ) { 987 js = d.createElement( s ); 988 js.id = id; 989 js.src = p + '://platform.twitter.com/widgets.js'; 990 fjs.parentNode.insertBefore( js, fjs ); 991 } 992} )( document, 'script', 'twitter-wjs' ); 993; 994/* globals JSON */ 995( function () { 996 var eventName = 'wpcom_masterbar_click'; 997 998 var linksTracksEvents = { 999 // top level items 1000 'wp-admin-bar-blog' : 'my_sites', 1001 'wp-admin-bar-newdash' : 'reader', 1002 'wp-admin-bar-ab-new-post' : 'write_button', 1003 'wp-admin-bar-my-account' : 'my_account', 1004 'wp-admin-bar-notes' : 'notifications', 1005 // my sites - top items 1006 'wp-admin-bar-switch-site' : 'my_sites_switch_site', 1007 'wp-admin-bar-blog-info' : 'my_sites_site_info', 1008 'wp-admin-bar-site-view' : 'my_sites_view_site', 1009 'wp-admin-bar-blog-stats' : 'my_sites_site_stats', 1010 'wp-admin-bar-plan' : 'my_sites_plan', 1011 'wp-admin-bar-plan-badge' : 'my_sites_plan_badge', 1012 // my sites - manage 1013 'wp-admin-bar-edit-page' : 'my_sites_manage_site_pages', 1014 'wp-admin-bar-new-page-badge' : 'my_sites_manage_add_page', 1015 'wp-admin-bar-edit-post' : 'my_sites_manage_blog_posts', 1016 'wp-admin-bar-new-post-badge' : 'my_sites_manage_add_post', 1017 'wp-admin-bar-edit-attachment' : 'my_sites_manage_media', 1018 'wp-admin-bar-new-attachment-badge' : 'my_sites_manage_add_media', 1019 'wp-admin-bar-comments' : 'my_sites_manage_comments', 1020 'wp-admin-bar-edit-jetpack-testimonial' : 'my_sites_manage_testimonials', 1021 'wp-admin-bar-new-jetpack-testimonial' : 'my_sites_manage_add_testimonial', 1022 'wp-admin-bar-edit-jetpack-portfolio' : 'my_sites_manage_portfolio', 1023 'wp-admin-bar-new-jetpack-portfolio' : 'my_sites_manage_add_portfolio', 1024 // my sites - personalize 1025 'wp-admin-bar-themes' : 'my_sites_personalize_themes', 1026 'wp-admin-bar-cmz' : 'my_sites_personalize_themes_customize', 1027 // my sites - configure 1028 'wp-admin-bar-sharing' : 'my_sites_configure_sharing', 1029 'wp-admin-bar-people' : 'my_sites_configure_people', 1030 'wp-admin-bar-people-add' : 'my_sites_configure_people_add_button', 1031 'wp-admin-bar-plugins' : 'my_sites_configure_plugins', 1032 'wp-admin-bar-domains' : 'my_sites_configure_domains', 1033 'wp-admin-bar-domains-add' : 'my_sites_configure_add_domain', 1034 'wp-admin-bar-blog-settings' : 'my_sites_configure_settings', 1035 'wp-admin-bar-legacy-dashboard' : 'my_sites_configure_wp_admin', 1036 // reader 1037 'wp-admin-bar-followed-sites' : 'reader_followed_sites', 1038 'wp-admin-bar-reader-followed-sites-manage': 'reader_manage_followed_sites', 1039 'wp-admin-bar-discover-discover' : 'reader_discover', 1040 'wp-admin-bar-discover-search' : 'reader_search', 1041 'wp-admin-bar-my-activity-my-likes' : 'reader_my_likes', 1042 // account 1043 'wp-admin-bar-user-info' : 'my_account_user_name', 1044 // account - profile 1045 'wp-admin-bar-my-profile' : 'my_account_profile_my_profile', 1046 'wp-admin-bar-account-settings' : 'my_account_profile_account_settings', 1047 'wp-admin-bar-billing' : 'my_account_profile_manage_purchases', 1048 'wp-admin-bar-security' : 'my_account_profile_security', 1049 'wp-admin-bar-notifications' : 'my_account_profile_notifications', 1050 // account - special 1051 'wp-admin-bar-get-apps' : 'my_account_special_get_apps', 1052 'wp-admin-bar-next-steps' : 'my_account_special_next_steps', 1053 'wp-admin-bar-help' : 'my_account_special_help', 1054 }; 1055 1056 var notesTracksEvents = { 1057 openSite: function ( data ) { 1058 return { 1059 clicked: 'masterbar_notifications_panel_site', 1060 site_id: data.siteId 1061 }; 1062 }, 1063 openPost: function ( data ) { 1064 return { 1065 clicked: 'masterbar_notifications_panel_post', 1066 site_id: data.siteId, 1067 post_id: data.postId 1068 }; 1069 }, 1070 openComment: function ( data ) { 1071 return { 1072 clicked: 'masterbar_notifications_panel_comment', 1073 site_id: data.siteId, 1074 post_id: data.postId, 1075 comment_id: data.commentId 1076 }; 1077 } 1078 }; 1079
1080 // Element.prototype.matches as a standalone function, with old browser fallback 1081 function matches( node, selector ) { 1082 if ( ! node ) { 1083 return undefined; 1084 } 1085 1086 if ( ! Element.prototype.matches && ! Element.prototype.msMatchesSelector ) { 1087 throw new Error( 'Unsupported browser' ); 1088 } 1089 1090 return Element.prototype.matches ? node.matches( selector ) : node.msMatchesSelector( selector ); 1091 } 1092 1093 // Element.prototype.closest as a standalone function, with old browser fallback 1094 function closest( node, selector ) { 1095 if ( ! node ) { 1096 return undefined; 1097 } 1098 1099 if ( Element.prototype.closest ) { 1100 return node.closest( selector ); 1101 } 1102 1103 do { 1104 if ( matches( node, selector ) ) { 1105 return node; 1106 } 1107 1108 node = node.parentElement || node.parentNode; 1109 } while ( node !== null && node.nodeType === 1 ); 1110 1111 return null; 1112 } 1113 1114 function recordTracksEvent( eventProps ) { 1115 eventProps = eventProps || {}; 1116 window._tkq = window._tkq || []; 1117 window._tkq.push( [ 'recordEvent', eventName, eventProps ] ); 1118 } 1119 1120 function parseJson( s, defaultValue ) { 1121 try { 1122 return JSON.parse( s ); 1123 } catch ( e ) { 1124 return defaultValue; 1125 } 1126 } 1127 1128 function createTrackableLinkEventHandler( link ) { 1129 return function () { 1130 var parent = closest( link, 'li' ); 1131 1132 if ( ! parent ) { 1133 return; 1134 } 1135 1136 var trackingId = link.getAttribute( 'ID' ) || parent.getAttribute( 'ID' ); 1137 1138 if ( ! linksTracksEvents.hasOwnProperty( trackingId ) ) { 1139 return; 1140 } 1141 1142 var eventProps = { 'clicked': linksTracksEvents[ trackingId ] }; 1143 recordTracksEvent( eventProps ); 1144 } 1145 } 1146 1147 function init() { 1148 var trackableLinkSelector = '.mb-trackable .ab-item:not(div),' + 1149 '#wp-admin-bar-notes .ab-item,' + 1150 '#wp-admin-bar-user-info .ab-item,' + 1151 '.mb-trackable .ab-secondary'; 1152 1153 var trackableLinks = document.querySelectorAll( trackableLinkSelector ); 1154 1155 for ( var i = 0; i < trackableLinks.length; i++ ) { 1156 var link = trackableLinks[ i ]; 1157 var handler = createTrackableLinkEventHandler( link ); 1158 1159 link.addEventListener( 'click', handler ); 1160 link.addEventListener( 'touchstart', handler ); 1161 } 1162 } 1163 1164 if ( document.readyState === 'loading' ) { 1165 document.addEventListener( 'DOMContentLoaded', init ); 1166 } else { 1167 init(); 1168 } 1169 1170 // listen for postMessage events from the notifications iframe 1171 window.addEventListener( 'message', function ( event ) { 1172 if ( event.origin !== 'https://widgets.wp.com' ) { 1173 return; 1174 } 1175 1176 var data = ( typeof event.data === 'string' ) ? parseJson( event.data, {} ) : event.data; 1177 if ( data.type !== 'notesIframeMessage' ) { 1178 return; 1179 } 1180 1181 var eventData = notesTracksEvents[ data.action ]; 1182 if ( ! eventData ) { 1183 return; 1184 } 1185 1186 recordTracksEvent( eventData( data ) ); 1187 }, false ); 1188 1189} )(); 1190; 1191!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.style.removeProperty("display"),e.style.opacity=t,e.style.transition="opacity 0.2s",e.style.pointerEvents="none";var a=function(t){t.target===e&&"opacity"===t.propertyName&&(e.style.removeProperty("transition"),e.style.removeProperty("opacity"),e.style.removeProperty("pointer-events"),e.removeEventListener("transitionend",a),e.removeEventListener("transitioncancel",a),o())};requestAnimationFrame((function(){requestAnimationFrame((function(){e.addEventListener("transitionend",a),e.addEventListener("transitioncancel",a),e.style.opacity=r}))}))}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=300,l=t.scrollTop,s=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 c(){a=!1}
1191s=Math.min(s,t.scrollHeight-window.innerHeight),t.addEventListener("wheel",c),function e(){var u,d=Date.now(),p=(u=(d-i)/n)<.5?2*u*u:1-Math.pow(-2*u+2,2)/2,m=(p=p>1?1:p)*s;if(t.scrollTop=l+m,d<=i+n&&a)return requestAnimationFrame(e);r&&r(),o&&(o.style.minHeight=""),a=!1,t.removeEventListener("wheel",c)}()},getJSONAttribute:function(e,t){if(e&&e.hasAttribute(t))try{return JSON.parse(e.getAttribute(t))}catch(e){return}},convertToPlainText:function(e){var t=document.createElement("div");return t.textContent=e,t.innerHTML},stripHTML:function(e){return e.replace(/<[^>]*>?/gm,"")},emitEvent:function(e,t,r){var o;try{o=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:r||null})}catch(e){(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(),b()}}function f(){s=!0}function v(){s=!1}function y(){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;if(a===p.overlay){if(n)return;b()}else if(i)b();else if(a.classList.contains("jp-carousel-image-download"))m("download_original_click");else if(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;else if(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 w(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 w(jetpackCarouselStrings.no_comment_email,!1);if(!c.author.length)return void w(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(e){return void w(jetpackCarouselStrings.comment_post_error,!1)}"approved"===e.comment_status?w(jetpackCarouselStrings.comment_approved,!0):"unapproved"===e.comment_status?w(jetpackCarouselStrings.comment_unapproved,!0):w(jetpackCarouselStrings.comment_post_error,!1),E(),q(a),l.value=jetpackCarouselStrings.post_comment,r.hide(n),s.classList.remove("jp-carousel-is-disabled")}else w(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);else if(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);else if(!r.closest(a,".jp-carousel-info"))return})),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 w(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 j(){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&&(t.classList.add("single-image-gallery"),t.setAttribute("data-carousel-extra",JSON.stringify({blog_id:Number(jetpackCarouselStrings.blog_id)})))}}))}function S(o){(!o||o<0||o>p.slides.length)&&(o=0),p.currentSlide=p.slides[o];var a,i,n=p.currentSlide,s=n.attrs.attachmentId,c=p.info.querySelector(".jp-carousel-icon-info"),u=p.info.querySelector(".jp-carousel-icon-comments");(c&&c.classList.contains("jp-carousel-selected")||u&&u.classList.contains("jp-carousel-selected"))&&0!==p.overlay.scrollTop&&r.scrollToElement(p.overlay,p.overlay),function(e){var t=e.el,r=e.attrs,o=t.querySelector("img");if(!o.hasAttribute("data-loaded")){var a=!!r.previewImage,i=r.thumbSize;!a||i&&t.offsetWidth>i.width?o.src=r.src:o.src=r.previewImage,o.setAttribute("itemprop","image"),o.setAttribute("data-loaded",1)}}(p.slides[o]),1!==Number(jetpackCarouselStrings.display_background_image)||p.slides[o].backgroundImage||function(t){var r=t.el;e&&e.slides&&(r=e.slides[e.activeIndex]);var o=t.attrs.originalElement;o.complete&&0!==o.naturalHeight?A(t,r,o):o.onload=function(){A(t,r,o)}}(p.slides[o]),r.hide(p.caption),function(e){var t,o,a,i,n="",l="",s="";if(t=p.overlay.querySelector(".jp-carousel-photo-caption"),o=p.overlay.querySelector(".jp-carousel-caption"),a=p.overlay.querySelector(".jp-carousel-photo-title"),i=p.overlay.querySelector(".jp-carousel-photo-description"),r.hide(t),r.hide(o),r.hide(a),r.hide(i),n=k(e.caption)||"",l=k(e.title)||"",s=k(e.desc)||"",(n||l||s)&&(n&&(t.innerHTML=n,o.innerHTML=n,r.show(t),r.show(o)),r.stripHTML(n)===r.stripHTML(l)&&(l=""),r.stripHTML(n)===r.stripHTML(s)&&(s=""),r.stripHTML(l)===r.
1191stripHTML(s)&&(s=""),s&&(i.innerHTML=s,r.show(i),l||n||(t.innerHTML=r.stripHTML(s),r.show(t))),l)){var c=r.stripHTML(l);a.innerHTML=c,n||(t.innerHTML=c,o.innerHTML=c,r.show(t)),r.show(a)}}({caption:n.attrs.caption,title:n.attrs.title,desc:n.attrs.desc}),function(e){if(!e||1!==Number(jetpackCarouselStrings.display_exif))return!1;var t=p.info.querySelector(".jp-carousel-image-meta ul.jp-carousel-image-exif"),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=x(a);break;case"aperture":a="f/"+a}r+="<li><h5>"+jetpackCarouselStrings[o]+"</h5>"+a+"</li>"}}t.innerHTML=r,t.style.removeProperty("display")}(p.slides[o].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")}(n),1===Number(jetpackCarouselStrings.display_comments)&&(a=p.slides[o].attrs.commentsOpened,i=p.container.querySelector(".jp-carousel-comment-form-container"),1===parseInt(a,10)?r.fadeIn(i):r.fadeOut(i),q(s),r.hide(p.info.querySelector("#jp-carousel-comment-post-results")));var d=p.info.querySelector(".jp-carousel-pagination");if(d&&p.slides.length>5){var m=o+1;d.innerHTML="<span>"+m+" / "+p.slides.length+"</span>"}jetpackCarouselStrings.stats&&((new Image).src=document.location.protocol+"https://pixel.wp.com/g.gif?"+jetpackCarouselStrings.stats+"&post="+encodeURIComponent(s)+"&rand="+Math.random()),g(s),window.location.hash=l="#jp-carousel-"+s}function b(){document.body.style.overflow=a,document.documentElement.style.overflow=i,E(),f(),r.emitEvent(p.overlay,"jp_carousel.beforeClose"),window.scrollTo(window.scrollX||window.pageXOffset||0,n||0),e.destroy(),p.isOpen=!1,p.slides=[],p.currentSlide=void 0,p.gallery.innerHTML="",r.fadeOut(p.overlay,(function(){r.emitEvent(p.overlay,"jp_carousel.afterClose")}))}function L(e,t,r){var o=r?e.replace(/.*=([\d]+%2C[\d]+).*$/,"$1"):e.replace(/.*-([\d]+x[\d]+)\..+$/,"$1"),a=o!==e?r?o.split("%2C"):o.split("x"):[t,0];return"9999"===a[0]&&(a[0]="0"),"9999"===a[1]&&(a[1]="0"),a}function x(e){return e>=1?Math.round(10*e)/10+"s":"1/"+Math.round(1/e)+"s"}function k(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(e){}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()}}
1191function A(e,r,o){var a=t.getBackgroundImage(o);e.backgroundImage=a,r.style.backgroundImage="url("+a+")",r.style.backgroundSize="cover"}function E(){p.commentField&&(p.commentField.value="")}function T(e,o){p.slides=[];var a={width:window.innerWidth,height:window.innerHeight-64};0!==o&&((new Image).src=e[o].getAttribute("data-gallery-src"));var i=!!r.closest(e[0],".tiled-gallery.type-rectangular");Array.prototype.forEach.call(e,(function(e,o){var n=r.closest(e,"a"),l=e.getAttribute("data-orig-file")||e.getAttribute("src-orig"),s=e.getAttribute("data-attachment-id")||e.getAttribute("data-id")||"0",c=document.querySelector('img[data-attachment-id="'+s+'"] + figcaption');c=c?c.innerHTML:e.getAttribute("data-image-caption");var u={originalElement:e,attachmentId:s,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")||"",mediumFile:e.getAttribute("data-medium-file")||"",largeFile:e.getAttribute("data-large-file")||"",origFile:l||"",thumbSize:{width:e.naturalWidth,height:e.naturalHeight},caption:c||"",permalink:n&&n.getAttribute("href"),src:l||e.getAttribute("src")||""},d=r.closest(e,".tiled-gallery-item"),m=d&&d.querySelector(".tiled-gallery-caption"),g=m&&m.innerHTML;g&&(u.caption=g);var h=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(u.origWidth=h.width||u.thumbSize.width,u.origHeight=h.height||u.thumbSize.height,"undefined"!=typeof wpcom&&wpcom.carousel&&wpcom.carousel.generateImgSrc?u.src=wpcom.carousel.generateImgSrc(e,a):u.src=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 r=/^i[0-2]\.wp\.com$/i.test(t.hostname),o=L(e.mediumFile,e.origWidth,r),a=L(e.largeFile,e.origWidth,r),i=parseInt(a[0],10),n=parseInt(a[1],10),l=parseInt(o[0],10),s=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),i>=e.maxWidth||n>=e.maxHeight)return e.largeFile;if(l>=e.maxWidth||s>=e.maxHeight)return e.mediumFile;if(r){var c=e.largeFile.lastIndexOf("?"),u=e.largeFile;return-1!==c&&(u=e.largeFile.substring(0,c),(e.origWidth>e.maxWidth||e.origHeight>e.maxHeight)&&(e.origMaxWidth=2*e.maxWidth,e.origMaxHeight=2*e.maxHeight,u+="?fit="+e.origMaxWidth+"%2C"+e.origMaxHeight)),u}return e.origFile}({origFile:u.src,origWidth:u.origWidth,origHeight:u.origHeight,maxWidth:a.width,maxHeight:a.height,mediumFile:u.mediumFile,largeFile:u.largeFile}),e.setAttribute("data-gallery-src",u.src),"0"!==u.attachmentId){u.title=t.texturize(u.title),u.desc=t.texturize(u.desc),u.caption=t.texturize(u.caption);var f=new Image;f.src=u.src;var v=document.createElement("div");v.classList.add("swiper-slide"),v.setAttribute("itemprop","associatedMedia"),v.setAttribute("itemscope",""),v.setAttribute("itemtype","https://schema.org/ImageObject");var y=document.createElement("div");y.classList.add("swiper-zoom-container"),p.gallery.appendChild(v),v.appendChild(y),y.appendChild(f),v.setAttribute("data-attachment-id",u.attachmentId),v.setAttribute("data-permalink",u.permalink),v.setAttribute("data-orig-file",u.origFile),i&&(u.previewImage=u.src);var w={el:v,attrs:u,index:o};p.slides.push(w)}}))}function H(e,t){if(!window.Swiper670){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),C(e,t)},a.onerror=function(){r.hide(o)},void document.head.appendChild(a)}C(e,t)}function C(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&&(y(),!p.isOpen)){for(var u 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[u]=o[u];-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",T(t.querySelectorAll(s.imgSelector),s.startIndex),(e=new window.Swiper670(".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(){S(s.startIndex)}},preventClicks:!1,preventClicksPropagation:!1,preventInteractionOnTransition:!r.isTouch(),threshold:5}
1191)).on("slideChange",(function(e){S(0===e.activeIndex?p.slides.length-1:e.activeIndex===p.slides.length+1?0:e.activeIndex-1),p.overlay.classList.remove("jp-carousel-hide-controls")})),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")}))}}document.body.addEventListener("click",(function(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;var i=o.parentElement,n=i.parentElement,l=null;if(n&&n.classList.contains("wp-block-image")?l=i.getAttribute("href"):i&&i.classList.contains("wp-block-image")&&i.querySelector(":scope > a")&&(l=i.querySelector(":scope > a").getAttribute("href")),l&&l.split("?")[0]!==o.getAttribute("data-orig-file").split("?")[0]&&l!==o.getAttribute("data-permalink"))return;if(i.classList.contains("gallery-caption"))return;if(r.matches(i,"figcaption"))return;document.documentElement.style.height="auto",e.preventDefault(),e.stopPropagation();var s=r.closest(o,d),u=Array.prototype.indexOf.call(a.querySelectorAll(d),s);H(a,{startIndex:u})}}})),1===Number(jetpackCarouselStrings.single_image_gallery)&&(j(),document.body.addEventListener("is.post-load",(function(){j()}))),window.addEventListener("hashchange",(function(){var t=/jp-carousel-(\d+)/;if(window.location.hash&&t.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 r,o,a=window.location.hash.match(t),i=parseInt(a[1],10),n=document.querySelectorAll(c),s=0;s<n.length;s++){for(var u,d=n[s],m=d.querySelectorAll("img"),g=0;g<m.length;g++)if(parseInt(m[g].getAttribute("data-attachment-id"),10)===i||parseInt(m[g].getAttribute("data-id"),10)===i){u=g;break}if(void 0!==u){r=d,o=u,p.isOpen?(S(o),e.slideTo(o+1)):H(r,{startIndex:o});break}}}}else p.isOpen&&b()})),window.location.hash&&r.emitEvent(window,"hashchange")}"loading"!==document.readyState?o():document.addEventListener("DOMContentLoaded",o)}();; 1192!function(){function e(){this.galleries=[],this.findAndSetupNewGalleries()}function t(e){this.gallery=e,this.addCaptionEvents(),this.resize(),this.gallery.classList.remove("tiled-gallery-unresized")}e.prototype.findAndSetupNewGalleries=function(){var e=this,r=document.querySelectorAll(".tiled-gallery.tiled-gallery-unresized");Array.prototype.forEach.call(r,(function(r){e.galleries.push(new t(r))}))},e.prototype.resizeAll=function(){Array.prototype.forEach.call(this.galleries,(function(e){e.resize()}))},t.prototype.resizeableElementsSelector=".gallery-row, .gallery-group, .tiled-gallery-item img",t.prototype.addCaptionEvents=function(){var e=this.gallery.querySelectorAll(".tiled-gallery-caption");Array.prototype.forEach.call(e,(function(e){e.style.display="none"}));var t=function(e){var t=e.target.closest(".tiled-gallery-item"),r="mouseover"===e.type?"block":"none";if(t){var i=t.querySelector(".tiled-gallery-caption");i&&(i.style.display=r)}};this.gallery.addEventListener("mouseover",t),this.gallery.addEventListener("mouseout",t)},t.prototype.getExtraDimension=function(e,t,r){if("horizontal"===r){var i="border"===t?"borderLeftWidth":t+"Left",n="border"===t?"borderRightWidth":t+"Right";return(parseInt(e.style[i],10)||0)+(parseInt(e.style[n],10)||0)}if("vertical"===r){var o="border"===t?"borderTopWidth":t+"Top",a="border"===t?"borderBottomWidth":t+"Bottom";return(parseInt(e.style[o],10)||0)+(parseInt(e.style[a],10)||0)}return 0},t.prototype.resize=function(){var e=parseInt(this.gallery.dataset.originalWidth,10),t=parseFloat(getComputedStyle(this.gallery.parentNode,null).width.replace("px","")),r=Math.min(1,t/e),i=this,n=this.gallery.querySelectorAll(this.resizeableElementsSelector);Array.prototype.forEach.call(n,(function(e){var t=i.getExtraDimension(e,"margin","horizontal"),n=i.getExtraDimension(e,"margin","vertical"),o=i.getExtraDimension(e,"padding","horizontal"),a=i.getExtraDimension(e,"padding","vertical"),l=i.getExtraDimension(e,"border","horizontal"),s=i.getExtraDimension(e,"border","vertical"),d=parseInt(e.dataset.originalWidth,10)+o+l+t,c=parseInt(e.dataset.originalHeight,10)+a+s+n;e.style.width=Math.floor(r*d)-t+"px",e.style.height=Math.floor(r*c)-n+"px"}))};var r,i=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame;r=function(){var t=new e;document.body.addEventListener("is.post-load",(function(){t.findAndSetupNewGalleries()})),"function"==typeof jQuery&&jQuery(document).on("page-rendered.wpcom-newdash",(function(){t.findAndSetupNewGalleries()})),window.chrome&&i?function(e){var t=!1,r=null;function n(){e.resizeAll(),t&&i(n)}window.addEventListener("resize",(function(){clearTimeout(r),t||i(n),t=!0,r=setTimeout((function(){t=!1}),15)}))}(t):function(e){window.addEventListener("resize",(function(){e.resizeAll()}))}(t),"undefined"!=typeof wp&&wp.customize&&wp.customize.selectiveRefresh&&wp.customize.selectiveRefresh.bind("partial-content-rendered",(function(e){wp.isJetpackWidgetPlaced(e,"gallery")&&t.findAndSetupNewGalleries()}))},"loading"!==document.readyState?r():document.addEventListener("DOMContentLoaded",r)}();; 1193( function () { 1194 'use strict'; 1195 1196 if ( typeof window.wpcom === 'undefined' ) { 1197 window.wpcom = {}; 1198 } 1199 1200 if ( window.wpcom.carousel ) { 1201 return; 1202 } 1203 1204 var prebuilt_widths = jetpackCarouselStrings.widths; 1205 var pageviews_stats_args = jetpackCarouselStrings.stats_query_args; 1206 1207 var findFirstLargeEnoughWidth = function ( original_w, original_h, dest_w, dest_h ) { 1208 var inverse_ratio = original_h / original_w; 1209 1210 for ( var i = 0; i < prebuilt_widths.length; ++i ) { 1211 if ( prebuilt_widths[ i ] >= dest_w || prebuilt_widths[ i ] * inverse_ratio >
1211= dest_h ) { 1212 return prebuilt_widths[ i ]; 1213 } 1214 } 1215 1216 return original_w; 1217 }; 1218 1219 var removeResizeFromImageURL = function ( url ) { 1220 return removeArgFromURL( url, 'resize' ); 1221 }; 1222 1223 var removeArgFromURL = function ( url, arg ) { 1224 var re = new RegExp( '[\\?&]' + arg + '(=[^?&]+)?' ); 1225 if ( url.match( re ) ) { 1226 return url.replace( re, '' ); 1227 } 1228 return url; 1229 }; 1230 1231 var addWidthToImageURL = function ( url, width ) { 1232 width = parseInt( width, 10 ); 1233 // Give devices with a higher devicePixelRatio higher-res images (Retina display = 2, Android phones = 1.5, etc) 1234 if ( 'undefined' !== typeof window.devicePixelRatio && window.devicePixelRatio > 1 ) { 1235 width = Math.round( width * window.devicePixelRatio ); 1236 } 1237 url = addArgToURL( url, 'w', width ); 1238 url = addArgToURL( url, 'h', '' ); 1239 return url; 1240 }; 1241 1242 var addArgToURL = function ( url, arg, value ) { 1243 var re = new RegExp( arg + '=[^?&]+' ); 1244 if ( url.match( re ) ) { 1245 return url.replace( re, arg + '=' + value ); 1246 } else { 1247 var divider = url.indexOf( '?' ) !== -1 ? '&' : '?'; 1248 return url + divider + arg + '=' + value; 1249 } 1250 }; 1251 1252 var stat = function ( names ) { 1253 if ( typeof names !== 'string' ) { 1254 names = names.join( ',' ); 1255 } 1256 1257 new Image().src = window.location.protocol + 1258 'https://pixel.wp.com/g.gif?v=wpcom-no-pv' + 1259 '&x_carousel=' + names + 1260 '&baba=' + Math.random(); 1261 }; 1262 1263 var pageview = function ( post_id ) { 1264 new Image().src = window.location.protocol + 1265 'https://pixel.wp.com/g.gif?host=' + encodeURIComponent( window.location.host ) + 1266 '&ref=' + encodeURIComponent( document.referrer ) + 1267 '&rand=' + Math.random() + 1268 '&' + pageviews_stats_args + 1269 '&post=' + encodeURIComponent( post_id ); 1270 }; 1271 1272 var generateImgSrc = function ( srcItem, max ) { 1273 var origSize = srcItem.getAttribute( 'data-orig-size' ) || ''; 1274 1275 var src = srcItem.getAttribute( 'src' ) || srcItem.getAttribute( 'original' ) || srcItem.getAttribute( 'data-original' ) || srcItem.getAttribute( 'data-lazy-src' ); 1276 if ( src.indexOf( 'imgpress' ) !== -1 ) { 1277 src = srcItem.getAttribute( 'data-orig-file' ); 1278 } 1279 // Square/Circle galleries use a resize param that needs to be removed. 1280 src = removeResizeFromImageURL( src ); 1281 src = addWidthToImageURL( 1282 src, 1283 findFirstLargeEnoughWidth( origSize.width, origSize.height, max.width, max.height ) 1284 ); 1285 1286 return src; 1287 }; 1288 1289 window.wpcom.carousel = { 1290 findFirstLargeEnoughWidth: findFirstLargeEnoughWidth, 1291 removeResizeFromImageURL: removeResizeFromImageURL, 1292 addWidthToImageURL: addWidthToImageURL, 1293 stat: stat, 1294 pageview: pageview, 1295 generateImgSrc: generateImgSrc 1296 }; 1297 1298} )(); 1299; 1300 1301}
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.