import{K as d}from"./vendor-other.7b559694.js";import{p as y,q as g,s as w,t as f}from"./app-core.a6d808ce.js";const S=d.bind(window.wp.element.createElement),x=e=>Object.prototype.toString.call(e).slice(8,-1).toLowerCase(),u=e=>{const c=o=>{for(const s in e)Object.prototype.hasOwnProperty.call(e,s)&&(o[s]=u(e[s]))},t=()=>{const o={};return c(o),o},n=()=>e.map(function(o){return u(o)}),a=()=>{const o=new Map;for(const[s,m]of e)o.set(s,u(m));return o},i=()=>{const o=new Set;for(const s of e)o.add(u(s));return o},l=()=>{const o=e.bind(void 0);return c(o),o},r=x(e);return r==="object"?t():r==="array"?n():r==="map"?a():r==="set"?i():r==="function"?l():e},A=(e,c=!1,t=!0)=>{const{body:n}=document.implementation.createHTMLDocument("");n.innerHTML=e;const a=n.getElementsByTagName("*");let i=a.length;for(;i--;){const r=a[i];if(r.tagName==="SCRIPT")r.parentNode.removeChild(r);else{let o=r.attributes.length;for(;o--;){const{name:s}=r.attributes[o];s.startsWith("on")&&r.removeAttribute(s)}}}const l=c?n.textContent:n.innerHTML;return t?l.trim():l},k=()=>"aioseo-"+new Date().getTime().toString(36)+Math.random().toString(36).slice(2,7),B=(e,c=!1)=>{const t=g();return!e||!t.tags?e:(t.tags.forEach(n=>{if(n.id==="custom_field"){const r=new RegExp(`#${n.id}-([a-zA-Z0-9_-]+)`,"g");e=e.replace(r,(o,s)=>w(s));return}if(n.id==="tax_name"){const r=new RegExp(`#${n.id}-([a-zA-Z0-9_-]+)`,"g");e=e.replace(r,`[${n.name} - $1]`);return}const a=new RegExp(`#${n.id}(?![a-zA-Z0-9_])`,"g"),i=e.match(a),l=t.liveTags[n.id]||n.value;i&&(e=e.replace(a,"%|%"+l))}),e=e.replace(/%\|%/g,"").replace(/<(?:.|\n)*?>/gm," "),c||(e=e.replace(/\s/g," ")),f(f(e)))},I=(e,c)=>(e=parseFloat(e||"").toFixed(2),isNaN(e)?"":new Intl.NumberFormat("en-US",{style:"currency",currency:c||"USD"}).format(e)),L=(e,c)=>{const t=c.findIndex(n=>n.id===e);t!==-1&&(c[t].app.unmount(),c.splice(t,1))},{registerBlockCollection:p,registerBlockType:_}=window.wp.blocks,C=e=>{if(!e||!y())return;const{name:c,settings:t}=e;if(t?.icon&&!t?.icon?.foreground){const n={foreground:"#141B38",src:t.icon};t.icon=n}typeof p=="function"&&t.category==="aioseo"&&(t.category="widgets"),typeof p!="function"&&t.category!=="aioseo"&&(t.category="aioseo"),_(c,t)};export{A as c,u as d,I as f,k as g,S as h,L as m,B as p,C as r};
