const e=["STRONG","EM","CODE","CC-LINK","BR","P","SPAN","DL","DT","DD"];const t=(()=>{if(null==globalThis.document)return()=>"";const e=document.createElement("span"),t=document.createTextNode("");return e.appendChild(t),n=>(t.data=n,e.innerHTML)})();function n(e){return e instanceof Text?(e.parentNode.removeChild(e),e.data):""}function o(o,...a){let r="";for(let e=0;e<o.length;e++){r+=o[e];const n=a[e];null!=n&&(r+="string"==typeof n?t(n):n)}const l=document.createElement("template");return l.innerHTML=r,Array.from(l.content.querySelectorAll("*")).forEach((t=>{if(e.includes(t.tagName))Array.from(t.attributes).filter((e=>{return n=e.name,!("CC-LINK"===t.tagName?["href","a11y-desc","lang"].includes(n):["title","aria-label","lang"].includes(n));var n})).forEach((e=>(console.warn(`Attribute ${e.name} is not allowed on <${t.tagName.toLowerCase()}> in translations!`),t.removeAttribute(e.name))));else{const e=n(t.previousSibling),o=n(t.nextSibling),a=document.createTextNode(e+t.textContent+o);t.parentNode.replaceChild(a,t),console.warn(`Node <${t.tagName.toLowerCase()}> is not allowed in translations!`)}})),l.content.cloneNode(!0)}export{o as sanitize};
//# sourceMappingURL=i18n-sanitize.js.map
