( function ( g ) { var t = { PLATFORM_WINDOWS: 'windows', PLATFORM_IPHONE: 'iphone', PLATFORM_IPOD: 'ipod', PLATFORM_IPAD: 'ipad', PLATFORM_BLACKBERRY: 'blackberry', PLATFORM_BLACKBERRY_10: 'blackberry_10', PLATFORM_SYMBIAN: 'symbian_series60', PLATFORM_SYMBIAN_S40: 'symbian_series40', PLATFORM_J2ME_MIDP: 'j2me_midp', PLATFORM_ANDROID: 'android', PLATFORM_ANDROID_TABLET: 'android_tablet', PLATFORM_FIREFOX_OS: 'firefoxOS', PLATFORM_MOBILE_GENERIC: 'mobile_generic', userAgent : false, // Shortcut to the browser User Agent String. matchedPlatformName : false, // Matched platform name. False otherwise. matchedUserAgentName : false, // Matched UA String. False otherwise. init: function() { try { t.userAgent = g.navigator.userAgent.toLowerCase(); t.getPlatformName(); t.getMobileUserAgentName(); } catch ( e ) { console.error( e ); } }, initForTest: function( userAgent ) { t.matchedPlatformName = false; t.matchedUserAgentName = false; try { t.userAgent = userAgent.toLowerCase(); t.getPlatformName(); t.getMobileUserAgentName(); } catch ( e ) { console.error( e ); } }, /** * This method detects the mobile User Agent name. */ getMobileUserAgentName: function() { if ( t.matchedUserAgentName !== false ) return t.matchedUserAgentName; if ( t.userAgent === false ) return false; if ( t.isChromeForIOS() ) t.matchedUserAgentName = 'chrome-for-ios'; else if ( t.isTwitterForIpad() ) t.matchedUserAgentName = 'twitter-for-ipad'; else if ( t.isTwitterForIphone() ) t.matchedUserAgentName = 'twitter-for-iphone'; else if ( t.isIPhoneOrIPod() ) t.matchedUserAgentName = 'iphone'; else if ( t.isIPad() ) t.matchedUserAgentName = 'ipad'; else if ( t.isAndroidTablet() ) t.matchedUserAgentName = 'android_tablet'; else if ( t.isAndroid() ) t.matchedUserAgentName = 'android'; else if ( t.isBlackberry10() ) t.matchedUserAgentName = 'blackberry_10'; else if ( has( 'blackberry' ) ) t.matchedUserAgentName = 'blackberry'; else if ( t.isBlackberryTablet() ) t.matchedUserAgentName = 'blackberry_tablet'; else if ( t.isWindowsPhone7() ) t.matchedUserAgentName = 'win7'; else if ( t.isWindowsPhone8() ) t.matchedUserAgentName = 'winphone8'; else if ( t.isOperaMini() ) t.matchedUserAgentName = 'opera-mini'; else if ( t.isOperaMobile() ) t.matchedUserAgentName = 'opera-mobi'; else if ( t.isKindleFire() ) t.matchedUserAgentName = 'kindle-fire'; else if ( t.isSymbianPlatform() ) t.matchedUserAgentName = 'series60'; else if ( t.isFirefoxMobile() ) t.matchedUserAgentName = 'firefox_mobile'; else if ( t.isFirefoxOS() ) t.matchedUserAgentName = 'firefoxOS'; else if ( t.isFacebookForIphone() ) t.matchedUserAgentName = 'facebook-for-iphone'; else if ( t.isFacebookForIpad() ) t.matchedUserAgentName = 'facebook-for-ipad'; else if ( t.isWordPressForIos() ) t.matchedUserAgentName = 'ios-app'; else if ( has( 'iphone' ) ) t.matchedUserAgentName = 'iphone-unknown'; else if ( has( 'ipad' ) ) t.matchedUserAgentName = 'ipad-unknown'; return t.matchedUserAgentName; }, /** * This method detects the mobile platform name. */ getPlatformName : function() { if ( t.matchedPlatformName !== false ) return t.matchedPlatformName; if ( t.userAgent === false ) return false; if ( has( 'windows ce' ) || has( 'windows phone' ) ) { t.matchedPlatformName = t.PLATFORM_WINDOWS; } else if ( has( 'ipad' ) ) { t.matchedPlatformName = t.PLATFORM_IPAD; } else if ( has( 'ipod' ) ) { t.matchedPlatformName = t.PLATFORM_IPOD; } else if ( has( 'iphone' ) ) { t.matchedPlatformName = t.PLATFORM_IPHONE; } else if ( has( 'android' ) ) { if ( t.isAndroidTablet() ) t.matchedPlatformName = t.PLATFORM_ANDROID_TABLET; else t.matchedPlatformName = t.PLATFORM_ANDROID; } else if ( t.isKindleFire() ) { t.matchedPlatformName = t.PLATFORM_ANDROID_TABLET; } else if ( t.isBlackberry10() ) { t.matchedPlatformName = t.PLATFORM_BLACKBERRY_10; } else if ( has( 'blackberry' ) ) { t.matchedPlatformName = t.PLATFORM_BLACKBERRY; } else if ( t.isBlackberryTablet() ) { t.matchedPlatformName = t.PLATFORM_BLACKBERRY; } else if ( t.isSymbianPlatform() ) { t.matchedPlatformName = t.PLATFORM_SYMBIAN; } else if ( t.isSymbianS40Platform() ) { t.matchedPlatformName = t.PLATFORM_SYMBIAN_S40; } else if ( t.isJ2MEPlatform() ) { t.matchedPlatformName = t.PLATFORM_J2ME_MIDP; } else if ( t.isFirefoxOS() ) { t.matchedPlatformName = t.PLATFORM_FIREFOX_OS; } else if ( t.isFirefoxMobile() ) { t.matchedPlatformName = t.PLATFORM_MOBILE_GENERIC; } return t.matchedPlatformName; }, /** * Detect the BlackBerry OS version. * * Note: This is for smartphones only. Does not work on BB tablets. */ getBlackBerryOSVersion : check( function() { if ( t.isBlackberry10() ) return '10'; if ( ! has( 'blackberry' ) ) return false; var rv = -1; // Return value assumes failure. var re; if ( has( 'webkit' ) ) { // Detecting the BB OS version for devices running OS 6.0 or higher re = /Version\/([\d\.]+)/i; } else { // BlackBerry devices <= 5.XX re = /BlackBerry\w+\/([\d\.]+)/i; } if ( re.exec( t.userAgent ) != null ) rv = RegExp.$1.toString(); return rv === -1 ? false : rv; } ), /** * Detects if the current UA is iPhone Mobile Safari or another iPhone or iPod Touch Browser. */ isIPhoneOrIPod : check( function() { return has( 'safari' ) && ( has( 'iphone' ) || has( 'ipod' ) ); } ), /** * Detects if the current device is an iPad. */ isIPad : check( function() { return has( 'ipad' ) && has( 'safari' ); } ), /** * Detects if the current UA is Chrome for iOS */ isChromeForIOS : check( function() { return t.isIPhoneOrIPod() && has( 'crios/' ); } ), /** * Detects if the current browser is the Native Android browser. */ isAndroid : check( function() { if ( has( 'android' ) ) { return ! ( t.isOperaMini() || t.isOperaMobile() || t.isFirefoxMobile() ); } } ), /** * Detects if the current browser is the Native Android Tablet browser. */ isAndroidTablet : check( function() { if ( has( 'android' ) && ! has( 'mobile' ) ) { return ! ( t.isOperaMini() || t.isOperaMobile() || t.isFirefoxMobile() ); } } ), /** * Detects if the current browser is Opera Mobile */ isOperaMobile : check( function() { return has( 'opera' ) && has( 'mobi' ); } ), /** * Detects if the current browser is Opera Mini */ isOperaMini : check( function() { return has( 'opera' ) && has( 'mini' ); } ), /** * isBlackberry10() can be used to check the User Agent for a BlackBerry 10 device. */ isBlackberry10 : check( function() { return has( 'bb10' ) && has( 'mobile' ); } ), /** * isBlackberryTablet() can be used to check the User Agent for a RIM blackberry tablet */ isBlackberryTablet : check( function() { return has( 'playbook' ) && has( 'rim tablet' ); } ), /** * Detects if the current browser is a Windows Phone 7 device. */ isWindowsPhone7 : check( function () { return has( 'windows phone os 7' ); } ), /** * Detects if the current browser is a Windows Phone 8 device. */ isWindowsPhone8 : check( function () { return has( 'windows phone 8' ); } ), /** * Detects if the device platform is J2ME. */ isJ2MEPlatform : check( function () { return has( 'j2me/midp' ) || ( has( 'midp' ) && has( 'cldc' ) ); } ), /** * Detects if the device platform is the Symbian Series 40. */ isSymbianS40Platform : check( function() { if ( has( 'series40' ) ) { return has( 'nokia' ) || has( 'ovibrowser' ) || has( 'nokiabrowser' ); } } ), /** * Detects if the device platform is the Symbian Series 60. */ isSymbianPlatform : check( function() { if ( has( 'webkit' ) ) { // First, test for WebKit, then make sure it's either Symbian or S60. return has( 'symbian' ) || has( 'series60' ); } else if ( has( 'symbianos' ) && has( 'series60' ) ) { return true; } else if ( has( 'nokia' ) && has( 'series60' ) ) { return true; } else if ( has( 'opera mini' ) ) { return has( 'symbianos' ) || has( 'symbos' ) || has( 'series 60' ); } } ), /** * Detects if the current browser is the Kindle Fire Native browser. */ isKindleFire : check( function() { return has( 'silk/' ) && has( 'silk-accelerated=' ); } ), /** * Detects if the current browser is Firefox Mobile (Fennec) */ isFirefoxMobile : check( function() { return has( 'fennec' ); } ), /** * Detects if the current browser is the native FirefoxOS browser */ isFirefoxOS : check( function() { return has( 'mozilla' ) && has( 'mobile' ) && has( 'gecko' ) && has( 'firefox' ); } ), /** * Detects if the current UA is Facebook for iPad */ isFacebookForIpad : check( function() { if ( ! has( 'ipad' ) ) return false; return has( 'facebook' ) || has( 'fbforiphone' ) || has( 'fban/fbios;' ); } ), /** * Detects if the current UA is Facebook for iPhone */ isFacebookForIphone : check( function() { if ( ! has( 'iphone' ) ) return false; return ( has( 'facebook' ) && ! has( 'ipad' ) ) || ( has( 'fbforiphone' ) && ! has( 'tablet' ) ) || ( has( 'fban/fbios;' ) && ! has( 'tablet' ) ); // FB app v5.0 or higher } ), /** * Detects if the current UA is Twitter for iPhone */ isTwitterForIphone : check( function() { if ( has( 'ipad' ) ) return false; return has( 'twitter for iphone' ); } ), /** * Detects if the current UA is Twitter for iPad */ isTwitterForIpad : check( function() { return has( 'twitter for ipad' ) || ( has( 'ipad' ) && has( 'twitter for iphone' ) ); } ), /** * Detects if the current UA is WordPress for iOS */ isWordPressForIos : check( function() { return has( 'wp-iphone' ); } ) }; function has( str ) { return t.userAgent.indexOf( str ) != -1; } function check( fn ) { return function() { return t.userAgent === false ? false : fn() || false; } } g.wpcom_mobile_user_agent_info = t; } )( typeof window !== 'undefined' ? window : this ); ; !function(){function e(e){e.querySelectorAll('[aria-expanded="true"]').forEach((function(e){e.setAttribute("aria-expanded","false")}))}function t(t){const n=t.target.closest("[aria-expanded]");if("true"===n.getAttribute("aria-expanded"))e(n.closest(".wp-block-navigation-item"));else{const t=n.closest(".wp-block-navigation-item");n.closest(".wp-block-navigation__submenu-container, .wp-block-navigation__container, .wp-block-page-list").querySelectorAll(".wp-block-navigation-item").forEach((function(n){n!==t&&e(n)})),n.setAttribute("aria-expanded","true")}}window.addEventListener("load",(()=>{document.querySelectorAll(".wp-block-navigation-submenu__toggle").forEach((function(e){e.addEventListener("click",t)})),document.addEventListener("click",(function(t){document.querySelectorAll(".wp-block-navigation").forEach((function(n){n.contains(t.target)||e(n)}))})),document.addEventListener("keyup",(function(t){document.querySelectorAll(".wp-block-navigation-item.has-child").forEach((function(n){if(n.contains(t.target)){if("Escape"===t.key){const t=n.querySelector('[aria-expanded="true"]');e(n),null==t||t.focus()}}else e(n)}))}))}))}(); //# sourceMappingURL=view.min.js.map; !function(){"use strict";function e(e){return function(e){if(Array.isArray(e))return t(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,o){if(e){if("string"==typeof e)return t(e,o);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?t(e,o):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function t(e,t){(null==t||t>e.length)&&(t=e.length);for(var o=0,n=new Array(t);o0&&this.registerTriggers.apply(this,e(a)),this.onClick=this.onClick.bind(this),this.onKeydown=this.onKeydown.bind(this)}var n;return(n=[{key:"registerTriggers",value:function(){for(var e=this,t=arguments.length,o=new Array(t),n=0;n0&&void 0!==arguments[0]?arguments[0]:null;if(this.activeElement=document.activeElement,this.modal.setAttribute("aria-hidden","false"),this.modal.classList.add(this.config.openClass),this.scrollBehaviour("disable"),this.addEventListeners(),this.config.awaitOpenAnimation){var o=function t(){e.modal.removeEventListener("animationend",t,!1),e.setFocusToFirstNode()};this.modal.addEventListener("animationend",o,!1)}else this.setFocusToFirstNode();this.config.onShow(this.modal,this.activeElement,t)}},{key:"closeModal",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=this.modal;if(this.modal.setAttribute("aria-hidden","true"),this.removeEventListeners(),this.scrollBehaviour("enable"),this.activeElement&&this.activeElement.focus&&this.activeElement.focus(),this.config.onClose(this.modal,this.activeElement,e),this.config.awaitCloseAnimation){var o=this.config.openClass;this.modal.addEventListener("animationend",(function e(){t.classList.remove(o),t.removeEventListener("animationend",e,!1)}),!1)}else t.classList.remove(this.config.openClass)}},{key:"closeModalById",value:function(e){this.modal=document.getElementById(e),this.modal&&this.closeModal()}},{key:"scrollBehaviour",value:function(e){if(this.config.disableScroll){var t=document.querySelector("body");switch(e){case"enable":Object.assign(t.style,{overflow:""});break;case"disable":Object.assign(t.style,{overflow:"hidden"})}}}},{key:"addEventListeners",value:function(){this.modal.addEventListener("touchstart",this.onClick),this.modal.addEventListener("click",this.onClick),document.addEventListener("keydown",this.onKeydown)}},{key:"removeEventListeners",value:function(){this.modal.removeEventListener("touchstart",this.onClick),this.modal.removeEventListener("click",this.onClick),document.removeEventListener("keydown",this.onKeydown)}},{key:"onClick",value:function(e){(e.target.hasAttribute(this.config.closeTrigger)||e.target.parentNode.hasAttribute(this.config.closeTrigger))&&(e.preventDefault(),e.stopPropagation(),this.closeModal(e))}},{key:"onKeydown",value:function(e){27===e.keyCode&&this.closeModal(e),9===e.keyCode&&this.retainFocus(e)}},{key:"getFocusableNodes",value:function(){var t=this.modal.querySelectorAll(o);return Array.apply(void 0,e(t))}},{key:"setFocusToFirstNode",value:function(){var e=this;if(!this.config.disableFocus){var t=this.getFocusableNodes();if(0!==t.length){var o=t.filter((function(t){return!t.hasAttribute(e.config.closeTrigger)}));o.length>0&&o[0].focus(),0===o.length&&t[0].focus()}}}},{key:"retainFocus",value:function(e){var t=this.getFocusableNodes();if(0!==t.length)if(t=t.filter((function(e){return null!==e.offsetParent})),this.modal.contains(document.activeElement)){var o=t.indexOf(document.activeElement);e.shiftKey&&0===o&&(t[t.length-1].focus(),e.preventDefault()),!e.shiftKey&&t.length>0&&o===t.length-1&&(t[0].focus(),e.preventDefault())}else t[0].focus()}}])&&function(e,t){for(var o=0;o')),!1},r=function(e,t){if(function(e){e.length<=0&&(console.warn("MicroModal: ❗Please specify at least one %c'micromodal-trigger'","background-color: #f8f9fa;color: #50596c;font-weight: bold;","data attribute."),console.warn("%cExample:","background-color: #f8f9fa;color: #50596c;font-weight: bold;",''))}(e),!t)return!0;for(var o in t)a(o);return!0},{init:function(t){var o=Object.assign({},{openTrigger:"data-micromodal-trigger"},t),a=e(document.querySelectorAll("[".concat(o.openTrigger,"]"))),s=function(e,t){var o=[];return e.forEach((function(e){var n=e.attributes[t].value;void 0===o[n]&&(o[n]=[]),o[n].push(e)})),o}(a,o.openTrigger);if(!0!==o.debugMode||!1!==r(a,s))for(var l in s){var c=s[l];o.targetModal=l,o.triggers=e(c),i=new n(o)}},show:function(e,t){var o=t||{};o.targetModal=e,!0===o.debugMode&&!1===a(e)||(i&&i.removeEventListeners(),(i=new n(o)).showModal())},close:function(e){e?i.closeModalById(e):i.closeModal()}});"undefined"!=typeof window&&(window.MicroModal=s);var l=s;function c(e){const t=e.querySelector(".wp-block-navigation__responsive-dialog"),o="true"===e.getAttribute("aria-hidden");e.classList.toggle("has-modal-open",!o),t.toggleAttribute("aria-modal",!o),o?(t.removeAttribute("role"),t.removeAttribute("aria-modal")):(t.setAttribute("role","dialog"),t.setAttribute("aria-modal","true")),document.documentElement.classList.toggle("has-modal-open")}window.addEventListener("load",(()=>{l.init({onShow:c,onClose:c,openClass:"is-menu-open"}),document.querySelectorAll(".wp-block-navigation-item__content").forEach((function(e){var t,o;if(!(o=e).hash||o.protocol!==window.location.protocol||o.host!==window.location.host||o.pathname!==window.location.pathname||o.search!==window.location.search||"_blank"===(null===(t=e.attributes)||void 0===t?void 0:t.target))return;const n=e.closest(".wp-block-navigation__responsive-container"),i=null==n?void 0:n.getAttribute("id");e.addEventListener("click",(()=>{i&&n.classList.contains("has-modal-open")&&l.close(i)}))}))}))}(); //# sourceMappingURL=view-modal.min.js.map; !function(e){"object"==typeof exports&&"undefined"!=typeof module||"function"!=typeof define||!define.amd?e():define("inert",e)}((function(){"use strict";var e,t,n,i,o,r,s=function(e,t,n){return t&&a(e.prototype,t),n&&a(e,n),e};function a(e,t){for(var n=0;na;)o(e,r=n[a++])&&(~u(p,r)||f(p,r));return p}},function(t,n,r){var e=r(10),o=r(55),i=r(57);r=function(t){return function(n,r,u){var c,f=e(n),a=i(f),p=o(u,a);if(t&&r!=r){for(;p"+t+""}var u,c=e(42),f=e(64),a=e(59),p=e(48),s=e(66),l=e(39),y=(e=e(47),"prototype"),v="script",d=e("IE_PROTO"),b=function(){try{u=new ActiveXObject("htmlfile")}catch(t){}var t;b="undefined"==typeof document||document.domain&&u?function(t){t.write(i("")),t.close();var n=t.parentWindow.Object;return t=null,n}(u):((t=l("iframe")).style.display="none",s.appendChild(t),t.src=String("javascript:"),(t=t.contentWindow.document).open(),t.write(i("document.F=Object")),t.close(),t.F);for(var n=a.length;n--;)delete b[y][a[n]];return b()};p[d]=!0,n.exports=Object.create||function(n,r){var e;return null!==n?(o[y]=c(n),e=new o,o[y]=null,e[d]=n):e=b(),r===t?e:f(e,r)}},function(t,n,r){var e=r(5),o=r(41),i=r(42),u=r(10),c=r(65);t.exports=e?Object.defineProperties:function(t,n){i(t);for(var r,e=u(n),f=c(n),a=f.length,p=0;p3&&void 0!==arguments[3]?arguments[3]:10;const u=n[t];if(!r(o))return;if(!e(i))return;if("function"!=typeof c)return void console.error("The hook callback must be a function.");if("number"!=typeof s)return void console.error("If specified, the hook priority must be a number.");const l={callback:c,priority:s,namespace:i};if(u[o]){const n=u[o].handlers;let t;for(t=n.length;t>0&&!(s>=n[t-1].priority);t--);t===n.length?n[t]=l:n.splice(t,0,l),u.__current.forEach((n=>{n.name===o&&n.currentIndex>=t&&n.currentIndex++}))}else u[o]={handlers:[l],runs:0};"hookAdded"!==o&&n.doAction("hookAdded",o,i,c,s)}},i=function(n,t){let o=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return function(i,c){const s=n[t];if(!r(i))return;if(!o&&!e(c))return;if(!s[i])return 0;let u=0;if(o)u=s[i].handlers.length,s[i]={runs:s[i].runs,handlers:[]};else{const n=s[i].handlers;for(let t=n.length-1;t>=0;t--)n[t].namespace===c&&(n.splice(t,1),u++,s.__current.forEach((n=>{n.name===i&&n.currentIndex>=t&&n.currentIndex--})))}return"hookRemoved"!==i&&n.doAction("hookRemoved",i,c),u}},c=function(n,t){return function(e,r){const o=n[t];return void 0!==r?e in o&&o[e].handlers.some((n=>n.namespace===r)):e in o}},s=function(n,t){let e=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return function(r){const o=n[t];o[r]||(o[r]={handlers:[],runs:0}),o[r].runs++;const i=o[r].handlers;for(var c=arguments.length,s=new Array(c>1?c-1:0),u=1;u=0),u[8]){case"b":e=parseInt(e,10).toString(2);break;case"c":e=String.fromCharCode(parseInt(e,10));break;case"d":case"i":e=parseInt(e,10);break;case"j":e=JSON.stringify(e,null,u[6]?parseInt(u[6]):0);break;case"e":e=u[7]?parseFloat(e).toExponential(u[7]):parseFloat(e).toExponential();break;case"f":e=u[7]?parseFloat(e).toFixed(u[7]):parseFloat(e);break;case"g":e=u[7]?String(Number(e.toPrecision(u[7]))):parseFloat(e);break;case"o":e=(parseInt(e,10)>>>0).toString(8);break;case"s":e=String(e),e=u[7]?e.substring(0,u[7]):e;break;case"t":e=String(!!e),e=u[7]?e.substring(0,u[7]):e;break;case"T":e=Object.prototype.toString.call(e).slice(8,-1).toLowerCase(),e=u[7]?e.substring(0,u[7]):e;break;case"u":e=parseInt(e,10)>>>0;break;case"v":e=e.valueOf(),e=u[7]?e.substring(0,u[7]):e;break;case"x":e=(parseInt(e,10)>>>0).toString(16);break;case"X":e=(parseInt(e,10)>>>0).toString(16).toUpperCase()}o.json.test(u[8])?h+=e:(!o.number.test(u[8])||f&&!u[3]?p="":(p=f?"+":"-",e=e.toString().replace(o.sign,"")),l=u[4]?"0"===u[4]?"0":u[4].charAt(1):" ",c=u[6]-(p+e).length,s=u[6]&&c>0?l.repeat(c):"",h+=u[5]?p+e+s:"0"===l?p+s+e:s+p+e)}return h}var s=Object.create(null);function l(t){if(s[t])return s[t];for(var n,e=t,r=[],i=0;e;){if(null!==(n=o.text.exec(e)))r.push(n[0]);else if(null!==(n=o.modulo.exec(e)))r.push("%");else{if(null===(n=o.placeholder.exec(e)))throw new SyntaxError("[sprintf] unexpected placeholder");if(n[2]){i|=1;var a=[],u=n[2],l=[];if(null===(l=o.key.exec(u)))throw new SyntaxError("[sprintf] failed to parse named argument key");for(a.push(l[1]);""!==(u=u.substring(l[0].length));)if(null!==(l=o.key_access.exec(u)))a.push(l[1]);else{if(null===(l=o.index_access.exec(u)))throw new SyntaxError("[sprintf] failed to parse named argument key");a.push(l[1])}n[2]=a}else i|=2;if(3===i)throw new Error("[sprintf] mixing positional and named placeholders is not (yet) supported");r.push(n)}e=e.substring(n[0].length)}return s[t]=r}n.sprintf=i,n.vsprintf=a,"undefined"!=typeof window&&(window.sprintf=i,window.vsprintf=a,void 0===(r=function(){return{sprintf:i,vsprintf:a}}.call(n,e,n,t))||(t.exports=r))}()}},n={};function e(r){var o=n[r];if(void 0!==o)return o.exports;var i=n[r]={exports:{}};return t[r](i,i.exports,e),i.exports}e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,{a:n}),n},e.d=function(t,n){for(var r in n)e.o(n,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:n[r]})},e.o=function(t,n){return Object.prototype.hasOwnProperty.call(t,n)},e.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var r={};!function(){"use strict";e.r(r),e.d(r,{__:function(){return __},_n:function(){return _n},_nx:function(){return _nx},_x:function(){return _x},createI18n:function(){return x},defaultI18n:function(){return _},getLocaleData:function(){return m},hasTranslation:function(){return L},isRTL:function(){return S},resetLocaleData:function(){return F},setLocaleData:function(){return w},sprintf:function(){return u},subscribe:function(){return k}});var t=e(9756),n=e.n(t),o=e(124),i=e.n(o);const a=n()(console.error);function u(t){try{for(var n=arguments.length,e=new Array(n>1?n-1:0),r=1;r":5,">=":5,"==":4,"!=":4,"&&":3,"||":2,"?":1,"?:":1},l=["(","?"],c={")":["("],":":["?","?:"]},f=/<=|>=|==|!=|&&|\|\||\?:|\(|!|\*|\/|%|\+|-|<|>|\?|\)|:/;var p={"!":function(t){return!t},"*":function(t,n){return t*n},"/":function(t,n){return t/n},"%":function(t,n){return t%n},"+":function(t,n){return t+n},"-":function(t,n){return t-n},"<":function(t,n){return t":function(t,n){return t>n},">=":function(t,n){return t>=n},"==":function(t,n){return t===n},"!=":function(t,n){return t!==n},"&&":function(t,n){return t&&n},"||":function(t,n){return t||n},"?:":function(t,n,e){if(t)throw n;return e}};var d={contextDelimiter:"",onMissingKey:null};function g(t,n){var e;for(e in this.data=t,this.pluralForms={},this.options={},d)this.options[e]=void 0!==n&&e in n?n[e]:d[e]}g.prototype.getPluralForm=function(t,n){var e,r,o,i,a=this.pluralForms[t];return a||("function"!=typeof(o=(e=this.data[t][""])["Plural-Forms"]||e["plural-forms"]||e.plural_forms)&&(r=function(t){var n,e,r;for(n=t.split(";"),e=0;e=0||s[o]1===t?0:1},v=/^i18n\.(n?gettext|has_translation)(_|$)/,x=(t,n,e)=>{const r=new g({}),o=new Set,i=()=>{o.forEach((t=>t()))},a=function(t){var n;let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"default";r.data[e]={...r.data[e],...t},r.data[e][""]={...h,...null===(n=r.data[e])||void 0===n?void 0:n[""]},delete r.pluralForms[e]},u=(t,n)=>{a(t,n),i()},s=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default",n=arguments.length>1?arguments[1]:void 0,e=arguments.length>2?arguments[2]:void 0,o=arguments.length>3?arguments[3]:void 0,i=arguments.length>4?arguments[4]:void 0;return r.data[t]||a(void 0,t),r.dcnpgettext(t,n,e,o,i)},l=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default";return t},_x=(t,n,r)=>{let o=s(r,n,t);return e?(o=e.applyFilters("i18n.gettext_with_context",o,t,n,r),e.applyFilters("i18n.gettext_with_context_"+l(r),o,t,n,r)):o};if(t&&u(t,n),e){const t=t=>{v.test(t)&&i()};e.addAction("hookAdded","core/i18n",t),e.addAction("hookRemoved","core/i18n",t)}return{getLocaleData:function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default";return r.data[t]},setLocaleData:u,addLocaleData:function(t){var n;let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"default";r.data[e]={...r.data[e],...t,"":{...h,...null===(n=r.data[e])||void 0===n?void 0:n[""],...null==t?void 0:t[""]}},delete r.pluralForms[e],i()},resetLocaleData:(t,n)=>{r.data={},r.pluralForms={},u(t,n)},subscribe:t=>(o.add(t),()=>o.delete(t)),__:(t,n)=>{let r=s(n,void 0,t);return e?(r=e.applyFilters("i18n.gettext",r,t,n),e.applyFilters("i18n.gettext_"+l(n),r,t,n)):r},_x:_x,_n:(t,n,r,o)=>{let i=s(o,void 0,t,n,r);return e?(i=e.applyFilters("i18n.ngettext",i,t,n,r,o),e.applyFilters("i18n.ngettext_"+l(o),i,t,n,r,o)):i},_nx:(t,n,r,o,i)=>{let a=s(i,o,t,n,r);return e?(a=e.applyFilters("i18n.ngettext_with_context",a,t,n,r,o,i),e.applyFilters("i18n.ngettext_with_context_"+l(i),a,t,n,r,o,i)):a},isRTL:()=>"rtl"===_x("ltr","text direction"),hasTranslation:(t,n,o)=>{var i,a;const u=n?n+""+t:t;let s=!(null===(i=r.data)||void 0===i||null===(a=i[null!=o?o:"default"])||void 0===a||!a[u]);return e&&(s=e.applyFilters("i18n.has_translation",s,t,n,o),s=e.applyFilters("i18n.has_translation_"+l(o),s,t,n,o)),s}}};var b=window.wp.hooks;const y=x(void 0,void 0,b.defaultHooks);var _=y;const m=y.getLocaleData.bind(y),w=y.setLocaleData.bind(y),F=y.resetLocaleData.bind(y),k=y.subscribe.bind(y),__=y.__.bind(y),_x=y._x.bind(y),_n=y._n.bind(y),_nx=y._nx.bind(y),S=y.isRTL.bind(y),L=y.hasTranslation.bind(y)}(),(window.wp=window.wp||{}).i18n=r}(); //# sourceMappingURL=index.min.js.map; !function(){"use strict";var e={d:function(t,n){for(var o in n)e.o(n,o)&&!e.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:n[o]})},o:function(e,t){return Object.prototype.hasOwnProperty.call(e,t)}},t={};function n(e){"undefined"!=typeof document&&("complete"!==document.readyState&&"interactive"!==document.readyState?document.addEventListener("DOMContentLoaded",e):e())}e.d(t,{default:function(){return n}}),(window.wp=window.wp||{}).domReady=t.default}(); //# sourceMappingURL=index.min.js.map; (()=>{var t={90055:(t,e,i)=>{"use strict";function o(t,e){return{default:{details:"mapbox://styles/automattic/cjolkhmez0qdd2ro82dwog1in",no_details:"mapbox://styles/automattic/cjolkci3905d82soef4zlmkdo"},black_and_white:{details:"mapbox://styles/automattic/cjolkixvv0ty42spgt2k4j434",no_details:"mapbox://styles/automattic/cjolkgc540tvj2spgzzoq37k4"},satellite:{details:"mapbox://styles/mapbox/satellite-streets-v10",no_details:"mapbox://styles/mapbox/satellite-v9"},terrain:{details:"mapbox://styles/automattic/cjolkf8p405fh2soet2rdt96b",no_details:"mapbox://styles/automattic/cjolke6fz12ys2rpbpvgl12ha"}}[t][e?"details":"no_details"]}i.d(e,{h:()=>o})},84634:(t,e,i)=>{"use strict";i.d(e,{YB:()=>n,b2:()=>o,k:()=>s,xt:()=>a,zb:()=>r});const o=t=>t.hasOwnProperty("lat")&&t.hasOwnProperty("lng")?t:{lat:t.latitude||0,lng:t.longitude||0};function n(t,e){const i=new t.LngLatBounds;return e.forEach((t=>{i.extend([t.coordinates.longitude,t.coordinates.latitude])})),i}function s(t,e){t.fitBounds(e,{padding:{top:80,bottom:80,left:40,right:40}})}function r(t,e){t.innerHTML=`\n\t\t\n\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\n\t`}function a(t){return new t.Popup({closeButton:!0,closeOnClick:!1,offset:{left:[0,0],top:[0,5],right:[0,0],bottom:[0,-40]}})}},96442:(t,e,i)=>{"use strict";i.d(e,{E0:()=>l,ot:()=>r,rZ:()=>a});var o=i(85007);const n=6371e3;function s(t){return Math.abs(n*Math.cos(t*Math.PI/180)*2*Math.PI/256)}function r(t,e){return 512/Math.pow(2,t)*.5*s(e)}function a(t,e){return new Promise((i=>{if(e.mapkitScriptIsLoading)(0,o.Dz)(e,"mapkit").then((t=>{i(t)}));else{e.mapkitScriptIsLoading=!0;const n=t.createElement("script");n.addEventListener("load",(async()=>{const t=await(0,o.Dz)(e,"mapkit");e.mapkitScriptIsLoading=!1,i(t)}),{once:!0}),n.src="https://cdn.apple-mapkit.com/mk/5.x.x/mapkit.js",n.crossOrigin="anonymous",t.head.appendChild(n)}}))}function l(t,e,i){return new Promise(((e,o)=>{i.mapkitIsInitialized?e():i.mapkitIsInitializing?function(t){return new Promise(((e,i)=>{const o=()=>{void 0===t.mapkitIsInitializing?i():!1===t.mapkitIsInitializing?e():t.requestAnimationFrame(o)};o()}))}(i).then((()=>{e()})):(i.mapkitIsInitializing=!0,i.mapkitIsInitialized=!1,t.init({authorizationCallback:async t=>{try{const n=await fetch("https://public-api.wordpress.com/wpcom/v2/mapkit");if(200===n.status){t((await n.json()).wpcom_mapkit_access_token)}else o();i.mapkitIsInitializing=!1,i.mapkitIsInitialized=!0,e()}catch(t){o()}}}))}))}},51321:(t,e,i)=>{"use strict";i.d(e,{Z:()=>o});const o=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(e)t.style.height=e+"px";else{const e=t.offsetWidth,i=window.location.search.indexOf("map-block-counter")>-1?window.innerHeight:.8*window.innerHeight,o=Math.min(e*(3/4),i);t.style.height=o+"px"}}},24795:(t,e,i)=>{"use strict";i.d(e,{G:()=>o.Z,k:()=>n.Z});var o=i(49735),n=i(75867)},49735:(t,e,i)=>{"use strict";i.d(e,{Z:()=>d});var o=i(90017),n=i.n(o),s=i(85007),r=i(24393),a=i(45388),l=i(90055),p=i(84634),c=i(51321);const d=class{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:()=>{};n()(this,"sizeMap",(()=>{(0,c.Z)(this.container,this.mapHeight),this.map.resize(),this.setBoundsByMarkers()})),n()(this,"closeInfoWindow",(()=>{this.activeMarker=null,this.infoWindow.remove()})),this.root=t;const{currentDoc:i,currentWindow:o}=(0,s.bL)(this.root);this.document=i,this.window=o,this.onError=e,this.mapStyle=this.root.getAttribute("data-map-style")||"default",this.mapDetails="true"===this.root.getAttribute("data-map-details"),this.apiKey=this.root.getAttribute("data-api-key")||null,this.scrollToZoom="true"===this.root.getAttribute("data-scroll-to-zoom"),this.showFullscreenButton="true"===this.root.getAttribute("data-show-fullscreen-button"),this.points=JSON.parse(this.root.getAttribute("data-points")||"[]"),this.mapCenter=JSON.parse(this.root.getAttribute("data-map-center")||"{}"),this.mapHeight=this.root.getAttribute("data-map-height")||null,this.markerColor=this.root.getAttribute("data-marker-color")||"red";const r=this.root.getAttribute("data-zoom");this.zoom=r&&r.length?parseInt(this.root.getAttribute("data-zoom"),10):13,this.activeMarker=null;const a=this.root.querySelector("ul");if(a&&(a.style.display="none"),!this.apiKey||!this.apiKey.length)throw new Error("API key missing")}initDOM(){this.root.innerHTML='
',this.container=this.root.querySelector(".wp-block-jetpack-map__gm-container")}loadMapLibraries(){return new Promise((t=>{const e={"mapbox-gl-js":()=>{(0,s.Dz)(this.window,"mapboxgl").then((e=>{this.mapboxgl=e,e.accessToken=this.apiKey,t(e)}))}};(0,s.Pp)(a,e,this.root)}))}initMap(){try{this.map=new this.mapboxgl.Map({container:this.container,style:(0,l.h)(this.mapStyle,this.mapDetails),center:(0,p.b2)(this.mapCenter),zoom:this.zoom,pitchWithRotate:!1,attributionControl:!1,dragRotate:!1})}catch(t){return void this.onError("mapbox_error",t.message)}this.scrollToZoom||this.map.scrollZoom.disable(),this.showFullscreenButton&&this.map.addControl(new this.mapboxgl.FullscreenControl),this.map.on("error",(t=>{this.onError("mapbox_error",t.error.message)})),this.zoomControl=new this.mapboxgl.NavigationControl({showCompass:!1,showZoom:!0})}initInfoWindow(){this.infoWindowContent=this.document.createElement("div"),this.infoWindow=(0,p.xt)(this.mapboxgl),this.infoWindow.setDOMContent(this.infoWindowContent)}setBoundsByMarkers(){if(!this.map)return;if(this.map.dragPan.enable(),!this.points.length)return;if(this.activeMarker)return;const t=(0,p.YB)(this.mapboxgl,this.points);this.points.length>1?(0,p.k)(this.map,t):(this.map.setCenter(t.getCenter()),this.map.addControl(this.zoomControl))}initMapSize(){this.setBoundsByMarkers(),this.debouncedSizeMap=(0,r.D)(this.sizeMap,250),this.debouncedSizeMap()}initHandlers(){this.map.getCanvas().addEventListener("click",this.closeInfoWindow),window.addEventListener("resize",this.debouncedSizeMap)}showInfoWindow(t,e){const i=[e.coordinates.longitude,e.coordinates.latitude];this.activeMarker=t,this.infoWindowContent.innerHTML="

",this.infoWindowContent.querySelector("h3").textContent=e.title,this.infoWindowContent.querySelector("p").textContent=e.caption,this.infoWindow.setLngLat(i).addTo(this.map)}initMarkers(){this.points.forEach((t=>{const e=[t.coordinates.longitude,t.coordinates.latitude],i=this.document.createElement("div");i.className="wp-block-jetpack-map-marker";const o=new this.mapboxgl.Marker(i).setLngLat(e).setOffset([0,-19]).addTo(this.map);o.getElement().addEventListener("click",(()=>this.showInfoWindow(o,t))),(0,p.zb)(i,this.markerColor)}))}async init(){this.initDOM(),await this.loadMapLibraries(),this.initMap(),this.initInfoWindow(),this.initMapSize(),this.initHandlers(),this.initMarkers()}}},75867:(t,e,i)=>{"use strict";i.d(e,{Z:()=>l});var o=i(90017),n=i.n(o),s=i(24393),r=i(96442),a=i(51321);const l=class{constructor(t){n()(this,"sizeMap",(()=>{(0,a.Z)(this.container,this.mapHeight)})),this.root=t,this.blog_id=this.root.getAttribute("data-blog-id"),this.center=JSON.parse(this.root.getAttribute("data-map-center")),this.points=JSON.parse(this.root.getAttribute("data-points")||"[]"),this.color=this.root.getAttribute("data-marker-color")||"red",this.zoom=parseFloat(this.root.getAttribute("data-zoom"))||10,this.scrollToZoom="true"===this.root.getAttribute("data-scroll-to-zoom"),this.mapStyle=this.root.getAttribute("data-map-style")||"default",this.mapHeight=this.root.getAttribute("data-map-height")||null}async init(){this.initDOM(),await this.loadLibrary(),await this.fetchKey(),this.initMapSize(),this.initMap(),this.addPoints(),this.initHandlers()}initDOM(){this.root.innerHTML='
',this.container=this.root.querySelector(".wp-block-jetpack-map__mb-container")}initMapSize(){this.debouncedSizeMap=(0,s.D)(this.sizeMap,250),this.sizeMap()}initHandlers(){window.addEventListener("resize",this.debouncedSizeMap)}loadLibrary(){return new Promise((t=>{(0,r.rZ)(document,window).then((e=>{this.mapkit=e,t()}))}))}fetchKey(){return(0,r.E0)(this.mapkit,this.blog_id,window)}initMap(){const t=new this.mapkit.Coordinate(this.center.lat,this.center.lng),e=(()=>{switch(this.mapStyle){case"satellite":return this.mapkit.Map.MapTypes.Satellite;case"black_and_white":return this.mapkit.Map.MapTypes.MutedStandard;case"hybrid":return this.mapkit.Map.MapTypes.Hybrid;default:return this.mapkit.Map.MapTypes.Standard}})();this.map=new this.mapkit.Map(this.container,{center:t,mapType:e,showsMapTypeControl:!1}),this.points.length<2&&this.zoom&&this.setZoom(),this.scrollToZoom&&(this.map._allowWheelToZoom=!0)}setZoom(){this.map.cameraDistance=(0,r.ot)(this.zoom,this.center.lat)}addPoints(){const t=this.points.map((t=>{const e=new this.mapkit.Coordinate(t.coordinates.latitude,t.coordinates.longitude);return new this.mapkit.MarkerAnnotation(e,{color:this.color,title:t.title,callout:{calloutContentForAnnotation:function(t){const e=document.createElement("div");e.style.width=t.element.parentElement.offsetWidth/2+"px";const i=e.appendChild(document.createElement("div"));i.style.fontSize="17px",i.style.fontWeight="600",i.style.lineHeight="19px",i.style.marginTop="8px",i.textContent=t.title;const o=e.appendChild(document.createElement("p"));return o.style.fontSize="14px",o.style.margin="0px 0px 4px 0px",o.textContent=t.data?.caption,e}},calloutEnabled:!0,data:{caption:t.caption}})}));this.map.showItems(t)}}},85007:(t,e,i)=>{"use strict";function o(t){const e=t.ownerDocument;return{currentDoc:e,currentWindow:e.defaultView||e.parentWindow}}function n(t,e,i){const n=`${window.Jetpack_Block_Assets_Base_Url.url}editor-assets`,{currentDoc:s}=o(i),r=s.getElementsByTagName("head")[0];t.forEach((t=>{const[i,o]=t.file.split("/").pop().split(".");if("css"===o){if(s.getElementById(t.id))return;const e=s.createElement("link");e.id=t.id,e.rel="stylesheet",e.href=`${n}/${i}-${t.version}.${o}`,r.appendChild(e)}if("js"===o){const a=e[t.id]?e[t.id]:null;if(s.getElementById(t.id))return a();const l=s.createElement("script");l.id=t.id,l.type="text/javascript",l.src=`${n}/${i}-${t.version}.${o}`,l.onload=a,r.appendChild(l)}}))}function s(t,e){return new Promise((i=>{const o=()=>{t[e]?i(t[e]):t.requestAnimationFrame(o)};o()}))}i.d(e,{Dz:()=>s,Pp:()=>n,bL:()=>o})},24393:(t,e,i)=>{"use strict";function o(t,e){let i;return function(){for(var o=arguments.length,n=new Array(o),s=0;st.apply(this,n)),e)}}i.d(e,{D:()=>o})},80425:(t,e,i)=>{"object"==typeof window&&window.Jetpack_Block_Assets_Base_Url&&window.Jetpack_Block_Assets_Base_Url.url&&(i.p=window.Jetpack_Block_Assets_Base_Url.url)},47701:t=>{"use strict";t.exports=window.wp.domReady},90017:(t,e,i)=>{var o=i(96930);t.exports=function(t,e,i){return(e=o(e))in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t},t.exports.__esModule=!0,t.exports.default=t.exports},45061:(t,e,i)=>{var o=i(73522).default;t.exports=function(t,e){if("object"!==o(t)||null===t)return t;var i=t[Symbol.toPrimitive];if(void 0!==i){var n=i.call(t,e||"default");if("object"!==o(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)},t.exports.__esModule=!0,t.exports.default=t.exports},96930:(t,e,i)=>{var o=i(73522).default,n=i(45061);t.exports=function(t){var e=n(t,"string");return"symbol"===o(e)?e:String(e)},t.exports.__esModule=!0,t.exports.default=t.exports},73522:t=>{function e(i){return t.exports=e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t.exports.__esModule=!0,t.exports.default=t.exports,e(i)}t.exports=e,t.exports.__esModule=!0,t.exports.default=t.exports},45388:t=>{"use strict";t.exports=JSON.parse('[{"id":"mapbox-gl-js","file":"node_modules/mapbox-gl/dist/mapbox-gl.js","version":"1.13.0"},{"id":"mapbox-gl-css","file":"node_modules/mapbox-gl/dist/mapbox-gl.css","version":"1.13.0"}]')}},e={};function i(o){var n=e[o];if(void 0!==n)return n.exports;var s=e[o]={exports:{}};return t[o](s,s.exports,i),s.exports}i.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return i.d(e,{a:e}),e},i.d=(t,e)=>{for(var o in e)i.o(e,o)&&!i.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:e[o]})},i.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),i.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),(()=>{var t;i.g.importScripts&&(t=i.g.location+"");var e=i.g.document;if(!t&&e&&(e.currentScript&&(t=e.currentScript.src),!t)){var o=e.getElementsByTagName("script");o.length&&(t=o[o.length-1].src)}if(!t)throw new Error("Automatic publicPath is not supported in this browser");t=t.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),i.p=t+"../"})(),(()=>{"use strict";i(80425)})(),(()=>{"use strict";var t=i(47701),e=i.n(t),o=i(24795);e()((function(){Array.from(document.querySelectorAll(".wp-block-jetpack-map")).forEach((async t=>{try{if("mapkit"===t.getAttribute("data-map-provider")){new o.k(t).init()}else{new o.G(t).init()}}catch(t){}}))}))})()})();; // listen for rlt authentication events and pass them to children of this document. ( function() { var currentToken; var parentOrigin; var iframeOrigins; var initializationListeners = []; var hasBeenInitialized = false; var RLT_KEY = 'jetpack:wpcomRLT'; // IE11 compat version that doesn't require on `new URL( src )` function getOriginFromUrl( url ) { var parser = document.createElement('a'); parser.href = url; return parser.origin; } // run on `load` for suitable iframes, this injects the current token if available function rltIframeInjector( event ) { if ( ! currentToken ) { return; } rltInjectToken( currentToken, event.target.contentWindow, getOriginFromUrl( event.target.src ) ); } // run on DOMContentLoaded or later function rltMonitorIframes() { // wait until suitable iframes are loaded before trying to inject the RLT var iframes = document.querySelectorAll( "iframe" ); for( var i=0; i= 0; } function rltInvalidateWindowToken( token, target, origin ) { if ( target && typeof target.postMessage === 'function' ) { try { target.postMessage( JSON.stringify( { type: 'rltMessage', data: { event: 'invalidate', token: token, sourceOrigin: window.location.origin, }, } ), origin ); } catch ( err ) { return; } } } /** * PUBLIC METHODS */ window.rltInvalidateToken = function( token, sourceOrigin ) { // invalidate in current context if ( token === currentToken ) { currentToken = null; } // remove from localstorage, but only if in a top level window, not iframe try { if ( window.location === window.parent.location && window.localStorage ) { if ( window.localStorage.getItem(RLT_KEY) === token ) { window.localStorage.removeItem(RLT_KEY); } } } catch( e ) { console.info("localstorage access for invalidate denied - probably blocked third-party access", window.location.href); } // invalidate in iframes var iframes = document.querySelectorAll("iframe"); for( var i=0; i