"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const b=/\bmso-list:[^;]*ignore/i,g=/\bmso-list:[^;]*\bl(\d+)/i,p=/\bmso-list:[^;]*\blevel(\d+)/i,E=(s,a)=>{const n=s.getAttribute("style"),r=n==null?void 0:n.match(g);if(!r)return null;const u=Number(r[1]),l=n==null?void 0:n.match(p),m=l?Number(l[1]):1,h=new RegExp(`@list l${u}:level${m}\\s*\\{[^\\}]*mso-level-number-format:\\s*([\\w-]+)`,"i"),e=a.match(h),t=e&&e[1]==="bullet"?"bullet":"ordered";return{id:u,indent:m,type:t,element:s}},M=s=>{var m,h;const a=Array.from(s.querySelectorAll("[style*=mso-list]")),n=[],r=[];a.forEach(e=>{(e.getAttribute("style")||"").match(b)?n.push(e):r.push(e)}),n.forEach(e=>{var t;return(t=e.parentNode)==null?void 0:t.removeChild(e)});const u=s.documentElement.innerHTML,l=r.map(e=>E(e,u)).filter(e=>e);for(;l.length;){const e=[];let t=l.shift();for(;t;)e.push(t),t=l.length&&((m=l[0])==null?void 0:m.element)===t.element.nextElementSibling&&l[0].id===t.id?l.shift():null;const f=document.createElement("ul");e.forEach(o=>{const c=document.createElement("li");c.setAttribute("data-list",o.type),o.indent>1&&c.setAttribute("class",`ql-indent-${o.indent-1}`),c.innerHTML=o.element.innerHTML,f.appendChild(c)});const d=(h=e[0])==null?void 0:h.element,{parentNode:i}=d??{};d&&(i==null||i.replaceChild(f,d)),e.slice(1).forEach(o=>{let{element:c}=o;i==null||i.removeChild(c)})}};function v(s){s.documentElement.getAttribute("xmlns:w")==="urn:schemas-microsoft-com:office:word"&&M(s)}exports.default=v;
