customElements.define("{s}-{s}", class extends HTMLElement {{ constructor() {{ super(); this.attachShadow({{ mode: 'open' }}); const template = document.getElementById("@{s}"); const node = document.importNode(template.content, true); this.shadowRoot.appendChild(node); this[ZsPtr] = null; }} connectedCallback() {{ if (this[ZsPtr] === null) {{ wasm_ready.then(async () => {{ const id = ObjectStore.generateFreeId(); ObjectStore.registerObject(id, this); this[ZsPtr] = await WebAssembly.promising(wasm.exports['export::{s}::init'])(id); }}); }} }} }});