1(function () { 2 var script = document.currentScript; 3 var spriteUrl = script ? new URL('palo-icons.svg', script.src).href : 'assets/palo-icons.svg'; 4 5 function iconMarkup(name, className) { 6 var cls = className ? ' ' + className : ''; 7 return '<svg class="palo-svg-icon' + cls + '" aria-hidden="true" focusable="false"><use href="' + 8 spriteUrl + '#palo-icon-' + name + '"></use></svg>'; 9 } 10 11 window.paloIcon = iconMarkup; 12 13 window.paloRenderIcons = function (root) { 14 var scope = root || document; 15 scope.querySelectorAll('[data-palo-icon]').forEach(function (node) { 16 var name = node.getAttribute('data-palo-icon'); 17 if (!name || node.getAttribute('data-palo-rendered') === 'true') return; 18 node.innerHTML = iconMarkup(name, node.getAttribute('data-palo-icon-class') || ''); 19 node.setAttribute('data-palo-rendered', 'true'); 20 if (!node.hasAttribute('aria-hidden')) node.setAttribute('aria-hidden', 'true'); 21 }); 22 }; 23 24 function boot() { 25 window.paloRenderIcons(document); 26 if (!document.body || !window.MutationObserver) return; 27 var observer = new MutationObserver(function (mutations) { 28 mutations.forEach(function (mutation) { 29 mutation.addedNodes.forEach(function (node) { 30 if (node.nodeType === 1) window.paloRenderIcons(node); 31 }); 32 }); 33 }); 34 observer.observe(document.body, { childList: true, subtree: true }); 35 } 36 37 if (document.readyState === 'loading') { 38 document.addEventListener('DOMContentLoaded', boot); 39 } else { 40 boot(); 41 } 42}());
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.