PageSourceSearch

https://static.cloud.coveo.com/atomic/v3.19.0/autoloader/index.esm.js

js coveo.com collected 2026-09-24 07:36:28 UTC 1,695 bytes, 44 lines download raw bytes

1import searchElementMap from "../components/components/search/lazy-index.js";
2if (typeof window !== "undefined") {
3  const discover = async (root) => {
4    const rootTagName = root instanceof Element ? root.tagName.toLowerCase() : "";
5    const rootIsAtomicElement = rootTagName?.startsWith("atomic-");
6    const tags = [...root.querySelectorAll(":not(:defined)")].map((el) => el.tagName.toLowerCase()).filter((tag) => tag.startsWith("atomic-"));
7    if (rootIsAtomicElement && !customElements.get(rootTagName)) {
8      tags.push(rootTagName);
9    }
10    if (rootIsAtomicElement) {
11      const childTemplates = root.querySelectorAll("template");
12      for (const template of childTemplates) {
13        discover(template.content);
14        observer.observe(template.content, { subtree: true, childList: true });
15      }
16      if ("shadowRoot" in root && root.shadowRoot) {
17        discover(root.shadowRoot);
18        observer.observe(root.shadowRoot, { subtree: true, childList: true });
19      }
20    }
21    const tagsToRegister = [...new Set(tags)];
22    await Promise.allSettled(
23      tagsToRegister.map((tagName) => register(tagName))
24    );
25    customElements.upgrade(root);
26  };
27  const register = (tagName) => {
28    if (customElements.get(tagName)) {
29      return Promise.resolve();
30    }
31    return searchElementMap[tagName]?.();
32  };
33  const observer = new MutationObserver((mutations) => {
34    for (const { addedNodes } of mutations) {
35      for (const node of addedNodes) {
36        if (node.nodeType === Node.ELEMENT_NODE) {
37          discover(node);
38        }
39      }
40    }
41  });
42  discover(document.body);
43  observer.observe(document.documentElement, { subtree: true, childList: true });
44}

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.