"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("../../../../web-namespaces@2.0.1/node_modules/web-namespaces/index.cjs.js"),d=require("../../../../hastscript@9.0.1/node_modules/hastscript/lib/index.cjs.js");function N(e,n){return l(e,{})||{type:"root",children:[]}}function l(e,n){const t=p(e,n);return t&&n.afterTransform&&n.afterTransform(e,t),t}function p(e,n){switch(e.nodeType){case 1:return b(e,n);case 3:return g(e);case 8:return y(e);case 9:return i(e,n);case 10:return h();case 11:return i(e,n);default:return}}function i(e,n){return{type:"root",children:f(e,n)}}function h(){return{type:"doctype"}}function g(e){return{type:"text",value:e.nodeValue||""}}function y(e){return{type:"comment",value:e.nodeValue||""}}function b(e,n){const t=e.namespaceURI,o=t===a.webNamespaces.svg?d.s:d.h,r=t===a.webNamespaces.html?e.tagName.toLowerCase():e.tagName,c=t===a.webNamespaces.html&&r==="template"?e.content:e,s=e.getAttributeNames(),m={};let u=-1;for(;++u<s.length;)m[s[u]]=e.getAttribute(s[u])||"";return o(r,m,f(c,n))}function f(e,n){const t=e.childNodes,o=[];let r=-1;for(;++r<t.length;){const c=l(t[r],n);c!==void 0&&o.push(c)}return o}exports.fromDom=N;
//# sourceMappingURL=index.cjs.js.map
