1/* eslint-disable */ 2import{FranklinBlock,decorateBlock,decorateButtons,decorateIcons,loadBlock,decorateSections}from"../../scripts/lib-franklin.js";export default class DemoLoader extends FranklinBlock{staticSchema;async storeOriginalMarkup(){if(!("srcdoc"===window.location.pathname))return;const e=document.createElement("div");e.innerHTML=this.staticSchema;const t=encodeURIComponent(e.innerHTML.toString());document.querySelector("body").setAttribute("data-sidekick-schema-html",t)}async fetchDemoPathReference(e){if(window.prefetchedPages&&window.prefetchedPages[e])return window.prefetchedPages[e];const t=e,o=await fetch(`${t}.plain.html`);if(!o.ok)return;const r=await o.text();if(!(r.length<10))return this.staticSchema=r,r;console.error("missin demoLoader HTML on: ",e,o)}async beforeBlockRender(){const e=this.findSectionContent("page-reference")?.textContent.trim();if(e&&!e.startsWith("/"))return void console.error('Page reference must start with a forward slash "/"');const t=await this.fetchDemoPathReference(e);this.storeOriginalMarkup();const o=document.createElement("div");o.innerHTML=t,await new Promise(e=>{setTimeout(e,250)}),decorateButtons(o),decorateIcons(o),this.inputData.markup=o.innerHTML}emulateSectionHydration(){decorateSections(this.block.querySelector(".core-demo-loader-inside"));this.block.querySelectorAll(".core-demo-loader-inside > div").forEach(e=>{e.setAttribute("data-section-status","activated"),e.setAttribute("data-main-section-layout-container","true")})}afterBlockRender(){this.emulateSectionHydration();this.block.querySelectorAll('.core-demo-loader-inside div[class^="core-"]').forEach(e=>!Array.from(e.classList).some(e=>e.startsWith("core-tab")||e.includes("wrapper"))&&(decorateBlock(e),loadBlock(e)))}}export const schema='{\n "demo-loader": {\n "name": "demo-loader",\n "description": "n/a",\n "coreBlockData": {\n "notApplicable": true\n },\n "schema": {}\n }\n}\n';export const template=' <div class="core-demo-loader-misc">\n <div class="core-demo-loader-inside block-inside">\n {{ markup }}\n </div>\n</div>\n';export const smartCaptureConfig=" {}";
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.