PageSourceSearch

https://fieldstudies.org/wp-content/plugins/bricksextras/components/assets/js/inert.min.js?ver=1.7.0

js fieldstudies.org collected 2026-09-24 09:11:52 UTC 7,269 bytes, 7 lines download raw bytes

1/*!
2 * Inert Polyfill
3 * https://github.com/WICG/inert
4 * Copyright (c) 2016 Google Inc.
5 * Licensed under Apache-2.0 (https://github.com/WICG/inert/blob/main/LICENSE)
6 */
7!function(){if("undefined"==typeof window)return;let e=Array.prototype.slice,t=Element.prototype.matches||Element.prototype.msMatchesSelector,n="a[href],area[href],input:not([disabled]),select:not([disabled]),textarea:not([disabled]),button:not([disabled]),details,summary,iframe,object,embed,[contenteditable]";class i{constructor(e,t){this._inertManager=t,this._rootElement=e,this._managedNodes=new Set,this._rootElement.hasAttribute("aria-hidden")?this._savedAriaHidden=this._rootElement.getAttribute("aria-hidden"):this._savedAriaHidden=null,this._rootElement.setAttribute("aria-hidden","true"),this._makeSubtreeUnfocusable(this._rootElement),this._observer=new MutationObserver(this._onMutation.bind(this)),this._observer.observe(this._rootElement,{attributes:!0,childList:!0,subtree:!0})}destructor(){this._observer.disconnect(),this._rootElement&&(null!==this._savedAriaHidden?this._rootElement.setAttribute("aria-hidden",this._savedAriaHidden):this._rootElement.removeAttribute("aria-hidden")),this._managedNodes.forEach(function(e){this._unmanageNode(e.node)},this),this._observer=null,this._rootElement=null,this._managedNodes=null,this._inertManager=null}get managedNodes(){return new Set(this._managedNodes)}get hasSavedAriaHidden(){return null!==this._savedAriaHidden}set savedAriaHidden(e){this._savedAriaHidden=e}get savedAriaHidden(){return this._savedAriaHidden}_makeSubtreeUnfocusable(e){r(e,e=>this._visitNode(e));let t=document.activeElement;if(!document.body.contains(e)){let n=e,i;for(;n;){if(n.nodeType===Node.DOCUMENT_FRAGMENT_NODE){i=n;break}n=n.parentNode}i&&(t=i.activeElement)}e.contains(t)&&(t.blur(),t===document.activeElement&&document.body.focus())}_visitNode(e){if(e.nodeType!==Node.ELEMENT_NODE)return;let i=e;i!==this._rootElement&&i.hasAttribute("inert")&&this._adoptInertRoot(i),(t.call(i,n)||i.hasAttribute("tabindex"))&&this._manageNode(i)}_manageNode(e){let t=this._inertManager.register(e,this);this._managedNodes.add(t)}_unmanageNode(e){let t=this._inertManager.deregister(e,this);t&&this._managedNodes.delete(t)}_unmanageSubtree(e){r(e,e=>this._unmanageNode(e))}_adoptInertRoot(e){let t=this._inertManager.getInertRoot(e);t||(this._inertManager.setInert(e,!0),t=this._inertManager.getInertRoot(e)),t.managedNodes.forEach(function(e){this._manageNode(e.node)},this)}_onMutation(t,n){t.forEach(function(t){let n=t.target;if("childList"===t.type)e.call(t.addedNodes).forEach(function(e){this._makeSubtreeUnfocusable(e)},this),e.call(t.removedNodes).forEach(function(e){this._unmanageSubtree(e)},this);else if("attributes"===t.type){if("tabindex"===t.attributeName)this._manageNode(n);else if(n!==this._rootElement&&"inert"===t.attributeName&&n.hasAttribute("inert")){this._adoptInertRoot(n);let i=this._inertManager.getInertRoot(n);this._managedNodes.forEach(function(e){n.contains(e.node)&&i._manageNode(e.node)})}}},this)}}class s{constructor(e,t){this._node=e,this._overrodeFocusMethod=!1,this._inertRoots=new Set([t]),this._savedTabIndex=null,this._destroyed=!1,this.ensureUntabbable()}destructor(){if(this._throwIfDestroyed(),this._node&&this._node.nodeType===Node.ELEMENT_NODE){let e=this._node;null!==this._savedTabIndex?e.setAttribute("tabindex",this._savedTabIndex):e.removeAttribute("tabindex"),this._overrodeFocusMethod&&delete e.focus}this._node=null,this._inertRoots=null,this._destroyed=!0}get destroyed(){return this._destroyed}_throwIfDestroyed(){if(this.destroyed)throw Error("Trying to access destroyed InertNode")}get hasSavedTabIndex(){return null!==this._savedTabIndex}get node(){return this._throwIfDestroyed(),this._node}set savedTabIndex(e){this._throwIfDestroyed(),this._savedTabIndex=e}get savedTabIndex(){return this._throwIfDestroyed(),this._savedTabIndex}ensureUntabbable(){if(this.node.nodeType!==Node.ELEMENT_NODE)return;let e=this.node;if(t.call(e,n)){if(-1===e.tabIndex&&this.hasSavedTabIndex)return;e.hasAttribute("tabindex")&&(this._savedTabIndex=e.tabIndex),e.setAttribute("tabindex","-1"),e.nodeType===Node.ELEMENT_NODE&&(e.focus=function(){},this._overrodeFocusMethod=!0)}else e.hasAttribute("tabindex")&&(this._savedTabIndex=e.tabIndex,e.removeAttribute("tabindex"))}
7addInertRoot(e){this._throwIfDestroyed(),this._inertRoots.add(e)}removeInertRoot(e){this._throwIfDestroyed(),this._inertRoots.delete(e),0===this._inertRoots.size&&this.destructor()}}function r(e,t,n){if(e.nodeType==Node.ELEMENT_NODE){let i=e;t&&t(i);let s=i.shadowRoot;if(s){r(s,t,s);return}if("content"==i.localName){let o=i,d=o.getDistributedNodes?o.getDistributedNodes():[];for(let a=0;a<d.length;a++)r(d[a],t,n);return}if("slot"==i.localName){let h=i,l=h.assignedNodes?h.assignedNodes({flatten:!0}):[];for(let u=0;u<l.length;u++)r(l[u],t,n);return}}let c=e.firstChild;for(;null!=c;)r(c,t,n),c=c.nextSibling}function o(e){if(e.querySelector("style#inert-style, link#inert-style"))return;let t=document.createElement("style");t.setAttribute("id","inert-style"),t.textContent="\n[inert] {\n  pointer-events: none;\n  cursor: default;\n}\n\n[inert], [inert] * {\n  -webkit-user-select: none;\n  -moz-user-select: none;\n  -ms-user-select: none;\n  user-select: none;\n}\n",e.appendChild(t)}if(!Element.prototype.hasOwnProperty("inert")){let d=new class n{constructor(e){if(!e)throw Error("Missing required argument; InertManager needs to wrap a document.");this._document=e,this._managedNodes=new Map,this._inertRoots=new Map,this._observer=new MutationObserver(this._watchForInert.bind(this)),o(e.head||e.body||e.documentElement),"loading"===e.readyState?e.addEventListener("DOMContentLoaded",this._onDocumentLoaded.bind(this)):this._onDocumentLoaded()}setInert(e,t){if(t){if(this._inertRoots.has(e))return;let n=new i(e,this);if(e.setAttribute("inert",""),this._inertRoots.set(e,n),!this._document.body.contains(e)){let s=e.parentNode;for(;s;)11===s.nodeType&&o(s),s=s.parentNode}}else{if(!this._inertRoots.has(e))return;let r=this._inertRoots.get(e);r.destructor(),this._inertRoots.delete(e),e.removeAttribute("inert")}}getInertRoot(e){return this._inertRoots.get(e)}register(e,t){let n=this._managedNodes.get(e);return void 0!==n?n.addInertRoot(t):n=new s(e,t),this._managedNodes.set(e,n),n}deregister(e,t){let n=this._managedNodes.get(e);return n?(n.removeInertRoot(t),n.destroyed&&this._managedNodes.delete(e),n):null}_onDocumentLoaded(){let t=e.call(this._document.querySelectorAll("[inert]"));t.forEach(function(e){this.setInert(e,!0)},this),this._observer.observe(this._document.body||this._document.documentElement,{attributes:!0,subtree:!0,childList:!0})}_watchForInert(n,i){let s=this;n.forEach(function(n){switch(n.type){case"childList":e.call(n.addedNodes).forEach(function(n){if(n.nodeType!==Node.ELEMENT_NODE)return;let i=e.call(n.querySelectorAll("[inert]"));t.call(n,"[inert]")&&i.unshift(n),i.forEach(function(e){this.setInert(e,!0)},s)},s);break;case"attributes":if("inert"!==n.attributeName)return;let i=n.target,r=i.hasAttribute("inert");s.setInert(i,r)}},this)}}(document);Object.defineProperty(Element.prototype,"inert",{enumerable:!0,get:function(){return this.hasAttribute("inert")},set:function(e){d.setInert(this,e)}})}}();

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.