(()=>{"use strict";const e=window.React,t=window.wp.element,a=window.wp.i18n;window.SuiteMkt3k;const l=document.getElementById("suitemkt3k-form-designer");if(l){const n=JSON.parse(l.dataset.form||'{"name":"","design":{"title":"","description":"","cta_label":"Subscribe","accent":"#6366F1","fields":[{"key":"name","label":"Name","required":false},{"key":"email","label":"Email","required":true}]}}');(0,t.createRoot)(l).render((0,e.createElement)(function({initial:l}){const[n,s]=(0,t.useState)(l);return(0,e.createElement)("div",{className:"wmk-designer"},(0,e.createElement)("aside",{className:"wmk-designer-left"},(0,e.createElement)("label",{className:"wmk-field"},(0,e.createElement)("span",null,(0,a.__)("Form name","suitemkt3k")),(0,e.createElement)("input",{className:"wmk-input",value:n.name||"",onChange:e=>s({...n,name:e.target.value})})),(0,e.createElement)("label",{className:"wmk-field"},(0,e.createElement)("span",null,(0,a.__)("Title","suitemkt3k")),(0,e.createElement)("input",{className:"wmk-input",value:n.design.title||"",onChange:e=>s({...n,design:{...n.design,title:e.target.value}})})),(0,e.createElement)("label",{className:"wmk-field"},(0,e.createElement)("span",null,(0,a.__)("Description","suitemkt3k")),(0,e.createElement)("textarea",{className:"wmk-input",rows:"2",value:n.design.description||"",onChange:e=>s({...n,design:{...n.design,description:e.target.value}})})),(0,e.createElement)("label",{className:"wmk-field"},(0,e.createElement)("span",null,(0,a.__)("CTA label","suitemkt3k")),(0,e.createElement)("input",{className:"wmk-input",value:n.design.cta_label||"",onChange:e=>s({...n,design:{...n.design,cta_label:e.target.value}})})),(0,e.createElement)("label",{className:"wmk-field"},(0,e.createElement)("span",null,(0,a.__)("Accent color","suitemkt3k")),(0,e.createElement)("input",{type:"color",value:n.design.accent||"#6366F1",onChange:e=>s({...n,design:{...n.design,accent:e.target.value}})}))),(0,e.createElement)("section",{className:"wmk-designer-right"},(0,e.createElement)("div",{className:"wmk-form",style:{"--wmk-accent":n.design.accent}},(0,e.createElement)("h3",{className:"wmk-form-title"},n.design.title),(0,e.createElement)("p",{className:"wmk-form-desc"},n.design.description),(n.design.fields||[]).map(t=>(0,e.createElement)("label",{key:t.key,className:"wmk-form-field"},(0,e.createElement)("span",null,t.label,t.required?" *":""),(0,e.createElement)("input",{disabled:!0}))),(0,e.createElement)("button",{className:"wmk-form-cta"},n.design.cta_label))))},{initial:n}))}})();