"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const s=require("react"),o={blogname:"name",custom_logo:"site_logo"},u=n=>{const[m,c]=s.useState(n.settings),r=s.useRef({}),i=a=>{const e=a.data;if(e.messageType&&e.messageType==="partial-update"){const t=r.current;o[e.property]?t[o[e.property]]=e.value:e.property.indexOf("menu")>-1&&(t.menu_settings||(t.menu_settings={}),t.menu_settings[e.property]=e.value),r.current=t,c({...r.current,random:Math.random()})}};return s.useEffect(()=>(window.addEventListener("message",i,!1),()=>{window.removeEventListener("message",i)}),[]),s.Children.map(n.children,(a,e)=>s.cloneElement(a,{...n,settings:{...m},key:`customizer-child-${e}`}))};exports.CustomizerWrapper=u;exports.default=u;
