import{b as c}from"./state.B1AUjM8Q.js";function x(){import.meta.url,import("_").catch(()=>1),async function*(){}().next()}function p(){if(c.postContextCache!==null)return c.postContextCache;jQuery;try{const e={};if(e.title=u(),e.description=d(),e.title||e.description)return c.postContextCache=JSON.stringify(e),c.postContextCache}catch(e){}return c.postContextCache="",""}function u(){var o;const e=jQuery,n=e("#title");if(n.length>0&&n.val())return n.val().trim();try{const t=window.wp;if(t&&t.data&&t.data.select){const r=(o=t.data.select("core/editor"))==null?void 0:o.getEditedPostAttribute("title");if(r)return r.trim()}}catch(t){}const i=e(".wp-heading-inline, h1.wp-heading-inline");if(i.length>0){const t=i.text().trim();if(t&&!t.match(/^(Edit|Add New)/i))return t}}function d(){var o;const e=jQuery,n=e("#content");if(n.length>0&&n.val()){let t=n.val();return l(t)}try{const t=window.wp;if(t&&t.data&&t.data.select){const r=(o=t.data.select("core/block-editor"))==null?void 0:o.getBlocks();if(r&&r.length>0){let a="";for(const s of r)s.attributes&&s.attributes.content&&(a+=s.attributes.content+" ");if(a)return l(a)}}}catch(t){}const i=e("#excerpt");if(i.length>0&&i.val()){let t=i.val();return l(t)}}function l(e){const n=document.createElement("div");n.innerHTML=e;let i=(n.textContent||n.innerText||"").trim();return i.length>500&&(i=i.substring(0,500)+"..."),i}export{x as __vite_legacy_guard,p as e};
