import{cC as L,cD as P,z as p,s as R,v,K as l,cE as _,cu as m,cF as c,J as w}from"./stepForm-f8dd96bd.js";import{e as z,b,a as h,c as T,M as U,m as I,u as M}from"./eventBooking-adf5f0fc.js";import"./customerPanel-988e466a.js";import"./eventListForm-20a47f1e.js";import"./catalogForm-529adddc.js";const k=L({modules:{entities:z,booking:b,eventEntities:h,eventBooking:T}});window.stylesInjectedV3=async function(){};const B=_({loader:()=>c(()=>import(""+(window.__dynamic_handler__||function(e){return e})("./CustomizeCatalog-6a361029.js")+""),[],import.meta.url)}),V=_({loader:()=>c(()=>import(""+(window.__dynamic_handler__||function(e){return e})("./CustomizeCustomerPanel-b148b53e.js")+""),[],import.meta.url)}),S=_({loader:()=>c(()=>import(""+(window.__dynamic_handler__||function(e){return e})("./CustomizeEmployeePanel-2c159744.js")+""),[],import.meta.url)}),H=_({loader:()=>c(()=>import(""+(window.__dynamic_handler__||function(e){return e})("./CustomizeEventCalendar-7e8231d6.js")+""),[],import.meta.url)}),K=_({loader:()=>c(()=>import(""+(window.__dynamic_handler__||function(e){return e})("./CustomizeEventList-6aadca70.js")+""),[],import.meta.url)}),C=_({loader:()=>c(()=>import(""+(window.__dynamic_handler__||function(e){return e})("./CustomizeStepNew-0263f3a1.js")+""),[],import.meta.url)}),E=window.wpAmeliaUrls.wpAmeliaPluginURL+"v3/public/";window.__dynamic_handler__=function(e){return E+"assets/"+e};window.__dynamic_preload__=function(e){return e.map(s=>E+s)};function N(){const e=Array.isArray(window.localeLanguage)?window.localeLanguage[0]:"";return typeof e!="string"||!e?"en":e.toLowerCase().replace("_","-").split("-")[0]||"en"}function j(){let e=[];{const s=Array.from(document.getElementsByTagName("link")).filter(o=>o.getAttribute("rel")==="stylesheet"&&o.getAttribute("href")?.includes("ameliabooking/v3/public/assets")),i=Array.from(document.getElementsByTagName("style")).filter(o=>o.textContent?.includes("/* purgecss start ignore */"));e=[...s,...i]}return e}async function D(e){if(!e)return;const i=await(()=>new Promise(n=>{const t=()=>{const a=j();return a!==void 0&&a.length>0&&window.customizeComponentLoaded?a:null},r=t();if(r){n(r);return}const u=new MutationObserver(()=>{const a=t();a&&(u.disconnect(),n(a))});u.observe(document.head,{childList:!0,subtree:!0});const d=()=>{const a=t();a?(u.disconnect(),n(a)):window.customizeComponentLoaded||requestAnimationFrame(d)};requestAnimationFrame(d)}))(),o=document.createDocumentFragment();i.forEach((n,t)=>{const r=n.cloneNode(!0);r.id=`v3-style-${t}`,n.tagName==="LINK"&&n.href&&(r.href=n.href),o.appendChild(r)}),e.appendChild(o),window.stylesInjectedV3()}function y(){const s=document.getElementsByClassName("amd-cp__preview")[0]?.shadowRoot,i=s?.getElementById("amelia-app-backend-new");if(!i){setTimeout(y,100);return}const o=window.v3?.componentToMount!==void 0?window.v3.componentToMount:"Customize";let n,t;switch(o){case"CustomizeCatalog":n=B,t="CustomizeCatalog";break;case"CustomizeCustomerPanel":n=V,t="CustomizeCustomerPanel";break;case"CustomizeEmployeePanel":n=S,t="CustomizeEmployeePanel";break;case"CustomizeEventCalendar":n=H,t="CustomizeEventCalendar";break;case"CustomizeEventList":n=K,t="CustomizeEventList";break;case"CustomizeStepNew":n=C,t="CustomizeStepNew";break;default:n=C,t="CustomizeStepNew"}P({setup(){const r=p(window.wpAmeliaUrls),u=w(window.wpAmeliaLanguages),d=w(window.wpAmeliaSettings),a=p("wpAmeliaTimeZone"in window?window.wpAmeliaTimeZone[0]:""),A=p(window.localeLanguage[0]),f=w(window.wpAmeliaLabels),g=w(M());l("settings",m(d)),l("baseUrls",m(r)),l("timeZone",m(a)),l("localLanguage",m(A)),l("languages",m(u)),l("labels",m(f)),l("licence",g),R(async()=>{await D(s)})},template:`<${t} />`}).component(t,n).use(U,{theme:{preset:I,strategy:"runtime",darkModeStrategy:"class"},translations:{locale:N(),fallbackLocale:"en"}}).use(k).mount(i)}window.onUnmountedV3Callback||(window.onUnmountedV3Callback=async()=>{});async function F(){const s=document.getElementsByClassName("amd-cp__preview")[0]?.shadowRoot,i=s?.getElementById("amelia-app-backend-new"),o=i?.__vue_app__;if(s?.querySelectorAll('[id^="v3-style-"]')?.forEach(t=>{t.remove()}),o){o.unmount(),await v();const t=!i?.innerHTML||i.innerHTML.trim()==="";typeof window.onUnmountedV3Callback=="function"&&t&&await window.onUnmountedV3Callback()}}window.mountUnmountV3App=async()=>{window.v3?y():await F()};
