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M,EAAc,SAAS,cAAc,KAAK,MAAM,SAEtD,OADA,KAAK,KAAO,EACL,CACX,CACA,QAAA,GACI,MAAO,UAAO,KAAK,MAAM,eAC7B,CACA,YAAA,CAAa,GACT,KAAK,KAAK,YAAc,EAAQ,MAAM,QACtC,EAAQ,KAAO,KAAK,IACxB,CACA,aAAA,GACI,KAAK,KAAK,WAAW,YAAY,KAAK,KAC1C,SAoBG,SAAS,aAAY,QAAE,EAAU,KACpC,OAAO,IAAI,aAAa,EAC5B,QAkCO,SAAS,MAAK,KAAE,EAAI,cAAE,EAAa,SAAE,IACxC,IAAI,EAAU,GAEd,IAAK,MAAM,KAAS,kBAAkB,GAE9B,GAAS,EAAM,OAAS,GACxB,EAAQ,KAAK,GAKrB,OAAO,SAAS,CAAE,SAAU,EAAQ,OAAS,EAAU,GAC3D,QAeO,SAAS,YACZ,MAAM,EAAS,SAAU,GACrB,EAAO,QAAU,CACrB,EAEA,OADA,EAAO,QAAU,KACV,CACX","file":"/npm/a-jsx-runtime@1.2.0/lib/jsx-runtime.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/a-jsx-runtime@1.2.0/lib/jsx-runtime.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","/**\r\n * provides functions needed by babel for a custom pragma\r\n * to render parsed jsx code to html,\r\n * diff and patch in subsequent renders\r\n */\r\n// a map between v-trees and rendered DOM nodes / containers\r\nconst renderedVTrees = new WeakMap();\r\n// list of `ref` callbacks to be called after the DOM nodes are rendered\r\nconst refsToCall = [];\r\n/**\r\n * return the closest ancestor of the given VNode which has an DOM Element (i.e. is not a Fragment)\r\n * @param vNode {VNodeInterface}\r\n */\r\nfunction getParentElementNode(vNode) {\r\n    while (vNode.parent) {\r\n        vNode = vNode.parent;\r\n        if (vNode.node)\r\n            break;\r\n    }\r\n    // `.node` is only on \"Text\" and \"Element\" type VNode, and only Element has children\r\n    return vNode;\r\n}\r\n/**\r\n * for the given v-node all children are traversed till children with DOM nodes are found\r\n *\r\n * @param {VNodeInterface} vNode - parent node\r\n * @param {VNodeInterface} [alwaysAllow] - always contain the provided node in the returned list, even if it is not an element with DOM Node\r\n * @returns {VNodeInterface[]}\r\n */\r\nfunction getChildrenWithNodes(vNode, alwaysAllow) {\r\n    return vNode.children\r\n        .map(childNode => {\r\n        if (childNode === alwaysAllow)\r\n            return childNode;\r\n        if (childNode.node)\r\n            return childNode;\r\n        return getChildrenWithNodes(childNode, alwaysAllow);\r\n    })\r\n        .flat(Infinity);\r\n}\r\n/**\r\n * returns a tuple of the closest ancestor which has a DOM Node,\r\n * and the node which has a DOM node and is rendered as the next sibling for the provided node in the DOM.\r\n * Or null when it is the last child itself\r\n *\r\n * @param {VNodeInterface} vNode\r\n * @returns {([Node, Node | null])}\r\n */\r\nfunction getParentAndNextSibling(vNode) {\r\n    // node ancestor with Element,\r\n    const parentWithElement = getParentElementNode(vNode);\r\n    const siblings = getChildrenWithNodes(parentWithElement, vNode);\r\n    const indexOfNodeInSiblingsList = siblings.indexOf(vNode);\r\n    // no prev sibling, put before any other element (or null if parent has no children yet)\r\n    if (indexOfNodeInSiblingsList === 0) {\r\n        return [parentWithElement.node, parentWithElement.node.firstChild];\r\n    }\r\n    const prevSibling = siblings[indexOfNodeInSiblingsList - 1];\r\n    const nextSiblingNode = prevSibling ? prevSibling.node.nextSibling : null;\r\n    return [parentWithElement.node, nextSiblingNode];\r\n}\r\n/**\r\n * returns true if not nullish or false\r\n * that means 0 or empty string are allowed\r\n * @param {*} val\r\n */\r\nfunction truthy(value) {\r\n    return value !== false && value !== null && value !== undefined;\r\n}\r\n/**\r\n * escapes the provided string against xss attacks etc\r\n *\r\n * @param {string} text\r\n * @returns {string}\r\n */\r\nfunction sanitize(text) {\r\n    const div = document.createElement(\"div\");\r\n    div.textContent = text;\r\n    return div.innerHTML;\r\n}\r\n/**\r\n * makes sure children is alway an array\r\n * @param children {JSXChild} - i.e. props.children from a jsx call\r\n * @returns {JSXChild[]}\r\n */\r\nfunction normalizeChildren(children) {\r\n    if (typeof children === \"undefined\")\r\n        return [];\r\n    if (Array.isArray(children))\r\n        return children;\r\n    return [children];\r\n}\r\n/**\r\n * basically `Element.outerHTML` but also supports Text node and DocumentFragment\r\n * @param element {Node} - element which its html needs to be returned\r\n */\r\nfunction getOuterHtml(element) {\r\n    if (element instanceof Element)\r\n        return element.outerHTML;\r\n    if (element instanceof Text)\r\n        return sanitize(element.wholeText);\r\n    if (element instanceof DocumentFragment) {\r\n        return Array.from(element.childNodes)\r\n            .map(el => getOuterHtml(el))\r\n            .join(\"\");\r\n    }\r\n    // shouldn't reach this point\r\n    console.warn(\"getOuterHtml does not support this type of element\", element);\r\n    return \"\";\r\n}\r\n/**\r\n * generates the html as a string which can be used for example with `element.innerHTML()`\r\n *\r\n * @param tag {string|Function} - tag argument of the jsx call\r\n * @param props {Object} - props argument of jsx call\r\n */\r\nfunction asHtmlString(tag, props, children) {\r\n    const attributes = Object.entries(props)\r\n        .filter(([, value]) => truthy(value))\r\n        .map(([key, value]) => {\r\n        // e.g. disabled: true => <tag disabled>\r\n        if (value === true)\r\n            return key;\r\n        // for style as object:\r\n        // (style:) {display: \"none\", position: \"absolute\"} ==> 'display: none; position: absolute;'\r\n        if (key === \"style\" && typeof value === \"object\") {\r\n            value = Object.entries(value)\r\n                // ignore stuff like `{background: active && \"red\"}` when `active === false / null / undefined`\r\n                .filter(([, v]) => truthy(v))\r\n                // currently supports \"background-color\" not \"backgroundColor\"\r\n                .map(([k, v]) => `${k}: ${v}`)\r\n                .join(\"; \");\r\n        }\r\n        // (class:) [\"btn\", \"red\"] ==> \"btn red\"\r\n        if (key === \"class\" && Array.isArray(value))\r\n            value = value.join(\" \");\r\n        return `${key}=\"${value}\"`;\r\n    })\r\n        .join(\" \");\r\n    const content = children.map(child => child.toString()).join(\"\");\r\n    return `<${tag} ${attributes}>${content}</${tag}>`;\r\n}\r\n/**\r\n * generates HTML Node elements from the provided jsx item\r\n * @param tag {string|Function} - tag argument of the jsx call\r\n * @param props {Object} - props argument of jsx call\r\n */\r\nfunction asNode(tag, props, children, svgContext = false) {\r\n    // fragment\r\n    if (!tag) {\r\n        const fragments = children.map(item => item.asNode());\r\n        const documentFragment = document.createDocumentFragment();\r\n        documentFragment.append(...fragments);\r\n        return documentFragment;\r\n    }\r\n    // remember if the svg context was set for this node, and replace after generating all children\r\n    // currently not supporting the `is` option for Customized built-in elements\r\n    const node = svgContext ? document.createElementNS(\"http://www.w3.org/2000/svg\", tag) : document.createElement(tag);\r\n    // add attributes, event listeners etc.\r\n    ElementVNode.addProps(node, props);\r\n    node.append(...children\r\n        // .flat()\r\n        .map(child => child.asNode()));\r\n    return node;\r\n}\r\nfunction initializeJSXChildren(children) {\r\n    const childrenVNodes = children.map(child => {\r\n        if (Array.isArray(child))\r\n            return new FragmentVNode(child);\r\n        if (child instanceof VNode)\r\n            return child;\r\n        if (child instanceof Node)\r\n            return new LiveNodeVNode(child);\r\n        if (!truthy(child))\r\n            return new NullVNode();\r\n        return new TextVNode(child);\r\n    });\r\n    return childrenVNodes;\r\n}\r\n/**\r\n * renders the HTML for the given V-Node and adds to the DOM at the correct position\r\n * @param newNode - vNode to be rendered as HTML Node and added to DOM\r\n */\r\nfunction insertNewItem(newNode) {\r\n    const [parent, nextSibling] = getParentAndNextSibling(newNode);\r\n    parent.insertBefore(newNode.asNode(), nextSibling);\r\n}\r\n/**\r\n * iterate over all the children of the provided nodes, and each pairwise\r\n *\r\n * @param {VNodeInterface} oldNode - v-node from the old render\r\n * @param {VNodeInterface} newNode- v-node from the new tree which its children have to replace the children of the old node\r\n */\r\nfunction diffAndPatchChildren(oldNode, newNode) {\r\n    const oldChildren = oldNode.children.map((vnode, index) => ({\r\n        vnode,\r\n        index,\r\n        key: vnode.key,\r\n        used: false,\r\n    }));\r\n    const newChildren = newNode.children.map((vnode, index) => ({\r\n        vnode,\r\n        index,\r\n        key: vnode.key,\r\n    }));\r\n    newChildren.forEach((newChild) => {\r\n        const key = newChild.key;\r\n        let oldChild;\r\n        if (key !== undefined)\r\n            oldChild = oldChildren.find(child => child.key === key);\r\n        if (!oldChild) {\r\n            // first from the list which has not a key\r\n            // (even if in the new list there is not an item with the same key, don't recycle that item)\r\n            oldChild = oldChildren.find(child => child.key === undefined && child.used === false);\r\n        }\r\n        // no vnode from the old list was found which can be used for diff & patching\r\n        if (!oldChild) {\r\n            insertNewItem(newChild.vnode);\r\n        }\r\n        // diff & patch\r\n        else {\r\n            oldChild.used = true;\r\n            // child is modified -> diff & patch\r\n            if (newChild.vnode.type === oldChild.vnode.type)\r\n                oldChild.vnode.diffAndPatch(newChild.vnode);\r\n            // child is replaced -> won't be able to patch vnode from different types\r\n            else {\r\n                oldChild.vnode.removeFromDOM();\r\n                insertNewItem(newChild.vnode);\r\n            }\r\n        }\r\n    });\r\n    // remove obsolete dom elements\r\n    oldChildren.forEach(oldChild => {\r\n        if (!oldChild.used)\r\n            oldChild.vnode.removeFromDOM();\r\n    });\r\n}\r\n// base class which will be inherited from jsx and fragments function node generation\r\n// and will be used to distinguish them with other Elements\r\nclass VNode {\r\n}\r\n// V-Node which will be rendered as HTMLElement or SVGElement\r\nclass ElementVNode extends VNode {\r\n    constructor({ tag, props, children }) {\r\n        super();\r\n        this.type = \"Element\";\r\n        this.node = null;\r\n        this.parent = null;\r\n        this.svgContext = false; // will be set to true when element is an SVG Element\r\n        this.tag = tag;\r\n        this.props = props;\r\n        this.children = initializeJSXChildren(children);\r\n        // set parent property on all children\r\n        this.children.forEach(child => (child.parent = this));\r\n    }\r\n    toString() {\r\n        return asHtmlString(this.tag, this.props, this.children);\r\n    }\r\n    asNode() {\r\n        // traverse the VTree to check if this element is rendered inside an svg element\r\n        let svgContext = false;\r\n        let vNode = this;\r\n        while (vNode.parent) {\r\n            // @ts-ignore - ElementVNode has the tag property, other are undefined\r\n            if (vNode.tag === \"svg\") {\r\n                svgContext = true;\r\n                break;\r\n            }\r\n            vNode = vNode.parent;\r\n        }\r\n        // store the svg context information to the property to allow using it when the v-node is cloned\r\n        this.svgContext = svgContext;\r\n        const node = asNode(this.tag, this.props, this.children, this.svgContext);\r\n        this.node = node;\r\n        // memorize for next subtree re-renders\r\n        renderedVTrees.set(node, this);\r\n        return node;\r\n    }\r\n    removeFromDOM() {\r\n        if (this.node.parentNode) {\r\n            this.node.parentNode.removeChild(this.node);\r\n        }\r\n        else {\r\n            console.warn(\"jsx-runtime: can't remove\", this);\r\n        }\r\n    }\r\n    diffAndPatch(newNode) {\r\n        if (newNode.tag === this.tag) {\r\n            newNode.node = this.node;\r\n            // update props and attributes\r\n            ElementVNode.addProps(newNode.node, newNode.props, this.props);\r\n            // children => iter and patch\r\n            // old children being modified\r\n            diffAndPatchChildren(this, newNode);\r\n        }\r\n        // tag has changed\r\n        else {\r\n            this.node.replaceWith(newNode.asNode());\r\n        }\r\n        // memorize for next subtree re-renders\r\n        renderedVTrees.set(this.node, newNode);\r\n    }\r\n    static fromExistingElementNode(vNode, children) {\r\n        const { tag, props, parent, node, svgContext } = vNode;\r\n        const newVNode = new ElementVNode({ tag, props, children });\r\n        Object.assign(newVNode, { parent, node, svgContext });\r\n        return newVNode;\r\n    }\r\n    static addProps(element, newProps, oldProps) {\r\n        const isDiff = typeof oldProps !== \"undefined\";\r\n        if (!isDiff)\r\n            oldProps = {};\r\n        // iterate over all modified new and old properties and set/remove/update them\r\n        Array.from(new Set([...Object.keys(newProps), ...Object.keys(oldProps)]))\r\n            .map(propName => ({\r\n            propName,\r\n            oldValue: oldProps[propName],\r\n            newValue: newProps[propName],\r\n        }))\r\n            .filter(({ newValue, oldValue }) => newValue !== oldValue)\r\n            .forEach(({ propName, newValue, oldValue }) => {\r\n            // for style as object:\r\n            // (style:) {display: \"none\", position: \"absolute\"} ==> 'display: none; position: absolute;'\r\n            if (propName === \"style\" && typeof newValue === \"object\") {\r\n                newValue = Object.entries(newValue)\r\n                    .filter(([, v]) => truthy(v))\r\n                    .map(([k, v]) => `${k}: ${v}`)\r\n                    .join(\"; \");\r\n            }\r\n            // (class:) [\"btn\", \"red\"] ==> \"btn red\"\r\n            if (propName === \"class\" && Array.isArray(newValue)) {\r\n                newValue = newValue.join(\" \");\r\n            }\r\n            // props starting with \"on-\" are event listeners\r\n            if (propName.startsWith(\"on-\") &&\r\n                (typeof newValue === \"function\" ||\r\n                    typeof newValue === \"object\" ||\r\n                    typeof oldValue === \"function\" ||\r\n                    typeof oldValue === \"object\")) {\r\n                // remove leading \"on-\"\"\r\n                const event = propName.replace(/^on-/, \"\");\r\n                // key has the form of \"on-change\". value is the callback function or an object implementing {EventListener} interface\r\n                if (typeof newValue === \"function\" || typeof newValue === \"object\") {\r\n                    element.addEventListener(event, newValue);\r\n                }\r\n                if (typeof oldValue === \"function\" || typeof oldValue === \"object\") {\r\n                    element.removeEventListener(event, oldValue);\r\n                }\r\n            }\r\n            else if (propName === \"_ref\" && typeof newValue === \"function\") {\r\n                refsToCall.push(() => newValue(element));\r\n            } // old ref isn't unset\r\n            // the `checked` and `value` attribute on input elements will update the `defaultChecked` and `defaultValue` property.\r\n            // also possible to test if class has the property and always set it via prop instead of attribute\r\n            // but there are some ready only properties. and unclear if our custom elements always have a setter when there is a getter for some props\r\n            else if (isDiff && (propName === \"checked\" || propName === \"value\")) {\r\n                // @ts-ignore - e.g. input elements need checked set as property not only attribute when it is changes\r\n                element[propName] = newValue;\r\n            }\r\n            // boolean attribute set without value\r\n            else if (newValue === true)\r\n                element.setAttribute(propName, \"\");\r\n            // remove old attributes which are false now\r\n            else if (!truthy(newValue))\r\n                element.removeAttribute(propName);\r\n            // update to new value as string\r\n            else if (typeof newValue === \"string\" || typeof newValue === \"number\") {\r\n                element.setAttribute(propName, String(newValue));\r\n            }\r\n            // @ts-ignore - providing the value as property to html element\r\n            else\r\n                element[propName] = newValue;\r\n        });\r\n    }\r\n}\r\n// V-Node for the Fragment element in jsx (`<></>`) or when an array is placed directly in jsx children (e.g. `<elem>{[list]}</elem>`)\r\nclass FragmentVNode extends VNode {\r\n    constructor(children) {\r\n        super();\r\n        this.type = \"Fragment\";\r\n        this.parent = null;\r\n        this.children = initializeJSXChildren(children);\r\n        // set parent property on all children\r\n        this.children.forEach(child => (child.parent = this));\r\n    }\r\n    asNode() {\r\n        const node = asNode(undefined, {}, this.children);\r\n        return node;\r\n    }\r\n    toString() {\r\n        return this.children.map(child => child.toString()).join(\"\");\r\n    }\r\n    diffAndPatch(newVNode) {\r\n        return diffAndPatchChildren(this, newVNode);\r\n    }\r\n    removeFromDOM() {\r\n        this.children.forEach(child => child.removeFromDOM());\r\n    }\r\n}\r\n// V-Node for items which be rendered as text (string, number,.. )\r\nclass TextVNode extends VNode {\r\n    /**\r\n     *\r\n     */\r\n    constructor(content) {\r\n        super();\r\n        this.type = \"TextNode\";\r\n        this.children = [];\r\n        this.node = null;\r\n        this.parent = null;\r\n        this.props = { content };\r\n    }\r\n    asNode() {\r\n        const textNode = document.createTextNode(this.props.content);\r\n        this.node = textNode;\r\n        return textNode;\r\n    }\r\n    toString() {\r\n        return sanitize(this.props.content);\r\n    }\r\n    diffAndPatch(newNode) {\r\n        this.node.nodeValue = newNode.props.content;\r\n        newNode.node = this.node;\r\n    }\r\n    removeFromDOM() {\r\n        this.node.parentNode.removeChild(this.node);\r\n    }\r\n}\r\n// V-Node for `null`, `false` or `undefined` in jsx elements\r\nclass NullVNode extends VNode {\r\n    constructor() {\r\n        super();\r\n        this.type = \"Null\";\r\n        this.children = [];\r\n        this.parent = null;\r\n    }\r\n    asNode() {\r\n        // return null; // return empty fragment?\r\n        return document.createDocumentFragment();\r\n    }\r\n    diffAndPatch(newNode2) {\r\n        return;\r\n    }\r\n    removeFromDOM() {\r\n        return;\r\n    }\r\n    toString() {\r\n        return \"\";\r\n    }\r\n}\r\n// V-Node when a live HTMLElement was refernced in jsx (e.g. `<div>{document.getElementById(\"comp\")}</div>`)\r\nclass LiveNodeVNode extends VNode {\r\n    /**\r\n     *\r\n     */\r\n    constructor(node) {\r\n        super();\r\n        this.type = \"Node\";\r\n        this.children = [];\r\n        this.parent = null;\r\n        this.node = node;\r\n    }\r\n    asNode() {\r\n        return this.node;\r\n    }\r\n    diffAndPatch(newNode) {\r\n        if (newNode.node !== this.node) {\r\n            this.node.replaceWith(newNode.node);\r\n        }\r\n    }\r\n    removeFromDOM() {\r\n        this.node.parentElement.removeChild(this.node);\r\n    }\r\n    toString() {\r\n        return getOuterHtml(this.node);\r\n    }\r\n}\r\n// wrapper V-Node which references the HTML Node which itself is not rendered by jsx, but its content.\r\nclass RootVNode extends VNode {\r\n    /**\r\n     *\r\n     */\r\n    constructor(content, domNode) {\r\n        super();\r\n        this.type = \"Root\";\r\n        this.parent = null;\r\n        content.parent = this;\r\n        this.children = [content];\r\n        this.node = domNode;\r\n    }\r\n    asNode() {\r\n        return this.children[0].asNode();\r\n    }\r\n    toString() {\r\n        return this.children[0].toString();\r\n    }\r\n    diffAndPatch(newVNode) {\r\n        diffAndPatchChildren(this, newVNode);\r\n    }\r\n    removeFromDOM() {\r\n        this.node.remove();\r\n    }\r\n}\r\n// generate the V-Nodes and V-Tree based on the objects parsed by the jsx babel plugin\r\nfunction asVNode(tag, { _key: key, _slot: slot, ...props }) {\r\n    if (typeof tag === \"function\") {\r\n        let ref = undefined;\r\n        if (props._ref) {\r\n            ref = props._ref;\r\n            delete props._ref;\r\n        }\r\n        const result = tag(props);\r\n        let resultVNode;\r\n        if (result instanceof VNode) {\r\n            if (typeof ref === \"function\") {\r\n                refsToCall.push(() => {\r\n                    // @ts-ignore node property might exist or not. this is checked here\r\n                    const vNode = result.node ? result : getChildrenWithNodes(result)[0];\r\n                    // @ts-ignore vNode with node is returned\r\n                    if (vNode)\r\n                        ref(vNode.node);\r\n                });\r\n            }\r\n            if (typeof key !== \"undefined\")\r\n                result.key = key;\r\n            resultVNode = result;\r\n        }\r\n        else if (result instanceof Node)\r\n            resultVNode = new LiveNodeVNode(result);\r\n        // null jsx node\r\n        else if (!truthy(result))\r\n            resultVNode = new NullVNode();\r\n        else\r\n            resultVNode = new TextVNode(result);\r\n        if (typeof slot !== \"undefined\")\r\n            resultVNode.slot = slot;\r\n        return resultVNode;\r\n    }\r\n    const { children: propsChildren, ...attr } = props;\r\n    // make sure children is always an array\r\n    const children = normalizeChildren(propsChildren);\r\n    const vNode = tag ? new ElementVNode({ tag, children, props: attr }) : new FragmentVNode(children);\r\n    if (typeof slot !== \"undefined\")\r\n        vNode.slot = slot;\r\n    if (typeof key !== \"undefined\")\r\n        vNode.key = key;\r\n    return vNode;\r\n}\r\n// jsx is called when the element has one or zero children\r\nexport function jsx(tag, props) {\r\n    return asVNode(tag, props);\r\n}\r\n/**\r\n * converts pragma object to html string\r\n * jsxs is always called when element has more than one child\r\n *\r\n * @param {string | Function} tag - tag name or tag class\r\n * @param {Object | null} props - props for the tag\r\n */\r\nexport function jsxs(tag, props) {\r\n    return asVNode(tag, props);\r\n}\r\n// ne specific dev support yet\r\nexport const jsxDEV = jsx;\r\n/**\r\n * converts the fragments object to nodes\r\n *\r\n * @param {Object} props\r\n * @param {Array} props.children - child elements in the fragment\r\n */\r\nexport function Fragment(props) {\r\n    return asVNode(undefined, props);\r\n}\r\n/**\r\n * render the given markup into the given HTML node\r\n *\r\n * @param {JSXChild} markup - html as string, html element or jsx template\r\n * @param {HTMLElement} domNode - container for the template to be rendered into\r\n * @param {boolean} [append=false] - should the provided markup be appended to the existing markup, or default replace it\r\n */\r\nexport function render(markup, domNode, append = false) {\r\n    // the content of the given DOM Node was already rendered by jsx-runtime, and it only needs to be updated\r\n    const isReRender = renderedVTrees.has(domNode);\r\n    if (typeof markup === \"string\" || typeof markup === \"number\" || markup === true) {\r\n        markup = new TextVNode(markup);\r\n    }\r\n    else if (markup instanceof Node) {\r\n        markup = new LiveNodeVNode(markup);\r\n    }\r\n    else if (markup === undefined || markup === null || markup === false) {\r\n        markup = new NullVNode();\r\n    }\r\n    if (markup instanceof VNode) {\r\n        let vTree;\r\n        if (!append && !isReRender)\r\n            domNode.innerHTML = \"\";\r\n        if (isReRender) {\r\n            const oldVTree = renderedVTrees.get(domNode);\r\n            // was previously rendered as a subtree from another render\r\n            if (oldVTree.type === \"Element\") {\r\n                vTree = ElementVNode.fromExistingElementNode(oldVTree, [markup]);\r\n                oldVTree.diffAndPatch(vTree);\r\n                // update the children property in the memory reference from the previous render,\r\n                // attributes, etc will stay the same\r\n                oldVTree.children = vTree.children;\r\n            }\r\n            else {\r\n                vTree = new RootVNode(markup, domNode);\r\n                // diff and patch DOM based on the last render\r\n                oldVTree.diffAndPatch(vTree);\r\n            }\r\n        }\r\n        // first time render\r\n        else {\r\n            vTree = new RootVNode(markup, domNode);\r\n            domNode.append(vTree.asNode());\r\n        }\r\n        // memorize the V-Tree which rendered the current DOM, to use it in future re-renders\r\n        renderedVTrees.set(domNode, vTree);\r\n        // call all ref callbacks found during creation of new nodes during render\r\n        while (refsToCall.length) {\r\n            // remove first from list, and invoke it\r\n            refsToCall.splice(0, 1)[0]();\r\n        }\r\n    }\r\n    else {\r\n        throw new Error(\"render method called with wrong argument(s)\");\r\n    }\r\n}\r\n// provides component to autonomous update its content when provided promise resolved\r\nexport class SuspenseVNode extends VNode {\r\n    constructor({ placeholder, promise, template, }) {\r\n        super();\r\n        this.type = \"Suspense\";\r\n        this.parent = null;\r\n        // provided promise is resolved and content updated\r\n        this.isResolved = false;\r\n        // V-Node is already removed from node because of a re-render\r\n        this.isRemoved = false;\r\n        this.placeholder = placeholder;\r\n        this.promise = promise;\r\n        this.template = template;\r\n        const child = new FragmentVNode([placeholder]);\r\n        child.parent = this;\r\n        this.children = [child];\r\n    }\r\n    asNode() {\r\n        this.waitAndReRender();\r\n        return this.children[0].asNode();\r\n    }\r\n    waitAndReRender() {\r\n        this.promise.then(value => {\r\n            if (this.isRemoved)\r\n                return;\r\n            this.isResolved = true;\r\n            const contentMarkup = this.template(value);\r\n            const newContent = new FragmentVNode([contentMarkup]);\r\n            newContent.parent = this;\r\n            const oldFragmentChild = this.children[0];\r\n            this.children = [newContent];\r\n            oldFragmentChild.diffAndPatch(newContent);\r\n        });\r\n    }\r\n    // only returning the placeholder.\r\n    // not automatically rendering when promise resolves\r\n    toString() {\r\n        return this.placeholder ? this.placeholder.toString() : \"\";\r\n    }\r\n    removeFromDOM() {\r\n        this.isRemoved = true;\r\n        this.children.forEach(childVNode => childVNode.removeFromDOM());\r\n    }\r\n    diffAndPatch(newNode) {\r\n        if (!this.isResolved) {\r\n            // patches the placeholder with each other\r\n            diffAndPatchChildren(this, newNode);\r\n            newNode.waitAndReRender();\r\n        }\r\n        // already resolved, promise but has been changed.\r\n        // start new with the placeholder\r\n        else if (this.promise !== newNode.promise) {\r\n            this.removeFromDOM();\r\n            insertNewItem(newNode);\r\n        }\r\n        // already resolved, promise still the same.\r\n        // diff and patch the template results\r\n        else {\r\n            newNode.promise.then(value => {\r\n                newNode.isResolved = true;\r\n                const contentMarkup = newNode.template(value);\r\n                const newContent = new FragmentVNode([contentMarkup]);\r\n                newContent.parent = newNode;\r\n                newNode.children = [newContent];\r\n                diffAndPatchChildren(this, newNode);\r\n            });\r\n        }\r\n        // current Suspense Node is not in use any more\r\n        this.isRemoved = true;\r\n    }\r\n}\r\n/**\r\n * the provided string will be rendered as markup and not escaped / sanitized.\r\n * Use this with caution because theoretically it allows broken html or even xss attacks\r\n *\r\n *\r\n * @export\r\n * @param {string} content - html as string which needs to be rendered\r\n * @returns {VNodeInterface}\r\n * @example\r\n * `<article>{ rawHtml(richText) }</article>`\r\n */\r\nexport function rawHtml(content) {\r\n    return new (class RawHtml extends VNode {\r\n        constructor(content) {\r\n            super();\r\n            this.parent = null;\r\n            this.children = [];\r\n            this.type = \"RawHtml\";\r\n            this.childNodes = null;\r\n            this.content = content;\r\n        }\r\n        removeFromDOM() {\r\n            this.childNodes.forEach(node => node.parentElement.removeChild(node));\r\n        }\r\n        // simple re-renders without diffing and patching in case of modified content\r\n        diffAndPatch(newNode) {\r\n            if ((newNode.content = this.content)) {\r\n                newNode.node = this.node;\r\n                newNode.childNodes = this.childNodes;\r\n                return;\r\n            }\r\n            this.removeFromDOM();\r\n            insertNewItem(newNode);\r\n        }\r\n        toString() {\r\n            return content;\r\n        }\r\n        asNode() {\r\n            const template = document.createElement(\"template\");\r\n            template.innerHTML = this.content;\r\n            const documentFragment = template.content;\r\n            this.childNodes = Array.from(documentFragment.childNodes);\r\n            // basically the `.node` property is used to determine the last html node of the VNode,\r\n            // to position the next VNode's DOM Node after it.\r\n            // therefore .node returns the last node of the raw html\r\n            if (this.childNodes.length) {\r\n                this.node = this.childNodes[this.childNodes.length - 1];\r\n            }\r\n            return documentFragment;\r\n        }\r\n    })(content);\r\n}\r\n/**\r\n * Component to render placeholder markup till some promise is resolved and the markup is updated\r\n *\r\n * @param {Object} param0\r\n * @param {JSXChild} param0.placeholder - markup to be rendered during the time promise hasn't been resolved\r\n * @param {Promise} param0.promise - promise which needs to be resolved for the actual markup to be rendered\r\n * @param {Function} param0.template - function which will be called with promises resolve value and should return the desired jsx markup\r\n * @example\r\n *   <Suspense\r\n *     placeholder={<PlaceholderTableRows />}\r\n *     promise={pendingRequest}\r\n *     template={(response) =>\r\n *       <TableRows rows={response.items} />\r\n *     }\r\n *   />\r\n */\r\nexport function Suspense({ placeholder, promise, template, }) {\r\n    return new SuspenseVNode({\r\n        placeholder,\r\n        promise,\r\n        template,\r\n    });\r\n}\r\n// VNode for <!-- comments -->\r\nclass CommentVNode extends VNode {\r\n    constructor(content) {\r\n        super();\r\n        this.type = \"Comment\";\r\n        this.children = [];\r\n        this.node = null;\r\n        this.parent = null;\r\n        this.props = { content };\r\n    }\r\n    asNode() {\r\n        const commentNode = document.createComment(this.props.content);\r\n        this.node = commentNode;\r\n        return commentNode;\r\n    }\r\n    toString() {\r\n        return `<!--${this.props.content}-->`;\r\n    }\r\n    diffAndPatch(newNode) {\r\n        this.node.textContent = newNode.props.content;\r\n        newNode.node = this.node;\r\n    }\r\n    removeFromDOM() {\r\n        this.node.parentNode.removeChild(this.node);\r\n    }\r\n}\r\n/**\r\n * Function to render html comment in jsx output\r\n * @param param0\r\n * @param param0.content {string} - content of the html comment\r\n * @example\r\n *  render(\r\n *    <div>\r\n *      <Comment content=\" comment regarding the next input \" />\r\n *      <input />\r\n *    </div>,\r\n *    el\r\n *  );\r\n *  will render:\r\n *    <div>\r\n *      <!-- comment regarding the next input -->\r\n *      <input />\r\n *    </div>\r\n */\r\nexport function HTMLComment({ content = \"\" }) {\r\n    return new CommentVNode(content);\r\n}\r\n/**\r\n * named Container to be replaced with passed children\r\n *\r\n * @param {Object} options\r\n * @param {string} options.name - name of the slot\r\n * @param {JSXChild} options.hostsChildren - props.children from the parent component functions which contains the slotable elements\r\n * @param {JSXChild} options.children - props.children from the Slot element which is used for the fallback/default content\r\n * @returns {JSX.Element}\r\n * @example\r\n * function Dialog({children}) {\r\n *  return (\r\n *    <div>\r\n *      <Slot name=\"body\" hostsChildren={children}>\r\n *        <p> fallback text </p>\r\n *      </Slot>\r\n *      <footer>\r\n *        <Slot name=\"footer\" hostsChildren={children} />\r\n *      </footer>\r\n *    </div>\r\n *  );\r\n * }\r\n *\r\n * render (\r\n *  <Dialog>\r\n *    <h3 _slot=\"body\"> Title </h3>\r\n *    <p _slot=\"body\"> Description </p>\r\n *    <a _slot=\"footer\" href=\"mailto:name@email.com\">\r\n *      contact us\r\n *    </a>\r\n *  </Dialog>,\r\n *  element\r\n * )\r\n */\r\nexport function Slot({ name, hostsChildren, children }) {\r\n    let content = [];\r\n    // find children which have the correct slot attribute\r\n    for (const child of normalizeChildren(hostsChildren)) {\r\n        // @ts-ignore child only might have the slot property in case on VElement and Fragment\r\n        if (child && child.slot === name)\r\n            content.push(child);\r\n    }\r\n    // return default content aka its real children when no assigned node was found\r\n    // children is always an array (when passed to the tag function),\r\n    // convert to VNode\r\n    return Fragment({ children: content.length ? content : children });\r\n}\r\n/**\r\n * @example\r\n *  import { createRef } from \"./jsx-runtime\";\r\n *  function Comp() {\r\n *    const ref = createRef<HTMLInputElement>();\r\n *\r\n *    return (\r\n *      <>\r\n *        <input _ref={ref} />\r\n *        <my-label on-click={() => ref.current.focus() } />\r\n *      </>\r\n *    );\r\n *  }\r\n */\r\nexport function createRef() {\r\n    const result = function (el) {\r\n        result.current = el;\r\n    };\r\n    result.current = null;\r\n    return result;\r\n}\r\n"]}