"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});function g(t,n){if(!t)return[];const{from:i,to:o}=t.selection;let r;if(typeof n=="string")r=Object.entries(t.schema.nodes).filter(([,e])=>e.groups.includes(n)).map(([,e])=>({type:e}));else{r=n;for(const e of r)e.type=e.type?h(e.type,t.schema):null}let f=null,s=null;const l=new Set,c=new Set(r);return t.doc.nodesBetween(i,o,(e,d,y)=>{if(c.size===0)return!1;if(!e.isText){const p=r.filter(u=>u.type?typeof u.type=="string"?!1:e.type.name===u.type.name:!0).find(u=>u.attributes?a(e.attrs,u.attributes):!0);p&&(s&&f&&f!==y&&(c.delete(s),l.add(s)),s=p),f=e}}),s&&l.add(s),[...l.values()].map(e=>{var d;return e.key?e.key:typeof e.type=="string"?e.type:(d=e.type)!=null&&d.name?e.type.name:""})}function h(t,n){if(typeof t=="string"){if(!n.nodes[t])throw Error(`There is no node type named '${t}'. Maybe you forgot to add the extension?`);return n.nodes[t]}return t}function a(t,n,i){const o=Object.keys(n);return o.length?o.every(r=>i.strict?n[r]===t[r]:Object.prototype.toString.call(n[r])==="[object RegExp]"?n[r].test(t[r]):n[r]===t[r]):!0}exports.default=g;exports.objectIncludes=a;
//# sourceMappingURL=last-active-nodes.cjs.map
