/** * This script is used to load the web components from the CDN. * It appends the style and script tags to the document head. You only need * to use this script once in your application. * Once the script is loaded, the web components are available for use. * * Use another scripts to append specific web components to the DOM. */ (function () { const libVersion = "0.87.0"; const cdnBaseUrl = "https://ats-web-components.pages.dev"; const cdnUrl = `${cdnBaseUrl}/${libVersion}`; const styleTag = document.createElement("link"); styleTag.setAttribute("href", `${cdnUrl}/style.css`); styleTag.setAttribute("rel", "stylesheet"); styleTag.setAttribute("type", "text/css"); // Create a script tag for the web components const scriptTag = document.createElement("script"); scriptTag.setAttribute("src", `${cdnUrl}/index.js`); scriptTag.setAttribute("type", "module"); scriptTag.setAttribute("async", true); // Add the style and script tags to the document document.head.appendChild(styleTag); document.head.appendChild(scriptTag); })();