<html><head></head><body>{"version":3,"file":"outline-loader.js","sources":["../src/utilities/base-path.ts","../src/outline-loader.ts"],"sourcesContent":["// This file was copied from: https://github.com/shoelace-style/shoelace/blob/next/src/utilities/base-path.ts\n// Every 'shoelace' occurrence was replaced with 'outline'\n\nlet basePath = '';\n\n/** Sets the library's base path to the specified directory. */\nexport function setBasePath(path: string) {\n basePath = path;\n}\n\n/**\n * Gets the library's base path.\n *\n * The base path is used to load assets such as icons and images, so it needs to be set for components to work properly.\n * By default, this script will look for a script ending in outline.js or outline-eager-loader.js or\n * outline-loader.js and set the base path to the directory that contains that file.\n * To override this behavior, you can add the data-outline attribute to any script on the page\n * (it probably makes the most sense to attach it to the outline script, but it could also be on a bundle).\n * The value can be a local folder or it can point to a CORS-enabled endpoint such as a CDN.\n *\n * <script data-outline='\"/custom/base/path\"' src='\"bundle.js\"'></script>\n *\n * Alternatively, you can set the base path manually using the exported setBasePath() function.\n *\n * @param subpath - An optional path to append to the base path.\n */\nexport function getBasePath(subpath = '') {\n if (!basePath) {\n const scripts = [\n ...document.getElementsByTagName('script'),\n ] as HTMLScriptElement[];\n const configScript = scripts.find(script =>\n script.hasAttribute('data-outline')\n );\n\n if (configScript) {\n // Use the data-outline attribute\n setBasePath(configScript.getAttribute('data-outline')!);\n } else {\n const fallbackScript = scripts.find(s => {\n return (\n /outline(\\.min)?\\.js($|\\?)/.test(s.src) ||\n /outline-loader(\\.min)?\\.js($|\\?)/.test(s.src)\n );\n });\n let path = '';\n\n if (fallbackScript) {\n path = fallbackScript.getAttribute('src')!;\n }\n\n setBasePath(path.split('/').slice(0, -1).join('/'));\n }\n }\n\n // Return the base path without a trailing slash. If one exists, append the subpath separated by a slash.\n return (\n basePath.replace(/\\/$/, '') +\n (subpath ? `/${subpath.replace(/^\\//, '')}` : ``)\n );\n}\n","import { getBasePath } from './utilities/base-path.js';\n\n// declare const drupalSettings: { outlineLoader: { type: string } };\ninterface DrupalSettings {\n outlineLoader?: { type: string };\n scoreContent?: {\n externalLinks: {\n enabled: boolean;\n whitelistDomains: string[];\n omittedDomains: string[];\n };\n };\n}\ndeclare global {\n interface Window {\n drupalSettings?: DrupalSettings;\n }\n}\n\nconst mutationObserver = new MutationObserver(mutations => {\n for (const { addedNodes } of mutations) {\n for (const node of addedNodes) {\n if (node.nodeType === Node.ELEMENT_NODE) {\n const elementNode = node as Element;\n discoverElements(elementNode);\n if (elementNode.shadowRoot !== null) {\n discoverElements(elementNode.shadowRoot);\n }\n }\n }\n }\n});\n\nfunction observeElementInViewport(\n element: Element,\n callback: (isInView: boolean) => void\n): void {\n const observer = new IntersectionObserver(\n entries => {\n entries.forEach(entry => {\n if (entry.isIntersecting) {\n callback(true);\n observer.unobserve(entry.target); // Unobserve the element after it is in view\n }\n });\n },\n // look ahead 500px above and below the viewport\n { root: null, rootMargin: '500px 0px 500px 0px', threshold: 0 }\n );\n\n observer.observe(element);\n}\n\n/**\n * Checks a node for undefined elements and attempts to register them.\n */\nexport async function discoverElements(root: Element | ShadowRoot) {\n const undefinedElements = [...root.querySelectorAll(':not(:defined)')];\n\n if (undefinedElements.length === 0) {\n return;\n }\n const filteredElements = undefinedElements.filter(\n element =>\n element.tagName.toLowerCase().startsWith('score-') ||\n element.tagName.toLowerCase().startsWith('outline-')\n );\n\n // Create a Map of unique tag names to their corresponding elements\n const uniqueElementsMap = new Map(\n filteredElements.map(element => [element.tagName.toLowerCase(), element])\n );\n\n // if eager - register all elements\n // if lazy (default) - register elements when they are in viewport\n const loaderType = window?.drupalSettings?.outlineLoader?.type ?? 'lazy';\n\n if (loaderType === 'lazy') {\n filteredElements.forEach(element => {\n observeElementInViewport(element, async isInView => {\n if (isInView) {\n await register(element);\n }\n });\n });\n } else {\n await Promise.allSettled(\n Array.from(uniqueElementsMap.values()).map(element => register(element))\n );\n }\n}\n\n/**\n * Registers an element by tag name.\n */\nfunction register(element: Element): Promise<void> {\n const tagName = element.tagName.toLowerCase();\n\n // If the element is already defined, there's nothing more to do\n if (customElements.get(tagName)) {\n return Promise.resolve();\n }\n\n // if tagName starts with 'outline-' set path variable with getBasePath to /components/base/outline-<name_of_component>\n // if tagName starts with 'score-' set path variable with getBasePath to /components/score/score-<name_of_component>\n let path = getBasePath(\n `components/${\n tagName.startsWith('outline-') ? 'base' : 'score'\n }/${tagName}/${tagName}.js`\n );\n switch (tagName) {\n case 'outline-column':\n path = getBasePath(`components/base/outline-grid/outline-column/outline-column.js`);\n break;\n case 'score-card-jumbo-50':\n path = getBasePath(`components/score/score-card-jumbo-cta-50/score-card-jumbo-50.js`);\n break;\n case 'score-card-jumbo-circle':\n path = getBasePath(`components/score/score-card-jumbo-cta-circle/score-card-jumbo-cta-circle.js`);\n break;\n case 'score-card-event-search':\n path = getBasePath(`components/score/score-event-search/score-card-event-search.js`);\n break;\n case 'score-hr':\n path = getBasePath(`components/score/score-horizontal-rule/score-horizontal-rule.js`);\n break;\n case 'score-byline':\n path = getBasePath(`components/score/score-content-header/score-byline.js`);\n break;\n case 'score-content-header-heading':\n path = getBasePath(`components/score/score-content-header/score-content-header-heading.js`);\n break;\n case 'score-profile-hero':\n path = getBasePath(`components/score/score-hero-profile/score-profile-hero.js`);\n break;\n case 'score-custom-code':\n return Promise.resolve();\n }\n\n // Register it\n return new Promise<void>((resolve, reject) => {\n import(path)\n .then(() => {\n // if element has shadowroot - discover and observe it to find undefined elements\n if (element.shadowRoot) {\n // Find additional undefined components that might have been cloned into the shadowRoot of the element\n discoverElements(element.shadowRoot);\n mutationObserver.observe(element.shadowRoot, {\n subtree: true,\n childList: true,\n });\n }\n resolve();\n })\n .catch(error => {\n console.error(\n `Error occurred during import of <${tagName}> from ${path}:`,\n error\n );\n reject(new Error(`Unable to autoload <${tagName}> from ${path}`));\n });\n });\n}\n\n// Initial discovery\ndiscoverElements(document.body);\n\n// Specific to gated content that uses\n// videos from Vimeo, the functionality\n// uses ajax to obtain and return the outline-video-vimeo\n// component to then display on the page. \n// When using lazy loading with gated content, there\n// are issues with the outline-loader not detecting\n// the component being added which leads to no\n// video rendering at all.\n// As a workaround, create a outline-video-vimeo element in\n// memory and register this component with the outline-loader.\n// This allows the js for the component to be available\n// before the ajax for gated content runs.\n// This does however make the js code for the component load\n// on all pages, but the component code is very minimal.\nconst outline_video_vimeo = document.createElement('outline-video-vimeo');\nregister(outline_video_vimeo);"],"names":["basePath","setBasePath","path","getBasePath","subpath","scripts","document","getElementsByTagName","configScript","find","script","hasAttribute","getAttribute","fallbackScript","s","test","src","split","slice","join","replace","mutationObserver","MutationObserver","mutations","addedNodes","node","nodeType","Node","ELEMENT_NODE","elementNode","discoverElements","shadowRoot","async","root","undefinedElements","querySelectorAll","length","filteredElements","filter","element","tagName","toLowerCase","startsWith","uniqueElementsMap","Map","map","_c","_a","window","drupalSettings","outlineLoader","type","forEach","callback","observer","IntersectionObserver","entries","entry","isIntersecting","unobserve","target","rootMargin","threshold","observe","observeElementInViewport","isInView","register","Promise","allSettled","Array","from","values","customElements","get","resolve","reject","import","then","subtree","childList","catch","error","console","Error","body","createElement"],"mappings":"AAGA,IAAIA,EAAW,GAGT,SAAUC,EAAYC,GAC1BF,EAAWE,CACb,CAkBgB,SAAAC,EAAYC,EAAU,IACpC,IAAKJ,EAAU,CACb,MAAMK,EAAU,IACXC,SAASC,qBAAqB,WAE7BC,EAAeH,EAAQI,MAAKC,GAChCA,EAAOC,aAAa,kBAGtB,GAAIH,EAEFP,EAAYO,EAAaI,aAAa,qBACjC,CACL,MAAMC,EAAiBR,EAAQI,MAAKK,GAEhC,4BAA4BC,KAAKD,EAAEE,MACnC,mCAAmCD,KAAKD,EAAEE,OAG9C,IAAId,EAAO,GAEPW,IACFX,EAAOW,EAAeD,aAAa,QAGrCX,EAAYC,EAAKe,MAAM,KAAKC,MAAM,GAAI,GAAGC,KAAK,KAC/C,CACF,CAGD,OACEnB,EAASoB,QAAQ,MAAO,KACvBhB,EAAU,IAAIA,EAAQgB,QAAQ,MAAO,MAAQ,GAElD,CCzCA,MAAMC,EAAmB,IAAIC,kBAAiBC,I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A,GACN,IAAK,iBACHtC,EAAOC,EAAY,iEACnB,MACF,IAAK,sBACHD,EAAOC,EAAY,mEACnB,MACF,IAAK,0BACHD,EAAOC,EAAY,+EACnB,MACF,IAAK,0BACHD,EAAOC,EAAY,kEACnB,MACF,IAAK,WACHD,EAAOC,EAAY,mEACnB,MACF,IAAK,eACHD,EAAOC,EAAY,yDACnB,MACF,IAAK,+BACHD,EAAOC,EAAY,yEACnB,MACF,IAAK,qBACHD,EAAOC,EAAY,6DACnB,MACF,IAAK,oBACH,OAAOgE,QAAQO,UAInB,OAAO,IAAIP,SAAc,CAACO,EAASC,KACjCC,OAAO1E,GACJ2E,MAAK,KAEAtC,EAAQR,aAEVD,EAAiBS,EAAQR,YACzBV,EAAiB0C,QAAQxB,EAAQR,WAAY,CAC3C+C,SAAS,EACTC,WAAW,KAGfL,GAAS,IAEVM,OAAMC,IACLC,QAAQD,MACN,oCAAoCzC,WAAiBtC,KACrD+E,GAEFN,EAAO,IAAIQ,MAAM,uBAAuB3C,WAAiBtC,KAAQ,GACjE,GAER,CAGA4B,EAAiBxB,SAAS8E,MAiB1BlB,EAD4B5D,SAAS+E,cAAc"}</void></name_of_component></name_of_component></void><style> .hidden { display: none; } </style> <a href="http://www.eduftp.net" class="hidden">太阳城集团</a> <a href="http://hjnpqp.59shoushen.com" class="hidden">IT168数字家电频道</a> <a href="http://agdyof.xin415181b.com" class="hidden">卓繁信息</a> <a href="http://www.lcxlxxjc.com" class="hidden">hg-crown-contactus@lcxlxxjc.com</a> <a href="http://www.letaoyizs.com" class="hidden">皇冠体育</a> <a href="http://www.educoncepts-sdr.com" class="hidden">Sun-City-contactus@educoncepts-sdr.com</a> <a href="http://nihonnkazamidori.com" class="hidden">新余赶集网</a> <a href="http://teljnp.joker47.net" class="hidden">星际传奇</a> <a href="http://www.yutb.net" class="hidden">澳门新葡京</a> <a href="http://qsffav.p9pip.net" class="hidden">服装工业网</a> <a href="http://ermqgj.oz73.com" class="hidden">保山学院</a> <a href="http://zzaujd.mldad.com" class="hidden">中国天文科普网</a> <a href="http://www.educoncepts-sdr.com" class="hidden">太阳城</a> <a href="http://yifadi.es-one.com" class="hidden">南丰蜜桔网</a> <a href="http://www.hairstylescn.com" class="hidden">bbin-careers@hairstylescn.com</a> <a href="http://ngtads.huakangbook.com" class="hidden">铁甲工程机械网整机产品中心</a> <a href="http://www.vipsjerseyonline.net" class="hidden">新濠天地在线</a> <a href="http://zrvaar.19820920.com" class="hidden">河北科技师范学院</a> <a href="http://web-sitemap.4hpparts.com" class="hidden">宝鸡天气预报</a> <a href="http://rdkgkv.datsumoki.net" class="hidden">华强北电脑网</a> <a href="https://stock.adobe.com/search?k=科普一下fun88娱乐城的百科✔️网址:ad11.net✔️.gqc" class="hidden">明波通信</a> <a href="https://www.deep6gear.com/catalogsearch/result/?q=>>✔️最新网址:la55.net✔️手输<<pg电子app下载.ali" class="hidden">MAG磁力下载站</a> <a href="https://www.deep6gear.com/catalogsearch/result/?q=最正规网络博彩网络博彩网站>>✔️网址:la666.net✔️手输<<.ckq" class="hidden">重庆医药高等专科学校</a> <a href="https://stock.adobe.com/search?k=bg视讯线上平台✔️官方网址:la777.net✔️bg视讯线上平台✔️官方网址:la777.net✔️.atd" class="hidden">中国外贸通</a> <a href="https://acrmc.com/search/老虎机十大信誉平台✔️网址:la66.net✔️老虎机十大信誉平台✔️网址:la66.net✔️" class="hidden">保定地图</a> <a href="https://stock.adobe.com/search?k=✔️最新网址:la55.net✔️沙巴足球体育平台-维基百科" class="hidden">迅雷会员</a> <a href="https://es-la.facebook.com/public/>>✔️网址:ad11.net✔️手输<<最新真钱网赌娱乐>>✔️网址:ad11.net✔️手输<<最新真钱网赌娱乐.lcr" class="hidden">QQ网名</a> <a href="https://es-la.facebook.com/public/科普一下亚游平台app下载的百科✔️网址:la66.net✔️.xrd" class="hidden">易语言汉语编程官方论坛</a> <a href="https://stock.adobe.com/search?k=✔️最新网址:la55.net✔️(关于最正规网上赌博的简介)最正规网上赌博" class="hidden">全友家居旗舰店</a> <a href="https://es-la.facebook.com/public/>>✔️最新网址:la55.net✔️手输<<最可靠的买彩票平台" class="hidden">|电玩之家索尼PS2模拟中文游戏</a> <a href="/CN/eqkqng-752250.html" class="hidden">中企报盟信息科学研究院</a> <a href="/sitemap.xml" class="hidden">站点地图</a> <a href="/CN/zbfwgq-757978.html" class="hidden">河南易登网</a> <a href="/cn/vhlyln-766331.html" class="hidden">莱阳信息港</a> </body></html>