1/** 2 * navigation.js 3 * 4 * Handles toggling the navigation menu for small screens. 5 */ 6( function() { 7 var container = document.getElementById( 'site-navigation' ), 8 button = container.getElementsByTagName( 'h1' )[0], 9 menu = container.getElementsByTagName( 'ul' )[0]; 10 11 if ( undefined == button || undefined == menu ) 12 return false; 13 14 button.onclick = function() { 15 if ( -1 == menu.className.indexOf( 'nav-menu' ) ) 16 menu.className = 'nav-menu'; 17 18 if ( -1 != button.className.indexOf( 'toggled-on' ) ) { 19 button.className = button.className.replace( ' toggled-on', '' ); 20 menu.className = menu.className.replace( ' toggled-on', '' ); 21 container.className = container.className.replace( 'main-small-navigation', 'navigation-main' ); 22 } else { 23 button.className += ' toggled-on'; 24 menu.className += ' toggled-on'; 25 container.className = container.className.replace( 'navigation-main', 'main-small-navigation' ); 26 } 27 }; 28 29 // Hide menu toggle button if menu is empty. 30 if ( ! menu.childNodes.length ) 31 button.style.display = 'none'; 32 33 // Fix child menus for touch devices. 34 function fixMenuTouchTaps( container ) { 35 var touchStartFn, 36 parentLink = container.querySelectorAll( '.menu-item-has-children > a, .page_item_has_children > a' ); 37 38 if ( 'ontouchstart' in window ) { 39 touchStartFn = function( e ) { 40 var menuItem = this.parentNode; 41 42 if ( ! menuItem.classList.contains( 'focus' ) ) { 43 e.preventDefault(); 44 for( var i = 0; i < menuItem.parentNode.children.length; ++i ) { 45 if ( menuItem === menuItem.parentNode.children[i] ) { 46 continue; 47 } 48 menuItem.parentNode.children[i].classList.remove( 'focus' ); 49 } 50 menuItem.classList.add( 'focus' ); 51 } else { 52 menuItem.classList.remove( 'focus' ); 53 } 54 }; 55 56 for ( var i = 0; i < parentLink.length; ++i ) { 57 parentLink[i].addEventListener( 'touchstart', touchStartFn, false ) 58 } 59 } 60 } 61 62 fixMenuTouchTaps( container ); 63} )();; 64( function() { 65 var is_webkit = navigator.userAgent.toLowerCase().indexOf( 'webkit' ) > -1, 66 is_opera = navigator.userAgent.toLowerCase().indexOf( 'opera' ) > -1, 67 is_ie = navigator.userAgent.toLowerCase().indexOf( 'msie' ) > -1; 68 69 if ( ( is_webkit || is_opera || is_ie ) && 'undefined' !== typeof( document.getElementById ) ) { 70 var eventMethod = ( window.addEventListener ) ? 'addEventListener' : 'attachEvent'; 71 window[ eventMethod ]( 'hashchange', function() { 72 var element = document.getElementById( location.hash.substring( 1 ) ); 73 74 if ( element ) { 75 if ( ! /^(?:a|select|input|button|textarea)$/i.test( element.tagName ) ) 76 element.tabIndex = -1; 77 78 element.focus(); 79 } 80 }, false ); 81 } 82})(); 83; 84/*! This file is auto-generated */ 85window.addComment=function(v){var I,C,h,E=v.document,b={commentReplyClass:"comment-reply-link",commentReplyTitleId:"reply-title",cancelReplyId:"cancel-comment-reply-link",commentFormId:"commentform",temporaryFormId:"wp-temp-form-div",parentIdFieldId:"comment_parent",postIdFieldId:"comment_post_ID"},e=v.MutationObserver||v.WebKitMutationObserver||v.MozMutationObserver,i="querySelector"in E&&"addEventListener"in v,n=!!E.documentElement.dataset;function t(){o(),e&&new e(d).observe(E.body,{childList:!0,subtree:!0})}function o(e){if(i&&(I=g(b.cancelReplyId),C=g(b.commentFormId),I)){I.addEventListener("click",l);function t(e){if((e.metaKey||e.ctrlKey)&&13===e.keyCode&&"a"!==E.activeElement.tagName.toLowerCase())return C.removeEventListener("keydown",t),e.preventDefault(),C.submit.click(),!1}C&&C.addEventListener("keydown",t);for(var n=function(e){var t=b.commentReplyClass;e&&e.childNodes||(e=E);e=E.getElementsByClassName?e.getElementsByClassName(t):e.querySelectorAll("."+t);return e}(e),o=0,d=n.length;o<d;o++)n[o].addEventListener("click",r)}}function l(e){var t,n,o=g(b.temporaryFormId);o&&h&&(g(b.parentIdFieldId).value="0",t=o.textContent,o.parentNode.replaceChild(h,o),this.style.display="none",n=(o=(o=g(b.commentReplyTitleId))&&o.firstChild)&&o.nextSibling,o&&o.nodeType===Node.TEXT_NODE&&t&&(n&&"A"===n.nodeName&&n.id!==b.cancelReplyId&&(n.style.display=""),o.textContent=t),e.preventDefault())}function r(e){var t=g(b.commentReplyTitleId),t=t&&t.firstChild.textContent,n=this,o=a(n,"belowelement"),d=a(n,"commentid"),i=a(n,"respondelement"),l=a(n,"postid"),n=a(n,"replyto")||t;o&&d&&i&&l&&!1===v.addComment.moveForm(o,d,i,l,n)&&e.preventDefault()}function d(e){for(var t=e.length;t--;)if(e[t].addedNodes.length)return void o()}function a(e,t){return n?e.dataset[t]:e.getAttribute("data-"+t)}function g(e){return E.getElementById(e)}return i&&"loading"!==E.readyState?t():i&&v.addEventListener("DOMContentLoaded",t,!1),{init:o,moveForm:function(e,t,n,o,d){var i,l,r,a,m,c,s,e=g(e),n=(h=g(n),g(b.parentIdFieldId)),y=g(b.postIdFieldId),p=g(b.commentReplyTitleId),u=(p=p&&p.firstChild)&&p.nextSibling;if(e&&h&&n){void 0===d&&(d=p&&p.textContent),a=h,m=b.temporaryFormId,c=g(m),s=(s=g(b.commentReplyTitleId))?s.firstChild.textContent:"",c||((c=E.createElement("div")).id=m,c.style.display="none",c.textContent=s,a.parentNode.insertBefore(c,a)),o&&y&&(y.value=o),n.value=t,I.style.display="",e.parentNode.insertBefore(h,e.nextSibling),p&&p.nodeType===Node.TEXT_NODE&&(u&&"A"===u.nodeName&&u.id!==b.cancelReplyId&&(u.style.display="none"),p.textContent=d),I.onclick=function(){return!1};try{for(var f=0;f<C.elements.length;f++)if(i=C.elements[f],l=!1,"getComputedStyle"in v?r=v.getComputedStyle(i):E.documentElement.currentStyle&&(r=i.currentStyle),(i.offsetWidth<=0&&i.offsetHeight<=0||"hidden"===r.visibility)&&(l=!0),"hidden"
85!==i.type&&!i.disabled&&!l){i.focus();break}}catch(e){}return!1}}}}(window);; 86!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.JetpackScriptDataModule=t():e.JetpackScriptDataModule=t()}(globalThis,()=>(()=>{"use strict";var e={729(e,t,r){r.d(t,{$8:()=>n.$8,IT:()=>n.IT,KS:()=>n.KS,L2:()=>n.L2,Sy:()=>n.Sy,au:()=>n.au,d_:()=>n.d_,e5:()=>n.e5,hT:()=>n.hT,lI:()=>n.lI,mH:()=>n.mH,oQ:()=>n.oQ,sV:()=>n.sV});var n=r(336)},336(e,t,r){function n(){return window.JetpackScriptData}function o(){return n()?.site}function i(e=""){return`${n()?.site.admin_url}${e}`}function u(e=""){return i(`admin.php?page=jetpack${e}`)}function a(e=""){return i(`admin.php?page=my-jetpack${e}`)}function c(){return n()?.site.plan?.features?.active??[]}function s(e){return-1!==c().indexOf(e)}function p(){return"wpcom"===n()?.site?.host}function f(){return"woa"===n()?.site?.host}function d(){return n()?.site?.is_wpcom_platform}function l(){return"unknown"===n()?.site?.host}function m(){return p()?"simple":f()?"woa":"jetpack"}function S(e){return n()?.user.current_user.capabilities[e]}r.d(t,{$8:()=>d,IT:()=>s,KS:()=>m,L2:()=>l,Sy:()=>p,au:()=>n,d_:()=>S,e5:()=>a,hT:()=>i,lI:()=>f,mH:()=>c,oQ:()=>u,sV:()=>o})}};const t={};function r(n){const o=t[n];if(void 0!==o)return o.exports;const i=t[n]={exports:{}};return e[n](i,i.exports,r),i.exports}r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=(e,t)=>Object.hasOwn(e,t),r.r=e=>{Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};let n={};r.r(n),r.d(n,{currentUserCan:()=>o.d_,getActiveFeatures:()=>o.mH,getAdminUrl:()=>o.hT,getJetpackAdminPageUrl:()=>o.oQ,getMyJetpackUrl:()=>o.e5,getScriptData:()=>o.au,getSiteData:()=>o.sV,getSiteType:()=>o.KS,isJetpackSelfHostedSite:()=>o.L2,isSimpleSite:()=>o.Sy,isWoASite:()=>o.lI,isWpcomPlatformSite:()=>o.$8,siteHasFeature:()=>o.IT});var o=r(729);return n})());; 87/** 88 * Observe how the user enters content into the comment form in order to determine whether it's a bot or not. 89 * 90 * Note that no actual input is being saved here, only counts and timings between events. 91 */ 92 93( function() { 94 // Passive event listeners are guaranteed to never call e.preventDefault(), 95 // but they're not supported in all browsers. Use this feature detection 96 // to determine whether they're available for use. 97 var supportsPassive = false; 98 99 try { 100 var opts = Object.defineProperty( {}, 'passive', { 101 get : function() { 102 supportsPassive = true; 103 } 104 } ); 105 106 window.addEventListener( 'testPassive', null, opts ); 107 window.removeEventListener( 'testPassive', null, opts ); 108 } catch ( e ) {} 109 110 function init() { 111 var input_begin = ''; 112 113 var keydowns = {}; 114 var lastKeyup = null; 115 var lastKeydown = null; 116 var keypresses = []; 117 118 var modifierKeys = []; 119 var correctionKeys = []; 120 121 var lastMouseup = null; 122 var lastMousedown = null; 123 var mouseclicks = []; 124 var mouseclickCoordinates = []; 125 126 var mousemoveTimer = null; 127 var lastMousemoveX = null; 128 var lastMousemoveY = null; 129 var lastMousemoveTime = null; 130 var mousemoveStart = null; 131 var mousemoves = []; 132 var intervalsBetweenMousemovesAndClicks = []; 133 134 var touchmoveCountTimer = null; 135 var touchmoveCount = 0; 136 137 var lastTouchEnd = null; 138 var lastTouchStart = null; 139 var touchEvents = []; 140 141 var scrollCountTimer = null; 142 var scrollCount = 0; 143 144 var correctionKeyCodes = [ 'Backspace', 'Delete', 'ArrowUp', 'ArrowDown', 'ArrowLeft', 'ArrowRight', 'Home', 'End', 'PageUp', 'PageDown' ]; 145 var modifierKeyCodes = [ 'Shift', 'CapsLock' ]; 146 147 var forms = document.querySelectorAll( 'form[method=post]' ); 148 149 for ( var i = 0; i < forms.length; i++ ) { 150 var form = forms[i]; 151 152 var formAction = form.getAttribute( 'action' ); 153 154 // Ignore forms that POST directly to other domains; these could be things like payment forms. 155 if ( formAction ) { 156 // Check that the form is posting to an external URL, not a path. 157 if ( formAction.indexOf( 'http://' ) == 0 || formAction.indexOf( 'https://' ) == 0 ) { 158 if ( formAction.indexOf( 'http://' + window.location.hostname + '/' ) != 0 && formAction.indexOf( 'https://' + window.location.hostname + '/' ) != 0 ) { 159 continue; 160 } 161 } 162 } 163 164 form.addEventListener( 'submit', function () { 165 var ak_bkp = prepare_array_for_request( keypresses ); 166 var ak_bmc = prepare_array_for_request( mouseclicks ); 167 var ak_bte = prepare_array_for_request( touchEvents ); 168 var ak_bmm = prepare_array_for_request( mousemoves ); 169 var ak_bcc = prepare_array_for_request( mouseclickCoordinates ); 170 var ak_bibmac = intervalsBetweenMousemovesAndClicks.slice( 0, 100 ).join( ';' ); 171 172 var input_fields = { 173 // When did the user begin entering any input? 174 'bib': input_begin, 175 176 // When was the form submitted? 177 'bfs': Date.now(), 178 179 // How many keypresses did they make? 180 'bkpc': keypresses.length, 181
182 // How quickly did they press a sample of keys, and how long between them? 183 'bkp': ak_bkp, 184 185 // How quickly did they click the mouse, and how long between clicks? 186 'bmc': ak_bmc, 187 188 // How many mouseclicks did they make? 189 'bmcc': mouseclicks.length, 190 191 // When did they press modifier keys (like Shift or Capslock)? 192 'bmk': modifierKeys.join( ';' ), 193 194 // When did they correct themselves? e.g., press Backspace, or use the arrow keys to move the cursor back 195 'bck': correctionKeys.join( ';' ), 196 197 // How many times did they move the mouse? 198 'bmmc': mousemoves.length, 199 200 // How many times did they move around using a touchscreen? 201 'btmc': touchmoveCount, 202 203 // How many times did they scroll? 204 'bsc': scrollCount, 205 206 // How quickly did they perform touch events, and how long between them? 207 'bte': ak_bte, 208 209 // How many touch events were there? 210 'btec' : touchEvents.length, 211 212 // How quickly did they move the mouse, and how long between moves? 213 'bmm' : ak_bmm, 214 215 // Click coordinates 216 'bcc' : ak_bcc, 217 218 // Milliseconds between last mouse movement and each click 219 'bibmac' : ak_bibmac 220 }; 221 222 var akismet_field_prefix = 'ak_'; 223 224 if ( this.getElementsByClassName ) { 225 // Check to see if we've used an alternate field name prefix. We store this as an attribute of the container around some of the Akismet fields. 226 var possible_akismet_containers = this.getElementsByClassName( 'akismet-fields-container' ); 227 228 for ( var containerIndex = 0; containerIndex < possible_akismet_containers.length; containerIndex++ ) { 229 var container = possible_akismet_containers.item( containerIndex ); 230 231 if ( container.getAttribute( 'data-prefix' ) ) { 232 akismet_field_prefix = container.getAttribute( 'data-prefix' ); 233 break; 234 } 235 } 236 } 237 238 for ( var field_name in input_fields ) { 239 var field = document.createElement( 'input' ); 240 field.setAttribute( 'type', 'hidden' ); 241 field.setAttribute( 'name', akismet_field_prefix + field_name ); 242 field.setAttribute( 'value', input_fields[ field_name ] ); 243 this.appendChild( field ); 244 } 245 }, supportsPassive ? { passive: true } : false ); 246 247 form.addEventListener( 'keydown', function ( e ) { 248 // If you hold a key down, some browsers send multiple keydown events in a row. 249 // Ignore any keydown events for a key that hasn't come back up yet. 250 if ( e.key in keydowns ) { 251 return; 252 } 253 254 var keydownTime = ( new Date() ).getTime(); 255 keydowns[ e.key ] = [ keydownTime ]; 256 257 if ( ! input_begin ) { 258 input_begin = keydownTime; 259 } 260 261 // In some situations, we don't want to record an interval since the last keypress -- for example, 262 // on the first keypress, or on a keypress after focus has changed to another element. Normally, 263 // we want to record the time between the last keyup and this keydown. But if they press a 264 // key while already pressing a key, we want to record the time between the two keydowns. 265 266 var lastKeyEvent = Math.max( lastKeydown, lastKeyup ); 267 268 if ( lastKeyEvent ) { 269 keydowns[ e.key ].push( keydownTime - lastKeyEvent ); 270 } 271 272 lastKeydown = keydownTime; 273 }, supportsPassive ? { passive: true } : false ); 274 275 form.addEventListener( 'keyup', function ( e ) { 276 if ( ! ( e.key in keydowns ) ) { 277 // This key was pressed before this script was loaded, or a mouseclick happened during the keypress, or... 278 return; 279 } 280 281 var keyupTime = ( new Date() ).getTime(); 282 283 if ( 'TEXTAREA' === e.target.nodeName || 'INPUT' === e.target.nodeName ) { 284 if ( -1 !== modifierKeyCodes.indexOf( e.key ) ) { 285 modifierKeys.push( keypresses.length - 1 ); 286 } else if ( -1 !== correctionKeyCodes.indexOf( e.key ) ) { 287 correctionKeys.push( keypresses.length - 1 ); 288 } else { 289 // ^ Don't record timings for keys like Shift or backspace, since they 290 // typically get held down for longer than regular typing. 291 292 var keydownTime = keydowns[ e.key ][0]; 293 294 var keypress = []; 295 296 // Keypress duration. 297 keypress.push( keyupTime - keydownTime ); 298 299 // Amount of time between this keypress and the previous keypress. 300 if ( keydowns[ e.key ].length > 1 ) { 301 keypress.push( keydowns[ e.key ][1] ); 302 } 303 304 keypresses.push( keypress ); 305 } 306 } 307
308 delete keydowns[ e.key ]; 309 310 lastKeyup = keyupTime; 311 }, supportsPassive ? { passive: true } : false ); 312 313 form.addEventListener( "focusin", function ( e ) { 314 lastKeydown = null; 315 lastKeyup = null; 316 keydowns = {}; 317 }, supportsPassive ? { passive: true } : false ); 318 319 form.addEventListener( "focusout", function ( e ) { 320 lastKeydown = null; 321 lastKeyup = null; 322 keydowns = {}; 323 }, supportsPassive ? { passive: true } : false ); 324 } 325 326 document.addEventListener( 'mousedown', function ( e ) { 327 lastMousedown = ( new Date() ).getTime(); 328 329 if ( lastMousemoveTime ) { 330 intervalsBetweenMousemovesAndClicks.push( lastMousedown - lastMousemoveTime ); 331 } 332 333 var mouseclickCoordinate = []; 334 335 var rect = e.target.getBoundingClientRect(); 336 var relativeX = e.clientX - rect.left; 337 var relativeY = e.clientY - rect.top; 338 339 // Pixel offset of the click within the target element. 340 mouseclickCoordinate.push( Math.round( relativeX ) ); 341 mouseclickCoordinate.push( Math.round( relativeY ) ); 342 343 // Percentage offset of the click within the target element. 344 mouseclickCoordinate.push( rect.width > 0 ? Math.round( relativeX / rect.width * 100 ) : 0 ); 345 mouseclickCoordinate.push( rect.height > 0 ? Math.round( relativeY / rect.height * 100 ) : 0 ); 346 347 mouseclickCoordinates.push( mouseclickCoordinate ); 348 }, supportsPassive ? { passive: true } : false ); 349 350 document.addEventListener( 'mouseup', function ( e ) { 351 if ( ! lastMousedown ) { 352 // If the mousedown happened before this script was loaded, but the mouseup happened after... 353 return; 354 } 355 356 var now = ( new Date() ).getTime(); 357 358 var mouseclick = []; 359 mouseclick.push( now - lastMousedown ); 360 361 if ( lastMouseup ) { 362 mouseclick.push( lastMousedown - lastMouseup ); 363 } 364 365 mouseclicks.push( mouseclick ); 366 367 lastMouseup = now; 368 369 // If the mouse has been clicked, don't record this time as an interval between keypresses. 370 lastKeydown = null; 371 lastKeyup = null; 372 keydowns = {}; 373 }, supportsPassive ? { passive: true } : false ); 374 375 document.addEventListener( 'mousemove', function ( e ) { 376 lastMousemoveTime = ( new Date() ).getTime(); 377 378 if ( mousemoveTimer ) { 379 clearTimeout( mousemoveTimer ); 380 mousemoveTimer = null; 381 } 382 else { 383 mousemoveStart = lastMousemoveTime; 384 lastMousemoveX = e.offsetX; 385 lastMousemoveY = e.offsetY; 386 } 387 388 mousemoveTimer = setTimeout( function ( theEvent, originalMousemoveStart ) { 389 var now = ( new Date() ).getTime() - 500; // To account for the timer delay. 390 391 var mousemove = []; 392 mousemove.push( now - originalMousemoveStart ); 393 mousemove.push( 394 Math.round( 395 Math.sqrt( 396 Math.pow( theEvent.offsetX - lastMousemoveX, 2 ) + 397 Math.pow( theEvent.offsetY - lastMousemoveY, 2 ) 398 ) 399 ) 400 ); 401 402 if ( mousemove[1] > 0 ) { 403 // If there was no measurable distance, then it wasn't really a move. 404 mousemoves.push( mousemove ); 405 } 406 407 mousemoveStart = null; 408 mousemoveTimer = null; 409 }, 500, e, mousemoveStart ); 410 }, supportsPassive ? { passive: true } : false ); 411 412 document.addEventListener( 'touchmove', function ( e ) { 413 if ( touchmoveCountTimer ) { 414 clearTimeout( touchmoveCountTimer ); 415 } 416 417 touchmoveCountTimer = setTimeout( function () { 418 touchmoveCount++; 419 }, 500 ); 420 }, supportsPassive ? { passive: true } : false ); 421 422 document.addEventListener( 'touchstart', function ( e ) { 423 lastTouchStart = ( new Date() ).getTime(); 424 }, supportsPassive ? { passive: true } : false ); 425 426 document.addEventListener( 'touchend', function ( e ) { 427 if ( ! lastTouchStart ) { 428 // If the touchstart happened before this script was loaded, but the touchend happened after... 429 return; 430 } 431 432 var now = ( new Date() ).getTime(); 433 434 var touchEvent = []; 435 touchEvent.push( now - lastTouchStart ); 436 437 if ( lastTouchEnd ) { 438 touchEvent.push( lastTouchStart - lastTouchEnd ); 439 } 440 441 touchEvents.push( touchEvent ); 442 443 lastTouchEnd = now; 444 445 // Don't record this time as an interval between keypresses. 446 lastKeydown = null; 447 lastKeyup = null; 448 keydowns = {}; 449 }, supportsPassive ? { passive: true } : false ); 450 451 document.addEventListener( 'scroll', function ( e ) {
452 if ( scrollCountTimer ) { 453 clearTimeout( scrollCountTimer ); 454 } 455 456 scrollCountTimer = setTimeout( function () { 457 scrollCount++; 458 }, 500 ); 459 }, supportsPassive ? { passive: true } : false ); 460 } 461 462 /** 463 * For the timing/coordinate data that is collected, don't send more than `limit` data points in the request. 464 * Choose a random slice and send those, with each batch separated by semicolons and the items in each batch 465 * separated by commas. 466 */ 467 function prepare_array_for_request( a, limit ) { 468 if ( ! limit ) { 469 limit = 100; 470 } 471 472 var rv = ''; 473 474 if ( a.length > 0 ) { 475 var random_starting_point = Math.max( 0, Math.floor( Math.random() * a.length - limit ) ); 476 477 for ( var i = 0; i < limit && i < a.length; i++ ) { 478 var entry = a[ random_starting_point + i ]; 479 rv += entry.join( ',' ) + ';'; 480 } 481 } 482 483 return rv; 484 } 485 486 if ( document.readyState !== 'loading' ) { 487 init(); 488 } else { 489 document.addEventListener( 'DOMContentLoaded', init ); 490 } 491})();; 492void ( function ( d, s, id ) { 493 var js, 494 fjs = d.getElementsByTagName( s )[ 0 ], 495 p = /^http:/.test( d.location ) ? 'http' : 'https'; 496 if ( ! d.getElementById( id ) ) { 497 js = d.createElement( s ); 498 js.id = id; 499 js.src = p + '://platform.twitter.com/widgets.js'; 500 fjs.parentNode.insertBefore( js, fjs ); 501 } 502} )( document, 'script', 'twitter-wjs' ); 503;
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.