import{u as i,i as c,o as a,p as l}from"./index.4b887428.js";import{i as u}from"./isEmpty.15767c6b.js";import{i as p}from"./isEqual.59768dc1.js";const y=n=>{const e=document.getElementById(n);return e?e!=null&&e.contentWindow?e.contentWindow.document:e.contentDocument:null},h=()=>{let n=null;return async({editorData:e})=>{try{(n===null||!p(n,e))&&await l(),n=JSON.parse(JSON.stringify(e))}catch(t){console.error(t)}}},_=(n=null)=>{const e=i();if(u(e.currentPost))return;const t=()=>{e.isDirty=!1,e.saveCurrentPost(e.currentPost).then(()=>{const r=c(),o=a();!r.isUnlicensed&&o.hasPermission&&o.fetch()})};n==="elementor"?window.elementor.config.document.id===window.elementor.config.document.revisions.current_id&&t():t()},S=(n,e)=>{const t=window.parent.document,r=t.getElementById(e);r&&r.remove();try{new URL(n);const o=t.createElement("link");o.id=e,o.href=n,o.rel="stylesheet",t.head.appendChild(o)}catch{const s=t.createElement("style");s.id=e,s.textContent=n,t.head.appendChild(s)}};export{y as a,h as c,_ as h,S as i};
