smartdown
Version:
A library for translating, rendering and interacting with Smartdown documents. Smartdown is an extension of Markdown that provides richer media support and reactive programming capability.
2 lines • 2.76 kB
JavaScript
/*! For license information please see webcomponents-loader.js.LICENSE.txt */
!function(){"use strict";var e,t=!1,n=[],o=!1;function r(){window.WebComponents.ready=!0,document.dispatchEvent(new CustomEvent("WebComponentsReady",{bubbles:!0}))}function d(){window.customElements&&customElements.polyfillWrapFlushCallback&&customElements.polyfillWrapFlushCallback((function(t){e=t,o&&e()}))}function i(){window.HTMLTemplateElement&&HTMLTemplateElement.bootstrap&&HTMLTemplateElement.bootstrap(window.document),t=!0,c().then(r)}function c(){o=!1;var t=n.map((function(e){return e instanceof Function?e():e}));return n=[],Promise.all(t).then((function(){o=!0,e&&e()})).catch((function(e){console.error(e)}))}window.WebComponents=window.WebComponents||{},window.WebComponents.ready=window.WebComponents.ready||!1,window.WebComponents.waitFor=window.WebComponents.waitFor||function(e){e&&(n.push(e),t&&c())},window.WebComponents._batchCustomElements=d;var a="webcomponents-loader.js",s=[];(!("attachShadow"in Element.prototype)||!("getRootNode"in Element.prototype)||window.ShadyDOM&&window.ShadyDOM.force)&&s.push("sd"),window.customElements&&!window.customElements.forcePolyfill||s.push("ce");var l,w,m=function(){var e=document.createElement("template");if(!("content"in e))return!0;if(!(e.content.cloneNode()instanceof DocumentFragment))return!0;var t=document.createElement("template");t.content.appendChild(document.createElement("div")),e.content.appendChild(t);var n=e.cloneNode(!0);return 0===n.content.childNodes.length||0===n.content.firstChild.content.childNodes.length}();if(window.Promise&&Array.from&&window.URL&&window.Symbol&&!m||(s=["sd-ce-pf"]),s.length){var u,p=(w={createHTML:l=function(e){return e},createScript:l,createScriptURL:l},window.trustedTypes&&window.trustedTypes.createPolicy("webcomponents-loader",w)||w),f="bundles/webcomponents-"+s.join("-")+".js";if(window.WebComponents.root)u=window.WebComponents.root+f,window.trustedTypes&&window.trustedTypes.isScriptURL(window.WebComponents.root)&&(u=p.createScriptURL(u));else{var b=document.querySelector('script[src*="'+a+'"]');u=p.createScriptURL(b.src.replace(a,f))}var h=document.createElement("script");h.src=u,"loading"===document.readyState?(h.setAttribute("onload",p.createScript("window.WebComponents._batchCustomElements()")),document.write(p.createHTML(h.outerHTML)),document.addEventListener("DOMContentLoaded",i)):(h.addEventListener("load",(function(){d(),i()})),h.addEventListener("error",(function(){throw new Error("Could not load polyfill bundle"+u)})),document.head.appendChild(h))}else"complete"===document.readyState?(t=!0,r()):(window.addEventListener("load",i),window.addEventListener("DOMContentLoaded",(function(){window.removeEventListener("load",i),i()})))}();