PageSourceSearch

https://saferinternet.org.uk/wp-content/themes/safer-internet/public/7140-a155e89c74fe94dd606b.js

js saferinternet.org.uk collected 2026-09-24 06:34:30 UTC 6,879 bytes, 2 lines download raw bytes

1"use strict";(self.webpackChunkSaferInternet=self.webpackChunkSaferInternet||[]).push([[7140],{64804(e,t,i){function n(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,n=Array(t);i<t;i++)n[i]=e[i];return n}function o(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var n=i.call(e,t||"default");if("object"!=typeof n)return n;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(n.key),n)}}function r(e){return function(e){if(Array.isArray(e))return n(e)}(e)||function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e){if(e){if("string"==typeof e)return n(e,void 0);var t=({}).toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?n(e,void 0):void 0}}(e)||function(){throw TypeError(`Invalid attempt to spread non-iterable instance.
2In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}i.d(t,{A:()=>u});var a,s,l,c,d,u=(a=["a[href]","area[href]",'input:not([disabled]):not([type="hidden"]):not([aria-hidden])',"select:not([disabled]):not([aria-hidden])","textarea:not([disabled]):not([aria-hidden])","button:not([disabled]):not([aria-hidden])","iframe","object","embed","[contenteditable]",'[tabindex]:not([tabindex^="-"])'],s=function(){var e,t;function i(e){var t=e.targetModal,n=e.triggers,o=void 0===n?[]:n,a=e.onShow,s=e.onClose,l=e.openTrigger,c=e.closeTrigger,d=e.openClass,u=e.disableScroll,h=e.disableFocus,f=e.awaitCloseAnimation,v=e.awaitOpenAnimation,g=e.debugMode;!function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,i),this.modal="string"==typeof t?document.getElementById(t):t,this.config={debugMode:void 0!==g&&g,disableScroll:void 0!==u&&u,openTrigger:void 0===l?"data-micromodal-trigger":l,closeTrigger:void 0===c?"data-micromodal-close":c,openClass:void 0===d?"is-open":d,onShow:void 0===a?function(){}:a,onClose:void 0===s?function(){}:s,awaitCloseAnimation:void 0!==f&&f,awaitOpenAnimation:void 0!==v&&v,disableFocus:void 0!==h&&h},o.length>0&&this.registerTriggers.apply(this,r(o)),this.onClick=this.onClick.bind(this),this.onKeydown=this.onKeydown.bind(this)}return e=[{key:"registerTriggers",value:function(){for(var e=this,t=arguments.length,i=Array(t),n=0;n<t;n++)i[n]=arguments[n];i.filter(Boolean).forEach(function(t){t.addEventListener("click",function(t){return e.showModal(t)})})}},{key:"showModal",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;(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)?this.modal.addEventListener("animationend",function t(){e.modal.removeEventListener("animationend",t,!1),e.setFocusToFirstNode()},!1):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 i=this.config.openClass;this.modal.addEventListener("animationend",function e(){t.classList.remove(i),t.removeEventListener("animationend",e,!1)},!1)}else t.classList.remove(this.config.openClass)}},{key:"closeModalByIdOrElement",value:function(e){this.modal="string"==typeof e?document.getElementById(e):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))}}
2,{key:"onKeydown",value:function(e){27===e.keyCode&&this.closeModal(e),9===e.keyCode&&this.retainFocus(e)}},{key:"getFocusableNodes",value:function(){return Array.apply(void 0,r(this.modal.querySelectorAll(a)))}},{key:"setFocusToFirstNode",value:function(){var e=this;if(!this.config.disableFocus){var t=this.getFocusableNodes();if(0!==t.length){var i=t.filter(function(t){return!t.hasAttribute(e.config.closeTrigger)});i.length>0&&i[0].focus(),0===i.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 i=t.indexOf(document.activeElement);e.shiftKey&&0===i&&(t[t.length-1].focus(),e.preventDefault()),!e.shiftKey&&t.length>0&&i===t.length-1&&(t[0].focus(),e.preventDefault())}else t[0].focus()}}],o(i.prototype,e),t&&o(i,t),Object.defineProperty(i,"prototype",{writable:!1}),i}(),l=null,c=function(e){if("string"==typeof id?!document.getElementById(e):!e)return!1},d=function(e,t){if(e.length,!t)return!0;for(var i in t)c(i);return!0},{init:function(e){var t,i,n=Object.assign({},{openTrigger:"data-micromodal-trigger"},e),o=r(document.querySelectorAll("[".concat(n.openTrigger,"]"))),a=(t=n.openTrigger,i=[],o.forEach(function(e){var n=e.attributes[t].value;void 0===i[n]&&(i[n]=[]),i[n].push(e)}),i);if(!0!==n.debugMode||!1!==d(o,a))for(var c in a){var u=a[c];n.targetModal=c,n.triggers=r(u),l=new s(n)}},show:function(e,t){var i=t||{};i.targetModal=e,!0===i.debugMode&&!1===c(e)||(l&&l.removeEventListeners(),(l=new s(i)).showModal())},close:function(e){e?l.closeModalByIdOrElement(e):l.closeModal()}});window.MicroModal=u},7140(e,t,i){i.d(t,{Modal:()=>o});var n=i(64804);class o{constructor(e){this.openClass=e.openClass,this.jsClass=e.jsClass}init(){n.A.init({openClass:this.openClass,openTrigger:`data-${this.jsClass}-open`,closeTrigger:`data-${this.jsClass}-close`,disableScroll:!0})}}}}]);

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.