{ "version": 3, "sources": ["../../../node_modules/jsx-dom/min/index.js"], "sourcesContent": ["/* eslint-disable */\nconst keys = Object.keys;\nfunction identity(value) {\n return value;\n}\nfunction isBoolean(val) {\n return typeof val === \"boolean\";\n}\nfunction isElement(val) {\n return val && typeof val.nodeType === \"number\";\n}\nfunction isString(val) {\n return typeof val === \"string\";\n}\nfunction isNumber(val) {\n return typeof val === \"number\";\n}\nfunction isObject(val) {\n return typeof val === \"object\" ? val !== null : isFunction(val);\n}\nfunction isFunction(val) {\n return typeof val === \"function\";\n}\nfunction isComponentClass(Component) {\n return !!(Component && Component.isComponent);\n}\nfunction isArrayLike(obj) {\n return (\n isObject(obj) &&\n typeof obj.length === \"number\" &&\n typeof obj.nodeType !== \"number\"\n );\n}\nfunction forEach(value, fn) {\n if (!value) return;\n for (const key of keys(value)) {\n fn(value[key], key);\n }\n}\n\nfunction createRef() {\n return Object.seal({\n current: null,\n });\n}\nfunction isRef(maybeRef) {\n return isObject(maybeRef) && \"current\" in maybeRef;\n}\n\nconst jsxDomType = Symbol.for(\"jsx-dom:type\");\nvar JsxDomType = /*#__PURE__*/ (function (JsxDomType) {\n JsxDomType[\"ShadowRoot\"] = \"ShadowRoot\";\n return JsxDomType;\n})(JsxDomType || {});\nfunction ShadowRoot(_ref) {\n let { children, ref, ...attr } = _ref;\n return {\n [jsxDomType]: JsxDomType.ShadowRoot,\n ref,\n attr,\n children,\n };\n}\nfunction isShadowRoot(el) {\n return el != null && el[jsxDomType] === JsxDomType.ShadowRoot;\n}\n\nconst SVGNamespace = \"http://www.w3.org/2000/svg\";\n\n// https://facebook.github.io/react/docs/jsx-in-depth.html#booleans-null-and-undefined-are-ignored\n// Emulate JSX Expression logic to ignore certain type of children or className.\nfunction isVisibleChild(value) {\n return !isBoolean(value) && value != null;\n}\n\n/**\n * Convert a `value` to a className string.\n * `value` can be a string, an array or a `Dictionary`.\n */\nfunction className(value) {\n if (Array.isArray(value)) {\n return value.map(className).filter(Boolean).join(\" \");\n } else if (isObject(value)) {\n if (Symbol.iterator in value) {\n return className(Array.from(value));\n }\n return keys(value)\n .filter((k) => value[k])\n .join(\" \");\n } else if (isVisibleChild(value)) {\n return \"\" + value;\n } else {\n return \"\";\n }\n}\nfunction createFactory(tag) {\n return createElement.bind(null, tag);\n}\nfunction Fragment(attr) {\n const fragment = document.createDocumentFragment();\n appendChild(attr.children, fragment);\n return fragment;\n}\nclass Component {\n static isComponent = true;\n constructor(props) {\n this.props = props;\n }\n render() {\n return null;\n }\n}\nfunction initComponentClass(Class, attr, children) {\n attr = {\n ...attr,\n children,\n };\n const instance = new Class(attr);\n const node = instance.render();\n if (\"ref\" in attr) {\n attachRef(attr.ref, instance);\n }\n return node;\n}\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nfunction jsx(tag, _ref) {\n let { children, ...attr } = _ref;\n let node;\n if (isString(tag)) {\n node = attr.namespaceURI\n ? document.createElementNS(attr.namespaceURI, tag)\n : document.createElement(tag);\n attributes(attr, node);\n appendChild(children, node);\n\n // Select `option` elements in `select`\n if (node instanceof window.HTMLSelectElement && attr.value != null) {\n if (attr.multiple === true && Array.isArray(attr.value)) {\n const values = attr.value.map((value) => String(value));\n node\n .querySelectorAll(\"option\")\n .forEach(\n (option) => (option.selected = values.includes(option.value)),\n );\n } else {\n node.value = attr.value;\n }\n }\n attachRef(attr.ref, node);\n } else if (isFunction(tag)) {\n // Custom elements.\n if (isObject(tag.defaultProps)) {\n attr = {\n ...tag.defaultProps,\n ...attr,\n };\n }\n node = isComponentClass(tag)\n ? initComponentClass(tag, attr, children)\n : tag({\n ...attr,\n children,\n });\n } else {\n throw new TypeError(`Invalid JSX element type: ${tag}`);\n }\n return node;\n}\nfunction createElement(tag, attr) {\n for (\n var _len = arguments.length,\n children = new Array(_len > 2 ? _len - 2 : 0),\n _key2 = 2;\n _key2 < _len;\n _key2++\n ) {\n children[_key2 - 2] = arguments[_key2];\n }\n if (isString(attr) || Array.isArray(attr)) {\n children.unshift(attr);\n attr = {};\n }\n attr = attr || {};\n if (attr.children != null && !children.length) {\n ({ children, ...attr } = attr);\n }\n return jsx(\n tag,\n {\n ...attr,\n children,\n },\n attr.key,\n );\n}\nfunction attachRef(ref, node) {\n if (isRef(ref)) {\n ref.current = node;\n } else if (isFunction(ref)) {\n ref(node);\n }\n}\nfunction appendChild(child, node) {\n if (isArrayLike(child)) {\n appendChildren(child, node);\n } else if (isString(child) || isNumber(child)) {\n appendChildToNode(document.createTextNode(child), node);\n } else if (child === null) {\n appendChildToNode(document.createComment(\"\"), node);\n } else if (isElement(child)) {\n appendChildToNode(child, node);\n } else if (isShadowRoot(child)) {\n const shadowRoot = node.attachShadow(child.attr);\n appendChild(child.children, shadowRoot);\n attachRef(child.ref, shadowRoot);\n }\n}\nfunction appendChildren(children, node) {\n for (const child of [...children]) {\n appendChild(child, node);\n }\n return node;\n}\nfunction appendChildToNode(child, node) {\n if (node instanceof window.HTMLTemplateElement) {\n node.content.appendChild(child);\n } else {\n node.appendChild(child);\n }\n}\nfunction style(node, value) {\n if (value == null || value === false);\n else if (Array.isArray(value)) {\n value.forEach((v) => style(node, v));\n } else if (isString(value)) {\n node.setAttribute(\"style\", value);\n } else if (isObject(value)) {\n forEach(value, (val, key) => {\n if (key.indexOf(\"-\") === 0) {\n // CSS custom properties (variables) start with `-` (e.g. `--my-variable`)\n // and must be assigned via `setProperty`.\n node.style.setProperty(key, val);\n } else {\n node.style[key] = val;\n }\n });\n }\n}\nfunction attribute(key, value, node) {\n switch (key) {\n case \"htmlFor\":\n attr(node, \"for\", value);\n return;\n case \"dataset\":\n forEach(value, (dataValue, dataKey) => {\n if (dataValue != null) {\n node.dataset[dataKey] = dataValue;\n }\n });\n return;\n case \"innerHTML\":\n case \"innerText\":\n case \"textContent\":\n if (isVisibleChild(value)) {\n node[key] = value;\n }\n return;\n case \"dangerouslySetInnerHTML\":\n if (isObject(value)) {\n node.innerHTML = value[\"__html\"];\n }\n return;\n case \"value\":\n if (value == null || node instanceof window.HTMLSelectElement) {\n // skip nullish values\n // for `