import{u as i,h as a,j as c,m as l}from"./app-core.52885c02.js";import{q as u,k as m}from"./vendor-lodash.b9aaf385.js";const p=n=>{const e=document.getElementById(n);return e?e?.contentWindow?e.contentWindow.document:e.contentDocument:null},y=()=>{let n=null;return async({editorData:e})=>{try{(n===null||!m(n,e))&&await l(),n=JSON.parse(JSON.stringify(e))}catch(t){console.error(t)}}},h=(n=null)=>{const e=i();if(u(e.currentPost))return;const t=()=>{e.saveCurrentPost(e.currentPost).then(s=>{if(e.isDirty=!1,!s)return;const o=a(),r=c();!o.isUnlicensed&&r.hasPermission&&r.fetch()})};n==="elementor"?window.elementor.config.document.id===window.elementor.config.document.revisions.current_id&&t():t()},_=(n,e)=>{const t=window.parent.document,s=t.getElementById(e);s&&s.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 r=t.createElement("style");r.id=e,r.textContent=n,t.head.appendChild(r)}};export{p as a,y as c,h,_ as i};