const i=e=>{const t=document.createElement("div");return e&&typeof e=="string"&&(e=e.replace(/<script[^>]*>([\S\s]*?)<\/script>/gmi,""),e=e.replace(/<\/?\w(?:[^"'>]|"[^"]*"|'[^']*')*>/gmi,""),t.innerHTML=e,e=t.textContent),e},f=e=>(typeof e!="string"||!e.includes("&")||(Object.entries({"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"'}).forEach(([c,n])=>{e=e.replaceAll(c,n)}),e=e.replace(/<script[^>]*>([\S\s]*?)<\/script>/gmi,"")),e),d=e=>{new MutationObserver(function(){let t=e.id?document.getElementById(e.id):document.querySelector(e.selector);const c=document.querySelector(".edit-site-visual-editor__editor-canvas");!t&&c&&(t=e.id?c.contentWindow.document.getElementById(e.id):c.contentWindow.document.querySelector(e.selector)),t&&(e.done(t),e.loop||this.disconnect())}).observe(e.parent||document,{subtree:!!e.subtree||!e.parent,childList:!0})},p=e=>/^(?:(?:https?|ftp):\/\/)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)(?:\.(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)*(?:\.(?:[a-z\u00a1-\uffff]{2,})))(?::\d{2,5})?(?:\/\S*)?$/.test(e),h=e=>new URL(e,import.meta.url).href,m=e=>JSON.parse(JSON.stringify(e)),_=(e,t,c)=>{let n,r=0;const l={dev:-6,alpha:-5,a:-5,beta:-4,b:-4,RC:-3,rc:-3,"#":-2,p:1,pl:1},s=function(o){return o=(""+o).replace(/[_\-+]/g,"."),o=o.replace(/([^.\d]+)/g,".$1.").replace(/\.{2,}/g,"."),o.length?o.split("."):[-8]},u=function(o){return o?isNaN(o)?l[o]||-7:parseInt(o,10):0};e=s(e),t=s(t);const a=Math.max(e.length,t.length);for(n=0;n<a;n++)if(e[n]!==t[n]){if(e[n]=u(e[n]),t[n]=u(t[n]),e[n]<t[n]){r=-1;break}else if(e[n]>t[n]){r=1;break}}if(!c)return r;switch(c){case">":case"gt":return 0<r;case">=":case"ge":return 0<=r;case"<=":case"le":return 0>=r;case"===":case"=":case"eq":return r===0;case"<>":case"!==":case"ne":return r!==0;case"":case"<":case"lt":return 0>r;default:return null}},y=e=>{var n;const t=[],c=[...e];for(;c.length;){const{...r}=c.shift();(n=r.innerBlocks)!=null&&n.length&&c.push(...r.innerBlocks),r.innerBlocks=[],t.push(r)}return t},b=(e,t)=>e.filter(c=>!t.includes(c));export{b as a,f as b,m as c,i as d,y as f,h as g,p as i,d as o,_ as v};
