resul-template-builder 1.1.9 → 1.1.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -4999,7 +4999,7 @@ ${p}`)}e(p=>{const m=p.savedCanvases.map(f=>f.id===o?{...f,name:r,description:n,
4999
4999
 
5000
5000
  Important: The length constraint refers to the number of characters, not words.
5001
5001
  `.trim()),d&&a.trim()&&(E=`${E}
5002
- DO NOT INCLUDE: ${a}`);const $=await fetch("https://api.openai.com/v1/chat/completions",{method:"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer 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"},body:JSON.stringify({model:"gpt-4",messages:[{role:"system",content:"You are a professional copywriter. Generate engaging and effective content based on the user's prompt. Return only the generated content without any additional formatting or explanation. Pay careful attention to character count constraints."},{role:"user",content:E}],temperature:.7,max_tokens:500})});if(!$.ok)throw new Error("Failed to generate content");const z=(await $.json()).choices[0].message.content.trim();r(z),t()}catch{f("Failed to generate content")}finally{p(!1)}};return i.jsx(i.Fragment,{children:kt.createPortal(i.jsx("div",{id:"rsp-modal-backdrop",className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50 p-4",children:i.jsxs("div",{className:"rsp-modal rsp-generate-conteten-wrapper bg-white rounded-lg w-full max-w-[95vw]",style:{maxHeight:"calc(100vh - 32px)"},children:[i.jsxs("div",{className:"rsp-modal-header flex justify-between items-center p-6 border-b",children:[i.jsx("h2",{children:"Generate content"}),i.jsx("button",{onClick:t,className:"rsp-modal-close p-1 hover:bg-gray-100 rounded",children:i.jsx(oo,{className:"w-5 h-5"})})]}),i.jsxs("div",{className:"p-3 pt-0 space-y-3 overflow-y-auto",style:{maxHeight:"calc(100vh - 194px)"},children:[i.jsxs("div",{children:[i.jsx("label",{className:"rsp-properties-lable marginB5 block text-sm color-primary-black",children:"Prompt"}),i.jsx("textarea",{value:n,onChange:E=>s(E.target.value),className:"w-full p-2 border rounded-lg h-32 resize-none",placeholder:"Describe the content you want to generate..."})]}),i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("label",{className:"rsp-properties-lable marginB5 block text-sm color-primary-black",children:"Negative Prompt"}),i.jsxs("div",{className:"relative inline-block w-10 mr-2 align-middle select-none",children:[i.jsx("input",{type:"checkbox",checked:d,onChange:E=>c(E.target.checked),className:"toggle-checkbox absolute block w-6 h-6 rounded-full bg-white appearance-none cursor-pointer"}),i.jsx("label",{className:"toggle-label block overflow-hidden h-6 rounded-full bg-gray-300 cursor-pointer"})]})]}),d&&i.jsx("div",{children:i.jsx("textarea",{value:a,onChange:E=>l(E.target.value),className:"w-full p-2 border rounded-lg h-24 resize-none",placeholder:"Describe what you don't want in the generated content..."})}),i.jsx("div",{className:"rsp-generate-content grid grid-cols-2 gap-6",children:QT.map(E=>i.jsxs("div",{className:"space-y-3",children:[i.jsx("h4",{className:"rsp-properties-lable marginB5 block text-sm color-primary-black border-b pb-2",children:E.title}),i.jsx("div",{className:"flex flex-wrap gap-2",children:E.items.map(j=>i.jsx("button",{onClick:()=>v(E.title,j),className:`px-3 py-1.5 rounded-full text-sm transition-colors ${b[E.title]===j?"bg-primary-blue text-white":"bg-gray-100 color-secondary-black hover:bg-gray-200"}`,children:j},j))}),E.title==="Length"&&C&&i.jsxs("div",{className:"bg-gray-50 p-4 rounded-lg space-y-4",children:[i.jsx("h5",{className:"text-md font-regular color-primary-black",children:"Custom Length Settings"}),i.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[i.jsxs("div",{children:[i.jsx("label",{className:"block text-xs color-secondary-black mb-1",children:"Minimum Characters"}),i.jsx("input",{type:"number",value:g.min,onChange:j=>x(B=>({...B,min:parseInt(j.target.value)||0})),className:"w-full p-2 border rounded-md",min:"1"})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block text-xs color-secondary-black mb-1",children:"Maximum Characters"}),i.jsx("input",{type:"number",value:g.max,onChange:j=>x(B=>({...B,max:parseInt(j.target.value)||0})),className:"w-full p-2 border rounded-md",min:g.min})]})]})]})]},E.title))}),A().length>0&&i.jsxs("div",{className:"bg-gray-50 p-4 rounded-lg",children:[i.jsx("h4",{className:"text-md font-regular color-primary-black mb-2",children:"Selected Prompts:"}),i.jsxs("div",{className:"flex flex-wrap gap-2",children:[A().map(E=>i.jsx("span",{className:"inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium-del bg-blue-100 text-blue-800",children:E},E)),C&&i.jsxs("span",{className:"inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium-del bg-blue-100 text-blue-800",children:[g.min,"-",g.max," characters"]})]})]}),m&&i.jsxs("div",{className:"flex items-center space-x-2 text-red-500",children:[i.jsx(Kt,{className:"w-4 h-4"}),i.jsx("p",{className:"text-sm",children:m})]})]}),i.jsxs("div",{className:"rsp-modal-footer flex justify-end gap-2 p-6 border-t bg-gray-50",children:[i.jsx("button",{onClick:t,className:"rsp-button-secondary",children:"Cancel"}),i.jsx("button",{onClick:y,disabled:u,className:"rsp-button-primary",children:u?i.jsxs(i.Fragment,{children:[i.jsx("span",{className:"animate-spin mr-2",children:"⚪"}),"Generating..."]}):i.jsxs(i.Fragment,{children:[i.jsx(Jr,{className:"w-4 h-4 mr-2"}),"Generate"]})})]})]})}),document.body)})},Kg=(e,t,o)=>{var a;if(!o)return 0;const r=document.createTreeWalker(o,NodeFilter.SHOW_TEXT,null);let n=0,s;for(;(s=r.nextNode())!==null;){if(s===e)return n+t;n+=((a=s.textContent)==null?void 0:a.length)||0}return n},Yg=(e,t,o)=>{var u;if(!o)return null;const r=document.createTreeWalker(o,NodeFilter.SHOW_TEXT,null);let n=0,s=null,a=0,l=null,d=0,c;for(;(c=r.nextNode())!==null;){const p=((u=c.textContent)==null?void 0:u.length)||0;if(s===null&&n+p>=e&&(s=c,a=e-n),s!==null&&n+p>=t){l=c,d=t-n;break}n+=p}if(s&&l){const p=document.createRange();try{return p.setStart(s,a),p.setEnd(l,d),p}catch(m){return console.error("Error creating range from text offset:",m),null}}return null},eN=e=>{e.querySelectorAll("ul, ol").forEach(o=>{const r=o;Array.from(r.querySelectorAll("li")).forEach(s=>{var l;((l=s.textContent)==null?void 0:l.trim())||Array.from(s.childNodes).some(d=>{var c;return d.nodeType===Node.ELEMENT_NODE||d.nodeType===Node.TEXT_NODE&&((c=d.textContent)==null?void 0:c.trim())})||s.remove()})})},Jg=({id:e,content:t,style:o,onUpdate:r})=>{var ne;const n=vi(),{updateComponent:s}=Te(),{updateBlockComponent:a}=Ye(),{canvasTextEditorRef:l,currentSelection:d,getCanvasEditor:c,restoreSelection:u}=$o(),[p,m]=S.useState("content"),[f,b]=S.useState(!1),[h,g]=S.useState("Smileys & People"),[x,C]=S.useState(!1),[k,v]=S.useState(!1),[A,w]=S.useState({bold:!1,italic:!1,underline:!1,strikethrough:!1,superscript:!1,subscript:!1,textAlign:"left",fontFamily:(o==null?void 0:o.fontFamily)||"inherit",fontSize:(o==null?void 0:o.fontSize)||12,color:(o==null?void 0:o.color)||"#000000",hiliteColor:(o==null?void 0:o.hiliteColor)||"transparent",backgroundColor:(o==null?void 0:o.backgroundColor)||"transparent"}),y=S.useRef(null),E=()=>{var ae,oe,G;if(d!=null&&d.componentId){const Q=c(d.componentId);if((ae=Q==null?void 0:Q.editorRef)!=null&&ae.current)return Q.editorRef.current}return((G=(oe=l.current)==null?void 0:oe.editorRef)==null?void 0:G.current)||null},j=(ae=[])=>{const oe=()=>(u(),window.getSelection());let G=window.getSelection();if((!G||G.rangeCount===0)&&(G=oe()),G&&G.rangeCount>0&&ae.length>0){const Q=G.getRangeAt(0);ae.some(T=>T&&(T===Q.commonAncestorContainer||T.contains(Q.commonAncestorContainer)))||(G=oe())}return G&&G.rangeCount>0?G:null},B=(ae,oe)=>{var Q;const G=ae.cloneRange();if(G.startContainer===oe&&G.collapsed&&oe.childNodes.length){const J=document.createRange();if(J.selectNodeContents(oe),J.collapse(!1),J.endContainer===oe){const T=document.createTreeWalker(oe,NodeFilter.SHOW_TEXT,null);let X=null,H;for(;H=T.nextNode();)H.nodeType===Node.TEXT_NODE&&(X=H);if(X)G.setStart(X,((Q=X.textContent)==null?void 0:Q.length)??0);else{const D=document.createTextNode("");oe.appendChild(D),G.setStart(D,0)}}else G.setStart(J.endContainer,J.endOffset);G.collapse(!0)}return G},$=(ae,oe,G)=>{oe.deleteContents(),oe.insertNode(G),oe.setStartAfter(G),oe.setEndAfter(G),ae.removeAllRanges(),ae.addRange(oe)},_=(ae,oe,G)=>{let Q=ae,J=G;if((d==null?void 0:d.componentId)===e&&(d==null?void 0:d.isCanvas)&&(d!=null&&d.range)){Q=d.range.cloneRange();const X=window.getSelection();X==null||X.removeAllRanges(),X==null||X.addRange(Q),X&&X.rangeCount>0&&(J=X)}return{range:B(Q,oe),selection:J}};S.useEffect(()=>{p==="content"&&setTimeout(()=>{const ae=(d==null?void 0:d.isCanvas)===!0,oe=document.activeElement,G=(oe==null?void 0:oe.classList.contains("rsp-text-typing-block"))&&(oe==null?void 0:oe.closest(".email-text-content"));!ae&&!G&&z()},0)},[e,p,d]),S.useEffect(()=>{o!=null&&o._targetGroupId&&p==="content"&&setTimeout(()=>{const ae=(d==null?void 0:d.isCanvas)===!0,oe=document.activeElement,G=(oe==null?void 0:oe.classList.contains("rsp-text-typing-block"))&&(oe==null?void 0:oe.closest(".email-text-content"));!ae&&!G&&z()},0)},[o==null?void 0:o._targetGroupId,p,d]);const z=()=>{var ae;if((ae=y.current)!=null&&ae.editorRef.current){const oe=y.current.editorRef.current;oe.focus();const G=document.createRange(),Q=window.getSelection();G.selectNodeContents(oe),G.collapse(!1),Q==null||Q.removeAllRanges(),Q==null||Q.addRange(G)}},N=ae=>{if(r){r(ae);return}const oe=document.querySelector(`[data-component-id="${e}"]`),G=oe==null?void 0:oe.getAttribute("data-parent-id"),Q=oe==null?void 0:oe.getAttribute("data-column-index");G&&Q?a(G,e,ae):s(e,ae)},O=ae=>{N({content:ae})},K=(ae,oe)=>{N(typeof ae=="string"?{style:{...o,[ae]:oe}}:{style:{...o,...ae}})},F=ae=>{N({style:{...o,...ae}})},q=ae=>{const oe=y.current;if(!(oe!=null&&oe.editorRef.current))return;const G=window.getSelection();if(!(G!=null&&G.rangeCount))return;const Q=G.getRangeAt(0);if(oe.editorRef.current.contains(Q.commonAncestorContainer)){const T=Q,X=oe.editorRef.current;try{T.collapsed?R(T,ae,G):ee(T,ae,G,X),X&&(eN(X),O(X.innerHTML))}catch(H){console.error("Error creating link:",H),Y(ae,G,X)}G.removeAllRanges(),v(!1)}},R=(ae,oe,G)=>{const Q=document.createElement("a");Q.href=oe.url,Q.title=oe.title,Q.target=oe.target,Q.textContent=oe.displayText,Q.setAttribute("data-type",oe.type),ae.insertNode(Q),ae.setStartAfter(Q),ae.collapse(!0),G.removeAllRanges(),G.addRange(ae)},M=(ae,oe)=>{Array.from(oe.querySelectorAll("a")).filter(J=>ae.intersectsNode(J)).forEach(J=>{var X;const T=document.createDocumentFragment();for(;J.firstChild;)T.appendChild(J.firstChild);(X=J.parentNode)==null||X.replaceChild(T,J)})},L=(ae,oe,G)=>{const Q=ae.extractContents(),J=document.createElement("a");J.href=oe.url,J.title=oe.title,J.target=oe.target,J.setAttribute("data-type",oe.type),J.appendChild(Q),ae.insertNode(J);const T=document.createRange();T.selectNodeContents(J),G.removeAllRanges(),G.addRange(T)},U=(ae,oe,G)=>{const J=(G.textContent||"").indexOf(ae);if(J!==-1){const T=Yg(J,J+ae.length,G);if(T){const X=T.extractContents(),H=document.createElement("a");H.href=oe.url,H.title=oe.title,H.target=oe.target,H.setAttribute("data-type",oe.type),H.appendChild(X),T.insertNode(H)}}},ee=(ae,oe,G,Q)=>{const J=G.toString(),T=Kg(ae.startContainer,ae.startOffset,Q),X=Kg(ae.endContainer,ae.endOffset,Q);M(ae,Q);const H=Yg(T,X,Q);H&&H.toString()===J?L(H,oe,G):U(J,oe,Q)},Y=(ae,oe,G)=>{const Q=oe.toString();if(Q&&G){const J=G.innerHTML,T=`<a href="${ae.url}" title="${ae.title}" target="${ae.target}" data-type="${ae.type}">${ae.displayText}</a>`,X=J.replace(Q,T);G.innerHTML=X,O(X)}},te=ae=>{var V,Z,P,re,se,le,xe,Ce,je,ye;const oe=y.current;if(!(oe!=null&&oe.editorRef.current))return;const G=E(),Q=[oe.editorRef.current,G].filter(Ne=>!!Ne),J=j(Q);if(!(J!=null&&J.rangeCount))return;const T=J.getRangeAt(0).cloneRange(),X=(d==null?void 0:d.componentId)===e,H=(d==null?void 0:d.isCanvas)&&X,D=oe.editorRef.current.contains(T.commonAncestorContainer);if((((G==null?void 0:G.contains(T.commonAncestorContainer))??!1)&&!!G||H&&!!G)&&G){const{range:Ne,selection:_e}=_(((V=d==null?void 0:d.range)==null?void 0:V.cloneRange())??T,G,J),Re=Ne.commonAncestorContainer.nodeType===Node.TEXT_NODE?(Z=Ne.commonAncestorContainer.parentElement)==null?void 0:Z.closest("a"):(P=Ne.commonAncestorContainer)==null?void 0:P.closest("a"),Be=document.createTextNode(ae);if(Re){(re=Re.parentNode)==null||re.insertBefore(Be,Re.nextSibling);const ve=document.createRange();ve.setStartAfter(Be),ve.collapse(!0),_e.removeAllRanges(),_e.addRange(ve)}else $(_e,Ne,Be);G&&N({content:G.innerHTML})}else if(D){const Ne=oe.editorRef.current,_e=T.cloneRange(),Re=Ne.firstChild;if(Re&&Re.nodeType===Node.ELEMENT_NODE&&Re.tagName==="P"){const pe=Re,be=pe.childNodes.length===1&&((se=pe.firstChild)==null?void 0:se.nodeType)===Node.ELEMENT_NODE&&pe.firstChild.tagName==="BR";(((le=pe.textContent)==null?void 0:le.trim())===""||be)&&(_e.startContainer===Ne||pe.contains(_e.startContainer))&&(be&&(pe.innerHTML=""),_e.setStart(pe,0),_e.collapse(!0))}if(_e.startContainer===Ne&&_e.collapsed){const pe=document.createRange();pe.selectNodeContents(Ne),pe.collapse(!1);const be=pe.endContainer,ke=pe.endOffset;if(be.nodeType===Node.TEXT_NODE)_e.setStart(be,ke),_e.collapse(!0);else{const de=document.createTreeWalker(Ne,NodeFilter.SHOW_TEXT,null);let ce=null,me;for(;me=de.nextNode();)me.nodeType===Node.TEXT_NODE&&(ce=me);if(ce&&ce.textContent)_e.setStart(ce,ce.textContent.length),_e.collapse(!0);else{const Ae=Ne.lastChild;if(Ae){if(Ae.nodeType===Node.TEXT_NODE)_e.setStart(Ae,(Ae.textContent||"").length),_e.collapse(!0);else if(Ae.nodeType===Node.ELEMENT_NODE&&Ae.tagName==="P"){const Ee=Ae,Oe=Ee.childNodes.length;Ee.childNodes.length===1&&((xe=Ee.firstChild)==null?void 0:xe.nodeType)===Node.ELEMENT_NODE&&Ee.firstChild.tagName==="BR"?(Ee.innerHTML="",_e.setStart(Ee,0)):_e.setStart(Ee,Oe),_e.collapse(!0)}else if(Ae.nodeType===Node.ELEMENT_NODE){let Ee=Ae;for(;Ee.nodeType===Node.ELEMENT_NODE&&Ee.lastChild;)Ee=Ee.lastChild;Ee.nodeType===Node.TEXT_NODE?_e.setStart(Ee,(Ee.data||"").length):_e.setStart(Ee,Ee.childNodes.length),_e.collapse(!0)}}}}}const Be=_e.commonAncestorContainer.nodeType===Node.TEXT_NODE?(Ce=_e.commonAncestorContainer.parentElement)==null?void 0:Ce.closest("a"):(je=_e.commonAncestorContainer)==null?void 0:je.closest("a"),ve=document.createTextNode(ae);if(Be){(ye=Be.parentNode)==null||ye.insertBefore(ve,Be.nextSibling);const pe=document.createRange();pe.setStartAfter(ve),pe.collapse(!0),J.removeAllRanges(),J.addRange(pe)}else $(J,_e,ve);oe.handleInput?oe.handleInput():O(oe.editorRef.current.innerHTML)}b(!1)},ie=ae=>{var re,se,le,xe,Ce,je;const oe=y.current,G=((re=oe==null?void 0:oe.editorRef)==null?void 0:re.current)||null,Q=E(),J=[G,Q].filter(ye=>!!ye),T=j(J);if(!(T!=null&&T.rangeCount)){n.handleClose();return}const X=T.getRangeAt(0).cloneRange(),H=(d==null?void 0:d.componentId)===e,D=(d==null?void 0:d.isCanvas)&&H,W=(G==null?void 0:G.contains(X.commonAncestorContainer))??!1,V=((Q==null?void 0:Q.contains(X.commonAncestorContainer))??!1)&&!!Q||D&&!!Q,Z=W&&!!G||!(d!=null&&d.isCanvas)&&!!G;if(!V&&!Z){n.handleClose();return}const P=(ye,Ne,_e,Re)=>{var Be;if(Re){(Be=Re.parentNode)==null||Be.insertBefore(_e,Re.nextSibling);const ve=document.createRange();ve.setStartAfter(_e),ve.collapse(!0),ye.removeAllRanges(),ye.addRange(ve)}else $(ye,Ne,_e)};if(V&&Q){const{range:ye,selection:Ne}=_(((se=d==null?void 0:d.range)==null?void 0:se.cloneRange())??X,Q,T),_e=ye.commonAncestorContainer.nodeType===Node.TEXT_NODE?(le=ye.commonAncestorContainer.parentElement)==null?void 0:le.closest("a"):(xe=ye.commonAncestorContainer)==null?void 0:xe.closest("a"),Re=document.createTextNode(ae);P(Ne,ye,Re,_e??null),N({content:Q.innerHTML})}else if(Z&&G){const ye=X.commonAncestorContainer.nodeType===Node.TEXT_NODE?(Ce=X.commonAncestorContainer.parentElement)==null?void 0:Ce.closest("a"):(je=X.commonAncestorContainer)==null?void 0:je.closest("a"),Ne=document.createTextNode(ae);P(T,X,Ne,ye??null),oe!=null&&oe.handleInput?oe.handleInput():O(G.innerHTML)}n.handleClose()},ue=()=>{var ae,oe,G,Q;switch(p){case"content":return i.jsxs("div",{children:[i.jsx(Vg,{formatState:A,style:o||{},onFormatClick:(J,T)=>{var X,H;y.current&&((H=(X=y.current).execCommand)==null||H.call(X,J,T))},onStyleChange:K,onFontSizeChange:J=>K("fontSize",J),onFontFamilyChange:J=>K("fontFamily",J),textEditorRef:y,onPickerActive:J=>{var T;(T=y.current)!=null&&T.setColorPickerActive&&y.current.setColorPickerActive(J)},onShowEmojiPopover:()=>b(!0),onShowPersonalizationPopover:n.handleOpen,onShowLinkModal:()=>v(!0),canEditLink:((ae=y.current)==null?void 0:ae.canEditLink)||!1,canUnlink:((oe=y.current)==null?void 0:oe.canUnlink)||!1,disabledEmoji:((G=y.current)==null?void 0:G.disabledEmoji)||!0,showPersonalization:((Q=Te.getState().pConfig)==null?void 0:Q.isPersonalization)||!1}),i.jsx(Gg,{style:o||{},onStyleChange:K,onAllPaddingStyleChange:F})]});case"style":return i.jsx(Hg,{style:o||{},onStyleChange:K});case"spacing":return i.jsx(ao,{label:"Padding",id:"padding-control",marginSection:!1,paddingSection:!0,padding:o==null?void 0:o.paddingControl,onChange:J=>{F({paddingControl:J})}});default:return null}};return i.jsxs("div",{className:"space-y-6",children:[i.jsx(Kc,{activeTab:p,onTabChange:m}),ue(),i.jsx(bi,{isOpen:f,onClose:()=>b(!1),selectedCategory:h,onCategoryChange:g,onEmojiSelect:te}),i.jsx(qg,{isOpen:n.isOpen,onClose:n.handleClose,onTagSelect:ie,position:n.position}),i.jsx(Xg,{isOpen:x,onClose:()=>C(!1),initialContent:t,onGenerate:ae=>{O(ae),C(!1)}}),i.jsx(Ci,{isOpen:k,onClose:()=>v(!1),onSave:q,selectedText:((ne=window.getSelection())==null?void 0:ne.toString())||"",editorRef:y})]})},tN=({activeTab:e,onTabChange:t})=>i.jsxs("div",{className:"rsp-tab flex border-b border-gray-200",children:[i.jsx("button",{onClick:()=>t("content"),className:`w-full px-4 py-2 text-md -mb-px ${e==="content"?"active color-primary-blue":"inactive color-secondary-black"}`,children:"Content"}),i.jsx("button",{onClick:()=>t("style"),className:`w-full px-4 py-2 text-md -mb-px ${e==="style"?"active color-primary-blue":"inactive color-secondary-black"}`,children:"Style"}),i.jsx("button",{onClick:()=>t("action"),className:`w-full px-4 py-2 text-md -mb-px ${e==="action"?"active color-primary-blue":"inactive color-secondary-black"}`,children:"Action"})]}),Yc=({style:e,onStyleChange:t})=>i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{className:"rsp-property-elements-block rsp-select-dropdown flex items-center justify-between",children:[i.jsx("label",{className:"rsp-properties-lable block text-md color-primary-black",children:"Align"}),i.jsxs("div",{className:"flex items-center gap-1",children:[i.jsx(Ie,{text:"Left",position:"top",className:"line-block",children:i.jsx("button",{onClick:()=>t("iconPosition","left"),className:`p-1.5 rounded ${e.iconPosition==="left"?"bg-primary-blue text-white":"bg-tertiary-blue"}`,children:i.jsx(_o,{className:"w-4 h-4"})})}),i.jsx(Ie,{text:"Right",position:"top",className:"line-block",children:i.jsx("button",{onClick:()=>t("iconPosition","right"),className:`p-1.5 rounded ${e.iconPosition==="right"?"bg-primary-blue text-white":"bg-tertiary-blue"}`,children:i.jsx(Ro,{className:"w-4 h-4"})})})]})]}),i.jsx("div",{children:i.jsx(et,{label:"Icon spacing",mainClass:"button-control-view",onClick:()=>{},onChange:o=>t("iconIndent",o),min:5,max:50,step:2,defaultValue:e.iconIndent||8})}),i.jsx("div",{children:i.jsx(et,{label:"Icon size",mainClass:"button-control-view",onClick:()=>{},onChange:o=>t("iconSize",o),min:16,max:64,step:2,defaultValue:e.iconSize||16})})]}),us=({content:e,style:t,onContentChange:o})=>{const[r,n]=S.useState(!1),[s,a]=S.useState((e==null?void 0:e.imageUrl)||(t==null?void 0:t.iconUrl)||""),[l,d]=S.useState(""),{pConfig:c}=Te(),[u,p]=S.useState(!1),[m,f]=S.useState("upload");S.useEffect(()=>{d("")},[]),S.useEffect(()=>{const A=(e==null?void 0:e.imageUrl)||(t==null?void 0:t.iconUrl)||"";a(A),d("")},[e==null?void 0:e.imageUrl,t==null?void 0:t.iconUrl]);const b=A=>new Promise(w=>{const y=new Image;y.crossOrigin="anonymous",y.onload=()=>{w({hasCorsIssue:!1,isValid:!0})},y.onerror=()=>{const E=new Image;E.onload=()=>{w({hasCorsIssue:!0,isValid:!0})},E.onerror=()=>{w({hasCorsIssue:!1,isValid:!1})},E.src=A},y.src=A}),h=async A=>{try{const w={id:ot(),name:`image_${Date.now()}.jpg`,uploadedAt:new Date().toISOString(),uploadURL:A,isFav:!1,groupName:"",url:"",size:0},y=await c.imageCallback(2,w);if(y&&y.status&&y.data){const E=JSON.parse(y.data);E.url&&o({imageUrl:E.url}),d("")}else d("Failed to upload image to server")}catch(w){const y=w instanceof Error?w.message:"Unknown error";d(`Failed to process image from URL: ${y}`)}},g=async()=>{if(!s.trim()){d("Please enter an image URL");return}if(s.startsWith("data:")){d("Data URLs are not allowed. Please enter a valid image URL.");return}if(!/^[a-zA-Z]+:\/\/[^\s"'<>]+$/.test(s)){d("The URL contains spaces or invalid characters.");return}try{new URL(s)}catch{d("Please enter a valid URL");return}const{hasCorsIssue:w,isValid:y}=await b(s);if(!y){d("The URL does not point to a valid image");return}if(w){await h(s);return}d(""),o({imageUrl:s})},x=()=>{t.iconUrl?o({imageUrl:""}):o({imageUrl:""}),a(""),d("")},C=async()=>{try{await navigator.clipboard.writeText(e.imageUrl||t.iconUrl||""),p(!0),setTimeout(()=>p(!1),1e3)}catch(A){console.error("Failed to copy code:",A)}},k=A=>{if(!A)return{fileName:null,extension:null};const w=A.split("?")[0].split("#")[0],y=w==null?void 0:w.split("/").pop();if(!y)return{fileName:null,extension:null};const E=y.split("."),j=E.pop(),B=E.join(".");return{fileName:(B==null?void 0:B.trim())||"No name",extension:j}},v=A=>{const{fileName:w,extension:y}=k(A);return!w||!y?null:i.jsxs(i.Fragment,{children:[w.length>25?i.jsx(Ie,{text:w,position:"top",children:i.jsx("span",{className:"text-md max-w-[200px] overflow-hidden text-ellipsis whitespace-nowrap inline-block lh20",children:w})}):i.jsx("span",{className:"text-md max-w-[200px] overflow-hidden text-ellipsis whitespace-nowrap inline-block lh20",children:w}),i.jsxs("small",{className:"text-sm color-primary-grey marginT-2",children:[".",y]})]})};return i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{className:"rsp-tab flex border-b border-gray-200 marginT20",children:[i.jsx("button",{onClick:()=>f("upload"),className:`w-full px-4 py-2 text-md -mb-px ${m==="upload"?"active color-primary-blue":"inactive color-secondary-black"}`,children:"Upload"}),i.jsx("button",{onClick:()=>f("url"),className:`w-full px-4 py-2 text-md -mb-px ${m==="url"?"active color-primary-blue":"inactive color-secondary-black"}`,children:"Direct URL"})]}),m==="upload"&&i.jsxs(i.Fragment,{children:[(e.imageUrl||t.iconUrl)&&i.jsxs("div",{className:"image-preview-section gap-2 marginT20",children:[i.jsxs("div",{className:"flex align-center gap-2 flex-1",children:[i.jsx("div",{className:"image-preview-container",children:i.jsx("img",{src:(e==null?void 0:e.imageUrl)||t.iconUrl,alt:"Preview",className:"w-full h-32 object-cover"})}),i.jsx("div",{className:"flex flex-col items-start justify-center",children:v((e==null?void 0:e.imageUrl)||t.iconUrl)})]}),i.jsx(Ie,{text:u?"Copied":"Copy URL",position:"top",children:i.jsx(ut,{size:"md",icon:u?un:fi,color:u?"color-primary-green":"color-primary-blue",callBack:()=>{C()}})}),i.jsx(Ie,{text:"Remove",position:"top",children:i.jsx(ut,{size:"md",icon:Lr,callBack:e.imageUrl||t.iconUrl?x:g})})]}),i.jsx("div",{className:"flex justify-between space-x-2 marginT20",children:i.jsx("button",{onClick:()=>n(!0),className:"rsp-image-upload-properties flex items-center space-x-2 px-4 paddingY15 border rounded hover:bg-gray-50 flex-1",children:i.jsxs("div",{className:"flex flex-col items-center",children:[i.jsx("h3",{children:"Click here to upload image"}),i.jsx("span",{children:"Not more than 2MB"}),i.jsx("small",{children:".png, .jpg, .jpeg, .gif only"})]})})})]}),m==="url"&&i.jsxs(i.Fragment,{children:[(e.imageUrl||t.iconUrl)&&i.jsxs("div",{className:"image-preview-section gap-2 marginT20",children:[i.jsxs("div",{className:"flex align-center gap-2 flex-1",children:[i.jsx("div",{className:"image-preview-container",children:i.jsx("img",{src:(e==null?void 0:e.imageUrl)||t.iconUrl,alt:"Preview",className:"w-full h-32 object-cover"})}),i.jsx("div",{className:"flex flex-col items-start justify-center",children:v((e==null?void 0:e.imageUrl)||t.iconUrl)})]}),i.jsx(Ie,{text:u?"Copied":"Copy URL",position:"top",children:i.jsx(ut,{size:"md",icon:u?un:fi,color:u?"color-primary-green":"color-primary-blue",callBack:()=>{C()}})}),i.jsx(Ie,{text:"Remove",position:"top",children:i.jsx(ut,{size:"md",icon:Lr,callBack:e.imageUrl||t.iconUrl?x:g})})]}),i.jsxs("div",{className:"mt0 flex gap-2 align-items-end marginT20",children:[i.jsx(jt,{name:"imageUrl",classWrapper:"rsp-btninput marginT6",id:"rs_AudienceScore_Industry",placeholder:"Image URL",defaultValue:"Banking",value:s,onChange:A=>{a(A),d("")},required:!0}),e.imageUrl||t.iconUrl?i.jsx(i.Fragment,{}):s.length>0&&i.jsx("button",{onClick:e.imageUrl||t.iconUrl?x:g,className:`rsp-imageurl-button px-3 py-1 text-white rounded ${e.imageUrl||t.iconUrl?"bg-red-600 hover:bg-red-700":"bg-primary-btn hover:bg-blue-600"}`,children:e.imageUrl||t.iconUrl?"Remove":"Import"})]})]}),l&&i.jsxs("div",{className:"flex items-center text-red-500 text-sm gap-1 marginT5",children:[i.jsx(Kt,{className:"w-4 h-4 mr-1"}),l]}),i.jsx(zn,{isOpen:r,onClose:()=>n(!1),onSelect:A=>{o({imageUrl:A}),a(A),d("")},allowAllFiles:!1})]})},oN=({content:e,style:t,onContentChange:o,onStyleChange:r})=>{var v,A;const{pConfig:n}=Te(),[s,a]=S.useState(""),[l,d]=S.useState(""),[c,u]=S.useState((t==null?void 0:t.showIcon)||!1),[p,m]=S.useState(!1),[f,b]=S.useState(""),h="Button",g=(A=(v=n==null?void 0:n.templateDetails)==null?void 0:v.offerdetails)==null?void 0:A.previewData;S.useEffect(()=>{g&&e===g?(m(!0),b("")):g&&e!==g&&b(e)},[g,e]),S.useEffect(()=>{!p&&g&&e!==g&&b(e)},[e,p,g]),S.useEffect(()=>{u((t==null?void 0:t.showIcon)||!1)},[t==null?void 0:t.showIcon]),S.useEffect(()=>{g&&(e===g?p||m(!0):p&&m(!1))},[e,g,p]);const x=w=>{(w==null?void 0:w.imageUrl)!==void 0&&r("iconUrl",w.imageUrl),(w==null?void 0:w.imageAlt)!==void 0&&r("iconAlt",w.imageAlt)},C=()=>{g&&typeof g=="string"&&g.trim()!==""&&(b(e||""),o(g),m(!0))},k=()=>{o(h),m(!1)};return i.jsxs("div",{className:"space-y-4",children:[g&&i.jsxs("div",{className:"rsp-property-elements-block flex items-baseline justify-between",children:[i.jsx("label",{className:"rsp-properties-lable block text-sm color-primary-black w-[150px]",children:"Offer Code"}),i.jsx("button",{type:"button",className:`rsp-button-primary rsp-button-save paddingX15 fs17 ${p?"click-off":""}`,onClick:C,disabled:p,children:"Insert Code"})]}),i.jsxs("div",{className:"rsp-property-elements-block flex items-baseline justify-between",children:[i.jsx("label",{className:"rsp-properties-lable block text-sm color-primary-black w-[150px]",children:"Button text"}),i.jsxs("div",{className:"flex items-center gap-2 flex-1",children:[i.jsx(jt,{classWrapper:"marginT15 flex-1",id:"rs_AudienceScore_Industry",placeholder:"Button text",defaultValue:"Banking",value:e,handleOnchange:w=>o(w.target.value),maxLength:50,required:!0,disabled:g&&p}),g&&i.jsx(Ie,{text:"Reset",position:"top",children:i.jsx("button",{type:"button",className:`p-2 rounded ${p?"bg-primary-blue color-white cursor-pointer":"bg-gray-300 color-gray-500 cursor-not-allowed"}`,onClick:k,disabled:!p,children:i.jsx(Md,{className:"w-4 h-4"})})})]})]}),i.jsxs("div",{className:"rsp-property-elements-block space-y-4",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("label",{className:"rsp-properties-lable block text-sm color-primary-black",children:"Button icon"}),i.jsx(At,{id:"button-icon",isChecked:c,onToggle:w=>{u(w),w?r("showIcon",w):r("actionUpdates",{showIcon:w,iconUrl:""})}})]}),c&&i.jsxs(i.Fragment,{children:[i.jsx(us,{content:e,style:t,onContentChange:x}),i.jsx("div",{className:"marginT30 marginB25",children:i.jsx("div",{className:"flex items-center gap-1",children:i.jsx(jt,{placeholder:"Alternative Text",defaultValue:"Banking",value:(t==null?void 0:t.iconAltText)||"",required:!0,onChange:w=>{r("iconAltText",w),d(w)}})})})]}),c&&i.jsx("div",{className:"rsp-icons-button-properties space-y-4 p-4 bg-gray-50 rounded-lg",children:i.jsx(Yc,{style:t,onStyleChange:r})})]}),i.jsxs("div",{className:"space-y-4",children:[i.jsx("div",{className:"rsp-property-elements-block space-y-4",children:i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("label",{className:"rsp-properties-lable block text-sm color-primary-black",children:"Full width"}),i.jsx(At,{id:"button-full-width",isChecked:(t==null?void 0:t.fullWidth)||!1,onToggle:w=>{const y=(t==null?void 0:t.paddingControl)||{},E=13,j={...y,left:E,right:E,isCustomPadding:!0};r("actionUpdates",{fullWidth:w,paddingControl:j})}})]})}),!(t!=null&&t.fullWidth)&&i.jsxs("div",{className:"rsp-select-dropdown flex items-center justify-between",children:[i.jsx("label",{className:"rsp-properties-lable block text-sm color-primary-black",children:"Align"}),i.jsxs("div",{className:"flex items-center gap-1",children:[i.jsx(Ie,{text:"Left",position:"top",className:"line-block",children:i.jsx("button",{onClick:()=>r("textAlign","left"),className:`p-1.5 rounded ${t.textAlign==="left"?"bg-primary-blue color-white":"bg-tertiary-blue"}`,children:i.jsx(_o,{className:"w-4 h-4"})})}),i.jsx(Ie,{text:"Center",position:"top",className:"line-block",children:i.jsx("button",{onClick:()=>r("textAlign","center"),className:`p-1.5 rounded ${t.textAlign==="center"?"bg-primary-blue color-white":"bg-tertiary-blue"}`,children:i.jsx(Xo,{className:"w-4 h-4"})})}),i.jsx(Ie,{text:"Right",position:"top",className:"line-block",children:i.jsx("button",{onClick:()=>r("textAlign","right"),className:`p-1.5 rounded ${t.textAlign==="right"?"bg-primary-blue color-white":"bg-tertiary-blue"}`,children:i.jsx(Ro,{className:"w-4 h-4"})})})]})]})]})]})},Jc=({style:e,onStyleChange:t,id:o})=>{const[r,n]=S.useState("none"),s=a=>{n(a),t("buttonCustomBorder",a==="custom")};return i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{className:"flex items-center justify-between marginB20",children:[i.jsx("label",{className:"rsp-properties-lable block text-md color-primary-black",children:"Border"}),i.jsxs("div",{className:"flex items-center justify-between gap-2 rsp-btn-group rsp-border-two",children:[i.jsx("button",{className:`border-2 padding2 rounded flex items-center justify-center rsp-btn-set ${e!=null&&e.buttonCustomBorder?"border-quaternary-blue inactive":"border-primary-green active"}`,title:"Radius for All Corners",onClick:()=>{s("none"),t("buttonCustomBorder",!1)},children:i.jsx(Dg,{})}),i.jsx("button",{className:`border-2 padding2 rounded flex items-center justify-center rsp-btn-set ${e!=null&&e.buttonCustomBorder?"border-primary-green active":"border-quaternary-blue inactive"}`,title:"Radius per Corner",onClick:()=>{s("custom"),t("buttonCustomBorder",!0)},children:i.jsx(Pg,{})})]})]}),!(e!=null&&e.buttonCustomBorder)&&i.jsx("div",{className:"rsp-property-elements-block",children:i.jsx(dt,{label:"",style:{width:(e==null?void 0:e.buttonBorderWidth)||0,style:(e==null?void 0:e.buttonBorderStyle)||"solid",color:(e==null?void 0:e.buttonBorderColor)||"#000000",min:0,max:5},onStyleChange:(a,l)=>{switch(a){case"width":t("buttonBorderWidth",l);break;case"style":t("buttonBorderStyle",l);break;case"color":t("buttonBorderColor",l);break}}})}),i.jsxs("div",{className:"hidden",children:[(e==null?void 0:e.buttonCustomBorder)&&i.jsx("div",{className:"rsp-property-elements-block space-y-4",children:i.jsxs("div",{id:"rsp-custom-border-stepper-container",className:"space-y-4 dymond-column-set border-ss",children:[i.jsx(dt,{mainClass:"rsp-dynamic-btn padding-top-left",label:"",widthProps:!0,colorProps:!1,solidProps:!1,style:{width:(e==null?void 0:e.buttonBorderTopWidth)||0,style:(e==null?void 0:e.buttonBorderTopStyle)||"solid",color:(e==null?void 0:e.buttonBorderTopColor)||"#000000",min:0,max:5},onStyleChange:(a,l)=>{switch(a){case"width":t("buttonBorderTopWidth",l);break;case"style":t("buttonBorderTopStyle",l);break;case"color":t("buttonBorderTopColor",l);break}}}),i.jsx(dt,{mainClass:"rsp-dynamic-btn padding-bottom-left",label:"",widthProps:!0,colorProps:!1,solidProps:!1,style:{width:(e==null?void 0:e.buttonBorderLeftWidth)||0,style:(e==null?void 0:e.buttonBorderLeftStyle)||"solid",color:(e==null?void 0:e.buttonBorderLeftColor)||"#000000",min:0,max:5},onStyleChange:(a,l)=>{switch(a){case"width":t("buttonBorderLeftWidth",l);break;case"style":t("buttonBorderLeftStyle",l);break;case"color":t("buttonBorderLeftColor",l);break}}}),i.jsx("div",{className:"rsp-dynamic-btn"}),i.jsx(dt,{mainClass:"rsp-dynamic-btn padding-top-right",label:"",widthProps:!0,colorProps:!1,solidProps:!1,style:{width:(e==null?void 0:e.buttonBorderRightWidth)||0,style:(e==null?void 0:e.buttonBorderRightStyle)||"solid",color:(e==null?void 0:e.buttonBorderRightColor)||"#000000",min:0,max:5},onStyleChange:(a,l)=>{switch(a){case"width":t("buttonBorderRightWidth",l);break;case"style":t("buttonBorderRightStyle",l);break;case"color":t("buttonBorderRightColor",l);break}}}),i.jsx(dt,{mainClass:"rsp-dynamic-btn padding-bottom-right",label:"",widthProps:!0,colorProps:!1,solidProps:!1,style:{width:(e==null?void 0:e.buttonBorderBottomWidth)||0,style:(e==null?void 0:e.buttonBorderBottomStyle)||"solid",color:(e==null?void 0:e.buttonBorderBottomColor)||"#000000",min:0,max:5},onStyleChange:(a,l)=>{switch(a){case"width":t("buttonBorderBottomWidth",l);break;case"style":t("buttonBorderBottomStyle",l);break;case"color":t("buttonBorderBottomColor",l);break}}})]})}),(e==null?void 0:e.buttonCustomBorder)&&((e==null?void 0:e.buttonBorderTopWidth)||(e==null?void 0:e.buttonBorderLeftWidth)||(e==null?void 0:e.buttonBorderRightWidth)||(e==null?void 0:e.buttonBorderBottomWidth))&&i.jsx("div",{className:"rsp-property-elements-block",children:i.jsxs("div",{id:"rsp-custom-border-stepper-container",className:"space-y-4 dymond-column-set border-pp",children:[i.jsx(dt,{mainClass:"rsp-dynamic-btn padding-top-left",label:"",widthProps:!1,colorProps:!0,solidProps:!1,style:{width:(e==null?void 0:e.buttonBorderTopWidth)||0,style:(e==null?void 0:e.buttonBorderTopStyle)||"solid",color:(e==null?void 0:e.buttonBorderTopColor)||"#000000",min:0,max:5},onStyleChange:(a,l)=>{switch(a){case"width":t("buttonBorderTopWidth",l);break;case"style":t("buttonBorderTopStyle",l);break;case"color":t("buttonBorderTopColor",l);break}}}),i.jsx(dt,{mainClass:"rsp-dynamic-btn padding-bottom-left",label:"",widthProps:!1,colorProps:!0,solidProps:!1,style:{width:(e==null?void 0:e.buttonBorderLeftWidth)||0,style:(e==null?void 0:e.buttonBorderLeftStyle)||"solid",color:(e==null?void 0:e.buttonBorderLeftColor)||"#000000",min:0,max:5},onStyleChange:(a,l)=>{switch(a){case"width":t("buttonBorderLeftWidth",l);break;case"style":t("buttonBorderLeftStyle",l);break;case"color":t("buttonBorderLeftColor",l);break}}}),i.jsx("div",{className:"rsp-dynamic-btn"}),i.jsx(dt,{mainClass:"rsp-dynamic-btn padding-top-right",label:"",widthProps:!1,colorProps:!0,solidProps:!1,style:{width:(e==null?void 0:e.buttonBorderRightWidth)||0,style:(e==null?void 0:e.buttonBorderRightStyle)||"solid",color:(e==null?void 0:e.buttonBorderRightColor)||"#000000",min:0,max:5},onStyleChange:(a,l)=>{switch(a){case"width":t("buttonBorderRightWidth",l);break;case"style":t("buttonBorderRightStyle",l);break;case"color":t("buttonBorderRightColor",l);break}}}),i.jsx(dt,{mainClass:"rsp-dynamic-btn padding-bottom-right",label:"",widthProps:!1,colorProps:!0,solidProps:!1,style:{width:(e==null?void 0:e.buttonBorderBottomWidth)||0,style:(e==null?void 0:e.buttonBorderBottomStyle)||"solid",color:(e==null?void 0:e.buttonBorderBottomColor)||"#000000",min:0,max:5},onStyleChange:(a,l)=>{switch(a){case"width":t("buttonBorderBottomWidth",l);break;case"style":t("buttonBorderBottomStyle",l);break;case"color":t("buttonBorderBottomColor",l);break}}})]})}),(e==null?void 0:e.buttonCustomBorder)&&((e==null?void 0:e.buttonBorderTopWidth)||(e==null?void 0:e.buttonBorderLeftWidth)||(e==null?void 0:e.buttonBorderRightWidth)||(e==null?void 0:e.buttonBorderBottomWidth))&&i.jsx("div",{className:"rsp-property-elements-block",children:i.jsxs("div",{id:"rsp-custom-border-stepper-container",className:"space-y-4 dymond-column-set border-ss",children:[i.jsx(dt,{mainClass:"rsp-dynamic-btn padding-top-left",label:"",widthProps:!1,colorProps:!1,solidProps:!0,style:{width:(e==null?void 0:e.buttonBorderTopWidth)||0,style:(e==null?void 0:e.buttonBorderTopStyle)||"solid",color:(e==null?void 0:e.buttonBorderTopColor)||"#000000",min:0,max:5},onStyleChange:(a,l)=>{switch(a){case"width":t("buttonBorderTopWidth",l);break;case"style":t("buttonBorderTopStyle",l);break;case"color":t("buttonBorderTopColor",l);break}}}),i.jsx(dt,{mainClass:"rsp-dynamic-btn padding-bottom-left",label:"",widthProps:!1,colorProps:!1,solidProps:!0,style:{width:(e==null?void 0:e.buttonBorderLeftWidth)||0,style:(e==null?void 0:e.buttonBorderLeftStyle)||"solid",color:(e==null?void 0:e.buttonBorderLeftColor)||"#000000",min:0,max:5},onStyleChange:(a,l)=>{switch(a){case"width":t("buttonBorderLeftWidth",l);break;case"style":t("buttonBorderLeftStyle",l);break;case"color":t("buttonBorderLeftColor",l);break}}}),i.jsx("div",{className:"rsp-dynamic-btn"}),i.jsx(dt,{mainClass:"rsp-dynamic-btn padding-top-right",label:"",widthProps:!1,colorProps:!1,solidProps:!0,style:{width:(e==null?void 0:e.buttonBorderRightWidth)||0,style:(e==null?void 0:e.buttonBorderRightStyle)||"solid",color:(e==null?void 0:e.buttonBorderRightColor)||"#000000",min:0,max:5},onStyleChange:(a,l)=>{switch(a){case"width":t("buttonBorderRightWidth",l);break;case"style":t("buttonBorderRightStyle",l);break;case"color":t("buttonBorderRightColor",l);break}}}),i.jsx(dt,{mainClass:"rsp-dynamic-btn padding-bottom-right ",label:"",widthProps:!1,colorProps:!1,solidProps:!0,style:{width:(e==null?void 0:e.buttonBorderBottomWidth)||0,style:(e==null?void 0:e.buttonBorderBottomStyle)||"solid",color:(e==null?void 0:e.buttonBorderBottomColor)||"#000000",min:0,max:5},onStyleChange:(a,l)=>{switch(a){case"width":t("buttonBorderBottomWidth",l);break;case"style":t("buttonBorderBottomStyle",l);break;case"color":t("buttonBorderBottomColor",l);break}}})]})})]}),(e==null?void 0:e.buttonCustomBorder)&&i.jsx("div",{className:"rsp-property-elements-block marginB20",children:i.jsxs("div",{id:"rsp-custom-border-stepper-container",className:"space-y-4 hiddens",children:[i.jsx(dt,{label:"Top",labelClass:"color-secondary-grey fs13",style:{width:(e==null?void 0:e.buttonBorderTopWidth)||0,style:(e==null?void 0:e.buttonBorderTopStyle)||"solid",color:(e==null?void 0:e.buttonBorderTopColor)||"#000000",min:0,max:5},onStyleChange:(a,l)=>{switch(a){case"width":t("buttonBorderTopWidth",l);break;case"style":t("buttonBorderTopStyle",l);break;case"color":t("buttonBorderTopColor",l);break}}}),i.jsx(dt,{label:"Right",labelClass:"color-secondary-grey fs13",style:{width:(e==null?void 0:e.buttonBorderRightWidth)||0,style:(e==null?void 0:e.buttonBorderRightStyle)||"solid",color:(e==null?void 0:e.buttonBorderRightColor)||"#000000",min:0,max:5},onStyleChange:(a,l)=>{switch(a){case"width":t("buttonBorderRightWidth",l);break;case"style":t("buttonBorderRightStyle",l);break;case"color":t("buttonBorderRightColor",l);break}}}),i.jsx(dt,{label:"Bottom",labelClass:"color-secondary-grey fs13",style:{width:(e==null?void 0:e.buttonBorderBottomWidth)||0,style:(e==null?void 0:e.buttonBorderBottomStyle)||"solid",color:(e==null?void 0:e.buttonBorderBottomColor)||"#000000",min:0,max:5},onStyleChange:(a,l)=>{switch(a){case"width":t("buttonBorderBottomWidth",l);break;case"style":t("buttonBorderBottomStyle",l);break;case"color":t("buttonBorderBottomColor",l);break}}}),i.jsx(dt,{label:"Left",labelClass:"color-secondary-grey fs13",style:{width:(e==null?void 0:e.buttonBorderLeftWidth)||0,style:(e==null?void 0:e.buttonBorderLeftStyle)||"solid",color:(e==null?void 0:e.buttonBorderLeftColor)||"#000000",min:0,max:5},onStyleChange:(a,l)=>{switch(a){case"width":t("buttonBorderLeftWidth",l);break;case"style":t("buttonBorderLeftStyle",l);break;case"color":t("buttonBorderLeftColor",l);break}}})]})})]})},rN=({style:e,onStyleChange:t})=>{const o=()=>{const a=(e==null?void 0:e.paddingControl)||{};return a.isCustomPadding?a.left||a.right||0:a.all||0},r=()=>{var a;return((a=e==null?void 0:e.paddingControl)==null?void 0:a.btnspanheight)??5};function n(a,l){const d=a*Math.pow(10,l+1),c=Math.floor(d/10);return d>=c*10+5?(c+1)/Math.pow(10,l):c/Math.pow(10,l)}const s=[{label:"Standard Fonts",options:_t.standard},{label:"Non standard Fonts",options:_t.decorative}];return i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"rsp-property-elements-block space-y-6",children:[i.jsxs("div",{className:"rsp-property-elements-block flex items-center justify-between",children:[i.jsx("label",{className:"rsp-properties-lable block text-md color-primary-black",children:"Container background"}),i.jsx("div",{className:"flex flex-col space-y-2",children:i.jsx(gt,{value:(e==null?void 0:e.containerBackgroundColor)||"#ffffff",onChange:a=>{t("containerBackgroundColor",a)},children:null})})]}),i.jsxs("div",{className:"rsp-property-elements-block flex items-center justify-between",children:[i.jsx("label",{className:" text-md color-primary-black",children:"Button background"}),i.jsx("div",{className:"flex flex-col space-y-2",children:i.jsx(gt,{value:(e==null?void 0:e.buttonColor)||"#ffffff",onChange:a=>{t("buttonColor",a)},children:null})})]}),i.jsx(Tt,{label:"Font family",width:"width170",value:e.fontFamily||"Arial, sans-serif",options:s,onChange:a=>t("fontFamily",a),previewFont:!0,isGrouped:!0}),i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("label",{className:"rsp-properties-lable block text-md color-primary-black",children:"Font size"}),i.jsx(et,{actionButton:!0,label:"",mainClass:"button-control-view",isShowLeftDescription:!1,leftDescription:"",buttonClass:"",labelClass:"",onClick:()=>{},onChange:a=>t("fontSize",a),min:11,max:72,step:1,defaultValue:e.fontSize||16})]}),i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("label",{className:"rsp-properties-lable block text-md color-primary-black",children:"Text color"}),i.jsx("div",{className:"flex flex-col space-y-2",children:i.jsx(gt,{alpha:!1,value:(e==null?void 0:e.buttonTextColor)||"#ffffff",onChange:a=>{t("buttonTextColor",a)},children:null})})]}),i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("label",{className:"rsp-properties-lable block text-md color-primary-black",children:"Text style"}),i.jsxs("div",{className:"flex space-x-2",children:[i.jsx(Ie,{text:"Bold",position:"top",className:"line-block",children:i.jsx("button",{onClick:()=>t("bold",!e.bold),className:`p-2 rounded ${e.bold?"bg-primary-blue color-white":"bg-tertiary-blue color-primary-black"}`,children:i.jsx(Ko,{className:"w-4 h-4"})})}),i.jsx(Ie,{text:"Italic",position:"top",className:"line-block",children:i.jsx("button",{onClick:()=>t("italic",!e.italic),className:`p-2 rounded ${e.italic?"bg-primary-blue color-white":"bg-tertiary-blue color-primary-black"}`,children:i.jsx(Yo,{className:"w-4 h-4"})})}),i.jsx(Ie,{text:"Underline",position:"left",className:"line-block",children:i.jsx("button",{onClick:()=>t("underline",!e.underline),className:`p-2 rounded ${e.underline?"bg-primary-blue color-white":"bg-tertiary-blue color-primary-black"}`,children:i.jsx(Jo,{className:"w-4 h-4"})})})]})]}),i.jsx(Tt,{label:"Text transform",width:"width130",value:e.textTransform||"None",options:li,onChange:a=>t("textTransform",a)}),i.jsx(et,{actionButton:!0,label:"Letter spacing",mainClass:"button-control-view marginB20",isShowLeftDescription:!1,leftDescription:"",buttonClass:"",labelClass:"",onClick:()=>{},onChange:a=>t("letterSpacing",n(a,1)),min:-1,max:5,step:.5,defaultValue:e.letterSpacing||0}),i.jsxs("div",{className:"space-y-6",children:[!(e!=null&&e.fullWidth)&&i.jsx("div",{children:i.jsx(et,{actionButton:!0,label:"Width",mainClass:"button-control-view",isShowLeftDescription:!0,leftDescription:"Padding (left & right)",buttonClass:"",labelClass:"",onClick:()=>{},onChange:a=>{const d={...(e==null?void 0:e.paddingControl)||{},left:a,right:a,isCustomPadding:!0};t("paddingControl",d)},min:0,max:100,step:5,defaultValue:o()},`padding-lr-${o()}`)}),i.jsx("div",{children:i.jsx(et,{actionButton:!0,label:"Height",mainClass:"button-control-view",isShowLeftDescription:!0,leftDescription:"(px)",buttonClass:"",labelClass:"",onClick:()=>{},onChange:a=>{const d={...(e==null?void 0:e.paddingControl)||{},btnspanheight:a};t("paddingControl",d)},min:0,max:100,step:5,defaultValue:r()},`line-height-${r()}`)})]})]}),i.jsxs("div",{className:"space-y-6",children:[i.jsx(Jc,{id:"button-border-control",style:e,onStyleChange:(a,l)=>{t(a,l)}}),i.jsx("div",{className:"rsp-property-elements-block",children:i.jsx(Tr,{id:"button-border-radius-control",borderRadius:e.buttonRadiusControl,onChange:a=>{t("buttonRadiusControl",a)}})}),i.jsx("div",{className:"rsp-property-elements-block",children:i.jsx(ao,{label:"Margin and Padding",id:"button-padding-control",marginSection:!0,paddingSection:!0,margin:e.containerPadding,padding:{...e.paddingControl,isPaddingEnabled:!1},onChange:(a,l)=>{a&&t("containerPadding",a)}})})]}),i.jsx("div",{className:"space-y-6 hidden"})]})},nN=({style:e,onStyleChange:t,id:o})=>{var n,s;const r=(a,l)=>{t("actionTypeUpdates",{type:a,url:l})};return console.log("action: btn:",e),i.jsx("div",{className:"space-y-4",children:i.jsx(ma,{value:((n=e==null?void 0:e.actionTypeUpdates)==null?void 0:n.type)||"",initialUrl:((s=e==null?void 0:e.actionTypeUpdates)==null?void 0:s.url)||"",onChange:r},`action-dropdown-${o}`)})},Zg=({id:e,content:t,style:o={}})=>{const[r,n]=S.useState("content"),{updateComponent:s,duplicateComponents:a}=Te(),{updateBlockComponent:l}=Ye(),d=p=>{const m=document.querySelector(`[data-component-id="${e}"]`),f=m==null?void 0:m.getAttribute("data-parent-id"),b=m==null?void 0:m.getAttribute("data-column-index");f&&b?l(f,e,{content:p},"ButtonProperties"):s(e,{content:p})},c=async(p,m)=>{var A,w,y,E;const f=document.querySelector(`[data-component-id="${e}"]`),b=f==null?void 0:f.getAttribute("data-parent-id"),h=f==null?void 0:f.getAttribute("data-column-index");let g=null;if(b&&h){const{getBlockComponents:j}=Ye.getState();g=j(b,parseInt(h)).find($=>$.id===e)||null}else{const{getComponentForRender:j}=Te.getState();g=j(e)}const x=(A=g==null?void 0:g.contentTarget)==null?void 0:A.hasTargeting,C=((w=g==null?void 0:g.contentTarget)==null?void 0:w.activeTargetTabIndex)??0,k=(E=(y=g==null?void 0:g.contentTarget)==null?void 0:y.targetGroups)==null?void 0:E[C],v=x&&(k!=null&&k.style)?k.style:(g==null?void 0:g.style)||o;p==="actionUpdates"?b&&h?l(b,e,{style:{...v,...m}},"ButtonProperties"):s(e,{style:{...v,...m}}):b&&h?l(b,e,{style:{...v,[p]:m}},"ButtonProperties"):s(e,{style:{...v,[p]:m}}),await a()},u=()=>{switch(r){case"content":return i.jsx(oN,{content:t,style:o,onContentChange:d,onStyleChange:c});case"style":return i.jsx(rN,{style:o,onStyleChange:c});case"action":return i.jsx(nN,{style:o,onStyleChange:c,id:e});default:return null}};return i.jsxs("div",{className:"space-y-6",children:[i.jsx(tN,{activeTab:r,onTabChange:n}),u()]})},iN=({content:e,onContentChange:t,altText:o="",onAltTextChange:r})=>{const n=S.useRef(null),[s,a]=S.useState(""),[l,d]=S.useState(e||"");S.useEffect(()=>{d(e||"")},[e]);const c=async m=>{var b;const f=(b=m.target.files)==null?void 0:b[0];if(a(""),!!f){if(!f.type.startsWith("image/")){a("Please upload an image file");return}if(f.size>2*1024*1024){a("File size must not exceed 2MB");return}try{const h=new FileReader;h.onload=g=>{var x;(x=g.target)!=null&&x.result&&t(g.target.result)},h.onerror=()=>{a("Failed to read the image file")},h.readAsDataURL(f)}catch{a("Failed to process image")}}},u=()=>{if(!l.trim()){a("Please enter an image URL");return}try{new URL(l),a(""),t(l)}catch{a("Please enter a valid URL")}},p=()=>{t(""),d(""),a("")};return i.jsxs("div",{className:"space-y-4",children:[i.jsx("h3",{className:"text-md font-regular color-primary-black",children:"Image Upload"}),i.jsxs("div",{className:"space-y-2",children:[i.jsxs("button",{onClick:()=>{var m;return(m=n.current)==null?void 0:m.click()},className:"w-full flex items-center justify-center px-4 py-2 border-2 border-dashed border-gray-300 rounded-lg hover:border-gray-400",children:[i.jsx(Pd,{className:"w-5 h-5 mr-2"}),i.jsx("span",{children:"Choose Image"})]}),i.jsx("input",{ref:n,type:"file",className:"hidden",accept:"image/*",onChange:c}),s&&i.jsxs("div",{className:"flex items-center text-red-500 text-sm gap-1 marginT5",children:[i.jsx(Kt,{className:"w-4 h-4 mr-1"}),s]}),e&&i.jsx("img",{src:e,alt:"Preview",className:"w-full h-32 object-cover rounded-md"})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block text-md color-primary-black mb-1",children:"Image URL"}),i.jsxs("div",{className:"flex gap-2 align-items-end",children:[i.jsx("input",{type:"url",value:l,onChange:m=>d(m.target.value),disabled:!!e,className:`ai-email-input-field flex-1 p-2 ${e?"bg-gray-100 cursor-not-allowed":""}`,placeholder:"Enter image URL"}),i.jsx("button",{onClick:e?p:u,className:`px-3 py-2 text-white rounded ${e?"bg-red-600 hover:bg-red-700":"bg-primary-btn hover:bg-blue-600"}`,children:e?"Remove":"Import"})]})]}),e&&r&&i.jsxs("div",{className:"mt-4",children:[i.jsx("label",{className:"block text-md color-primary-black mb-1",children:"Alt text"}),i.jsx("input",{type:"text",value:o,onChange:m=>r(m.target.value),className:"ai-email-input-field w-full p-2",placeholder:"Enter alt text for accessibility",maxLength:125})]})]})},sN=({style:e,onStyleChange:t})=>i.jsxs("div",{className:"space-y-4",children:[i.jsx("h3",{className:"text-md font-regular color-primary-black",children:"Display Settings"}),i.jsxs("div",{children:[i.jsx("label",{className:"block text-md color-primary-black",children:"Object Fit"}),i.jsxs("select",{value:e.objectFit||"contain",onChange:o=>t("objectFit",o.target.value),className:"w-full p-2 border rounded-md",children:[i.jsx("option",{value:"cover",children:"Cover"}),i.jsx("option",{value:"contain",children:"Contain"}),i.jsx("option",{value:"fill",children:"Fill"}),i.jsx("option",{value:"scale-down",children:"Scale Down"})]})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block text-md color-primary-black",children:"Alt Text"}),i.jsx("input",{type:"text",value:e.alt||"",onChange:o=>t("alt",o.target.value),className:"w-full p-2 border rounded-md",placeholder:"Enter image description"})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block text-md color-primary-black",children:"Rounded corner"}),i.jsx("input",{type:"number",value:e.borderRadius||0,onChange:o=>t("borderRadius",parseInt(o.target.value)),className:"w-full p-2 border rounded-md",min:"0",max:"20"})]})]}),aN=({style:e,onStyleChange:t})=>i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{children:[i.jsx("label",{className:"block text-md color-primary-black",children:"Container background"}),i.jsxs("div",{className:"flex flex-col space-y-2",children:[i.jsx("input",{type:"color",value:e.backgroundColor||"#ffffff",onChange:o=>t("backgroundColor",o.target.value),className:"w-full p-1 h-10 border rounded-md"}),i.jsx("input",{type:"text",value:e.backgroundColor||"#ffffff",onChange:o=>t("backgroundColor",o.target.value),className:"w-full p-2 border rounded-md font-mono text-sm",placeholder:"#ffffff"})]})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block text-md color-primary-black",children:"Padding"}),i.jsx("div",{className:"grid grid-cols-2 gap-4",children:["Top","Right","Bottom","Left"].map(o=>i.jsxs("div",{children:[i.jsx("label",{className:"block text-xs text-gray-500 mb-1",children:o}),i.jsx("input",{type:"number",value:e[`padding${o}`]||0,onChange:r=>t(`padding${o}`,parseInt(r.target.value)),className:"w-full p-2 border rounded-md",min:"0",max:"100"})]},o))})]})]}),Qg=({style:e,onStyleChange:t,defaultWidth:o=180,defaultHeight:r=180,minSize:n=0,maxWidth:s=600})=>{const[a,l]=S.useState(null);S.useEffect(()=>{const u=parseInt(e.width)||o,p=parseInt(e.height)||r;l(u/p)},[o,r,e.width,e.height]);const d=S.useCallback((u,p)=>{if(p=Math.round(p),p<n&&(p=n),u==="width"&&p>s&&(p=s),e.maintainAspectRatio&&a)if(u==="width"){const m=Math.round(p/a);t("width",p),t("height",m)}else{const m=Math.round(p*a);if(m>s){const f=s,b=Math.round(f/a);t("width",f),t("height",b)}else t("width",m),t("height",p)}else t(u,p)},[e.maintainAspectRatio,a,t,s,n]),c=S.useCallback(u=>{if(u){const p=Math.round(Math.min(parseInt(e.width)||o,s)),m=Math.round(parseInt(e.height)||r),f=p/m;if(l(f),p>s){const b=s,h=Math.round(b/f);t("width",b),t("height",h)}}t("maintainAspectRatio",u)},[e.width,e.height,t,o,r,s]);return{handleSizeChange:d,toggleAspectRatio:c}},lN=({id:e,style:t,onStyleChange:o})=>{var c;const[r,n]=S.useState(600),{canvasSettings:s,components:a}=Te();S.useEffect(()=>{var f,b,h,g,x,C,k,v,A;const u=cr(e),p=((f=s==null?void 0:s.style)==null?void 0:f.emailWidth)||600;if(u.isInsideBlock){const w=a.find(y=>y.id===u.parentId);if(w&&w.type==="block"){const y=(b=w.style)==null?void 0:b.columnWidths,j=(((h=w.style)==null?void 0:h.columnGap)||0)*(u.columnCount-1),B=p-j;let $;y&&y[u.columnIndex]?$=y[u.columnIndex]:$=B/u.columnCount;const _=(g=t==null?void 0:t.paddingControl)!=null&&g.isCustomPadding?((x=t==null?void 0:t.paddingControl)==null?void 0:x.left)||0:((C=t==null?void 0:t.paddingControl)==null?void 0:C.all)||0,z=(k=t==null?void 0:t.paddingControl)!=null&&k.isCustomPadding?((v=t==null?void 0:t.paddingControl)==null?void 0:v.right)||0:((A=t==null?void 0:t.paddingControl)==null?void 0:A.all)||0,N=t!=null&&t.customBorder?(t==null?void 0:t.borderLeftWidth)||0:(t==null?void 0:t.borderWidth)||0,O=t!=null&&t.customBorder?(t==null?void 0:t.borderRightWidth)||0:(t==null?void 0:t.borderWidth)||0,K=Math.round($-_-z-N-O);n(K);return}}const m=Math.round(Rr(e,u.columnCount,t==null?void 0:t.paddingControl,t,p));n(m)},[e,t==null?void 0:t.paddingControl,t==null?void 0:t.borderWidth,t==null?void 0:t.borderLeftWidth,t==null?void 0:t.borderRightWidth,t==null?void 0:t.customBorder,(c=s==null?void 0:s.style)==null?void 0:c.emailWidth,a]);const{handleSizeChange:l,toggleAspectRatio:d}=Qg({style:t,onStyleChange:o,defaultWidth:200,defaultHeight:200,minSize:0,maxWidth:r});return i.jsxs("div",{className:"space-y-4",children:[i.jsx("h3",{className:"text-md font-regular color-primary-black",children:"Size Settings"}),i.jsxs("div",{children:[i.jsx("label",{className:"block text-md color-primary-black mb-1",children:"Width"}),i.jsxs("div",{className:"flex items-center space-x-2",children:[i.jsx("input",{type:"number",value:Math.round(parseInt(t.width)||200),onChange:u=>{const p=parseFloat(u.target.value)||0;l("width",p)},className:"w-full p-2 border rounded-md",min:"0",max:r,step:"1"}),i.jsx("span",{className:"text-sm text-gray-500",children:"px"})]}),i.jsxs("p",{className:"mt-1 text-xs text-gray-500",children:["Min: 0px, Max: ",r,"px",cr(e).isInsideBlock&&i.jsx("span",{className:"text-blue-600 ml-1",children:"(Block column width)"})]})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block text-md color-primary-black mb-1",children:"Height"}),i.jsxs("div",{className:"flex items-center space-x-2",children:[i.jsx("input",{type:"number",value:Math.round(parseInt(t.height)||200),onChange:u=>{const p=parseFloat(u.target.value)||0;l("height",p)},className:"w-full p-2 border rounded-md",min:"0",step:"1"}),i.jsx("span",{className:"text-sm text-gray-500",children:"px"})]}),i.jsx("p",{className:"mt-1 text-xs text-gray-500",children:"Min: 0px"})]}),i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("label",{className:"text-sm color-secondary-black",children:"Maintain aspect ratio"}),i.jsx(At,{isChecked:t.maintainAspectRatio||!1,onToggle:u=>{d(u)}}),i.jsxs("div",{className:"relative inline-block w-10 mr-2 align-middle select-none",children:[i.jsx("input",{type:"checkbox",checked:t.maintainAspectRatio||!1,onChange:u=>d(u.target.checked),className:"toggle-checkbox absolute block w-6 h-6 rounded-full bg-white appearance-none cursor-pointer"}),i.jsx("label",{className:"toggle-label block overflow-hidden h-6 rounded-full bg-gray-300 cursor-pointer"})]})]})]})},cN=[{title:"Style",items:["Photorealistic","Digital Art","Oil Painting","Watercolor","Sketch","3D Render","Minimalist","Abstract"]},{title:"Lighting",items:["Natural Light","Studio Light","Dramatic","Soft Light","Backlit","Golden Hour","Night","High Key"]},{title:"Composition",items:["Close-up","Wide Shot","Aerial View","Portrait","Landscape","Symmetrical","Rule of Thirds","Dynamic"]},{title:"Mood",items:["Vibrant","Serene","Dramatic","Mysterious","Cheerful","Professional","Elegant","Energetic"]}],dN=({isOpen:e,onClose:t,onGenerate:o})=>{const[r,n]=S.useState(""),[s,a]=S.useState(""),[l,d]=S.useState(!1),[c,u]=S.useState({}),[p,m]=S.useState(!1),[f,b]=S.useState("");if(!e)return null;const h=(C,k)=>{u(v=>({...v,[C]:v[C]===k?"":k}))},g=()=>Object.values(c).filter(Boolean),x=async()=>{var C;if(!r.trim()&&g().length===0){b("Please enter a prompt or select prompt categories");return}m(!0),b("");try{let k=r;const v=g();v.length>0&&(k=`${v.join(", ")}. ${k}`),l&&s.trim()&&(k=`${k}. DO NOT INCLUDE: ${s.trim()}`);const A=await fetch("https://api.openai.com/v1/images/generations",{method:"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer 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"},body:JSON.stringify({model:"dall-e-3",prompt:k,n:1,size:"1024x1024",quality:"standard",response_format:"url"})});if(!A.ok){const y=await A.json();throw new Error(((C=y.error)==null?void 0:C.message)||"Failed to generate image")}const w=await A.json();o(w.data[0].url),t()}catch(k){console.error("Image generation error:",k),b(k instanceof Error?k.message:"Failed to generate image")}finally{m(!1)}};return i.jsx(i.Fragment,{children:kt.createPortal(i.jsx("div",{id:"rsp-modal-backdrop",className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:i.jsxs("div",{className:"bg-white rounded-lg w-full max-w-4xl mx-4",children:[i.jsxs("div",{className:"flex justify-between items-center p-6 border-b",children:[i.jsx("h3",{className:"text-lg-del font-semibold-del",children:"Generate Image"}),i.jsx("button",{onClick:t,className:"p-1 hover:bg-gray-100 rounded",children:i.jsx(oo,{className:"w-5 h-5"})})]}),i.jsxs("div",{className:"p-6 space-y-6",children:[i.jsxs("div",{children:[i.jsx("label",{className:"block text-md font-regular color-primary-black mb-1",children:"Image Description"}),i.jsx("textarea",{value:r,onChange:C=>n(C.target.value),className:"w-full p-3 border rounded-lg h-32 resize-none",placeholder:"Describe the image you want to generate..."})]}),i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("label",{className:"text-md font-regular color-primary-black",children:"Negative Prompt"}),i.jsxs("div",{className:"relative inline-block w-10 mr-2 align-middle select-none",children:[i.jsx("input",{type:"checkbox",checked:l,onChange:C=>d(C.target.checked),className:"toggle-checkbox absolute block w-6 h-6 rounded-full bg-white appearance-none cursor-pointer"}),i.jsx("label",{className:"toggle-label block overflow-hidden h-6 rounded-full bg-gray-300 cursor-pointer"})]})]}),l&&i.jsx("div",{children:i.jsx("textarea",{value:s,onChange:C=>a(C.target.value),className:"w-full p-3 border rounded-lg h-24 resize-none",placeholder:"Describe what you don't want in the generated image..."})}),i.jsx("div",{className:"grid grid-cols-2 gap-6",children:cN.map(C=>i.jsxs("div",{className:"space-y-3",children:[i.jsx("h4",{className:"text-md font-regular color-primary-black border-b pb-2",children:C.title}),i.jsx("div",{className:"flex flex-wrap gap-2",children:C.items.map(k=>i.jsx("button",{onClick:()=>h(C.title,k),className:`px-3 py-1.5 rounded-full text-sm transition-colors ${c[C.title]===k?"bg-primary-blue text-white":"bg-gray-100 color-secondary-black hover:bg-gray-200"}`,children:k},k))})]},C.title))}),g().length>0&&i.jsxs("div",{className:"bg-gray-50 p-4 rounded-lg",children:[i.jsx("h4",{className:"text-md font-regular color-primary-black mb-2",children:"Selected Prompts:"}),i.jsx("div",{className:"flex flex-wrap gap-2",children:g().map(C=>i.jsx("span",{className:"inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium-del bg-blue-100 text-blue-800",children:C},C))})]}),f&&i.jsxs("div",{className:"flex items-center space-x-2 text-red-500",children:[i.jsx(Kt,{className:"w-4 h-4"}),i.jsx("p",{className:"text-sm",children:f})]})]}),i.jsxs("div",{className:"flex justify-end p-6 border-t space-x-3",children:[i.jsx("button",{onClick:t,className:"px-4 py-2 color-secondary-black bg-gray-100 rounded-lg hover:bg-gray-200",children:"Cancel"}),i.jsx("button",{onClick:x,disabled:p,className:"px-4 py-2 bg-primary-blue text-white rounded-lg hover:bg-blue-600 disabled:opacity-50 flex items-center space-x-2",children:p?i.jsxs(i.Fragment,{children:[i.jsx("span",{className:"animate-spin",children:"⚪"}),i.jsx("span",{children:"Generating..."})]}):i.jsxs(i.Fragment,{children:[i.jsx(Jr,{className:"w-4 h-4"}),i.jsx("span",{children:"Generate"})]})})]})]})}))})},e0=({id:e,content:t,style:o={}})=>{const{updateComponent:r}=Te(),[n,s]=S.useState(!1),[a,l]=S.useState("content"),d=f=>{r(e,{content:f})},c=f=>{r(e,{style:{...o,alt:f}})},u=(f,b)=>{const h={style:{...o,[f]:b}};if(o.maintainAspectRatio&&(f==="width"||f==="height")){const g=parseInt(o.width)||200,x=parseInt(o.height)||200,C=g/x;f==="width"?h.style.height=Math.round(b/C):h.style.width=Math.round(b*C)}(f==="width"||f==="height")&&(h.size={width:h.style.width||o.width||200,height:h.style.height||o.height||200}),r(e,h)},p=f=>{r(e,{style:{...o,...f}})},m=()=>{switch(a){case"content":return i.jsxs("div",{className:"space-y-6",children:[i.jsx(iN,{content:t,onContentChange:d,altText:o.alt||"",onAltTextChange:c}),i.jsxs("button",{onClick:()=>s(!0),className:"w-full flex items-center justify-center px-4 py-2 bg-primary-blue text-white rounded hover:bg-blue-600",children:[i.jsx(Jr,{className:"w-4 h-4 mr-2"}),"Generate Image"]}),i.jsx(lN,{id:e,style:o,onStyleChange:u})]});case"style":return i.jsxs("div",{className:"space-y-6",children:[i.jsx(sN,{style:o,onStyleChange:u}),i.jsx(aN,{style:o,onStyleChange:u})]});case"spacing":return i.jsx(ao,{id:"padding-control",padding:o.paddingControl,onChange:f=>{p({paddingControl:f})}});default:return null}};return i.jsxs("div",{className:"space-y-6",children:[i.jsx(Kc,{activeTab:a,onTabChange:l}),m(),i.jsx(dN,{isOpen:n,onClose:()=>s(!1),onGenerate:f=>{d(f),s(!1)}})]})},uN=({id:e,style:t,onStyleChange:o,content:r,columnCount:n})=>{var E,j;const[s,a]=S.useState(0),[l,d]=S.useState(600),{canvasSettings:c}=Te(),u=n||1,p=((E=c==null?void 0:c.style)==null?void 0:E.emailWidth)||600;!(t!=null&&t.enableContent)||(t==null?void 0:t.wrapperLayout)==="image-top"||(t==null?void 0:t.wrapperLayout)==="image-bottom"||Math.round(p*.5),S.useEffect(()=>{var z;const B=cr(e),$=((z=c==null?void 0:c.style)==null?void 0:z.emailWidth)||600,_=Rr(e,B.columnCount||u,t==null?void 0:t.paddingControl,t,$);d(_)},[e,u,t==null?void 0:t.paddingControl,t==null?void 0:t.borderWidth,t==null?void 0:t.borderLeftWidth,t==null?void 0:t.borderRightWidth,t==null?void 0:t.customBorder,(j=c==null?void 0:c.style)==null?void 0:j.emailWidth]);const{handleSizeChange:m}=Qg({style:{width:t.imageWidth,height:t.imageHeight,maintainAspectRatio:t.maintainAspectRatio},onStyleChange:(B,$)=>{o(B==="width"?"imageWidth":B==="height"?"imageHeight":B,$)},defaultWidth:300,defaultHeight:300,minSize:20,maxWidth:l});parseInt(t.imageWidth),t.imageHeight==="auto"||parseInt(t.imageHeight),t.maintainAspectRatio,S.useEffect(()=>{if(t!=null&&t.paddingControl){const B=t.paddingControl.left||0,$=t.paddingControl.right||0,_=B+$;a(_)}},[t.paddingControl.left,t.paddingControl.right]);let f=0,b=0;const{paddingControl:h}=t||{},{isCustomPadding:g,left:x=0,right:C=0,all:k=0}=h||{},{customBorder:v,borderRightWidth:A=0,borderLeftWidth:w=0,borderWidth:y=0}=t||{};return f=g?x+C:k*2,b=v?A+w:y*2,(t==null?void 0:t.imageWidth)+f+b>p?p-(f+b):t.imageWidth,i.jsx(i.Fragment,{children:i.jsx(et,{label:"Width",mainClass:"button-control-view",description:`Min: 20, Max: ${l}`,onChange:B=>m("width",B),onClick:()=>{},min:20,max:l,step:10,defaultValue:parseInt(t.imageWidth)<l?parseInt(t.imageWidth):l||180})})},pN=({style:e,onStyleChange:t})=>i.jsx("div",{className:"space-y-4",children:i.jsx(Tr,{id:"border-radius-control",borderRadius:e.borderRadiusControl,onChange:o=>{t("borderRadiusControl",o)}})}),t0=[{value:"image-left",label:"Left",description:"Image on the left side with text on the right",icon:i.jsx(i.Fragment,{children:i.jsxs("svg",{width:"14",height:"16",viewBox:"0 0 14 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[i.jsx("line",{x1:"0.5",y1:"0.5",x2:"0.5",y2:"15.5",stroke:"#BBBBBB",strokeLinecap:"round"}),i.jsx("rect",{x:"3.5",y:"5.5",width:"10",height:"5",rx:"1.5",fill:"#BBBBBB",stroke:"#BBBBBB"})]})})},{value:"image-top",label:"Top",description:"Image on top with text below",icon:i.jsx(i.Fragment,{children:i.jsxs("svg",{width:"16",height:"14",viewBox:"0 0 16 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[i.jsx("line",{x1:"0.5",y1:"0.5",x2:"15.5",y2:"0.5",stroke:"#BBBBBB",strokeLinecap:"round"}),i.jsx("rect",{x:"5.5",y:"13.5",width:"10",height:"5",rx:"1.5",transform:"rotate(-90 5.5 13.5)",fill:"#BBBBBB",stroke:"#BBBBBB"})]})})},{value:"image-right",label:"Right",description:"Image on the right side with text on the left",icon:i.jsx(i.Fragment,{children:i.jsxs("svg",{width:"14",height:"16",viewBox:"0 0 14 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[i.jsx("line",{x1:"13.5",y1:"0.5",x2:"13.5",y2:"15.5",stroke:"#BBBBBB",strokeLinecap:"round"}),i.jsx("rect",{x:"0.5",y:"5.5",width:"10",height:"5",rx:"1.5",fill:"#BBBBBB",stroke:"#BBBBBB"})]})})},{value:"image-bottom",label:"Bottom",description:"Image on bottom with text above",icon:i.jsx(i.Fragment,{children:i.jsxs("svg",{width:"16",height:"14",viewBox:"0 0 16 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[i.jsx("line",{x1:"0.5",y1:"13.5",x2:"15.5",y2:"13.5",stroke:"#BBBBBB",strokeLinecap:"round"}),i.jsx("rect",{x:"5.5",y:"10.5",width:"10",height:"5",rx:"1.5",transform:"rotate(-90 5.5 10.5)",fill:"#BBBBBB",stroke:"#BBBBBB"})]})})}],hN=({value:e,onChange:t,columnCount:o})=>{const r=o||1,n=r!==1?t0.filter(a=>["image-top","image-bottom"].includes(a.value)):t0,s=r!==1&&!["image-top","image-bottom"].includes(e)?"image-top":e;return i.jsxs("div",{className:"flex items-start justify-between",children:[i.jsx("label",{className:"block text-md color-primary-black",children:"Image position"}),i.jsx("div",{className:"rsp-image-position-props flex items-center gap-1 bg-builder-btn rounded padding3",children:n.map(a=>i.jsx("div",{className:`position-${a.value}`,children:i.jsx(Ie,{text:a.label,position:"top",className:"line-block",children:i.jsx("button",{onClick:()=>t(a.value),className:`padding5 rounded transition-colors ${s===a.value?"active bg-white box-shadow-01 btn-control":"inactive color-primary-black"}`,title:a.description,children:i.jsx("div",{className:"text-sm font-medium-del",children:a.icon})},a.value)})},a.value))})]})},fN=[{title:"Tone",items:["Professional","Casual","Friendly","Formal","Humorous","Inspirational","Persuasive","Educational"]},{title:"Purpose",items:["Marketing","Informational","Technical","Storytelling","Instructional","Promotional","Announcement","Description"]},{title:"Style",items:["Concise","Detailed","Conversational","Analytical","Creative","Factual","Narrative","Engaging"]},{title:"Content Type",items:["Product Feature","Service Overview","Company News","Customer Story","How-to Guide","Industry Update","Team Spotlight","Event Announcement"]},{title:"Length",items:["Very Short (50-100 chars)","Short (100-250 chars)","Medium (250-500 chars)","Long (500-1000 chars)","Very Long (1000+ chars)","Title Only (20-50 chars)","Snippet (50-100 chars)","Custom Length"]}],mN=({isOpen:e,onClose:t,onGenerate:o})=>{const[r,n]=S.useState(""),[s,a]=S.useState({}),[l,d]=S.useState({min:250,max:500}),[c,u]=S.useState(!1),[p,m]=S.useState(!1),[f,b]=S.useState("");if(!e)return null;const h=(k,v)=>{if(k==="Length"&&v==="Custom Length"){u(!0),a(A=>({...A,[k]:v}));return}k==="Length"&&u(!1),a(A=>({...A,[k]:A[k]===v?"":v}))},g=()=>Object.entries(s).filter(([k,v])=>k==="Length"&&v==="Custom Length"?!1:!!v).map(([k,v])=>v),x=()=>{const k=s.Length;return k?k==="Custom Length"?`The text content should be between ${l.min} and ${l.max} characters in length.`:k.replace(/\(|\)/g,""):""},C=async()=>{if(!r.trim()&&g().length===0){b("Please enter a prompt or select prompt categories");return}m(!0),b("");try{let k=r;const v=g(),A=x();(v.length>0||A)&&(k=`
5002
+ DO NOT INCLUDE: ${a}`);const $=await fetch("https://api.openai.com/v1/chat/completions",{method:"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer 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"},body:JSON.stringify({model:"gpt-4",messages:[{role:"system",content:"You are a professional copywriter. Generate engaging and effective content based on the user's prompt. Return only the generated content without any additional formatting or explanation. Pay careful attention to character count constraints."},{role:"user",content:E}],temperature:.7,max_tokens:500})});if(!$.ok)throw new Error("Failed to generate content");const z=(await $.json()).choices[0].message.content.trim();r(z),t()}catch{f("Failed to generate content")}finally{p(!1)}};return i.jsx(i.Fragment,{children:kt.createPortal(i.jsx("div",{id:"rsp-modal-backdrop",className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50 p-4",children:i.jsxs("div",{className:"rsp-modal rsp-generate-conteten-wrapper bg-white rounded-lg w-full max-w-[95vw]",style:{maxHeight:"calc(100vh - 32px)"},children:[i.jsxs("div",{className:"rsp-modal-header flex justify-between items-center p-6 border-b",children:[i.jsx("h2",{children:"Generate content"}),i.jsx("button",{onClick:t,className:"rsp-modal-close p-1 hover:bg-gray-100 rounded",children:i.jsx(oo,{className:"w-5 h-5"})})]}),i.jsxs("div",{className:"p-3 pt-0 space-y-3 overflow-y-auto",style:{maxHeight:"calc(100vh - 194px)"},children:[i.jsxs("div",{children:[i.jsx("label",{className:"rsp-properties-lable marginB5 block text-sm color-primary-black",children:"Prompt"}),i.jsx("textarea",{value:n,onChange:E=>s(E.target.value),className:"w-full p-2 border rounded-lg h-32 resize-none",placeholder:"Describe the content you want to generate..."})]}),i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("label",{className:"rsp-properties-lable marginB5 block text-sm color-primary-black",children:"Negative Prompt"}),i.jsxs("div",{className:"relative inline-block w-10 mr-2 align-middle select-none",children:[i.jsx("input",{type:"checkbox",checked:d,onChange:E=>c(E.target.checked),className:"toggle-checkbox absolute block w-6 h-6 rounded-full bg-white appearance-none cursor-pointer"}),i.jsx("label",{className:"toggle-label block overflow-hidden h-6 rounded-full bg-gray-300 cursor-pointer"})]})]}),d&&i.jsx("div",{children:i.jsx("textarea",{value:a,onChange:E=>l(E.target.value),className:"w-full p-2 border rounded-lg h-24 resize-none",placeholder:"Describe what you don't want in the generated content..."})}),i.jsx("div",{className:"rsp-generate-content grid grid-cols-2 gap-6",children:QT.map(E=>i.jsxs("div",{className:"space-y-3",children:[i.jsx("h4",{className:"rsp-properties-lable marginB5 block text-sm color-primary-black border-b pb-2",children:E.title}),i.jsx("div",{className:"flex flex-wrap gap-2",children:E.items.map(j=>i.jsx("button",{onClick:()=>v(E.title,j),className:`px-3 py-1.5 rounded-full text-sm transition-colors ${b[E.title]===j?"bg-primary-blue text-white":"bg-gray-100 color-secondary-black hover:bg-gray-200"}`,children:j},j))}),E.title==="Length"&&C&&i.jsxs("div",{className:"bg-gray-50 p-4 rounded-lg space-y-4",children:[i.jsx("h5",{className:"text-md font-regular color-primary-black",children:"Custom Length Settings"}),i.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[i.jsxs("div",{children:[i.jsx("label",{className:"block text-xs color-secondary-black mb-1",children:"Minimum Characters"}),i.jsx("input",{type:"number",value:g.min,onChange:j=>x(B=>({...B,min:parseInt(j.target.value)||0})),className:"w-full p-2 border rounded-md",min:"1"})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block text-xs color-secondary-black mb-1",children:"Maximum Characters"}),i.jsx("input",{type:"number",value:g.max,onChange:j=>x(B=>({...B,max:parseInt(j.target.value)||0})),className:"w-full p-2 border rounded-md",min:g.min})]})]})]})]},E.title))}),A().length>0&&i.jsxs("div",{className:"bg-gray-50 p-4 rounded-lg",children:[i.jsx("h4",{className:"text-md font-regular color-primary-black mb-2",children:"Selected Prompts:"}),i.jsxs("div",{className:"flex flex-wrap gap-2",children:[A().map(E=>i.jsx("span",{className:"inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium-del bg-blue-100 text-blue-800",children:E},E)),C&&i.jsxs("span",{className:"inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium-del bg-blue-100 text-blue-800",children:[g.min,"-",g.max," characters"]})]})]}),m&&i.jsxs("div",{className:"flex items-center space-x-2 text-red-500",children:[i.jsx(Kt,{className:"w-4 h-4"}),i.jsx("p",{className:"text-sm",children:m})]})]}),i.jsxs("div",{className:"rsp-modal-footer flex justify-end gap-2 p-6 border-t bg-gray-50",children:[i.jsx("button",{onClick:t,className:"rsp-button-secondary",children:"Cancel"}),i.jsx("button",{onClick:y,disabled:u,className:"rsp-button-primary",children:u?i.jsxs(i.Fragment,{children:[i.jsx("span",{className:"animate-spin mr-2",children:"⚪"}),"Generating..."]}):i.jsxs(i.Fragment,{children:[i.jsx(Jr,{className:"w-4 h-4 mr-2"}),"Generate"]})})]})]})}),document.body)})},Kg=(e,t,o)=>{var a;if(!o)return 0;const r=document.createTreeWalker(o,NodeFilter.SHOW_TEXT,null);let n=0,s;for(;(s=r.nextNode())!==null;){if(s===e)return n+t;n+=((a=s.textContent)==null?void 0:a.length)||0}return n},Yg=(e,t,o)=>{var u;if(!o)return null;const r=document.createTreeWalker(o,NodeFilter.SHOW_TEXT,null);let n=0,s=null,a=0,l=null,d=0,c;for(;(c=r.nextNode())!==null;){const p=((u=c.textContent)==null?void 0:u.length)||0;if(s===null&&n+p>=e&&(s=c,a=e-n),s!==null&&n+p>=t){l=c,d=t-n;break}n+=p}if(s&&l){const p=document.createRange();try{return p.setStart(s,a),p.setEnd(l,d),p}catch(m){return console.error("Error creating range from text offset:",m),null}}return null},eN=e=>{e.querySelectorAll("ul, ol").forEach(o=>{const r=o;Array.from(r.querySelectorAll("li")).forEach(s=>{var l;((l=s.textContent)==null?void 0:l.trim())||Array.from(s.childNodes).some(d=>{var c;return d.nodeType===Node.ELEMENT_NODE||d.nodeType===Node.TEXT_NODE&&((c=d.textContent)==null?void 0:c.trim())})||s.remove()})})},Jg=({id:e,content:t,style:o,onUpdate:r})=>{var ne;const n=vi(),{updateComponent:s}=Te(),{updateBlockComponent:a}=Ye(),{canvasTextEditorRef:l,currentSelection:d,getCanvasEditor:c,restoreSelection:u}=$o(),[p,m]=S.useState("content"),[f,b]=S.useState(!1),[h,g]=S.useState("Smileys & People"),[x,C]=S.useState(!1),[k,v]=S.useState(!1),[A,w]=S.useState({bold:!1,italic:!1,underline:!1,strikethrough:!1,superscript:!1,subscript:!1,textAlign:"left",fontFamily:(o==null?void 0:o.fontFamily)||"inherit",fontSize:(o==null?void 0:o.fontSize)||12,color:(o==null?void 0:o.color)||"#000000",hiliteColor:(o==null?void 0:o.hiliteColor)||"transparent",backgroundColor:(o==null?void 0:o.backgroundColor)||"transparent"}),y=S.useRef(null),E=()=>{var ae,oe,G;if(d!=null&&d.componentId){const Q=c(d.componentId);if((ae=Q==null?void 0:Q.editorRef)!=null&&ae.current)return Q.editorRef.current}return((G=(oe=l.current)==null?void 0:oe.editorRef)==null?void 0:G.current)||null},j=(ae=[])=>{const oe=()=>(u(),window.getSelection());let G=window.getSelection();if((!G||G.rangeCount===0)&&(G=oe()),G&&G.rangeCount>0&&ae.length>0){const Q=G.getRangeAt(0);ae.some(T=>T&&(T===Q.commonAncestorContainer||T.contains(Q.commonAncestorContainer)))||(G=oe())}return G&&G.rangeCount>0?G:null},B=(ae,oe)=>{var Q;const G=ae.cloneRange();if(G.startContainer===oe&&G.collapsed&&oe.childNodes.length){const J=document.createRange();if(J.selectNodeContents(oe),J.collapse(!1),J.endContainer===oe){const T=document.createTreeWalker(oe,NodeFilter.SHOW_TEXT,null);let X=null,H;for(;H=T.nextNode();)H.nodeType===Node.TEXT_NODE&&(X=H);if(X)G.setStart(X,((Q=X.textContent)==null?void 0:Q.length)??0);else{const D=document.createTextNode("");oe.appendChild(D),G.setStart(D,0)}}else G.setStart(J.endContainer,J.endOffset);G.collapse(!0)}return G},$=(ae,oe,G)=>{oe.deleteContents(),oe.insertNode(G),oe.setStartAfter(G),oe.setEndAfter(G),ae.removeAllRanges(),ae.addRange(oe)},_=(ae,oe,G)=>{let Q=ae,J=G;if((d==null?void 0:d.componentId)===e&&(d==null?void 0:d.isCanvas)&&(d!=null&&d.range)){Q=d.range.cloneRange();const X=window.getSelection();X==null||X.removeAllRanges(),X==null||X.addRange(Q),X&&X.rangeCount>0&&(J=X)}return{range:B(Q,oe),selection:J}};S.useEffect(()=>{p==="content"&&setTimeout(()=>{const ae=(d==null?void 0:d.isCanvas)===!0,oe=document.activeElement,G=(oe==null?void 0:oe.classList.contains("rsp-text-typing-block"))&&(oe==null?void 0:oe.closest(".email-text-content"));!ae&&!G&&z()},0)},[e,p,d]),S.useEffect(()=>{o!=null&&o._targetGroupId&&p==="content"&&setTimeout(()=>{const ae=(d==null?void 0:d.isCanvas)===!0,oe=document.activeElement,G=(oe==null?void 0:oe.classList.contains("rsp-text-typing-block"))&&(oe==null?void 0:oe.closest(".email-text-content"));!ae&&!G&&z()},0)},[o==null?void 0:o._targetGroupId,p,d]);const z=()=>{var ae;if((ae=y.current)!=null&&ae.editorRef.current){const oe=y.current.editorRef.current;oe.focus();const G=document.createRange(),Q=window.getSelection();G.selectNodeContents(oe),G.collapse(!1),Q==null||Q.removeAllRanges(),Q==null||Q.addRange(G)}},N=ae=>{if(r){r(ae);return}const oe=document.querySelector(`[data-component-id="${e}"]`),G=oe==null?void 0:oe.getAttribute("data-parent-id"),Q=oe==null?void 0:oe.getAttribute("data-column-index");G&&Q?a(G,e,ae):s(e,ae)},O=ae=>{N({content:ae})},K=(ae,oe)=>{N(typeof ae=="string"?{style:{...o,[ae]:oe}}:{style:{...o,...ae}})},F=ae=>{N({style:{...o,...ae}})},q=ae=>{const oe=y.current;if(!(oe!=null&&oe.editorRef.current))return;const G=window.getSelection();if(!(G!=null&&G.rangeCount))return;const Q=G.getRangeAt(0);if(oe.editorRef.current.contains(Q.commonAncestorContainer)){const T=Q,X=oe.editorRef.current;try{T.collapsed?R(T,ae,G):ee(T,ae,G,X),X&&(eN(X),O(X.innerHTML))}catch(H){console.error("Error creating link:",H),Y(ae,G,X)}G.removeAllRanges(),v(!1)}},R=(ae,oe,G)=>{const Q=document.createElement("a");Q.href=oe.url,Q.title=oe.title,Q.target=oe.target,Q.textContent=oe.displayText,Q.setAttribute("data-type",oe.type),ae.insertNode(Q),ae.setStartAfter(Q),ae.collapse(!0),G.removeAllRanges(),G.addRange(ae)},M=(ae,oe)=>{Array.from(oe.querySelectorAll("a")).filter(J=>ae.intersectsNode(J)).forEach(J=>{var X;const T=document.createDocumentFragment();for(;J.firstChild;)T.appendChild(J.firstChild);(X=J.parentNode)==null||X.replaceChild(T,J)})},L=(ae,oe,G)=>{const Q=ae.extractContents(),J=document.createElement("a");J.href=oe.url,J.title=oe.title,J.target=oe.target,J.setAttribute("data-type",oe.type),J.appendChild(Q),ae.insertNode(J);const T=document.createRange();T.selectNodeContents(J),G.removeAllRanges(),G.addRange(T)},U=(ae,oe,G)=>{const J=(G.textContent||"").indexOf(ae);if(J!==-1){const T=Yg(J,J+ae.length,G);if(T){const X=T.extractContents(),H=document.createElement("a");H.href=oe.url,H.title=oe.title,H.target=oe.target,H.setAttribute("data-type",oe.type),H.appendChild(X),T.insertNode(H)}}},ee=(ae,oe,G,Q)=>{const J=G.toString(),T=Kg(ae.startContainer,ae.startOffset,Q),X=Kg(ae.endContainer,ae.endOffset,Q);M(ae,Q);const H=Yg(T,X,Q);H&&H.toString()===J?L(H,oe,G):U(J,oe,Q)},Y=(ae,oe,G)=>{const Q=oe.toString();if(Q&&G){const J=G.innerHTML,T=`<a href="${ae.url}" title="${ae.title}" target="${ae.target}" data-type="${ae.type}">${ae.displayText}</a>`,X=J.replace(Q,T);G.innerHTML=X,O(X)}},te=ae=>{var V,Z,P,re,se,le,xe,Ce,je,ye;const oe=y.current;if(!(oe!=null&&oe.editorRef.current))return;const G=E(),Q=[oe.editorRef.current,G].filter(Ne=>!!Ne),J=j(Q);if(!(J!=null&&J.rangeCount))return;const T=J.getRangeAt(0).cloneRange(),X=(d==null?void 0:d.componentId)===e,H=(d==null?void 0:d.isCanvas)&&X,D=oe.editorRef.current.contains(T.commonAncestorContainer);if((((G==null?void 0:G.contains(T.commonAncestorContainer))??!1)&&!!G||H&&!!G)&&G){const{range:Ne,selection:_e}=_(((V=d==null?void 0:d.range)==null?void 0:V.cloneRange())??T,G,J),Re=Ne.commonAncestorContainer.nodeType===Node.TEXT_NODE?(Z=Ne.commonAncestorContainer.parentElement)==null?void 0:Z.closest("a"):(P=Ne.commonAncestorContainer)==null?void 0:P.closest("a"),Be=document.createTextNode(ae);if(Re){(re=Re.parentNode)==null||re.insertBefore(Be,Re.nextSibling);const ve=document.createRange();ve.setStartAfter(Be),ve.collapse(!0),_e.removeAllRanges(),_e.addRange(ve)}else $(_e,Ne,Be);G&&N({content:G.innerHTML})}else if(D){const Ne=oe.editorRef.current,_e=T.cloneRange(),Re=Ne.firstChild;if(Re&&Re.nodeType===Node.ELEMENT_NODE&&Re.tagName==="P"){const pe=Re,be=pe.childNodes.length===1&&((se=pe.firstChild)==null?void 0:se.nodeType)===Node.ELEMENT_NODE&&pe.firstChild.tagName==="BR";(((le=pe.textContent)==null?void 0:le.trim())===""||be)&&(_e.startContainer===Ne||pe.contains(_e.startContainer))&&(be&&(pe.innerHTML=""),_e.setStart(pe,0),_e.collapse(!0))}if(_e.startContainer===Ne&&_e.collapsed){const pe=document.createRange();pe.selectNodeContents(Ne),pe.collapse(!1);const be=pe.endContainer,ke=pe.endOffset;if(be.nodeType===Node.TEXT_NODE)_e.setStart(be,ke),_e.collapse(!0);else{const de=document.createTreeWalker(Ne,NodeFilter.SHOW_TEXT,null);let ce=null,me;for(;me=de.nextNode();)me.nodeType===Node.TEXT_NODE&&(ce=me);if(ce&&ce.textContent)_e.setStart(ce,ce.textContent.length),_e.collapse(!0);else{const Ae=Ne.lastChild;if(Ae){if(Ae.nodeType===Node.TEXT_NODE)_e.setStart(Ae,(Ae.textContent||"").length),_e.collapse(!0);else if(Ae.nodeType===Node.ELEMENT_NODE&&Ae.tagName==="P"){const Ee=Ae,Oe=Ee.childNodes.length;Ee.childNodes.length===1&&((xe=Ee.firstChild)==null?void 0:xe.nodeType)===Node.ELEMENT_NODE&&Ee.firstChild.tagName==="BR"?(Ee.innerHTML="",_e.setStart(Ee,0)):_e.setStart(Ee,Oe),_e.collapse(!0)}else if(Ae.nodeType===Node.ELEMENT_NODE){let Ee=Ae;for(;Ee.nodeType===Node.ELEMENT_NODE&&Ee.lastChild;)Ee=Ee.lastChild;Ee.nodeType===Node.TEXT_NODE?_e.setStart(Ee,(Ee.data||"").length):_e.setStart(Ee,Ee.childNodes.length),_e.collapse(!0)}}}}}const Be=_e.commonAncestorContainer.nodeType===Node.TEXT_NODE?(Ce=_e.commonAncestorContainer.parentElement)==null?void 0:Ce.closest("a"):(je=_e.commonAncestorContainer)==null?void 0:je.closest("a"),ve=document.createTextNode(ae);if(Be){(ye=Be.parentNode)==null||ye.insertBefore(ve,Be.nextSibling);const pe=document.createRange();pe.setStartAfter(ve),pe.collapse(!0),J.removeAllRanges(),J.addRange(pe)}else $(J,_e,ve);oe.handleInput?oe.handleInput():O(oe.editorRef.current.innerHTML)}b(!1)},ie=ae=>{var re,se,le,xe,Ce,je;const oe=y.current,G=((re=oe==null?void 0:oe.editorRef)==null?void 0:re.current)||null,Q=E(),J=[G,Q].filter(ye=>!!ye),T=j(J);if(!(T!=null&&T.rangeCount)){n.handleClose();return}const X=T.getRangeAt(0).cloneRange(),H=(d==null?void 0:d.componentId)===e,D=(d==null?void 0:d.isCanvas)&&H,W=(G==null?void 0:G.contains(X.commonAncestorContainer))??!1,V=((Q==null?void 0:Q.contains(X.commonAncestorContainer))??!1)&&!!Q||D&&!!Q,Z=W&&!!G||!(d!=null&&d.isCanvas)&&!!G;if(!V&&!Z){n.handleClose();return}const P=(ye,Ne,_e,Re)=>{var Be;if(Re){(Be=Re.parentNode)==null||Be.insertBefore(_e,Re.nextSibling);const ve=document.createRange();ve.setStartAfter(_e),ve.collapse(!0),ye.removeAllRanges(),ye.addRange(ve)}else $(ye,Ne,_e)};if(V&&Q){const{range:ye,selection:Ne}=_(((se=d==null?void 0:d.range)==null?void 0:se.cloneRange())??X,Q,T),_e=ye.commonAncestorContainer.nodeType===Node.TEXT_NODE?(le=ye.commonAncestorContainer.parentElement)==null?void 0:le.closest("a"):(xe=ye.commonAncestorContainer)==null?void 0:xe.closest("a"),Re=document.createTextNode(ae);P(Ne,ye,Re,_e??null),N({content:Q.innerHTML})}else if(Z&&G){const ye=X.commonAncestorContainer.nodeType===Node.TEXT_NODE?(Ce=X.commonAncestorContainer.parentElement)==null?void 0:Ce.closest("a"):(je=X.commonAncestorContainer)==null?void 0:je.closest("a"),Ne=document.createTextNode(ae);P(T,X,Ne,ye??null),oe!=null&&oe.handleInput?oe.handleInput():O(G.innerHTML)}n.handleClose()},ue=()=>{var ae,oe,G,Q;switch(p){case"content":return i.jsxs("div",{children:[i.jsx(Vg,{formatState:A,style:o||{},onFormatClick:(J,T)=>{var X,H;y.current&&((H=(X=y.current).execCommand)==null||H.call(X,J,T))},onStyleChange:K,onFontSizeChange:J=>K("fontSize",J),onFontFamilyChange:J=>K("fontFamily",J),textEditorRef:y,onPickerActive:J=>{var T;(T=y.current)!=null&&T.setColorPickerActive&&y.current.setColorPickerActive(J)},onShowEmojiPopover:()=>b(!0),onShowPersonalizationPopover:n.handleOpen,onShowLinkModal:()=>v(!0),canEditLink:((ae=y.current)==null?void 0:ae.canEditLink)||!1,canUnlink:((oe=y.current)==null?void 0:oe.canUnlink)||!1,disabledEmoji:((G=y.current)==null?void 0:G.disabledEmoji)||!0,showPersonalization:((Q=Te.getState().pConfig)==null?void 0:Q.isPersonalization)||!1}),i.jsx(Gg,{style:o||{},onStyleChange:K,onAllPaddingStyleChange:F})]});case"style":return i.jsx(Hg,{style:o||{},onStyleChange:K});case"spacing":return i.jsx(ao,{label:"Padding",id:"padding-control",marginSection:!1,paddingSection:!0,padding:o==null?void 0:o.paddingControl,onChange:J=>{F({paddingControl:J})}});default:return null}};return i.jsxs("div",{className:"space-y-6",children:[i.jsx(Kc,{activeTab:p,onTabChange:m}),ue(),i.jsx(bi,{isOpen:f,onClose:()=>b(!1),selectedCategory:h,onCategoryChange:g,onEmojiSelect:te}),i.jsx(qg,{isOpen:n.isOpen,onClose:n.handleClose,onTagSelect:ie,position:n.position}),i.jsx(Xg,{isOpen:x,onClose:()=>C(!1),initialContent:t,onGenerate:ae=>{O(ae),C(!1)}}),i.jsx(Ci,{isOpen:k,onClose:()=>v(!1),onSave:q,selectedText:((ne=window.getSelection())==null?void 0:ne.toString())||"",editorRef:y})]})},tN=({activeTab:e,onTabChange:t})=>i.jsxs("div",{className:"rsp-tab flex border-b border-gray-200",children:[i.jsx("button",{onClick:()=>t("content"),className:`w-full px-4 py-2 text-md -mb-px ${e==="content"?"active color-primary-blue":"inactive color-secondary-black"}`,children:"Content"}),i.jsx("button",{onClick:()=>t("style"),className:`w-full px-4 py-2 text-md -mb-px ${e==="style"?"active color-primary-blue":"inactive color-secondary-black"}`,children:"Style"}),i.jsx("button",{onClick:()=>t("action"),className:`w-full px-4 py-2 text-md -mb-px ${e==="action"?"active color-primary-blue":"inactive color-secondary-black"}`,children:"Action"})]}),Yc=({style:e,onStyleChange:t})=>i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{className:"rsp-property-elements-block rsp-select-dropdown flex items-center justify-between",children:[i.jsx("label",{className:"rsp-properties-lable block text-md color-primary-black",children:"Align"}),i.jsxs("div",{className:"flex items-center gap-1",children:[i.jsx(Ie,{text:"Left",position:"top",className:"line-block",children:i.jsx("button",{onClick:()=>t("iconPosition","left"),className:`p-1.5 rounded ${e.iconPosition==="left"?"bg-primary-blue text-white":"bg-tertiary-blue"}`,children:i.jsx(_o,{className:"w-4 h-4"})})}),i.jsx(Ie,{text:"Right",position:"top",className:"line-block",children:i.jsx("button",{onClick:()=>t("iconPosition","right"),className:`p-1.5 rounded ${e.iconPosition==="right"?"bg-primary-blue text-white":"bg-tertiary-blue"}`,children:i.jsx(Ro,{className:"w-4 h-4"})})})]})]}),i.jsx("div",{children:i.jsx(et,{label:"Icon spacing",mainClass:"button-control-view",onClick:()=>{},onChange:o=>t("iconIndent",o),min:5,max:50,step:2,defaultValue:e.iconIndent||8})}),i.jsx("div",{children:i.jsx(et,{label:"Icon size",mainClass:"button-control-view",onClick:()=>{},onChange:o=>t("iconSize",o),min:16,max:64,step:2,defaultValue:e.iconSize||16})})]}),us=({content:e,style:t,onContentChange:o})=>{const[r,n]=S.useState(!1),[s,a]=S.useState((e==null?void 0:e.imageUrl)||(t==null?void 0:t.iconUrl)||""),[l,d]=S.useState(""),{pConfig:c}=Te(),[u,p]=S.useState(!1),[m,f]=S.useState("upload");S.useEffect(()=>{d("")},[]),S.useEffect(()=>{const A=(e==null?void 0:e.imageUrl)||(t==null?void 0:t.iconUrl)||"";a(A),d("")},[e==null?void 0:e.imageUrl,t==null?void 0:t.iconUrl]);const b=A=>new Promise(w=>{const y=new Image;y.crossOrigin="anonymous",y.onload=()=>{w({hasCorsIssue:!1,isValid:!0})},y.onerror=()=>{const E=new Image;E.onload=()=>{w({hasCorsIssue:!0,isValid:!0})},E.onerror=()=>{w({hasCorsIssue:!1,isValid:!1})},E.src=A},y.src=A}),h=async A=>{try{const w={id:ot(),name:`image_${Date.now()}.jpg`,uploadedAt:new Date().toISOString(),uploadURL:A,isFav:!1,groupName:"",url:"",size:0},y=await c.imageCallback(2,w);if(y&&y.status&&y.data){const E=JSON.parse(y.data);E.url&&o({imageUrl:E.url}),d("")}else d("Failed to upload image to server")}catch(w){const y=w instanceof Error?w.message:"Unknown error";d(`Failed to process image from URL: ${y}`)}},g=async()=>{if(!s.trim()){d("Please enter an image URL");return}if(s.startsWith("data:")){d("Data URLs are not allowed. Please enter a valid image URL.");return}if(!/^[a-zA-Z]+:\/\/[^\s"'<>]+$/.test(s)){d("The URL contains spaces or invalid characters.");return}try{new URL(s)}catch{d("Please enter a valid URL");return}const{hasCorsIssue:w,isValid:y}=await b(s);if(!y){d("The URL does not point to a valid image");return}if(w){await h(s);return}d(""),o({imageUrl:s})},x=()=>{t.iconUrl?o({imageUrl:""}):o({imageUrl:""}),a(""),d("")},C=async()=>{try{await navigator.clipboard.writeText(e.imageUrl||t.iconUrl||""),p(!0),setTimeout(()=>p(!1),1e3)}catch(A){console.error("Failed to copy code:",A)}},k=A=>{if(!A)return{fileName:null,extension:null};const w=A.split("?")[0].split("#")[0],y=w==null?void 0:w.split("/").pop();if(!y)return{fileName:null,extension:null};const E=y.split("."),j=E.pop(),B=E.join(".");return{fileName:(B==null?void 0:B.trim())||"No name",extension:j}},v=A=>{const{fileName:w,extension:y}=k(A);return!w||!y?null:i.jsxs(i.Fragment,{children:[w.length>25?i.jsx(Ie,{text:w,position:"top",children:i.jsx("span",{className:"text-md max-w-[200px] overflow-hidden text-ellipsis whitespace-nowrap inline-block lh20",children:w})}):i.jsx("span",{className:"text-md max-w-[200px] overflow-hidden text-ellipsis whitespace-nowrap inline-block lh20",children:w}),i.jsxs("small",{className:"text-sm color-primary-grey marginT-2",children:[".",y]})]})};return i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{className:"rsp-tab flex border-b border-gray-200 marginT20",children:[i.jsx("button",{onClick:()=>f("upload"),className:`w-full px-4 py-2 text-md -mb-px ${m==="upload"?"active color-primary-blue":"inactive color-secondary-black"}`,children:"Upload"}),i.jsx("button",{onClick:()=>f("url"),className:`w-full px-4 py-2 text-md -mb-px ${m==="url"?"active color-primary-blue":"inactive color-secondary-black"}`,children:"Direct URL"})]}),m==="upload"&&i.jsxs(i.Fragment,{children:[(e.imageUrl||t.iconUrl)&&i.jsxs("div",{className:"image-preview-section gap-2 marginT20",children:[i.jsxs("div",{className:"flex align-center gap-2 flex-1",children:[i.jsx("div",{className:"image-preview-container",children:i.jsx("img",{src:(e==null?void 0:e.imageUrl)||t.iconUrl,alt:"Preview",className:"w-full h-32 object-cover"})}),i.jsx("div",{className:"flex flex-col items-start justify-center",children:v((e==null?void 0:e.imageUrl)||t.iconUrl)})]}),i.jsx(Ie,{text:u?"Copied":"Copy URL",position:"top",children:i.jsx(ut,{size:"md",icon:u?un:fi,color:u?"color-primary-green":"color-primary-blue",callBack:()=>{C()}})}),i.jsx(Ie,{text:"Remove",position:"top",children:i.jsx(ut,{size:"md",icon:Lr,callBack:e.imageUrl||t.iconUrl?x:g})})]}),i.jsx("div",{className:"flex justify-between space-x-2 marginT20",children:i.jsx("button",{onClick:()=>n(!0),className:"rsp-image-upload-properties flex items-center space-x-2 px-4 paddingY15 border rounded hover:bg-gray-50 flex-1",children:i.jsxs("div",{className:"flex flex-col items-center",children:[i.jsx("h3",{children:"Click here to upload image"}),i.jsx("span",{children:"Not more than 2MB"}),i.jsx("small",{children:".png, .jpg, .jpeg, .gif only"})]})})})]}),m==="url"&&i.jsxs(i.Fragment,{children:[(e.imageUrl||t.iconUrl)&&i.jsxs("div",{className:"image-preview-section gap-2 marginT20",children:[i.jsxs("div",{className:"flex align-center gap-2 flex-1",children:[i.jsx("div",{className:"image-preview-container",children:i.jsx("img",{src:(e==null?void 0:e.imageUrl)||t.iconUrl,alt:"Preview",className:"w-full h-32 object-cover"})}),i.jsx("div",{className:"flex flex-col items-start justify-center",children:v((e==null?void 0:e.imageUrl)||t.iconUrl)})]}),i.jsx(Ie,{text:u?"Copied":"Copy URL",position:"top",children:i.jsx(ut,{size:"md",icon:u?un:fi,color:u?"color-primary-green":"color-primary-blue",callBack:()=>{C()}})}),i.jsx(Ie,{text:"Remove",position:"top",children:i.jsx(ut,{size:"md",icon:Lr,callBack:e.imageUrl||t.iconUrl?x:g})})]}),i.jsxs("div",{className:"mt0 flex gap-2 align-items-end marginT20",children:[i.jsx(jt,{name:"imageUrl",classWrapper:"rsp-btninput marginT6",id:"rs_AudienceScore_Industry",placeholder:"Image URL",defaultValue:"Banking",value:s,onChange:A=>{a(A),d("")},required:!0}),e.imageUrl||t.iconUrl?i.jsx(i.Fragment,{}):s.length>0&&i.jsx("button",{onClick:e.imageUrl||t.iconUrl?x:g,className:`rsp-imageurl-button px-3 py-1 text-white rounded ${e.imageUrl||t.iconUrl?"bg-red-600 hover:bg-red-700":"bg-primary-btn hover:bg-blue-600"}`,children:e.imageUrl||t.iconUrl?"Remove":"Import"})]})]}),l&&i.jsxs("div",{className:"flex items-center text-red-500 text-sm gap-1 marginT5",children:[i.jsx(Kt,{className:"w-4 h-4 mr-1"}),l]}),i.jsx(zn,{isOpen:r,onClose:()=>n(!1),onSelect:A=>{o({imageUrl:A}),a(A),d("")},allowAllFiles:!1})]})},oN=({content:e,style:t,onContentChange:o,onStyleChange:r})=>{var v,A;const{pConfig:n}=Te(),[s,a]=S.useState(""),[l,d]=S.useState(""),[c,u]=S.useState((t==null?void 0:t.showIcon)||!1),[p,m]=S.useState(!1),[f,b]=S.useState(""),h="Button",g=(A=(v=n==null?void 0:n.templateDetails)==null?void 0:v.offerdetails)==null?void 0:A.previewData;S.useEffect(()=>{g&&e===g?(m(!0),b("")):g&&e!==g&&b(e)},[g,e]),S.useEffect(()=>{!p&&g&&e!==g&&b(e)},[e,p,g]),S.useEffect(()=>{u((t==null?void 0:t.showIcon)||!1)},[t==null?void 0:t.showIcon]),S.useEffect(()=>{g&&(e===g?p||m(!0):p&&m(!1))},[e,g,p]);const x=w=>{(w==null?void 0:w.imageUrl)!==void 0&&r("iconUrl",w.imageUrl),(w==null?void 0:w.imageAlt)!==void 0&&r("iconAlt",w.imageAlt)},C=()=>{g&&typeof g=="string"&&g.trim()!==""&&(b(e||""),o(g),m(!0))},k=()=>{o(h),m(!1)};return i.jsxs("div",{className:"space-y-4",children:[g&&i.jsxs("div",{className:"rsp-property-elements-block flex items-baseline justify-between",children:[i.jsx("label",{className:"rsp-properties-lable block text-sm color-primary-black w-[150px]",children:"Offer Code"}),i.jsx("button",{type:"button",className:`rsp-button-primary rsp-button-save paddingX15 fs17 ${p?"click-off":""}`,onClick:C,disabled:p,children:"Insert Code"})]}),i.jsxs("div",{className:"rsp-property-elements-block flex items-baseline justify-between",children:[i.jsx("label",{className:"rsp-properties-lable block text-sm color-primary-black w-[150px]",children:"Button text"}),i.jsxs("div",{className:"flex items-center gap-2 flex-1",children:[i.jsx(jt,{classWrapper:"marginT15 flex-1",id:"rs_AudienceScore_Industry",placeholder:"Button text",defaultValue:"Banking",value:e,handleOnchange:w=>o(w.target.value),maxLength:50,required:!0,disabled:g&&p}),g&&i.jsx(Ie,{text:"Reset",position:"top",children:i.jsx("button",{type:"button",className:`p-2 rounded ${p?"bg-primary-blue color-white cursor-pointer":"bg-gray-300 color-gray-500 cursor-not-allowed"}`,onClick:k,disabled:!p,children:i.jsx(Md,{className:"w-4 h-4"})})})]})]}),i.jsxs("div",{className:"rsp-property-elements-block space-y-4",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("label",{className:"rsp-properties-lable block text-sm color-primary-black",children:"Button icon"}),i.jsx(At,{id:"button-icon",isChecked:c,onToggle:w=>{u(w),w?r("showIcon",w):r("actionUpdates",{showIcon:w,iconUrl:""})}})]}),c&&i.jsxs(i.Fragment,{children:[i.jsx(us,{content:e,style:t,onContentChange:x}),i.jsx("div",{className:"marginT30 marginB25",children:i.jsx("div",{className:"flex items-center gap-1",children:i.jsx(jt,{placeholder:"Alternative Text",defaultValue:"Banking",value:(t==null?void 0:t.iconAltText)||"",required:!0,onChange:w=>{r("iconAltText",w),d(w)}})})})]}),c&&i.jsx("div",{className:"rsp-icons-button-properties space-y-4 p-4 bg-gray-50 rounded-lg",children:i.jsx(Yc,{style:t,onStyleChange:r})})]}),i.jsxs("div",{className:"space-y-4",children:[i.jsx("div",{className:"rsp-property-elements-block space-y-4",children:i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("label",{className:"rsp-properties-lable block text-sm color-primary-black",children:"Full width"}),i.jsx(At,{id:"button-full-width",isChecked:(t==null?void 0:t.fullWidth)||!1,onToggle:w=>{const y=(t==null?void 0:t.paddingControl)||{},E=13,j={...y,left:E,right:E,isCustomPadding:!0};r("actionUpdates",{fullWidth:w,paddingControl:j})}})]})}),!(t!=null&&t.fullWidth)&&i.jsxs("div",{className:"rsp-select-dropdown flex items-center justify-between",children:[i.jsx("label",{className:"rsp-properties-lable block text-sm color-primary-black",children:"Align"}),i.jsxs("div",{className:"flex items-center gap-1",children:[i.jsx(Ie,{text:"Left",position:"top",className:"line-block",children:i.jsx("button",{onClick:()=>r("textAlign","left"),className:`p-1.5 rounded ${t.textAlign==="left"?"bg-primary-blue color-white":"bg-tertiary-blue"}`,children:i.jsx(_o,{className:"w-4 h-4"})})}),i.jsx(Ie,{text:"Center",position:"top",className:"line-block",children:i.jsx("button",{onClick:()=>r("textAlign","center"),className:`p-1.5 rounded ${t.textAlign==="center"?"bg-primary-blue color-white":"bg-tertiary-blue"}`,children:i.jsx(Xo,{className:"w-4 h-4"})})}),i.jsx(Ie,{text:"Right",position:"top",className:"line-block",children:i.jsx("button",{onClick:()=>r("textAlign","right"),className:`p-1.5 rounded ${t.textAlign==="right"?"bg-primary-blue color-white":"bg-tertiary-blue"}`,children:i.jsx(Ro,{className:"w-4 h-4"})})})]})]})]})]})},Jc=({style:e,onStyleChange:t,id:o})=>{const[r,n]=S.useState("none"),s=a=>{n(a),t("buttonCustomBorder",a==="custom")};return i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{className:"flex items-center justify-between marginB20",children:[i.jsx("label",{className:"rsp-properties-lable block text-md color-primary-black",children:"Border"}),i.jsxs("div",{className:"flex items-center justify-between gap-2 rsp-btn-group rsp-border-two",children:[i.jsx("button",{className:`border-2 padding2 rounded flex items-center justify-center rsp-btn-set ${e!=null&&e.buttonCustomBorder?"border-quaternary-blue inactive":"border-primary-green active"}`,title:"Radius for All Corners",onClick:()=>{s("none"),t("buttonCustomBorder",!1)},children:i.jsx(Dg,{})}),i.jsx("button",{className:`border-2 padding2 rounded flex items-center justify-center rsp-btn-set ${e!=null&&e.buttonCustomBorder?"border-primary-green active":"border-quaternary-blue inactive"}`,title:"Radius per Corner",onClick:()=>{s("custom"),t("buttonCustomBorder",!0)},children:i.jsx(Pg,{})})]})]}),!(e!=null&&e.buttonCustomBorder)&&i.jsx("div",{className:"rsp-property-elements-block",children:i.jsx(dt,{label:"",style:{width:(e==null?void 0:e.buttonBorderWidth)||0,style:(e==null?void 0:e.buttonBorderStyle)||"solid",color:(e==null?void 0:e.buttonBorderColor)||"#000000",min:0,max:5},onStyleChange:(a,l)=>{switch(a){case"width":t("buttonBorderWidth",l);break;case"style":t("buttonBorderStyle",l);break;case"color":t("buttonBorderColor",l);break}}})}),i.jsxs("div",{className:"hidden",children:[(e==null?void 0:e.buttonCustomBorder)&&i.jsx("div",{className:"rsp-property-elements-block space-y-4",children:i.jsxs("div",{id:"rsp-custom-border-stepper-container",className:"space-y-4 dymond-column-set border-ss",children:[i.jsx(dt,{mainClass:"rsp-dynamic-btn padding-top-left",label:"",widthProps:!0,colorProps:!1,solidProps:!1,style:{width:(e==null?void 0:e.buttonBorderTopWidth)||0,style:(e==null?void 0:e.buttonBorderTopStyle)||"solid",color:(e==null?void 0:e.buttonBorderTopColor)||"#000000",min:0,max:5},onStyleChange:(a,l)=>{switch(a){case"width":t("buttonBorderTopWidth",l);break;case"style":t("buttonBorderTopStyle",l);break;case"color":t("buttonBorderTopColor",l);break}}}),i.jsx(dt,{mainClass:"rsp-dynamic-btn padding-bottom-left",label:"",widthProps:!0,colorProps:!1,solidProps:!1,style:{width:(e==null?void 0:e.buttonBorderLeftWidth)||0,style:(e==null?void 0:e.buttonBorderLeftStyle)||"solid",color:(e==null?void 0:e.buttonBorderLeftColor)||"#000000",min:0,max:5},onStyleChange:(a,l)=>{switch(a){case"width":t("buttonBorderLeftWidth",l);break;case"style":t("buttonBorderLeftStyle",l);break;case"color":t("buttonBorderLeftColor",l);break}}}),i.jsx("div",{className:"rsp-dynamic-btn"}),i.jsx(dt,{mainClass:"rsp-dynamic-btn padding-top-right",label:"",widthProps:!0,colorProps:!1,solidProps:!1,style:{width:(e==null?void 0:e.buttonBorderRightWidth)||0,style:(e==null?void 0:e.buttonBorderRightStyle)||"solid",color:(e==null?void 0:e.buttonBorderRightColor)||"#000000",min:0,max:5},onStyleChange:(a,l)=>{switch(a){case"width":t("buttonBorderRightWidth",l);break;case"style":t("buttonBorderRightStyle",l);break;case"color":t("buttonBorderRightColor",l);break}}}),i.jsx(dt,{mainClass:"rsp-dynamic-btn padding-bottom-right",label:"",widthProps:!0,colorProps:!1,solidProps:!1,style:{width:(e==null?void 0:e.buttonBorderBottomWidth)||0,style:(e==null?void 0:e.buttonBorderBottomStyle)||"solid",color:(e==null?void 0:e.buttonBorderBottomColor)||"#000000",min:0,max:5},onStyleChange:(a,l)=>{switch(a){case"width":t("buttonBorderBottomWidth",l);break;case"style":t("buttonBorderBottomStyle",l);break;case"color":t("buttonBorderBottomColor",l);break}}})]})}),(e==null?void 0:e.buttonCustomBorder)&&((e==null?void 0:e.buttonBorderTopWidth)||(e==null?void 0:e.buttonBorderLeftWidth)||(e==null?void 0:e.buttonBorderRightWidth)||(e==null?void 0:e.buttonBorderBottomWidth))&&i.jsx("div",{className:"rsp-property-elements-block",children:i.jsxs("div",{id:"rsp-custom-border-stepper-container",className:"space-y-4 dymond-column-set border-pp",children:[i.jsx(dt,{mainClass:"rsp-dynamic-btn padding-top-left",label:"",widthProps:!1,colorProps:!0,solidProps:!1,style:{width:(e==null?void 0:e.buttonBorderTopWidth)||0,style:(e==null?void 0:e.buttonBorderTopStyle)||"solid",color:(e==null?void 0:e.buttonBorderTopColor)||"#000000",min:0,max:5},onStyleChange:(a,l)=>{switch(a){case"width":t("buttonBorderTopWidth",l);break;case"style":t("buttonBorderTopStyle",l);break;case"color":t("buttonBorderTopColor",l);break}}}),i.jsx(dt,{mainClass:"rsp-dynamic-btn padding-bottom-left",label:"",widthProps:!1,colorProps:!0,solidProps:!1,style:{width:(e==null?void 0:e.buttonBorderLeftWidth)||0,style:(e==null?void 0:e.buttonBorderLeftStyle)||"solid",color:(e==null?void 0:e.buttonBorderLeftColor)||"#000000",min:0,max:5},onStyleChange:(a,l)=>{switch(a){case"width":t("buttonBorderLeftWidth",l);break;case"style":t("buttonBorderLeftStyle",l);break;case"color":t("buttonBorderLeftColor",l);break}}}),i.jsx("div",{className:"rsp-dynamic-btn"}),i.jsx(dt,{mainClass:"rsp-dynamic-btn padding-top-right",label:"",widthProps:!1,colorProps:!0,solidProps:!1,style:{width:(e==null?void 0:e.buttonBorderRightWidth)||0,style:(e==null?void 0:e.buttonBorderRightStyle)||"solid",color:(e==null?void 0:e.buttonBorderRightColor)||"#000000",min:0,max:5},onStyleChange:(a,l)=>{switch(a){case"width":t("buttonBorderRightWidth",l);break;case"style":t("buttonBorderRightStyle",l);break;case"color":t("buttonBorderRightColor",l);break}}}),i.jsx(dt,{mainClass:"rsp-dynamic-btn padding-bottom-right",label:"",widthProps:!1,colorProps:!0,solidProps:!1,style:{width:(e==null?void 0:e.buttonBorderBottomWidth)||0,style:(e==null?void 0:e.buttonBorderBottomStyle)||"solid",color:(e==null?void 0:e.buttonBorderBottomColor)||"#000000",min:0,max:5},onStyleChange:(a,l)=>{switch(a){case"width":t("buttonBorderBottomWidth",l);break;case"style":t("buttonBorderBottomStyle",l);break;case"color":t("buttonBorderBottomColor",l);break}}})]})}),(e==null?void 0:e.buttonCustomBorder)&&((e==null?void 0:e.buttonBorderTopWidth)||(e==null?void 0:e.buttonBorderLeftWidth)||(e==null?void 0:e.buttonBorderRightWidth)||(e==null?void 0:e.buttonBorderBottomWidth))&&i.jsx("div",{className:"rsp-property-elements-block",children:i.jsxs("div",{id:"rsp-custom-border-stepper-container",className:"space-y-4 dymond-column-set border-ss",children:[i.jsx(dt,{mainClass:"rsp-dynamic-btn padding-top-left",label:"",widthProps:!1,colorProps:!1,solidProps:!0,style:{width:(e==null?void 0:e.buttonBorderTopWidth)||0,style:(e==null?void 0:e.buttonBorderTopStyle)||"solid",color:(e==null?void 0:e.buttonBorderTopColor)||"#000000",min:0,max:5},onStyleChange:(a,l)=>{switch(a){case"width":t("buttonBorderTopWidth",l);break;case"style":t("buttonBorderTopStyle",l);break;case"color":t("buttonBorderTopColor",l);break}}}),i.jsx(dt,{mainClass:"rsp-dynamic-btn padding-bottom-left",label:"",widthProps:!1,colorProps:!1,solidProps:!0,style:{width:(e==null?void 0:e.buttonBorderLeftWidth)||0,style:(e==null?void 0:e.buttonBorderLeftStyle)||"solid",color:(e==null?void 0:e.buttonBorderLeftColor)||"#000000",min:0,max:5},onStyleChange:(a,l)=>{switch(a){case"width":t("buttonBorderLeftWidth",l);break;case"style":t("buttonBorderLeftStyle",l);break;case"color":t("buttonBorderLeftColor",l);break}}}),i.jsx("div",{className:"rsp-dynamic-btn"}),i.jsx(dt,{mainClass:"rsp-dynamic-btn padding-top-right",label:"",widthProps:!1,colorProps:!1,solidProps:!0,style:{width:(e==null?void 0:e.buttonBorderRightWidth)||0,style:(e==null?void 0:e.buttonBorderRightStyle)||"solid",color:(e==null?void 0:e.buttonBorderRightColor)||"#000000",min:0,max:5},onStyleChange:(a,l)=>{switch(a){case"width":t("buttonBorderRightWidth",l);break;case"style":t("buttonBorderRightStyle",l);break;case"color":t("buttonBorderRightColor",l);break}}}),i.jsx(dt,{mainClass:"rsp-dynamic-btn padding-bottom-right ",label:"",widthProps:!1,colorProps:!1,solidProps:!0,style:{width:(e==null?void 0:e.buttonBorderBottomWidth)||0,style:(e==null?void 0:e.buttonBorderBottomStyle)||"solid",color:(e==null?void 0:e.buttonBorderBottomColor)||"#000000",min:0,max:5},onStyleChange:(a,l)=>{switch(a){case"width":t("buttonBorderBottomWidth",l);break;case"style":t("buttonBorderBottomStyle",l);break;case"color":t("buttonBorderBottomColor",l);break}}})]})})]}),(e==null?void 0:e.buttonCustomBorder)&&i.jsx("div",{className:"rsp-property-elements-block marginB20",children:i.jsxs("div",{id:"rsp-custom-border-stepper-container",className:"space-y-4 hiddens",children:[i.jsx(dt,{label:"Top",labelClass:"color-secondary-grey fs13",style:{width:(e==null?void 0:e.buttonBorderTopWidth)||0,style:(e==null?void 0:e.buttonBorderTopStyle)||"solid",color:(e==null?void 0:e.buttonBorderTopColor)||"#000000",min:0,max:5},onStyleChange:(a,l)=>{switch(a){case"width":t("buttonBorderTopWidth",l);break;case"style":t("buttonBorderTopStyle",l);break;case"color":t("buttonBorderTopColor",l);break}}}),i.jsx(dt,{label:"Right",labelClass:"color-secondary-grey fs13",style:{width:(e==null?void 0:e.buttonBorderRightWidth)||0,style:(e==null?void 0:e.buttonBorderRightStyle)||"solid",color:(e==null?void 0:e.buttonBorderRightColor)||"#000000",min:0,max:5},onStyleChange:(a,l)=>{switch(a){case"width":t("buttonBorderRightWidth",l);break;case"style":t("buttonBorderRightStyle",l);break;case"color":t("buttonBorderRightColor",l);break}}}),i.jsx(dt,{label:"Bottom",labelClass:"color-secondary-grey fs13",style:{width:(e==null?void 0:e.buttonBorderBottomWidth)||0,style:(e==null?void 0:e.buttonBorderBottomStyle)||"solid",color:(e==null?void 0:e.buttonBorderBottomColor)||"#000000",min:0,max:5},onStyleChange:(a,l)=>{switch(a){case"width":t("buttonBorderBottomWidth",l);break;case"style":t("buttonBorderBottomStyle",l);break;case"color":t("buttonBorderBottomColor",l);break}}}),i.jsx(dt,{label:"Left",labelClass:"color-secondary-grey fs13",style:{width:(e==null?void 0:e.buttonBorderLeftWidth)||0,style:(e==null?void 0:e.buttonBorderLeftStyle)||"solid",color:(e==null?void 0:e.buttonBorderLeftColor)||"#000000",min:0,max:5},onStyleChange:(a,l)=>{switch(a){case"width":t("buttonBorderLeftWidth",l);break;case"style":t("buttonBorderLeftStyle",l);break;case"color":t("buttonBorderLeftColor",l);break}}})]})})]})},rN=({style:e,onStyleChange:t})=>{const o=()=>{const a=(e==null?void 0:e.paddingControl)||{};return a.isCustomPadding?a.left||a.right||0:a.all||0},r=()=>{var a;return((a=e==null?void 0:e.paddingControl)==null?void 0:a.btnspanheight)??5};function n(a,l){const d=a*Math.pow(10,l+1),c=Math.floor(d/10);return d>=c*10+5?(c+1)/Math.pow(10,l):c/Math.pow(10,l)}const s=[{label:"Standard Fonts",options:_t.standard},{label:"Non standard Fonts",options:_t.decorative}];return i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"rsp-property-elements-block space-y-6",children:[i.jsxs("div",{className:"rsp-property-elements-block flex items-center justify-between",children:[i.jsx("label",{className:"rsp-properties-lable block text-md color-primary-black",children:"Container background"}),i.jsx("div",{className:"flex flex-col space-y-2",children:i.jsx(gt,{value:(e==null?void 0:e.containerBackgroundColor)||"#ffffff",onChange:a=>{t("containerBackgroundColor",a)},children:null})})]}),i.jsxs("div",{className:"rsp-property-elements-block flex items-center justify-between",children:[i.jsx("label",{className:" text-md color-primary-black",children:"Button background"}),i.jsx("div",{className:"flex flex-col space-y-2",children:i.jsx(gt,{value:(e==null?void 0:e.buttonColor)||"#ffffff",onChange:a=>{t("buttonColor",a)},children:null})})]}),i.jsx(Tt,{label:"Font family",width:"width170",value:e.fontFamily||"Arial, sans-serif",options:s,onChange:a=>t("fontFamily",a),previewFont:!0,isGrouped:!0}),i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("label",{className:"rsp-properties-lable block text-md color-primary-black",children:"Font size"}),i.jsx(et,{actionButton:!0,label:"",mainClass:"button-control-view",isShowLeftDescription:!1,leftDescription:"",buttonClass:"",labelClass:"",onClick:()=>{},onChange:a=>t("fontSize",a),min:11,max:72,step:1,defaultValue:e.fontSize||16})]}),i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("label",{className:"rsp-properties-lable block text-md color-primary-black",children:"Text color"}),i.jsx("div",{className:"flex flex-col space-y-2",children:i.jsx(gt,{alpha:!1,value:(e==null?void 0:e.buttonTextColor)||"#ffffff",onChange:a=>{t("buttonTextColor",a)},children:null})})]}),i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("label",{className:"rsp-properties-lable block text-md color-primary-black",children:"Text style"}),i.jsxs("div",{className:"flex space-x-2",children:[i.jsx(Ie,{text:"Bold",position:"top",className:"line-block",children:i.jsx("button",{onClick:()=>t("bold",!e.bold),className:`p-2 rounded ${e.bold?"bg-primary-blue color-white":"bg-tertiary-blue color-primary-black"}`,children:i.jsx(Ko,{className:"w-4 h-4"})})}),i.jsx(Ie,{text:"Italic",position:"top",className:"line-block",children:i.jsx("button",{onClick:()=>t("italic",!e.italic),className:`p-2 rounded ${e.italic?"bg-primary-blue color-white":"bg-tertiary-blue color-primary-black"}`,children:i.jsx(Yo,{className:"w-4 h-4"})})}),i.jsx(Ie,{text:"Underline",position:"left",className:"line-block",children:i.jsx("button",{onClick:()=>t("underline",!e.underline),className:`p-2 rounded ${e.underline?"bg-primary-blue color-white":"bg-tertiary-blue color-primary-black"}`,children:i.jsx(Jo,{className:"w-4 h-4"})})})]})]}),i.jsx(Tt,{label:"Text transform",width:"width130",value:e.textTransform||"None",options:li,onChange:a=>t("textTransform",a)}),i.jsx(et,{actionButton:!0,label:"Letter spacing",mainClass:"button-control-view marginB20",isShowLeftDescription:!1,leftDescription:"",buttonClass:"",labelClass:"",onClick:()=>{},onChange:a=>t("letterSpacing",n(a,1)),min:-1,max:5,step:.5,defaultValue:e.letterSpacing||0}),i.jsxs("div",{className:"space-y-6",children:[!(e!=null&&e.fullWidth)&&i.jsx("div",{children:i.jsx(et,{actionButton:!0,label:"Width",mainClass:"button-control-view",isShowLeftDescription:!0,leftDescription:"Padding (left & right)",buttonClass:"",labelClass:"",onClick:()=>{},onChange:a=>{const d={...(e==null?void 0:e.paddingControl)||{},left:a,right:a,isCustomPadding:!0};t("paddingControl",d)},min:0,max:100,step:5,defaultValue:o()},`padding-lr-${o()}`)}),i.jsx("div",{children:i.jsx(et,{actionButton:!0,label:"Height",mainClass:"button-control-view",isShowLeftDescription:!0,leftDescription:"(px)",buttonClass:"",labelClass:"",onClick:()=>{},onChange:a=>{const d={...(e==null?void 0:e.paddingControl)||{},btnspanheight:a};t("paddingControl",d)},min:5,max:100,step:5,defaultValue:r()},`line-height-${r()}`)})]})]}),i.jsxs("div",{className:"space-y-6",children:[i.jsx(Jc,{id:"button-border-control",style:e,onStyleChange:(a,l)=>{t(a,l)}}),i.jsx("div",{className:"rsp-property-elements-block",children:i.jsx(Tr,{id:"button-border-radius-control",borderRadius:e.buttonRadiusControl,onChange:a=>{t("buttonRadiusControl",a)}})}),i.jsx("div",{className:"rsp-property-elements-block",children:i.jsx(ao,{label:"Margin and Padding",id:"button-padding-control",marginSection:!0,paddingSection:!0,margin:e.containerPadding,padding:{...e.paddingControl,isPaddingEnabled:!1},onChange:(a,l)=>{a&&t("containerPadding",a)}})})]}),i.jsx("div",{className:"space-y-6 hidden"})]})},nN=({style:e,onStyleChange:t,id:o})=>{var n,s;const r=(a,l)=>{t("actionTypeUpdates",{type:a,url:l})};return console.log("action: btn:",e),i.jsx("div",{className:"space-y-4",children:i.jsx(ma,{value:((n=e==null?void 0:e.actionTypeUpdates)==null?void 0:n.type)||"",initialUrl:((s=e==null?void 0:e.actionTypeUpdates)==null?void 0:s.url)||"",onChange:r},`action-dropdown-${o}`)})},Zg=({id:e,content:t,style:o={}})=>{const[r,n]=S.useState("content"),{updateComponent:s,duplicateComponents:a}=Te(),{updateBlockComponent:l}=Ye(),d=p=>{const m=document.querySelector(`[data-component-id="${e}"]`),f=m==null?void 0:m.getAttribute("data-parent-id"),b=m==null?void 0:m.getAttribute("data-column-index");f&&b?l(f,e,{content:p},"ButtonProperties"):s(e,{content:p})},c=async(p,m)=>{var A,w,y,E;const f=document.querySelector(`[data-component-id="${e}"]`),b=f==null?void 0:f.getAttribute("data-parent-id"),h=f==null?void 0:f.getAttribute("data-column-index");let g=null;if(b&&h){const{getBlockComponents:j}=Ye.getState();g=j(b,parseInt(h)).find($=>$.id===e)||null}else{const{getComponentForRender:j}=Te.getState();g=j(e)}const x=(A=g==null?void 0:g.contentTarget)==null?void 0:A.hasTargeting,C=((w=g==null?void 0:g.contentTarget)==null?void 0:w.activeTargetTabIndex)??0,k=(E=(y=g==null?void 0:g.contentTarget)==null?void 0:y.targetGroups)==null?void 0:E[C],v=x&&(k!=null&&k.style)?k.style:(g==null?void 0:g.style)||o;p==="actionUpdates"?b&&h?l(b,e,{style:{...v,...m}},"ButtonProperties"):s(e,{style:{...v,...m}}):b&&h?l(b,e,{style:{...v,[p]:m}},"ButtonProperties"):s(e,{style:{...v,[p]:m}}),await a()},u=()=>{switch(r){case"content":return i.jsx(oN,{content:t,style:o,onContentChange:d,onStyleChange:c});case"style":return i.jsx(rN,{style:o,onStyleChange:c});case"action":return i.jsx(nN,{style:o,onStyleChange:c,id:e});default:return null}};return i.jsxs("div",{className:"space-y-6",children:[i.jsx(tN,{activeTab:r,onTabChange:n}),u()]})},iN=({content:e,onContentChange:t,altText:o="",onAltTextChange:r})=>{const n=S.useRef(null),[s,a]=S.useState(""),[l,d]=S.useState(e||"");S.useEffect(()=>{d(e||"")},[e]);const c=async m=>{var b;const f=(b=m.target.files)==null?void 0:b[0];if(a(""),!!f){if(!f.type.startsWith("image/")){a("Please upload an image file");return}if(f.size>2*1024*1024){a("File size must not exceed 2MB");return}try{const h=new FileReader;h.onload=g=>{var x;(x=g.target)!=null&&x.result&&t(g.target.result)},h.onerror=()=>{a("Failed to read the image file")},h.readAsDataURL(f)}catch{a("Failed to process image")}}},u=()=>{if(!l.trim()){a("Please enter an image URL");return}try{new URL(l),a(""),t(l)}catch{a("Please enter a valid URL")}},p=()=>{t(""),d(""),a("")};return i.jsxs("div",{className:"space-y-4",children:[i.jsx("h3",{className:"text-md font-regular color-primary-black",children:"Image Upload"}),i.jsxs("div",{className:"space-y-2",children:[i.jsxs("button",{onClick:()=>{var m;return(m=n.current)==null?void 0:m.click()},className:"w-full flex items-center justify-center px-4 py-2 border-2 border-dashed border-gray-300 rounded-lg hover:border-gray-400",children:[i.jsx(Pd,{className:"w-5 h-5 mr-2"}),i.jsx("span",{children:"Choose Image"})]}),i.jsx("input",{ref:n,type:"file",className:"hidden",accept:"image/*",onChange:c}),s&&i.jsxs("div",{className:"flex items-center text-red-500 text-sm gap-1 marginT5",children:[i.jsx(Kt,{className:"w-4 h-4 mr-1"}),s]}),e&&i.jsx("img",{src:e,alt:"Preview",className:"w-full h-32 object-cover rounded-md"})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block text-md color-primary-black mb-1",children:"Image URL"}),i.jsxs("div",{className:"flex gap-2 align-items-end",children:[i.jsx("input",{type:"url",value:l,onChange:m=>d(m.target.value),disabled:!!e,className:`ai-email-input-field flex-1 p-2 ${e?"bg-gray-100 cursor-not-allowed":""}`,placeholder:"Enter image URL"}),i.jsx("button",{onClick:e?p:u,className:`px-3 py-2 text-white rounded ${e?"bg-red-600 hover:bg-red-700":"bg-primary-btn hover:bg-blue-600"}`,children:e?"Remove":"Import"})]})]}),e&&r&&i.jsxs("div",{className:"mt-4",children:[i.jsx("label",{className:"block text-md color-primary-black mb-1",children:"Alt text"}),i.jsx("input",{type:"text",value:o,onChange:m=>r(m.target.value),className:"ai-email-input-field w-full p-2",placeholder:"Enter alt text for accessibility",maxLength:125})]})]})},sN=({style:e,onStyleChange:t})=>i.jsxs("div",{className:"space-y-4",children:[i.jsx("h3",{className:"text-md font-regular color-primary-black",children:"Display Settings"}),i.jsxs("div",{children:[i.jsx("label",{className:"block text-md color-primary-black",children:"Object Fit"}),i.jsxs("select",{value:e.objectFit||"contain",onChange:o=>t("objectFit",o.target.value),className:"w-full p-2 border rounded-md",children:[i.jsx("option",{value:"cover",children:"Cover"}),i.jsx("option",{value:"contain",children:"Contain"}),i.jsx("option",{value:"fill",children:"Fill"}),i.jsx("option",{value:"scale-down",children:"Scale Down"})]})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block text-md color-primary-black",children:"Alt Text"}),i.jsx("input",{type:"text",value:e.alt||"",onChange:o=>t("alt",o.target.value),className:"w-full p-2 border rounded-md",placeholder:"Enter image description"})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block text-md color-primary-black",children:"Rounded corner"}),i.jsx("input",{type:"number",value:e.borderRadius||0,onChange:o=>t("borderRadius",parseInt(o.target.value)),className:"w-full p-2 border rounded-md",min:"0",max:"20"})]})]}),aN=({style:e,onStyleChange:t})=>i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{children:[i.jsx("label",{className:"block text-md color-primary-black",children:"Container background"}),i.jsxs("div",{className:"flex flex-col space-y-2",children:[i.jsx("input",{type:"color",value:e.backgroundColor||"#ffffff",onChange:o=>t("backgroundColor",o.target.value),className:"w-full p-1 h-10 border rounded-md"}),i.jsx("input",{type:"text",value:e.backgroundColor||"#ffffff",onChange:o=>t("backgroundColor",o.target.value),className:"w-full p-2 border rounded-md font-mono text-sm",placeholder:"#ffffff"})]})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block text-md color-primary-black",children:"Padding"}),i.jsx("div",{className:"grid grid-cols-2 gap-4",children:["Top","Right","Bottom","Left"].map(o=>i.jsxs("div",{children:[i.jsx("label",{className:"block text-xs text-gray-500 mb-1",children:o}),i.jsx("input",{type:"number",value:e[`padding${o}`]||0,onChange:r=>t(`padding${o}`,parseInt(r.target.value)),className:"w-full p-2 border rounded-md",min:"0",max:"100"})]},o))})]})]}),Qg=({style:e,onStyleChange:t,defaultWidth:o=180,defaultHeight:r=180,minSize:n=0,maxWidth:s=600})=>{const[a,l]=S.useState(null);S.useEffect(()=>{const u=parseInt(e.width)||o,p=parseInt(e.height)||r;l(u/p)},[o,r,e.width,e.height]);const d=S.useCallback((u,p)=>{if(p=Math.round(p),p<n&&(p=n),u==="width"&&p>s&&(p=s),e.maintainAspectRatio&&a)if(u==="width"){const m=Math.round(p/a);t("width",p),t("height",m)}else{const m=Math.round(p*a);if(m>s){const f=s,b=Math.round(f/a);t("width",f),t("height",b)}else t("width",m),t("height",p)}else t(u,p)},[e.maintainAspectRatio,a,t,s,n]),c=S.useCallback(u=>{if(u){const p=Math.round(Math.min(parseInt(e.width)||o,s)),m=Math.round(parseInt(e.height)||r),f=p/m;if(l(f),p>s){const b=s,h=Math.round(b/f);t("width",b),t("height",h)}}t("maintainAspectRatio",u)},[e.width,e.height,t,o,r,s]);return{handleSizeChange:d,toggleAspectRatio:c}},lN=({id:e,style:t,onStyleChange:o})=>{var c;const[r,n]=S.useState(600),{canvasSettings:s,components:a}=Te();S.useEffect(()=>{var f,b,h,g,x,C,k,v,A;const u=cr(e),p=((f=s==null?void 0:s.style)==null?void 0:f.emailWidth)||600;if(u.isInsideBlock){const w=a.find(y=>y.id===u.parentId);if(w&&w.type==="block"){const y=(b=w.style)==null?void 0:b.columnWidths,j=(((h=w.style)==null?void 0:h.columnGap)||0)*(u.columnCount-1),B=p-j;let $;y&&y[u.columnIndex]?$=y[u.columnIndex]:$=B/u.columnCount;const _=(g=t==null?void 0:t.paddingControl)!=null&&g.isCustomPadding?((x=t==null?void 0:t.paddingControl)==null?void 0:x.left)||0:((C=t==null?void 0:t.paddingControl)==null?void 0:C.all)||0,z=(k=t==null?void 0:t.paddingControl)!=null&&k.isCustomPadding?((v=t==null?void 0:t.paddingControl)==null?void 0:v.right)||0:((A=t==null?void 0:t.paddingControl)==null?void 0:A.all)||0,N=t!=null&&t.customBorder?(t==null?void 0:t.borderLeftWidth)||0:(t==null?void 0:t.borderWidth)||0,O=t!=null&&t.customBorder?(t==null?void 0:t.borderRightWidth)||0:(t==null?void 0:t.borderWidth)||0,K=Math.round($-_-z-N-O);n(K);return}}const m=Math.round(Rr(e,u.columnCount,t==null?void 0:t.paddingControl,t,p));n(m)},[e,t==null?void 0:t.paddingControl,t==null?void 0:t.borderWidth,t==null?void 0:t.borderLeftWidth,t==null?void 0:t.borderRightWidth,t==null?void 0:t.customBorder,(c=s==null?void 0:s.style)==null?void 0:c.emailWidth,a]);const{handleSizeChange:l,toggleAspectRatio:d}=Qg({style:t,onStyleChange:o,defaultWidth:200,defaultHeight:200,minSize:0,maxWidth:r});return i.jsxs("div",{className:"space-y-4",children:[i.jsx("h3",{className:"text-md font-regular color-primary-black",children:"Size Settings"}),i.jsxs("div",{children:[i.jsx("label",{className:"block text-md color-primary-black mb-1",children:"Width"}),i.jsxs("div",{className:"flex items-center space-x-2",children:[i.jsx("input",{type:"number",value:Math.round(parseInt(t.width)||200),onChange:u=>{const p=parseFloat(u.target.value)||0;l("width",p)},className:"w-full p-2 border rounded-md",min:"0",max:r,step:"1"}),i.jsx("span",{className:"text-sm text-gray-500",children:"px"})]}),i.jsxs("p",{className:"mt-1 text-xs text-gray-500",children:["Min: 0px, Max: ",r,"px",cr(e).isInsideBlock&&i.jsx("span",{className:"text-blue-600 ml-1",children:"(Block column width)"})]})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block text-md color-primary-black mb-1",children:"Height"}),i.jsxs("div",{className:"flex items-center space-x-2",children:[i.jsx("input",{type:"number",value:Math.round(parseInt(t.height)||200),onChange:u=>{const p=parseFloat(u.target.value)||0;l("height",p)},className:"w-full p-2 border rounded-md",min:"0",step:"1"}),i.jsx("span",{className:"text-sm text-gray-500",children:"px"})]}),i.jsx("p",{className:"mt-1 text-xs text-gray-500",children:"Min: 0px"})]}),i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("label",{className:"text-sm color-secondary-black",children:"Maintain aspect ratio"}),i.jsx(At,{isChecked:t.maintainAspectRatio||!1,onToggle:u=>{d(u)}}),i.jsxs("div",{className:"relative inline-block w-10 mr-2 align-middle select-none",children:[i.jsx("input",{type:"checkbox",checked:t.maintainAspectRatio||!1,onChange:u=>d(u.target.checked),className:"toggle-checkbox absolute block w-6 h-6 rounded-full bg-white appearance-none cursor-pointer"}),i.jsx("label",{className:"toggle-label block overflow-hidden h-6 rounded-full bg-gray-300 cursor-pointer"})]})]})]})},cN=[{title:"Style",items:["Photorealistic","Digital Art","Oil Painting","Watercolor","Sketch","3D Render","Minimalist","Abstract"]},{title:"Lighting",items:["Natural Light","Studio Light","Dramatic","Soft Light","Backlit","Golden Hour","Night","High Key"]},{title:"Composition",items:["Close-up","Wide Shot","Aerial View","Portrait","Landscape","Symmetrical","Rule of Thirds","Dynamic"]},{title:"Mood",items:["Vibrant","Serene","Dramatic","Mysterious","Cheerful","Professional","Elegant","Energetic"]}],dN=({isOpen:e,onClose:t,onGenerate:o})=>{const[r,n]=S.useState(""),[s,a]=S.useState(""),[l,d]=S.useState(!1),[c,u]=S.useState({}),[p,m]=S.useState(!1),[f,b]=S.useState("");if(!e)return null;const h=(C,k)=>{u(v=>({...v,[C]:v[C]===k?"":k}))},g=()=>Object.values(c).filter(Boolean),x=async()=>{var C;if(!r.trim()&&g().length===0){b("Please enter a prompt or select prompt categories");return}m(!0),b("");try{let k=r;const v=g();v.length>0&&(k=`${v.join(", ")}. ${k}`),l&&s.trim()&&(k=`${k}. DO NOT INCLUDE: ${s.trim()}`);const A=await fetch("https://api.openai.com/v1/images/generations",{method:"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer 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"},body:JSON.stringify({model:"dall-e-3",prompt:k,n:1,size:"1024x1024",quality:"standard",response_format:"url"})});if(!A.ok){const y=await A.json();throw new Error(((C=y.error)==null?void 0:C.message)||"Failed to generate image")}const w=await A.json();o(w.data[0].url),t()}catch(k){console.error("Image generation error:",k),b(k instanceof Error?k.message:"Failed to generate image")}finally{m(!1)}};return i.jsx(i.Fragment,{children:kt.createPortal(i.jsx("div",{id:"rsp-modal-backdrop",className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:i.jsxs("div",{className:"bg-white rounded-lg w-full max-w-4xl mx-4",children:[i.jsxs("div",{className:"flex justify-between items-center p-6 border-b",children:[i.jsx("h3",{className:"text-lg-del font-semibold-del",children:"Generate Image"}),i.jsx("button",{onClick:t,className:"p-1 hover:bg-gray-100 rounded",children:i.jsx(oo,{className:"w-5 h-5"})})]}),i.jsxs("div",{className:"p-6 space-y-6",children:[i.jsxs("div",{children:[i.jsx("label",{className:"block text-md font-regular color-primary-black mb-1",children:"Image Description"}),i.jsx("textarea",{value:r,onChange:C=>n(C.target.value),className:"w-full p-3 border rounded-lg h-32 resize-none",placeholder:"Describe the image you want to generate..."})]}),i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("label",{className:"text-md font-regular color-primary-black",children:"Negative Prompt"}),i.jsxs("div",{className:"relative inline-block w-10 mr-2 align-middle select-none",children:[i.jsx("input",{type:"checkbox",checked:l,onChange:C=>d(C.target.checked),className:"toggle-checkbox absolute block w-6 h-6 rounded-full bg-white appearance-none cursor-pointer"}),i.jsx("label",{className:"toggle-label block overflow-hidden h-6 rounded-full bg-gray-300 cursor-pointer"})]})]}),l&&i.jsx("div",{children:i.jsx("textarea",{value:s,onChange:C=>a(C.target.value),className:"w-full p-3 border rounded-lg h-24 resize-none",placeholder:"Describe what you don't want in the generated image..."})}),i.jsx("div",{className:"grid grid-cols-2 gap-6",children:cN.map(C=>i.jsxs("div",{className:"space-y-3",children:[i.jsx("h4",{className:"text-md font-regular color-primary-black border-b pb-2",children:C.title}),i.jsx("div",{className:"flex flex-wrap gap-2",children:C.items.map(k=>i.jsx("button",{onClick:()=>h(C.title,k),className:`px-3 py-1.5 rounded-full text-sm transition-colors ${c[C.title]===k?"bg-primary-blue text-white":"bg-gray-100 color-secondary-black hover:bg-gray-200"}`,children:k},k))})]},C.title))}),g().length>0&&i.jsxs("div",{className:"bg-gray-50 p-4 rounded-lg",children:[i.jsx("h4",{className:"text-md font-regular color-primary-black mb-2",children:"Selected Prompts:"}),i.jsx("div",{className:"flex flex-wrap gap-2",children:g().map(C=>i.jsx("span",{className:"inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium-del bg-blue-100 text-blue-800",children:C},C))})]}),f&&i.jsxs("div",{className:"flex items-center space-x-2 text-red-500",children:[i.jsx(Kt,{className:"w-4 h-4"}),i.jsx("p",{className:"text-sm",children:f})]})]}),i.jsxs("div",{className:"flex justify-end p-6 border-t space-x-3",children:[i.jsx("button",{onClick:t,className:"px-4 py-2 color-secondary-black bg-gray-100 rounded-lg hover:bg-gray-200",children:"Cancel"}),i.jsx("button",{onClick:x,disabled:p,className:"px-4 py-2 bg-primary-blue text-white rounded-lg hover:bg-blue-600 disabled:opacity-50 flex items-center space-x-2",children:p?i.jsxs(i.Fragment,{children:[i.jsx("span",{className:"animate-spin",children:"⚪"}),i.jsx("span",{children:"Generating..."})]}):i.jsxs(i.Fragment,{children:[i.jsx(Jr,{className:"w-4 h-4"}),i.jsx("span",{children:"Generate"})]})})]})]})}))})},e0=({id:e,content:t,style:o={}})=>{const{updateComponent:r}=Te(),[n,s]=S.useState(!1),[a,l]=S.useState("content"),d=f=>{r(e,{content:f})},c=f=>{r(e,{style:{...o,alt:f}})},u=(f,b)=>{const h={style:{...o,[f]:b}};if(o.maintainAspectRatio&&(f==="width"||f==="height")){const g=parseInt(o.width)||200,x=parseInt(o.height)||200,C=g/x;f==="width"?h.style.height=Math.round(b/C):h.style.width=Math.round(b*C)}(f==="width"||f==="height")&&(h.size={width:h.style.width||o.width||200,height:h.style.height||o.height||200}),r(e,h)},p=f=>{r(e,{style:{...o,...f}})},m=()=>{switch(a){case"content":return i.jsxs("div",{className:"space-y-6",children:[i.jsx(iN,{content:t,onContentChange:d,altText:o.alt||"",onAltTextChange:c}),i.jsxs("button",{onClick:()=>s(!0),className:"w-full flex items-center justify-center px-4 py-2 bg-primary-blue text-white rounded hover:bg-blue-600",children:[i.jsx(Jr,{className:"w-4 h-4 mr-2"}),"Generate Image"]}),i.jsx(lN,{id:e,style:o,onStyleChange:u})]});case"style":return i.jsxs("div",{className:"space-y-6",children:[i.jsx(sN,{style:o,onStyleChange:u}),i.jsx(aN,{style:o,onStyleChange:u})]});case"spacing":return i.jsx(ao,{id:"padding-control",padding:o.paddingControl,onChange:f=>{p({paddingControl:f})}});default:return null}};return i.jsxs("div",{className:"space-y-6",children:[i.jsx(Kc,{activeTab:a,onTabChange:l}),m(),i.jsx(dN,{isOpen:n,onClose:()=>s(!1),onGenerate:f=>{d(f),s(!1)}})]})},uN=({id:e,style:t,onStyleChange:o,content:r,columnCount:n})=>{var E,j;const[s,a]=S.useState(0),[l,d]=S.useState(600),{canvasSettings:c}=Te(),u=n||1,p=((E=c==null?void 0:c.style)==null?void 0:E.emailWidth)||600;!(t!=null&&t.enableContent)||(t==null?void 0:t.wrapperLayout)==="image-top"||(t==null?void 0:t.wrapperLayout)==="image-bottom"||Math.round(p*.5),S.useEffect(()=>{var z;const B=cr(e),$=((z=c==null?void 0:c.style)==null?void 0:z.emailWidth)||600,_=Rr(e,B.columnCount||u,t==null?void 0:t.paddingControl,t,$);d(_)},[e,u,t==null?void 0:t.paddingControl,t==null?void 0:t.borderWidth,t==null?void 0:t.borderLeftWidth,t==null?void 0:t.borderRightWidth,t==null?void 0:t.customBorder,(j=c==null?void 0:c.style)==null?void 0:j.emailWidth]);const{handleSizeChange:m}=Qg({style:{width:t.imageWidth,height:t.imageHeight,maintainAspectRatio:t.maintainAspectRatio},onStyleChange:(B,$)=>{o(B==="width"?"imageWidth":B==="height"?"imageHeight":B,$)},defaultWidth:300,defaultHeight:300,minSize:20,maxWidth:l});parseInt(t.imageWidth),t.imageHeight==="auto"||parseInt(t.imageHeight),t.maintainAspectRatio,S.useEffect(()=>{if(t!=null&&t.paddingControl){const B=t.paddingControl.left||0,$=t.paddingControl.right||0,_=B+$;a(_)}},[t.paddingControl.left,t.paddingControl.right]);let f=0,b=0;const{paddingControl:h}=t||{},{isCustomPadding:g,left:x=0,right:C=0,all:k=0}=h||{},{customBorder:v,borderRightWidth:A=0,borderLeftWidth:w=0,borderWidth:y=0}=t||{};return f=g?x+C:k*2,b=v?A+w:y*2,(t==null?void 0:t.imageWidth)+f+b>p?p-(f+b):t.imageWidth,i.jsx(i.Fragment,{children:i.jsx(et,{label:"Width",mainClass:"button-control-view",description:`Min: 20, Max: ${l}`,onChange:B=>m("width",B),onClick:()=>{},min:20,max:l,step:10,defaultValue:parseInt(t.imageWidth)<l?parseInt(t.imageWidth):l||180})})},pN=({style:e,onStyleChange:t})=>i.jsx("div",{className:"space-y-4",children:i.jsx(Tr,{id:"border-radius-control",borderRadius:e.borderRadiusControl,onChange:o=>{t("borderRadiusControl",o)}})}),t0=[{value:"image-left",label:"Left",description:"Image on the left side with text on the right",icon:i.jsx(i.Fragment,{children:i.jsxs("svg",{width:"14",height:"16",viewBox:"0 0 14 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[i.jsx("line",{x1:"0.5",y1:"0.5",x2:"0.5",y2:"15.5",stroke:"#BBBBBB",strokeLinecap:"round"}),i.jsx("rect",{x:"3.5",y:"5.5",width:"10",height:"5",rx:"1.5",fill:"#BBBBBB",stroke:"#BBBBBB"})]})})},{value:"image-top",label:"Top",description:"Image on top with text below",icon:i.jsx(i.Fragment,{children:i.jsxs("svg",{width:"16",height:"14",viewBox:"0 0 16 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[i.jsx("line",{x1:"0.5",y1:"0.5",x2:"15.5",y2:"0.5",stroke:"#BBBBBB",strokeLinecap:"round"}),i.jsx("rect",{x:"5.5",y:"13.5",width:"10",height:"5",rx:"1.5",transform:"rotate(-90 5.5 13.5)",fill:"#BBBBBB",stroke:"#BBBBBB"})]})})},{value:"image-right",label:"Right",description:"Image on the right side with text on the left",icon:i.jsx(i.Fragment,{children:i.jsxs("svg",{width:"14",height:"16",viewBox:"0 0 14 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[i.jsx("line",{x1:"13.5",y1:"0.5",x2:"13.5",y2:"15.5",stroke:"#BBBBBB",strokeLinecap:"round"}),i.jsx("rect",{x:"0.5",y:"5.5",width:"10",height:"5",rx:"1.5",fill:"#BBBBBB",stroke:"#BBBBBB"})]})})},{value:"image-bottom",label:"Bottom",description:"Image on bottom with text above",icon:i.jsx(i.Fragment,{children:i.jsxs("svg",{width:"16",height:"14",viewBox:"0 0 16 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[i.jsx("line",{x1:"0.5",y1:"13.5",x2:"15.5",y2:"13.5",stroke:"#BBBBBB",strokeLinecap:"round"}),i.jsx("rect",{x:"5.5",y:"10.5",width:"10",height:"5",rx:"1.5",transform:"rotate(-90 5.5 10.5)",fill:"#BBBBBB",stroke:"#BBBBBB"})]})})}],hN=({value:e,onChange:t,columnCount:o})=>{const r=o||1,n=r!==1?t0.filter(a=>["image-top","image-bottom"].includes(a.value)):t0,s=r!==1&&!["image-top","image-bottom"].includes(e)?"image-top":e;return i.jsxs("div",{className:"flex items-start justify-between",children:[i.jsx("label",{className:"block text-md color-primary-black",children:"Image position"}),i.jsx("div",{className:"rsp-image-position-props flex items-center gap-1 bg-builder-btn rounded padding3",children:n.map(a=>i.jsx("div",{className:`position-${a.value}`,children:i.jsx(Ie,{text:a.label,position:"top",className:"line-block",children:i.jsx("button",{onClick:()=>t(a.value),className:`padding5 rounded transition-colors ${s===a.value?"active bg-white box-shadow-01 btn-control":"inactive color-primary-black"}`,title:a.description,children:i.jsx("div",{className:"text-sm font-medium-del",children:a.icon})},a.value)})},a.value))})]})},fN=[{title:"Tone",items:["Professional","Casual","Friendly","Formal","Humorous","Inspirational","Persuasive","Educational"]},{title:"Purpose",items:["Marketing","Informational","Technical","Storytelling","Instructional","Promotional","Announcement","Description"]},{title:"Style",items:["Concise","Detailed","Conversational","Analytical","Creative","Factual","Narrative","Engaging"]},{title:"Content Type",items:["Product Feature","Service Overview","Company News","Customer Story","How-to Guide","Industry Update","Team Spotlight","Event Announcement"]},{title:"Length",items:["Very Short (50-100 chars)","Short (100-250 chars)","Medium (250-500 chars)","Long (500-1000 chars)","Very Long (1000+ chars)","Title Only (20-50 chars)","Snippet (50-100 chars)","Custom Length"]}],mN=({isOpen:e,onClose:t,onGenerate:o})=>{const[r,n]=S.useState(""),[s,a]=S.useState({}),[l,d]=S.useState({min:250,max:500}),[c,u]=S.useState(!1),[p,m]=S.useState(!1),[f,b]=S.useState("");if(!e)return null;const h=(k,v)=>{if(k==="Length"&&v==="Custom Length"){u(!0),a(A=>({...A,[k]:v}));return}k==="Length"&&u(!1),a(A=>({...A,[k]:A[k]===v?"":v}))},g=()=>Object.entries(s).filter(([k,v])=>k==="Length"&&v==="Custom Length"?!1:!!v).map(([k,v])=>v),x=()=>{const k=s.Length;return k?k==="Custom Length"?`The text content should be between ${l.min} and ${l.max} characters in length.`:k.replace(/\(|\)/g,""):""},C=async()=>{if(!r.trim()&&g().length===0){b("Please enter a prompt or select prompt categories");return}m(!0),b("");try{let k=r;const v=g(),A=x();(v.length>0||A)&&(k=`
5003
5003
  Generate content for an image+text component with the following characteristics:
5004
5004
  ${v.length>0?`Style: ${v.join(", ")}`:""}
5005
5005
  ${A?`Length: ${A}`:""}
@@ -5014,7 +5014,7 @@ DO NOT INCLUDE: ${a}`);const $=await fetch("https://api.openai.com/v1/chat/compl
5014
5014
  ${$&&m?"errorContainer":""}
5015
5015
  ${o}
5016
5016
  rs-radio-wrapper position-relative
5017
- ${u?"rs-popover-enabled":""}`,children:[$&&m&&i.jsx("div",{className:"validation-message",children:$}),i.jsx("div",{className:"radio-wrapper",children:i.jsxs("label",{htmlFor:n,className:B?"mr0":"",children:[i.jsx("input",{type:e,id:n,name:r,onChange:F,value:O,checked:q,className:`radio ${t}`,disabled:k}),i.jsxs("span",{className:`${t} ${E?"align-items-center d-flex position-relative top-15":""} lbl ${k?"color-secondary-grey":""}`,children:[v&&i.jsx("i",{className:l}),f&&w?i.jsxs(i.Fragment,{children:[i.jsx("i",{className:"d-none",children:O==null?void 0:O.slice(0,j)}),E&&i.jsx(Ie,{text:O.slice(j),children:i.jsx("span",{children:K(O.slice(j),25)})})]}):i.jsx("span",{className:`${B?"d-none":""}`,children:a}),A&&A]}),d]})})]})},s0=S.memo(_N),RN=S.memo(({isOpen:e,onClose:t,component:o})=>{var j,B,$,_,z;const[r,n]=S.useState(null),[s,a]=S.useState(null),[l,d]=S.useState(0),[c,u]=S.useState("common"),{pConfig:p,selectedComponent:m,components:f}=Te(),{blockComponents:b}=Ye(),h=S.useRef(!1),g=S.useRef(null),x=N=>N&&typeof N=="object"&&N.offerId&&N.offerName&&typeof N.offerId=="number"&&typeof N.offerName=="string",C=N=>N&&typeof N=="object"&&N.offerTypeId&&N.friendlyName&&typeof N.offerTypeId=="number"&&typeof N.friendlyName=="string",k=N=>{const{selectedComponent:O}=Te.getState(),{updateComponent:K}=Te.getState(),{updateBlockComponent:F}=Ye.getState();if(!O)return;const q=document.querySelector(`[data-component-id="${O}"]`),R=q==null?void 0:q.getAttribute("data-parent-id"),M=q==null?void 0:q.getAttribute("data-column-index");let L=null,U={};if(R&&M){const Y=`${R}-${M}`;L=(b[Y]||[]).find(ie=>ie.id===O),U=(L==null?void 0:L.content)||{}}else L=f.find(Y=>Y.id===O),U=(L==null?void 0:L.content)||{};const ee={content:{buttonText:"Offer Code",...U,...N}};R&&M?F(R,O,ee):K(O,ee)},v=N=>{const{selectedComponent:O}=Te.getState(),{updateComponent:K}=Te.getState(),{updateBlockComponent:F}=Ye.getState();if(!O)return;const q=document.querySelector(`[data-component-id="${O}"]`),R=q==null?void 0:q.getAttribute("data-parent-id"),M=q==null?void 0:q.getAttribute("data-column-index");let L=null,U={};if(R&&M){const Y=`${R}-${M}`;L=(b[Y]||[]).find(ie=>ie.id===O),U=(L==null?void 0:L.content)||{}}else L=f.find(Y=>Y.id===O),U=(L==null?void 0:L.content)||{};const ee={content:{buttonText:"Offer Code",...U,...N}};R&&M?F(R,O,ee):K(O,ee)},A=()=>{if(!g.current)return;const{selectedComponent:N}=Te.getState(),{updateComponent:O}=Te.getState(),{updateBlockComponent:K}=Ye.getState();if(!N)return;const F=document.querySelector(`[data-component-id="${N}"]`),q=F==null?void 0:F.getAttribute("data-parent-id"),R=F==null?void 0:F.getAttribute("data-column-index");let M=null,L={};if(q&&R){const ne=`${q}-${R}`;M=(b[ne]||[]).find(oe=>oe.id===N),L=(M==null?void 0:M.content)||{}}else M=f.find(ne=>ne.id===N),L=(M==null?void 0:M.content)||{};const{offerType:U,offer:ee,codeType:Y,offerListCountData:te,...ie}=L,ue={content:{buttonText:"Offer Code",...ie,...g.current}};q&&R?K(q,N,ue):O(N,ue)};if(S.useEffect(()=>{var N,O,K,F;if(e){h.current=!1;let q=null;if(m&&(q=f.find(Y=>Y.id===m),!q)){const Y=document.querySelector(`[data-component-id="${m}"]`),te=Y==null?void 0:Y.getAttribute("data-parent-id"),ie=Y==null?void 0:Y.getAttribute("data-column-index");if(te&&ie){const ue=`${te}-${ie}`;q=(b[ue]||[]).find(ae=>ae.id===m)}}const R=q||o,M=(N=R==null?void 0:R.content)==null?void 0:N.offerType,L=((O=R==null?void 0:R.content)==null?void 0:O.codeType)??"common",U=(K=R==null?void 0:R.content)==null?void 0:K.offer,ee=((F=R==null?void 0:R.content)==null?void 0:F.offerListCountData)??0;g.current={offerType:M,offer:U,codeType:L,offerListCountData:ee},n(M??null),u(L),d(ee),x(U)?a(U):a(null),C(M)?n(M):n(null),M&&(p!=null&&p.offerCallback)&&!h.current&&(p.offerCallback(2,{...M,codeType:L}),h.current=!0,x(U)&&setTimeout(async()=>{const Y=await p.offerCallback(3,{...U,codeType:L});Y!=null&&Y.status&&(Y!=null&&Y.data)&&d(Y.data)},100))}},[e,m]),S.useEffect(()=>{e||(h.current=!1)},[e]),S.useEffect(()=>{e||(n(null),a(null),d(0),u("common"),g.current=null)},[e]),!e)return null;const w=()=>{const N=C(r),O=x(s);if(!N||!O){console.error("handleSubmit - invalid data detected:",{offerType:r,offer:s,isValidOfferType:N,isValidOffer:O});return}v({offerType:r,offer:s,codeType:c,offerListCountData:l}),p==null||p.offerCallback(4,{selectedOfferType:r,selectedOffer:s,codeType:c}),t()},y=()=>{A(),t()},E=N=>{u(N),n(null),a(null),d(0),k({codeType:N,offerType:null,offer:null,offerListCountData:0}),p==null||p.offerCallback(1,N)};return i.jsx(i.Fragment,{children:kt.createPortal(i.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50",children:i.jsx("div",{id:"rsp-modal-backdrop",className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:i.jsxs("div",{className:"rsp-modal bg-white rounded-lg w-full max-w-[500px]",children:[i.jsxs("div",{className:"rsp-modal-header",children:[i.jsx("div",{className:"flex items-center space-x-1",children:i.jsx("h2",{className:"modal-title",children:"Select offer"})}),i.jsx(Pt,{className:"icon-md",color:"color-primary-blue",innerCloseContent:!1,handleClose:y})]}),i.jsxs("div",{className:"rsp-modal-body",children:[i.jsxs("div",{className:"form-group marginB41",children:[i.jsx("label",{className:"rsp-properties-lable marginB25 block fs19 color-primary-black",children:"Offer code type"}),i.jsxs("div",{className:"flex space-x-4",children:[i.jsx(s0,{name:"codeType",labelName:"common",value:c,onValueChange:E,className:"w-4 h-4 color-primary-black capitalize"}),i.jsx(s0,{name:"codeType",labelName:"unique",value:c,onValueChange:E,className:"w-4 h-4 color-primary-black capitalize"})]})]}),i.jsx(BN,{selectedType:r,onSelect:N=>{n(N),(r==null?void 0:r.offerTypeId)!==(N==null?void 0:N.offerTypeId)?(a(null),d(0),k({offerType:N,offer:null,offerListCountData:0})):k({offerType:N})},codeType:c}),i.jsx(SN,{selectedOffer:s,onSelect:N=>{if(N&&x(N)){a(N);const O={offerId:N.offerId,offerName:N.offerName};v({offer:O})}else a(null),v({offer:null})},component:o,setOfferListCountData:d,codeType:c}),((B=(j=p==null?void 0:p.offerData)==null?void 0:j.offerTypeData)==null?void 0:B.length)>0&&((_=($=p==null?void 0:p.offerData)==null?void 0:$.offerListData)==null?void 0:_.length)>0&&l>0&&i.jsx("p",{className:"padding0 color-primary-grey text-sm marginT-15",children:`${l||((z=p==null?void 0:p.offerData)==null?void 0:z.offerListCountData)} offer is available`})]}),i.jsxs("div",{className:"rsp-modal-footer flex justify-end",children:[i.jsx("button",{onClick:y,className:"rsp-button-secondary",children:"Cancel"}),i.jsx("button",{onClick:w,disabled:!r||!s,className:"rsp-button-primary disabled:opacity-50 disabled:cursor-not-allowed",children:"Save"})]})]})})}),document.body)})}),IN=({selectedType:e,onTypeChange:t,onSelectOffer:o,component:r})=>{const{isOpen:n,openModal:s,closeModal:a,selectOffer:l}=NN();return i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"rsp-property-elements-block flex items-center justify-between marginT10",children:[i.jsx("label",{className:"rsp-properties-lable block text-md color-primary-black",children:"Offer type"}),i.jsx("button",{onClick:s,className:"rsp-offer-button px-4 py-2 bg-[var(--th-primary-color)] text-white text-sm rounded-lg hover:bg-[var(--th-primary-color)] transition-colors",children:"Select Offer"})]}),i.jsx(RN,{isOpen:n,onClose:a,onSelect:l,component:r})]})},LN=({label:e,description:t,id:o,value:r,onChange:n,min:s,max:a,step:l})=>{const d=c=>{var m;let u=parseFloat(c.target.value);isNaN(u)&&(u=0);const p=l?((m=l.toString().split(".")[1])==null?void 0:m.length)||0:10;u=parseFloat(u.toFixed(p)),l&&(s!==void 0?u=Math.round((u-s)/l)*l+s:u=Math.round(u/l)*l),u=parseFloat(u.toFixed(p)),s!==void 0&&(u=Math.max(u,s)),a!==void 0&&(u=Math.min(u,a)),u=parseFloat(u.toFixed(p)),n(u)};return i.jsxs("div",{className:"flex items-center justify-between",children:[e&&i.jsxs("label",{htmlFor:o,className:"rsp-properties-lable block text-md color-primary-black",children:[e,t&&i.jsxs("span",{className:"text-xs text-gray-500",children:[" - (",t,")"]})]}),i.jsx("input",{id:o,type:"number",value:r,onChange:d,className:"w-20 p-2 border rounded",min:s,max:a,step:l})]})},$N=({style:e,onStyleChange:t})=>{const o=[{value:"none",label:"None"},{value:"uppercase",label:"Uppercase"},{value:"lowercase",label:"Lowercase"},{value:"capitalize",label:"Capitalize"}];(d=>o.some(c=>c.value===d))(e.textTransform)&&e.textTransform;function n(d,c){const u=d*Math.pow(10,c+1),p=Math.floor(u/10);return u>=p*10+5?(p+1)/Math.pow(10,c):p/Math.pow(10,c)}const s=[{label:"Standard Fonts",options:_t.standard},{label:"Non standard Fonts",options:_t.decorative}],a=()=>{const d=(e==null?void 0:e.paddingControl)||{};return d.isCustomPadding?d.left||d.right||0:d.all||0},l=()=>{var d;return((d=e==null?void 0:e.paddingControl)==null?void 0:d.btnspanheight)??5};return i.jsxs("div",{className:"space-y-6",children:[i.jsx("div",{className:"rsp-property-elements-block hidden",children:i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("label",{className:"rsp-properties-lable block text-md color-primary-black",children:"Button color"}),i.jsx("div",{className:"flex flex-col space-y-2",children:i.jsx(gt,{value:(e==null?void 0:e.buttonColor)||"#ffffff",onChange:d=>{t("buttonColor",d)}})})]})}),i.jsx("div",{className:"rsp-property-elements-block",children:i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("label",{className:"rsp-properties-lable block text-md color-primary-black",children:"Full width"}),i.jsx(At,{id:"buttonFullWidth",isChecked:(e==null?void 0:e.buttonFullWidth)||!1,onToggle:d=>{const c=(e==null?void 0:e.paddingControl)||{},u=13,p={...c,left:u,right:u,isCustomPadding:!0};t("actionUpdates",{buttonFullWidth:d,paddingControl:p})}})]})}),!(e!=null&&e.buttonFullWidth)&&i.jsx("div",{className:"rsp-property-elements-block",children:i.jsxs("div",{className:"rsp-select-dropdown flex items-center justify-between",children:[i.jsx("label",{className:"rsp-properties-lable block text-md color-primary-black",children:"Align"}),i.jsxs("div",{className:"flex items-center gap-1",children:[i.jsx(Ie,{text:"Left",position:"top",className:"line-block",children:i.jsx("button",{onClick:()=>t("textAlign","left"),className:`p-1.5 rounded ${e.textAlign==="left"?"bg-primary-blue text-white":"bg-tertiary-blue color-primary-black"}`,children:i.jsx(_o,{className:"w-4 h-4"})})}),i.jsx(Ie,{text:"Center",position:"top",className:"line-block",children:i.jsx("button",{onClick:()=>t("textAlign","center"),className:`p-1.5 rounded ${e.textAlign==="center"?"bg-primary-blue text-white":"bg-tertiary-blue color-primary-black"}`,children:i.jsx(Xo,{className:"w-4 h-4"})})}),i.jsx(Ie,{text:"Right",position:"top",className:"line-block",children:i.jsx("button",{onClick:()=>t("textAlign","right"),className:`p-1.5 rounded ${e.textAlign==="right"?"bg-primary-blue text-white":"bg-tertiary-blue color-primary-black"}`,children:i.jsx(Ro,{className:"w-4 h-4"})})})]})]})}),i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("label",{className:"rsp-properties-lable block text-md color-primary-black",children:"Text color"}),i.jsx("div",{className:"flex flex-col space-y-2",children:i.jsx(gt,{alpha:!1,value:(e==null?void 0:e.buttonTextColor)||"#ffffff",onChange:d=>{t("buttonTextColor",d)}})})]}),i.jsx(Tt,{label:"Font family",width:"width170",value:e.fontFamily||"Arial, sans-serif",options:s,onChange:d=>t("fontFamily",d),previewFont:!0,isGrouped:!0}),i.jsxs("div",{className:"rsp-button-text flex items-center justify-between hidden",children:[i.jsx("label",{className:"rsp-properties-lable block text-md color-primary-black",children:"Font family"}),i.jsxs("select",{value:e.fontFamily||"Arial, sans-serif",onChange:d=>t("fontFamily",d.target.value),className:"ai-email-input-field height33",children:[_t.standard.map(d=>i.jsx("option",{value:d.value,style:{fontFamily:d.value},children:d.label},d.value)),_t.decorative.map(d=>i.jsx("option",{value:d.value,style:{fontFamily:d.value},children:d.label},d.value))]})]}),i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("label",{className:"rsp-properties-lable block text-md color-primary-black",children:"Font size"}),i.jsx(et,{label:"",mainClass:"button-control-view",onClick:()=>{},onChange:d=>t("fontSize",d),min:16,max:72,step:1,defaultValue:e.fontSize||16})]}),i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("label",{className:"rsp-properties-lable block text-md color-primary-black",children:"Text style"}),i.jsxs("div",{className:"flex gap-2",children:[i.jsx(Ie,{text:"Bold",position:"top",className:"line-block",children:i.jsx("button",{onClick:()=>t("bold",!e.bold),className:`p-2 rounded ${e.bold?"bg-primary-blue text-white":"bg-tertiary-blue color-primary-black"}`,children:i.jsx(Ko,{className:"w-4 h-4"})})}),i.jsx(Ie,{text:"Italic",position:"top",className:"line-block",children:i.jsx("button",{onClick:()=>t("italic",!e.italic),className:`p-2 rounded ${e.italic?"bg-primary-blue text-white":"bg-tertiary-blue color-primary-black"}`,children:i.jsx(Yo,{className:"w-4 h-4"})})}),i.jsx(Ie,{text:"Underline",position:"left",className:"line-block",children:i.jsx("button",{onClick:()=>t("underline",!e.underline),className:`p-2 rounded ${e.underline?"bg-primary-blue text-white":"bg-tertiary-blue color-primary-black"}`,children:i.jsx(Jo,{className:"w-4 h-4"})})})]})]}),i.jsx(Tt,{label:"Text transform",width:"width130",value:e.textTransform||"None",options:li,onChange:d=>t("textTransform",d)}),i.jsx("div",{className:"rsp-select-dropdown flex items-center justify-between"}),i.jsxs("div",{className:"space-y-4 hidden",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("label",{className:"rsp-properties-lable block text-md color-primary-black",children:"Auto line height"}),i.jsx(At,{id:"autoLineHeightEnabled",isChecked:(e==null?void 0:e.autoLineHeightEnabled)||!1,onToggle:d=>{t("autoLineHeightEnabled",d)}})]}),!(e!=null&&e.autoLineHeightEnabled)&&i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("label",{className:"rsp-properties-lable block text-md color-primary-black",children:"Line height"}),i.jsx(LN,{label:"",id:"radius-top-right",value:e.lineHeight||1.5,min:1.2,max:1.5,step:.1,onChange:d=>{t("lineHeight",d)}})]})]}),i.jsxs("div",{className:"rsp-property-elements-block",children:[i.jsx(et,{label:"Letter spacing",mainClass:"button-control-view marginB20",id:"letter-spacing",onClick:()=>{},onChange:d=>t("letterSpacing",n(d,1)),min:-1,max:5,step:.5,defaultValue:e.letterSpacing||0}),i.jsxs("div",{className:"space-y-6",children:[!(e!=null&&e.buttonFullWidth)&&i.jsx("div",{children:i.jsx(et,{actionButton:!0,label:"Width",mainClass:"button-control-view",isShowLeftDescription:!0,leftDescription:"Padding (left & right)",buttonClass:"",labelClass:"",onClick:()=>{},onChange:d=>{const u={...(e==null?void 0:e.paddingControl)||{},left:d,right:d,isCustomPadding:!0};t("paddingControl",u)},min:0,max:100,step:5,defaultValue:a()},`padding-lr-${a()}`)}),i.jsx("div",{children:i.jsx(et,{actionButton:!0,label:"Height",mainClass:"button-control-view",isShowLeftDescription:!0,leftDescription:"(px)",buttonClass:"",labelClass:"",onClick:()=>{},onChange:d=>{const u={...(e==null?void 0:e.paddingControl)||{},btnspanheight:d};t("paddingControl",u)},min:0,max:100,step:5,defaultValue:l()},`line-height-${l()}`)})]})]}),i.jsx(Jc,{id:"button-border-control",style:e,onStyleChange:(d,c)=>{t(d,c)}}),i.jsx("div",{className:"rsp-property-elements-block",children:i.jsx(Tr,{id:"button-border-radius-control",borderRadius:e.buttonRadiusControl,onChange:d=>{t("buttonRadiusControl",d)}})}),i.jsx("div",{children:i.jsx(ao,{label:"Margin and Padding",id:"button-padding-control",marginSection:!0,paddingSection:!0,margin:e.containerPadding,padding:{...e.paddingControl,isPaddingEnabled:!1},onChange:(d,c)=>{d&&t("containerPadding",d)}})})]})},MN=({content:e,style:t,onStyleChange:o,onContentChange:r,component:n,handleSelectOffer:s,handleImageUrl:a})=>{const[l,d]=S.useState((t==null?void 0:t.showIcon)||!1),[c,u]=S.useState("");return S.useEffect(()=>{d((t==null?void 0:t.showIcon)||!1)},[t==null?void 0:t.showIcon]),i.jsxs("div",{className:"space-y-6",children:[i.jsx(IN,{selectedType:t.offerType||"code",onTypeChange:p=>o("offerType",p),onSelectOffer:s,component:n}),i.jsx("div",{children:i.jsxs("div",{className:"rsp-property-elements-block flex items-center justify-between",children:[i.jsx("label",{className:"rsp-properties-lable block text-md color-primary-black",children:"Container background"}),i.jsx("div",{className:"flex flex-col space-y-2",children:i.jsx(gt,{value:(t==null?void 0:t.containerBackgroundColor)||"#ffffff",onChange:p=>{o("containerBackgroundColor",p)}})})]})}),i.jsx("div",{className:"rsp-property-elements-block",children:i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("label",{className:"rsp-properties-lable block text-md color-primary-black",children:"Button background"}),i.jsx("div",{className:"flex flex-col space-y-2",children:i.jsx(gt,{value:(t==null?void 0:t.buttonColor)||"#ffffff",onChange:p=>{o("buttonColor",p)}})})]})}),i.jsxs("div",{className:"rsp-property-elements-block space-y-6",children:[i.jsxs("div",{className:"space-y-6",children:[i.jsxs("div",{className:"rsp-property-elements-block flex items-center justify-between",children:[i.jsx("label",{className:"rsp-properties-lable block text-md color-primary-black",children:"Button icon"}),i.jsx(At,{id:"showIcon",isChecked:l,onToggle:p=>{d(p),p?o("showIcon",p):o("actionUpdates",{showIcon:p,iconUrl:""})}})]}),l&&i.jsxs(i.Fragment,{children:[i.jsx(us,{content:e,style:t,onContentChange:a}),i.jsx("div",{className:"marginT30 marginB25",children:i.jsx("div",{className:"flex items-center gap-1",children:i.jsx(jt,{placeholder:"Alternative Text",defaultValue:"Banking",value:(t==null?void 0:t.iconAltText)||"",required:!0,onChange:p=>{o("iconAltText",p),u(p)}})})})]}),l&&i.jsx("div",{className:"mt20 space-y-6",children:i.jsx(Yc,{style:t,onStyleChange:o})})]}),i.jsx($N,{style:t,onStyleChange:o})]}),i.jsx("div",{className:"space-y-6"})]})},FN=({style:e,onStyleChange:t})=>{const{offerSnippets:o,pConfig:r}=Te(),n=S.useMemo(()=>!o||o.length===0?[]:o.map(s=>{let a="regular",l=null;try{s.jsonContent&&(l=JSON.parse(s.jsonContent),a=l.type||"regular")}catch{}return{...s,parsedType:a,parsedJsonContent:l}}).filter(s=>{var a,l;return((a=s.parsedType)==null?void 0:a.toLowerCase())==="row"||((l=s.parsedType)==null?void 0:l.toLowerCase())==="block"}),[o]);return i.jsx("div",{className:"offer-property offer-snippet-list",children:n.length>0?i.jsx("div",{className:"space-y-2",children:n.map(s=>i.jsx(aa,{snippet:s},s.snippetID))}):i.jsx("div",{className:"no-data-snippet",children:i.jsx("p",{className:"text-center",children:r!=null&&r.offersnippetData?"No offer snippets available":"Offer snippets not configured"})})})},a0=({id:e,content:t,style:o={},onUpdate:r,component:n})=>{const[s,a]=S.useState("content"),{updateComponent:l}=Te(),{updateBlockComponent:d}=Ye(),c=h=>{if(r){r(h);return}const g=document.querySelector(`[data-component-id="${e}"]`),x=g==null?void 0:g.getAttribute("data-parent-id"),C=g==null?void 0:g.getAttribute("data-column-index");x&&C?d(x,e,h):l(e,h)},u=(h,g)=>{c({content:{...t,[h]:g}})},p=(h,g)=>{var j,B,$,_;const x=document.querySelector(`[data-component-id="${e}"]`),C=x==null?void 0:x.getAttribute("data-parent-id"),k=x==null?void 0:x.getAttribute("data-column-index");let v=null;if(C&&k){const{getBlockComponents:z}=Ye.getState();v=z(C,parseInt(k)).find(O=>O.id===e)||null}else{const{getComponentForRender:z}=Te.getState();v=z(e)}const A=(j=v==null?void 0:v.contentTarget)==null?void 0:j.hasTargeting,w=((B=v==null?void 0:v.contentTarget)==null?void 0:B.activeTargetTabIndex)??0,y=(_=($=v==null?void 0:v.contentTarget)==null?void 0:$.targetGroups)==null?void 0:_[w],E=A&&(y!=null&&y.style)?y.style:(v==null?void 0:v.style)||o;c(h==="actionUpdates"?{style:{...E,...g}}:{style:{...E,[h]:g}})},m=()=>{},f=h=>{(h==null?void 0:h.imageUrl)!==void 0&&p("iconUrl",h.imageUrl),(h==null?void 0:h.imageAlt)!==void 0&&p("iconAltText",h.imageAlt)},b=()=>{switch(s){case"content":return i.jsx(MN,{content:t,style:o,onContentChange:u,onStyleChange:p,component:n,handleSelectOffer:m,handleImageUrl:f});case"templates":return i.jsx(FN,{style:o,onStyleChange:p});default:return null}};return i.jsxs("div",{className:"space-y-6",children:[i.jsx(TN,{activeTab:s,onTabChange:a}),b()]})},DN=({style:e,formatState:t,hasTextSelection:o=!1,onStyleChange:r,onFontFamilyDropdownOpen:n})=>{const s=[{label:"Standard Fonts",options:_t.standard},{label:"Non standard Fonts",options:_t.decorative}];return i.jsxs("div",{className:"space-y-4",children:[i.jsx("div",{className:"rsp-property-elements-block",children:i.jsx(et,{mainClass:"button-control-view",label:"Cell padding",onClick:()=>{},onChange:a=>{let l=a||8;l=Math.min(24,Math.max(2,l)),r("cellPadding",l)},min:2,max:24,step:1,defaultValue:e.cellPadding||8})}),i.jsxs("div",{className:"rsp-property-elements-block flex items-center justify-between hidden",children:[i.jsx("label",{className:"rsp-properties-lable block text-md color-primary-black",children:"Cell padding"}),i.jsx("input",{type:"number",value:e.cellPadding||8,onChange:a=>{let l=parseInt(a.target.value)||8;l=Math.min(24,Math.max(2,l)),r("cellPadding",l)},onInput:a=>{a.currentTarget.value=a.currentTarget.value.replace(/^0+/,"")},className:"w-28 p-2 border rounded-md",min:"2",max:"24"})]}),i.jsxs("div",{className:"rsp-property-elements-block rsp-select-dropdown flex items-center justify-between",children:[i.jsx("label",{className:"rsp-properties-lable block text-md color-primary-black",children:"Align"}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(Ie,{text:"Left",position:"top",className:"line-block",children:i.jsx("button",{onClick:()=>r("textAlign","left"),className:`p-1.5 rounded ${e.textAlign==="left"?"bg-primary-blue text-white":"bg-tertiary-blue color-primary-black"}`,children:i.jsx(_o,{className:"w-4 h-4"})})}),i.jsx(Ie,{text:"Center",position:"top",className:"line-block",children:i.jsx("button",{onClick:()=>r("textAlign","center"),className:`p-1.5 rounded ${e.textAlign==="center"?"bg-primary-blue text-white":"bg-tertiary-blue color-primary-black"}`,children:i.jsx(Xo,{className:"w-4 h-4"})})}),i.jsx(Ie,{text:"Right",position:"top",className:"line-block",children:i.jsx("button",{onClick:()=>r("textAlign","right"),className:`p-1.5 rounded ${e.textAlign==="right"?"bg-primary-blue text-white":"bg-tertiary-blue color-primary-black"}`,children:i.jsx(Ro,{className:"w-4 h-4"})})})]})]}),i.jsxs("div",{className:"rsp-property-elements-block flex items-center justify-between",children:[i.jsx("label",{className:"rsp-properties-lable block text-md color-primary-black",children:"Container background"}),i.jsx("div",{className:"flex flex-col space-y-2",children:i.jsx(gt,{value:(e==null?void 0:e.containerBackgroundColor)||"transparent",onChange:a=>{r("containerBackgroundColor",a)}})})]}),i.jsx(Tt,{className:"marginB20",label:"Font family",width:"width170",value:o&&(t!=null&&t.fontFamily)?t.fontFamily:e.fontFamily||"Arial, sans-serif",options:s,onChange:a=>r("fontFamily",a),onMouseDown:()=>{n==null||n()},previewFont:!0,isGrouped:!0}),i.jsxs("div",{className:"rsp-property-elements-block flex items-center justify-between",children:[i.jsx("label",{className:"rsp-properties-lable block text-md color-primary-black",children:"Font size"}),i.jsx(et,{label:"",mainClass:"button-control-view",onClick:()=>{},onChange:a=>r("fontSize",a),min:16,max:72,step:1,defaultValue:e.fontSize||16})]}),i.jsxs("div",{className:"rsp-property-elements-block flex items-center justify-between",children:[i.jsx("label",{className:"rsp-properties-lable block text-md color-primary-black",children:"Text color"}),i.jsx("div",{className:"flex flex-col space-y-2",children:i.jsx(gt,{alpha:!1,value:(e==null?void 0:e.textColor)||"#ffffff",onChange:a=>{r("textColor",a)}})})]}),i.jsxs("div",{className:"rsp-property-elements-block flex items-center justify-between",children:[i.jsx("label",{className:"rsp-properties-lable block text-md color-primary-black",children:"Text style"}),i.jsxs("div",{className:"flex gap-2",children:[i.jsx(Ie,{text:"Bold",position:"top",className:"line-block",children:i.jsx("button",{onClick:()=>r("bold",!e.bold),className:`p-2 rounded ${e.bold?"bg-primary-blue text-white":"bg-tertiary-blue color-primary-black"}`,children:i.jsx(Ko,{className:"w-4 h-4"})})}),i.jsx(Ie,{text:"Italic",position:"top",className:"line-block",children:i.jsx("button",{onClick:()=>r("italic",!e.italic),className:`p-2 rounded ${e.italic?"bg-primary-blue text-white":"bg-tertiary-blue color-primary-black"}`,children:i.jsx(Yo,{className:"w-4 h-4"})})}),i.jsx(Ie,{text:"Underline",position:"left",className:"line-block",children:i.jsx("button",{onClick:()=>r("underline",!e.underline),className:`p-2 rounded ${e.underline?"bg-primary-blue text-white":"bg-tertiary-blue color-primary-black"}`,children:i.jsx(Jo,{className:"w-4 h-4"})})})]})]}),i.jsx(dt,{label:"Border",style:{width:(e==null?void 0:e.borderWidth)||1,style:(e==null?void 0:e.borderStyle)||"solid",color:(e==null?void 0:e.borderColor)||"#E5E7EB",min:1},onStyleChange:(a,l)=>{switch(a){case"width":r("borderWidth",l);break;case"style":r("borderStyle",l);break;case"color":r("borderColor",l);break}}})]})},PN={plain:{"style-01":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAApAQMAAABawnhjAAAAAXNSR0IB2cksfwAAAAZQTFRFAAAA////pdmf3QAAACFJREFUeNpjgIH693//7//+DyedkMPbuMGMDV18VD8EAABYFMLjGS3ZgAAAAABJRU5ErkJggg==","style-02":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAApCAAAAABFZ7X8AAAAAXNSR0IB2cksfwAAADNJREFUeNpj2E8mYNj/Hw5IYQ41jQxgAOQQzRwYp47G42g8jsbjaDyOxuNoPI7GI/XiEQBoadGIwOs/+QAAAABJRU5ErkJggg==","style-03":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAApCAAAAABFZ7X8AAAAAXNSR0IB2cksfwAAAEJJREFUeNpj2E8mYNj/Hw5IYQ41jQxgAOQQzRwYp5Ifj5/ggBTmUNMIiRsgh2jmwDh1ND+O5sfR/DiaH0fz4+DIjwBZwrEIIFAx9gAAAABJRU5ErkJggg==","style-04":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAApAgMAAAAdYgKzAAAAAXNSR0IB2cksfwAAAAlQTFRF////f39/AAAAzPvRnQAAACNJREFUeNpjEA1FBgwUgVULmFY1cK1i0FoBZBJQO2rvSLIXAMaWNMMO+RuaAAAAAElFTkSuQmCC","style-05":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAApCAAAAABFZ7X8AAAAAXNSR0IB2cksfwAAAFNJREFUeNrtlTEOACAIA/vz/rkfwMQFJ4MMEiM3dWnSgQuwJPiliIkdxJqpzAGTQ8V5rYiJRI/ax5qpC7Q4nxTdMYZ9rJiaPoD2sX1sH2NTbzzWAUtWCQEZ+rfCAAAAAElFTkSuQmCC","style-06":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAApCAAAAABFZ7X8AAAAAXNSR0IB2cksfwAAADdJREFUeNpj+E8mYBgpGhnA4D8JzIFx6ifywIjRCIkbIINo5oA4dTQ/jubH0fw4mh9H8+Pg8CMAfh0wc+8qMBsAAAAASUVORK5CYII=","style-07":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAApCAAAAABFZ7X8AAAAAXNSR0IB2cksfwAAAE9JREFUeNpj+E8mYBgpGhnA4D8JzIFxaj15AMXG+k/Eg6GkERE3YI0QJlACP3Pg/UhCAhgpGhHxSEJ+pL9TyU4Ao/lxND+O5kfinEqPihUADt4QxnHQ91wAAAAASUVORK5CYII="},grid:{"style-01":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAApCAAAAABFZ7X8AAAAAXNSR0IB2cksfwAAADtJREFUeNpjmEkmYJj5Hw5IYQ41jQxgAOQQzRwgp6bBASlMsjWOxiNtnDqaH0fjcTQeR+NxNB4HRzwCAKe1WKTJTDjtAAAAAElFTkSuQmCC","style-02":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAApCAMAAABX0hoSAAAAAXNSR0IB2cksfwAAAAxQTFRFvdbu////nMLlAAAA9IvssgAAADdJREFUeNpjIB8wwgEpzKGmkRkMgByimQPkVCY4IIVJtsbReKSJU0fz42g8jsbjaDyOxuMgiUcAiB8ImQdJGSwAAAAASUVORK5CYII=","style-03":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAApCAMAAABX0hoSAAAAAXNSR0IB2cksfwAAAAxQTFRF98qs////9LCDAAAAaYSk9QAAADdJREFUeNpjIB8wwgEpzKGmkRkMgByimQPkVCY4IIVJtsbReKSJU0fz42g8jsbjaDyOxuMgiUcAiB8ImQdJGSwAAAAASUVORK5CYII=","style-04":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAApCAAAAABFZ7X8AAAAAXNSR0IB2cksfwAAADtJREFUeNpjuE0mYLj9Hw5IYQ41jQxgAOQQzRwgp56EA1KYZGscjUfaOHU0P47G42g8jsbjaDwOjngEAJ5M/zCxTwHCAAAAAElFTkSuQmCC","style-05":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAApCAMAAABX0hoSAAAAAXNSR0IB2cksfwAAAAxQTFRF/+WZ/////9lmAAAA63K0kwAAADdJREFUeNpjIB8wwgEpzKGmkRkMgByimQPkVCY4IIVJtsbReKSJU0fz42g8jsbjaDyOxuMgiUcAiB8ImQdJGSwAAAAASUVORK5CYII=","style-06":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAApCAMAAABX0hoSAAAAAXNSR0IB2cksfwAAAAxQTFRFxeCz////qNCNAAAAIaHJqgAAADdJREFUeNpjIB8wwgEpzKGmkRkMgByimQPkVCY4IIVJtsbReKSJU0fz42g8jsbjaDyOxuMgiUcAiB8ImQdJGSwAAAAASUVORK5CYII=","style-07":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAApCAAAAABFZ7X8AAAAAXNSR0IB2cksfwAAAE9JREFUeNpj+E8mYBgpGhnA4D8JzIFxahp5gAKNZxAgjQTmAGmExA1QnAQm/Z1KQXQggTQSmENLIyKPpZHApL9T6Z+tRvPjaH4czY9Uz48ACVjcErnC5AYAAAAASUVORK5CYII=","style-08":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAApCAMAAABX0hoSAAAAAXNSR0IB2cksfwAAAAxQTFRF////3ur2nMLlAAAAKSdyJQAAAEpJREFUeNpjGAUEADMYkMqkP2AiD1CgkREBmEhgDpBGSNwAxUlg0t+pZEcHaloggTm0NCLyGBMJTPo7lf7ZajQ/jubH0fxI9fwIAN+oB4rU/Ud4AAAAAElFTkSuQmCC","style-09":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAApCAMAAABX0hoSAAAAAXNSR0IB2cksfwAAAAxQTFRF////++TV9LCDAAAAc2YSvQAAAEpJREFUeNpjGAUEADMYkMqkP2AiD1CgkREBmEhgDpBGSNwAxUlg0t+pZEcHaloggTm0NCLyGBMJTPo7lf7ZajQ/jubH0fxI9fwIAN+oB4rU/Ud4AAAAAElFTkSuQmCC","style-10":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAApCAAAAABFZ7X8AAAAAXNSR0IB2cksfwAAAFBJREFUeNpj+E8mYBgpGhnA4D8JzIFx6knyAAUa3yLASRKYA6QREjdAcRKY9HcqBdGBBE6SwBxaGhF57CQJTPo7lf7ZajQ/jubH0fxI9fwIAE6k0z5Fc0COAAAAAElFTkSuQmCC","style-11":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAApCAMAAABX0hoSAAAAAXNSR0IB2cksfwAAAAxQTFRF//////LM/9lmAAAAeVz29QAAAEpJREFUeNpjGAUEADMYkMqkP2AiD1CgkREBmEhgDpBGSNwAxUlg0t+pZEcHaloggTm0NCLyGBMJTPo7lf7ZajQ/jubH0fxI9fwIAN+oB4rU/Ud4AAAAAElFTkSuQmCC","style-12":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAApCAMAAABX0hoSAAAAAXNSR0IB2cksfwAAAAxQTFRF////4u/ZqNCNAAAA625YRwAAAEpJREFUeNpjGAUEADMYkMqkP2AiD1CgkREBmEhgDpBGSNwAxUlg0t+pZEcHaloggTm0NCLyGBMJTPo7lf7ZajQ/jubH0fxI9fwIAN+oB4rU/Ud4AAAAAElFTkSuQmCC","style-13":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAApCAAAAABFZ7X8AAAAAXNSR0IB2cksfwAAAE1JREFUeNpj+E8mYBghGhlAAMggnjkwTk0jEyDbmHYGDggyh5ZGRNwAxSFMoDh+5oD7kfx4JIE5xDQi4pFo5oD7cTQ/jubH0fw4RPMjAOV9E1CylahcAAAAAElFTkSuQmCC","style-14":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAApCAMAAABX0hoSAAAAAXNSR0IB2cksfwAAAAxQTFRF////3ur2nMLlAAAAKSdyJQAAAEZJREFUeNpjGAX4ATMYkMqkP2AiE6CYwQgHBJlDSyMiboDiECZQHD9zwP1IfjySwBxiGhHxSDRzwP04mh9H8+Nofhyi+REA2I0Gs9tiU0QAAAAASUVORK5CYII=","style-15":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAApCAMAAABX0hoSAAAAAXNSR0IB2cksfwAAAAxQTFRF////++TV9LCDAAAAc2YSvQAAAEZJREFUeNpjGAX4ATMYkMqkP2AiE6CYwQgHBJlDSyMiboDiECZQHD9zwP1IfjySwBxiGhHxSDRzwP04mh9H8+Nofhyi+REA2I0Gs9tiU0QAAAAASUVORK5CYII=","style-16":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAApCAAAAABFZ7X8AAAAAXNSR0IB2cksfwAAAE1JREFUeNpj+E8mYBghGhlAAMggnjkwTj1JJkC28eRbOCDIHFoaEXEDFIcwgeL4mQPuR/LjkQTmENOIiEeimQPux9H8OJofR/PjEM2PAP9h5rhkNcWPAAAAAElFTkSuQmCC","style-17":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAApCAMAAABX0hoSAAAAAXNSR0IB2cksfwAAAAxQTFRF//////LM/9lmAAAAeVz29QAAAEZJREFUeNpjGAX4ATMYkMqkP2AiE6CYwQgHBJlDSyMiboDiECZQHD9zwP1IfjySwBxiGhHxSDRzwP04mh9H8+Nofhyi+REA2I0Gs9tiU0QAAAAASUVORK5CYII=","style-18":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAApCAMAAABX0hoSAAAAAXNSR0IB2cksfwAAAAxQTFRF////4u/ZqNCNAAAA625YRwAAAEZJREFUeNpjGAX4ATMYkMqkP2AiE6CYwQgHBJlDSyMiboDiECZQHD9zwP1IfjySwBxiGhHxSDRzwP04mh9H8+Nofhyi+REA2I0Gs9tiU0QAAAAASUVORK5CYII=","style-19":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAApCAAAAABFZ7X8AAAAAXNSR0IB2cksfwAAAEdJREFUeNpjGAX4wX8wIJVJf5BGLjPtDByQwhxqGiHeBXKIZg6QU8kDQI3/4YAU5lDTCMuVxDMHyKnkgdH8OJofR/PjIMqPABZTOEISDFodAAAAAElFTkSuQmCC","style-20":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAApCAMAAABX0hoSAAAAAXNSR0IB2cksfwAAAA9QTFRFnMLl////3ur2W5vVAAAARQeP3QAAAExJREFUeNrtkzkOADAIw8Lx/zdXYqArsFBUPHmJlMWQIvhkSIZIXHuu4npKAXYyOm2oBnNce67WISej04ZqEMW15WqV7XF73B4f6vEAGcQO+50f28QAAAAASUVORK5CYII=","style-21":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAApCAMAAABX0hoSAAAAAXNSR0IB2cksfwAAAA9QTFRF9LCD////++TV7X0xAAAAfASWdQAAAExJREFUeNrtkzkOADAIw8Lx/zdXYqArsFBUPHmJlMWQIvhkSIZIXHuu4npKAXYyOm2oBnNce67WISej04ZqEMW15WqV7XF73B4f6vEAGcQO+50f28QAAAAASUVORK5CYII=","style-22":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAApCAAAAABFZ7X8AAAAAXNSR0IB2cksfwAAAFBJREFUeNrtk7ENADAIw/L/HxzDMdxAJQa6AgtFxZOXSFkMKoJPhmoQxbXnKl9PKVicjE4bwhCJa9PVImB1MjptCEM1rk1Xa2yP2+P2+FCPB+DGUm5ppR1TAAAAAElFTkSuQmCC","style-23":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAApCAMAAABX0hoSAAAAAXNSR0IB2cksfwAAAA9QTFRF/9lm//////LM/8AAAAAAyG1M9AAAAExJREFUeNrtkzkOADAIw8Lx/zdXYqArsFBUPHmJlMWQIvhkSIZIXHuu4npKAXYyOm2oBnNce67WISej04ZqEMW15WqV7XF73B4f6vEAGcQO+50f28QAAAAASUVORK5CYII=","style-24":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAApCAMAAABX0hoSAAAAAXNSR0IB2cksfwAAAA9QTFRFqNCN////4u/ZcK1HAAAAPaNftgAAAExJREFUeNrtkzkOADAIw8Lx/zdXYqArsFBUPHmJlMWQIvhkSIZIXHuu4npKAXYyOm2oBnNce67WISej04ZqEMW15WqV7XF73B4f6vEAGcQO+50f28QAAAAASUVORK5CYII=","style-25":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAApCAAAAABFZ7X8AAAAAXNSR0IB2cksfwAAAFNJREFUeNpj+P+fgTwwxDT+BwMgh2jmwDiVTIBi4/+ZcECQOYQ0MqFFUzoYEMGkxMYBjcczcECQOYQ0osejCRgQwaTExtH8OJofR/PjiM2PZGsEAN5AVSEUxOaVAAAAAElFTkSuQmCC","style-26":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAApCAMAAABX0hoSAAAAAXNSR0IB2cksfwAAAA9QTFRF////3ur2vdbuW5vVAAAAx62pegAAAFRJREFUeNrt07EKwEAIA9Bo7v+/uZDB1dIe5wm+KUtAkAD8BOhVhJB8HUtO/YEBHtLYrQhRcYl7EitO3fRHC2nsVoSouMQsiRWnzh5nj7PHi/Z43gPTtQ6Vxo+FgAAAAABJRU5ErkJggg==","style-27":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAApCAMAAABX0hoSAAAAAXNSR0IB2cksfwAAAA9QTFRF////++TV98qs7X0xAAAAMAVLkgAAAFRJREFUeNrt07EKwEAIA9Bo7v+/uZDB1dIe5wm+KUtAkAD8BOhVhJB8HUtO/YEBHtLYrQhRcYl7EitO3fRHC2nsVoSouMQsiRWnzh5nj7PHi/Z43gPTtQ6Vxo+FgAAAAABJRU5ErkJggg==","style-28":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAApCAAAAABFZ7X8AAAAAXNSR0IB2cksfwAAAFpJREFUeNpj+L+ULPCfYWhp/A8GQB7RzAFyKnkAxcb/t+GAIHNoaUTEDVCcAQyA4oSY9HcqleLxLRwQZA4tjYh4BIpDogkoTohJf6eO5sfR/DiaH4dBfiRfIwC7Z096LHDqZAAAAABJRU5ErkJggg==","style-29":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAApCAMAAABX0hoSAAAAAXNSR0IB2cksfwAAAA9QTFRF//////LM/+WZ/8AAAAAAIfB8oQAAAFRJREFUeNrt07EKwEAIA9Bo7v+/uZDB1dIe5wm+KUtAkAD8BOhVhJB8HUtO/YEBHtLYrQhRcYl7EitO3fRHC2nsVoSouMQsiRWnzh5nj7PHi/Z43gPTtQ6Vxo+FgAAAAABJRU5ErkJggg==","style-30":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAApCAMAAABX0hoSAAAAAXNSR0IB2cksfwAAAA9QTFRF////4u/ZxeCzcK1HAAAABxcEXAAAAFRJREFUeNrt07EKwEAIA9Bo7v+/uZDB1dIe5wm+KUtAkAD8BOhVhJB8HUtO/YEBHtLYrQhRcYl7EitO3fRHC2nsVoSouMQsiRWnzh5nj7PHi/Z43gPTtQ6Vxo+FgAAAAABJRU5ErkJggg==","style-31":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAApCAAAAABFZ7X8AAAAAXNSR0IB2cksfwAAAEdJREFUeNpjSCMTMKT9hwNSmENNIwMYADlEMwfIqeQBSjSegQNSmAOkERI3QA7RzIFx6mh+HIn5kfJsNZofR/PjaH6kfn4EAENZgDs94rT1AAAAAElFTkSuQmCC","style-32":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAApCAMAAABX0hoSAAAAAXNSR0IB2cksfwAAAAxQTFRFnMLl////3ur2LnS1otaQUwAAAEFJREFUeNpjIB8wwgEpzKGmkRkMgByimQPkVPoDJjgghTlAGiFxA+SQwqS/U0fz44jMj5Rnq9H8OJofR/Mj9fMjAA9XCh/0gdfJAAAAAElFTkSuQmCC","style-33":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAApCAMAAABX0hoSAAAAAXNSR0IB2cksfwAAAAxQTFRF9LCD////++TVxFkR+Q1X/AAAAEFJREFUeNpjIB8wwgEpzKGmkRkMgByimQPkVPoDJjgghTlAGiFxA+SQwqS/U0fz44jMj5Rnq9H8OJofR/Mj9fMjAA9XCh/0gdfJAAAAAElFTkSuQmCC","style-34":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAApCAAAAABFZ7X8AAAAAXNSR0IB2cksfwAAAEdJREFUeNpjOEkmYDj5Hw5IYQ41jdVgAOQQzRwgp5IHKNH4Fg5IYQ6QRkjcADlEMwfGqaP5cSTmR8qz1Wh+HM2Po/mR+vkRAA37+uY4EkbpAAAAAElFTkSuQmCC","style-35":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAApCAMAAABX0hoSAAAAAXNSR0IB2cksfwAAAAxQTFRF/9lm//////LMv48AzptggQAAAEFJREFUeNpjIB8wwgEpzKGmkRkMgByimQPkVPoDJjgghTlAGiFxA+SQwqS/U0fz44jMj5Rnq9H8OJofR/Mj9fMjAA9XCh/0gdfJAAAAAElFTkSuQmCC","style-36":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAApCAMAAABX0hoSAAAAAXNSR0IB2cksfwAAAAxQTFRFqNCN////4u/ZU4E1GgA+swAAAEFJREFUeNpjIB8wwgEpzKGmkRkMgByimQPkVPoDJjgghTlAGiFxA+SQwqS/U0fz44jMj5Rnq9H8OJofR/Mj9fMjAA9XCh/0gdfJAAAAAElFTkSuQmCC","style-37":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAApCAAAAABFZ7X8AAAAAXNSR0IB2cksfwAAAE1JREFUeNpj+E8mYBghGhlAAMggnjkwTk0jEyDbmHYGDggyh5ZGRNwAxSFMoDh+5oD7kfx4JIE5xDQi4pFo5oD7cTQ/jubH0fw4RPMjAOV9E1CylahcAAAAAElFTkSuQmCC","style-38":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAApCAMAAABX0hoSAAAAAXNSR0IB2cksfwAAAAxQTFRF////3ur2nMLlLnS166ziPgAAAEZJREFUeNpjGAX4ATMYkMqkP2AiE6CYwQgHBJlDSyMiboDiECZQHD9zwP1IfjySwBxiGhHxSDRzwP04mh9H8+Nofhyi+REA2I0Gs9tiU0QAAAAASUVORK5CYII=","style-39":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAApCAMAAABX0hoSAAAAAXNSR0IB2cksfwAAAAxQTFRF////++TV9LCDxFkR5AnqzgAAAEZJREFUeNpjGAX4ATMYkMqkP2AiE6CYwQgHBJlDSyMiboDiECZQHD9zwP1IfjySwBxiGhHxSDRzwP04mh9H8+Nofhyi+REA2I0Gs9tiU0QAAAAASUVORK5CYII=","style-40":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAApCAAAAABFZ7X8AAAAAXNSR0IB2cksfwAAAE1JREFUeNpj+E8mYBghGqvBAMggmjkwTj1JJkC28eRbOCDIHFoaEXEDFIcwgeL4mQPuR/LjkQTmENOIiEeimQPux9H8OJofR/PjEM2PAPvfLtm5y6ZtAAAAAElFTkSuQmCC","style-41":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAApCAMAAABX0hoSAAAAAXNSR0IB2cksfwAAAAxQTFRF//////LM/9lmv48AC0XLXAAAAEZJREFUeNpjGAX4ATMYkMqkP2AiE6CYwQgHBJlDSyMiboDiECZQHD9zwP1IfjySwBxiGhHxSDRzwP04mh9H8+Nofhyi+REA2I0Gs9tiU0QAAAAASUVORK5CYII=","style-42":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAApCAMAAABX0hoSAAAAAXNSR0IB2cksfwAAAAxQTFRF////4u/ZqNCNU4E18b+lhwAAAEZJREFUeNpjGAX4ATMYkMqkP2AiE6CYwQgHBJlDSyMiboDiECZQHD9zwP1IfjySwBxiGhHxSDRzwP04mh9H8+Nofhyi+REA2I0Gs9tiU0QAAAAASUVORK5CYII="},list:{"style-01":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAApBAAAAACAl1j9AAAAAXNSR0IB2cksfwAAAEJJREFUeNpj+I8HMAyMJAMDkPjAwMCPzqTE2G9puAHDnzO4Ae0kgT46c+YAAwPPGTQmJcaOkPjEGwij8Tkw8UkrOwG+ctHvPFzDAgAAAABJRU5ErkJggg==","style-02":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAApAgMAAAAdYgKzAAAAAXNSR0IB2cksfwAAAAxQTFRF////3ur2nMLlAAAAKSdyJQAAAD9JREFUeNpjoCb4/4H5/wH+/wz2f4BMAmq1ViEDBtFQZEAi9//X8P9X4/+H1v8N/f8Vv+KB8i+aM4aBf0nSCQAFNW0OMyWcDgAAAABJRU5ErkJggg==","style-03":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAApAgMAAAAdYgKzAAAAAXNSR0IB2cksfwAAAAxQTFRF////++TV9LCDAAAAc2YSvQAAAD9JREFUeNpjoCb4/4H5/wH+/wz2f4BMAmq1ViEDBtFQZEAi9//X8P9X4/+H1v8N/f8Vv+KB8i+aM4aBf0nSCQAFNW0OMyWcDgAAAABJRU5ErkJggg==","style-04":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAApCAAAAABFZ7X8AAAAAXNSR0IB2cksfwAAAEBJREFUeNpj+E8mYBgpGhnA4D8JzIFx6knyAMP/t+SBoaYREjdABtHMAXHqaH4cFvmR7AQwmh9H8+Nofhw8fgQAQuYYs6IfNwkAAAAASUVORK5CYII=","style-05":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAApAgMAAAAdYgKzAAAAAXNSR0IB2cksfwAAAAxQTFRF//////LM/9lmAAAAeVz29QAAAD9JREFUeNpjoCb4/4H5/wH+/wz2f4BMAmq1ViEDBtFQZEAi9//X8P9X4/+H1v8N/f8Vv+KB8i+aM4aBf0nSCQAFNW0OMyWcDgAAAABJRU5ErkJggg==","style-06":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAApAgMAAAAdYgKzAAAAAXNSR0IB2cksfwAAAAxQTFRF////4u/ZqNCNAAAA625YRwAAAD9JREFUeNpjoCb4/4H5/wH+/wz2f4BMAmq1ViEDBtFQZEAi9//X8P9X4/+H1v8N/f8Vv+KB8i+aM4aBf0nSCQAFNW0OMyWcDgAAAABJRU5ErkJggg==","style-07":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAApBAAAAACAl1j9AAAAAXNSR0IB2cksfwAAAD5JREFUeNpj+JaGGzD8xwNoJ8nAACQ+MDDwozMpMRavP/+cwQ1oJwn00ZkzBxgYeM6gMSkxdjQ+R+NzuMUnACEhhnf/RQYHAAAAAElFTkSuQmCC","style-08":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAApAgMAAAAdYgKzAAAAAXNSR0IB2cksfwAAAAxQTFRF////3ur2nMLlAAAAKSdyJQAAADxJREFUeNpj0FqFDBgoAv8/MP8/wP+fwf4PkElALZq9oqHIgETu/6/h/6/G/w+t/xv6/ysBxaP+HQj/AgBeMJSkvkJu9AAAAABJRU5ErkJggg==","style-09":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAApAgMAAAAdYgKzAAAAAXNSR0IB2cksfwAAAAxQTFRF////++TV9LCDAAAAc2YSvQAAADxJREFUeNpj0FqFDBgoAv8/MP8/wP+fwf4PkElALZq9oqHIgETu/6/h/6/G/w+t/xv6/ysBxaP+HQj/AgBeMJSkvkJu9AAAAABJRU5ErkJggg==","style-10":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAApCAAAAABFZ7X8AAAAAXNSR0IB2cksfwAAAD5JREFUeNpj+H+SPMDwn0ww1DQygMF/EpgD4lTy4/EteWCoaYTEDZBBNHNAnDqaH0fz42h+HM2Po/lxcORHAL+C4oBsiT46AAAAAElFTkSuQmCC","style-11":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAApAgMAAAAdYgKzAAAAAXNSR0IB2cksfwAAAAxQTFRF//////LM/9lmAAAAeVz29QAAADxJREFUeNpj0FqFDBgoAv8/MP8/wP+fwf4PkElALZq9oqHIgETu/6/h/6/G/w+t/xv6/ysBxaP+HQj/AgBeMJSkvkJu9AAAAABJRU5ErkJggg==","style-12":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAApAgMAAAAdYgKzAAAAAXNSR0IB2cksfwAAAAxQTFRF////4u/ZqNCNAAAA625YRwAAADxJREFUeNpj0FqFDBgoAv8/MP8/wP+fwf4PkElALZq9oqHIgETu/6/h/6/G/w+t/xv6/ysBxaP+HQj/AgBeMJSkvkJu9AAAAABJRU5ErkJggg==","style-13":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAApAQAAAABId9eNAAAAAXNSR0IB2cksfwAAACtJREFUeNpjIBbIN3+o4z/4A0O8/gGU/g8C/3DSCTX8jR/s2NDFgTqHhX4AgLyq+JZ2N5oAAAAASUVORK5CYII=","style-14":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAApAgMAAAAdYgKzAAAAAXNSR0IB2cksfwAAAAlQTFRFW5vV////AAAACNDYnwAAADFJREFUeNpjoCJgDHVgDWUQDWEIDQAyCSgWDQ1B5SKBECZUtQS4qPZiGIUBRu2lu70ARMUw80s2fjwAAAAASUVORK5CYII=","style-15":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAApAgMAAAAdYgKzAAAAAXNSR0IB2cksfwAAAAlQTFRF7X0x////AAAAgf7PagAAADFJREFUeNpjoCJgDHVgDWUQDWEIDQAyCSgWDQ1B5SKBECZUtQS4qPZiGIUBRu2lu70ARMUw80s2fjwAAAAASUVORK5CYII=","style-16":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAApCAAAAABFZ7X8AAAAAXNSR0IB2cksfwAAAD1JREFUeNpjWEomYBghGv+DAZBBNHOAnPofDkjVSBYYahoZwADII5o5QE5FgNF4HI3H0XgcjcfReBzAeAQAF2dyWmTlDSEAAAAASUVORK5CYII=","style-17":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAApAgMAAAAdYgKzAAAAAXNSR0IB2cksfwAAAAlQTFRF/8AA////AAAAQC/IDQAAADFJREFUeNpjoCJgDHVgDWUQDWEIDQAyCSgWDQ1B5SKBECZUtQS4qPZiGIUBRu2lu70ARMUw80s2fjwAAAAASUVORK5CYII=","style-18":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAApAgMAAAAdYgKzAAAAAXNSR0IB2cksfwAAAAlQTFRFcK1H////AAAAM4H5DgAAADFJREFUeNpjoCJgDHVgDWUQDWEIDQAyCSgWDQ1B5SKBECZUtQS4qPZiGIUBRu2lu70ARMUw80s2fjwAAAAASUVORK5CYII=","style-19":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAApCAAAAABFZ7X8AAAAAXNSR0IB2cksfwAAAERJREFUeNpjGAX4wX8wIJVJf5BGrra0M2SBoaYR4l0gj2jmADmVPADU+J8sMNQ0wnMl0cwBcip5YDQ/jubH0fw4iPIjAJdEbnKbHwk5AAAAAElFTkSuQmCC","style-20":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAApCAMAAABX0hoSAAAAAXNSR0IB2cksfwAAAA9QTFRFnMLl////3ur2W5vVAAAARQeP3QAAAEdJREFUeNrtk7ENADAIw5LQ/2+uxAUoC0XFUxZLWYwwwScik4j67LkK14MspoknkVSePVd9aDFNPAnJ8my56rI9bo/b40M9XgvbD6+zDd1aAAAAAElFTkSuQmCC","style-21":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAApCAMAAABX0hoSAAAAAXNSR0IB2cksfwAAAA9QTFRF9LCD////++TV7X0xAAAAfASWdQAAAEdJREFUeNrtk7ENADAIw5LQ/2+uxAUoC0XFUxZLWYwwwScik4j67LkK14MspoknkVSePVd9aDFNPAnJ8my56rI9bo/b40M9XgvbD6+zDd1aAAAAAElFTkSuQmCC","style-22":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAApCAAAAABFZ7X8AAAAAXNSR0IB2cksfwAAAE1JREFUeNrt0zENAEAMAkD8+6iYikEDn1RBw9L/fG9iIWEBYcInRZWIfpyZmmFJJC2vFVFItuPQVBNSlteKKJLacWiqZ/+4f9w/XvTHA6TlZY7DXYWJAAAAAElFTkSuQmCC","style-23":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAApCAMAAABX0hoSAAAAAXNSR0IB2cksfwAAAA9QTFRF/9lm//////LM/8AAAAAAyG1M9AAAAEdJREFUeNrtk7ENADAIw5LQ/2+uxAUoC0XFUxZLWYwwwScik4j67LkK14MspoknkVSePVd9aDFNPAnJ8my56rI9bo/b40M9XgvbD6+zDd1aAAAAAElFTkSuQmCC","style-24":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAApCAMAAABX0hoSAAAAAXNSR0IB2cksfwAAAA9QTFRFqNCN////4u/ZcK1HAAAAPaNftgAAAEdJREFUeNrtk7ENADAIw5LQ/2+uxAUoC0XFUxZLWYwwwScik4j67LkK14MspoknkVSePVd9aDFNPAnJ8my56rI9bo/b40M9XgvbD6+zDd1aAAAAAElFTkSuQmCC","style-25":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAApAQAAAABId9eNAAAAAXNSR0IB2cksfwAAAC1JREFUeNpjIATs2R/8kW/+gCFe/x8E/sBpBgWwMAZtrw7Wjy6Orm+w6yekDgCM9jZz+D9F6wAAAABJRU5ErkJggg==","style-26":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAApAQMAAABawnhjAAAAAXNSR0IB2cksfwAAAAZQTFRFW5vV////dMw4QwAAAC1JREFUeNpjIBbYsz/4I9/8AUO8/j8I/IHTDApgYQzaXh2sH10cXd9g149LHgDZiDZTXPUkUQAAAABJRU5ErkJggg==","style-27":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAApAQMAAABawnhjAAAAAXNSR0IB2cksfwAAAAZQTFRF7X0x////RtYsOwAAAC1JREFUeNpjIBbYsz/4I9/8AUO8/j8I/IHTDApgYQzaXh2sH10cXd9g149LHgDZiDZTXPUkUQAAAABJRU5ErkJggg==","style-28":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAApAQMAAABawnhjAAAAAXNSR0IB2cksfwAAAAZQTFRFpaWl////LnrmUQAAAC1JREFUeNpjIBbYsz/4I9/8AUO8/j8I/IHTDApgYQzaXh2sH10cXd9g149LHgDZiDZTXPUkUQAAAABJRU5ErkJggg==","style-29":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAApAQMAAABawnhjAAAAAXNSR0IB2cksfwAAAAZQTFRF/8AA////qAjcygAAAC1JREFUeNpjIBbYsz/4I9/8AUO8/j8I/IHTDApgYQzaXh2sH10cXd9g149LHgDZiDZTXPUkUQAAAABJRU5ErkJggg==","style-30":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAApAQMAAABawnhjAAAAAXNSR0IB2cksfwAAAAZQTFRFcK1H////II+pvwAAAC1JREFUeNpjIBbYsz/4I9/8AUO8/j8I/IHTDApgYQzaXh2sH10cXd9g149LHgDZiDZTXPUkUQAAAABJRU5ErkJggg==","style-31":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAApBAAAAACAl1j9AAAAAXNSR0IB2cksfwAAAEFJREFUeNpj+MCAB/zHA2gnCbYY6C5+dCYlxuL1558zuAHtJIEWnzlzgIGB5wwakwJj8QbCMIpPvIEwGp/DK38CAPKPkT8XrNsjAAAAAElFTkSuQmCC","style-32":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAApCAMAAABX0hoSAAAAAXNSR0IB2cksfwAAAAxQTFRF////3ur2W5vVLnS1ImmZKQAAADtJREFUeNpjYGAiDzCMFMAMBiQy6Q/Ij0dG8sBQ0wiJGyCDaOaAOHUUDIv8SHYCGM2Po/lxND8OnvoRADEoBgrX1LMZAAAAAElFTkSuQmCC","style-33":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAApCAMAAABX0hoSAAAAAXNSR0IB2cksfwAAAAxQTFRF////++TV7X0xxFkRZi4T5gAAADtJREFUeNpjYGAiDzCMFMAMBiQy6Q/Ij0dG8sBQ0wiJGyCDaOaAOHUUDIv8SHYCGM2Po/lxND8OnvoRADEoBgrX1LMZAAAAAElFTkSuQmCC","style-34":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAApCAAAAABFZ7X8AAAAAXNSR0IB2cksfwAAAERJREFUeNpj+L+UPMDwn0ww1DRWg8F/EpgD4lTy4/EteWCoaYTEDZBBNHNgnEomGM2Pgyo/kp0ARvPjaH4czY+Dp34EAITbMl3NzzFwAAAAAElFTkSuQmCC","style-35":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAApCAMAAABX0hoSAAAAAXNSR0IB2cksfwAAAAxQTFRF//////LM/8AAv48AePiWcAAAADtJREFUeNpjYGAiDzCMFMAMBiQy6Q/Ij0dG8sBQ0wiJGyCDaOaAOHUUDIv8SHYCGM2Po/lxND8OnvoRADEoBgrX1LMZAAAAAElFTkSuQmCC","style-36":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAApCAMAAABX0hoSAAAAAXNSR0IB2cksfwAAAAxQTFRF////4u/ZcK1HU4E1F2AR2QAAADtJREFUeNpjYGAiDzCMFMAMBiQy6Q/Ij0dG8sBQ0wiJGyCDaOaAOHUUDIv8SHYCGM2Po/lxND8OnvoRADEoBgrX1LMZAAAAAElFTkSuQmCC","style-37":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAApCAAAAABFZ7X8AAAAAXNSR0IB2cksfwAAAE1JREFUeNpj+E8mYBgpGhnA4D8JzIFxKgOZAMWUM8SDIaYRETdAPhgAJfAzB8Sp5KaGkaIREY8k5Ef6O5XsBDCaH0fz42h+JM6p9KhYAfIwjW/iZfngAAAAAElFTkSuQmCC","style-38":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAApAgMAAAAdYgKzAAAAAXNSR0IB2cksfwAAAAxQTFRF////3ur2W5vVLnS1ImmZKQAAAEtJREFUeNpjoCJg/n+A/z+D/R+G/x+ATAKKVyGDFUABplA4CCGJC7T3UPz/0Pq/of+/hv+/Qlgvkiso4YLsRfIvfsVozhie/sUd2wAZfGLz3FsOPAAAAABJRU5ErkJggg==","style-39":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAApAgMAAAAdYgKzAAAAAXNSR0IB2cksfwAAAAxQTFRF////++TV7X0xxFkRZi4T5gAAAEpJREFUeNpjoCb4/4H5/wH+/wz2f4BMAmq1ViEDkMjUUDggiQuyd/r/q/H/Q+v/hv7/SlhvA8IVlHBB9jYj/ItfMZozhql/ccY2ALl2buds2hazAAAAAElFTkSuQmCC","style-40":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAApCAAAAABFZ7X8AAAAAXNSR0IB2cksfwAAAE9JREFUeNpj+E8mYBgpGqvB4D8JzIFx6lLyAIqNS98SD4aSRkTcgDVCmEAJ/MyB9yMJCWCkaETEIwn5kf5OJTsBjObH0fw4mh+Jcyo9KlYAoIVZ89e1ioIAAAAASUVORK5CYII=","style-41":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAApAgMAAAAdYgKzAAAAAXNSR0IB2cksfwAAAAxQTFRF//////LM/8AAv48AePiWcAAAAEpJREFUeNpjoCb4/4H5/wH+/wz2f4BMAmq1ViEDkMjUUDggiQuyd/r/q/H/Q+v/hv7/SlhvA8IVlHBB9jYj/ItfMZozhql/ccY2ALl2buds2hazAAAAAElFTkSuQmCC","style-42":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAApAgMAAAAdYgKzAAAAAXNSR0IB2cksfwAAAAxQTFRF////4u/ZcK1HU4E1F2AR2QAAAEpJREFUeNpjoCb4/4H5/wH+/wz2f4BMAmq1ViEDkMjUUDggiQuyd/r/q/H/Q+v/hv7/SlhvA8IVlHBB9jYj/ItfMZozhql/ccY2ALl2buds2hazAAAAAElFTkSuQmCC"}},Vo=(e,t)=>{const o=PN[e];return o&&o[t]||""},Bt=(e,t=ro.DEFAULT_BORDER_WIDTH)=>({borderColor:e,cellBorderColor:e,headerRowBorderColor:e,headerRowBorderWidth:t,headerRowTextColor:l0,headerRowFontWeight:c0,firstColumnTextColor:l0,firstColumnFontWeight:c0}),So=(e,t,o={})=>({...Bt(e,o.headerBorderWidth??2),alternateRowColor:t,firstColumnBackgroundColor:o.firstColumnBg,headerRowNoBorder:o.noBorder}),l0="#000000",c0="bold",yt={borderStyle:"none",borderWidth:0,borderColor:"transparent"},Nr={firstColumnFontStyle:"italic",firstColumnFontWeight:"normal"},Vr=(e,t,o)=>({...So(e,t,{noBorder:!0,firstColumnBg:"#ffffff"}),textColor:o,headerRowTextColor:o,firstColumnTextColor:o,...Nr}),Hr=(e,t,o)=>({...So(e,t,{noBorder:!0}),headerRowBackgroundColor:o,headerRowTextColor:"#ffffff"}),ON=()=>{const e=[],t=dr();for(let o=1;o<=42;o++){const r={...t,borderStyle:"solid",borderWidth:ro.DEFAULT_BORDER_WIDTH,borderColor:ro.DEFAULT_BORDER_COLOR},n={1:()=>({...Bt("#666666",2),containerBackgroundColor:void 0,alternateRowColor:void 0,firstColumnFontStyle:"normal",firstColumnBorderColor:"#666666",headerRowNoBorder:void 0,cellBorderStyle:void 0,cellBorderWidth:void 0,cellBorderColor:void 0,cellVerticalBorderStyle:void 0,cellVerticalBorderWidth:void 0}),2:()=>({...Bt("#9cc2e5",2),containerBackgroundColor:void 0,alternateRowColor:void 0,firstColumnFontStyle:"normal",firstColumnBorderColor:"#9cc2e5",headerRowNoBorder:void 0,cellBorderStyle:void 0,cellBorderWidth:void 0,cellBorderColor:void 0,cellVerticalBorderStyle:void 0,cellVerticalBorderWidth:void 0}),3:()=>({...Bt("#f4b083",2),containerBackgroundColor:void 0,alternateRowColor:void 0,firstColumnFontStyle:"normal",firstColumnBorderColor:"#f4b083",headerRowNoBorder:void 0,cellBorderStyle:void 0,cellBorderWidth:void 0,cellBorderColor:void 0,cellVerticalBorderStyle:void 0,cellVerticalBorderWidth:void 0}),4:()=>({...Bt("#c9c9c9",2),containerBackgroundColor:void 0,alternateRowColor:void 0,firstColumnFontStyle:"normal",firstColumnBorderColor:"#c9c9c9",headerRowNoBorder:void 0,cellBorderStyle:void 0,cellBorderWidth:void 0,cellBorderColor:void 0,cellVerticalBorderStyle:void 0,cellVerticalBorderWidth:void 0}),5:()=>({...Bt("#ffd966",2),containerBackgroundColor:void 0,alternateRowColor:void 0,firstColumnFontStyle:"normal",firstColumnBorderColor:"#ffd966",headerRowNoBorder:void 0,cellBorderStyle:void 0,cellBorderWidth:void 0,cellBorderColor:void 0,cellVerticalBorderStyle:void 0,cellVerticalBorderWidth:void 0}),6:()=>({...Bt("#a8d08d",2),containerBackgroundColor:void 0,alternateRowColor:void 0,firstColumnFontStyle:"normal",firstColumnBorderColor:"#a8d08d",headerRowNoBorder:void 0,cellBorderStyle:void 0,cellBorderWidth:void 0,cellBorderColor:void 0,cellVerticalBorderStyle:void 0,cellVerticalBorderWidth:void 0}),7:()=>({...Bt("#666666",2),containerBackgroundColor:void 0,alternateRowColor:"#cccccc",headerRowNoBorder:!0,...yt,cellBorderStyle:"solid",cellBorderWidth:1,cellBorderColor:"#666666",cellVerticalBorderStyle:"solid",cellVerticalBorderWidth:1,firstColumnBorderColor:"#666666",firstColumnFontStyle:"normal"}),8:()=>({...Bt("#9cc2e5",2),containerBackgroundColor:void 0,alternateRowColor:"#deeaf6",headerRowNoBorder:!0,...yt,cellBorderStyle:"solid",cellBorderWidth:1,cellBorderColor:"#9cc2e5",cellVerticalBorderStyle:"solid",cellVerticalBorderWidth:1,firstColumnBorderColor:"#9cc2e5",firstColumnFontStyle:"normal"}),9:()=>({...Bt("#f4b083",2),containerBackgroundColor:void 0,alternateRowColor:"#fbe4d5",headerRowNoBorder:!0,...yt,cellBorderStyle:"solid",cellBorderWidth:1,cellBorderColor:"#f4b083",cellVerticalBorderStyle:"solid",cellVerticalBorderWidth:1,firstColumnBorderColor:"#f4b083",firstColumnFontStyle:"normal"}),10:()=>({...Bt("#c9c9c9",2),containerBackgroundColor:void 0,alternateRowColor:"#ededed",headerRowNoBorder:!0,...yt,cellBorderStyle:"solid",cellBorderWidth:1,cellBorderColor:"#c9c9c9",cellVerticalBorderStyle:"solid",cellVerticalBorderWidth:1,firstColumnBorderColor:"#c9c9c9",firstColumnFontStyle:"normal"}),11:()=>({...Bt("#ffd966",2),containerBackgroundColor:void 0,alternateRowColor:"#fff2cc",headerRowNoBorder:!0,...yt,cellBorderStyle:"solid",cellBorderWidth:1,cellBorderColor:"#ffd966",cellVerticalBorderStyle:"solid",cellVerticalBorderWidth:1,firstColumnBorderColor:"#ffd966",firstColumnFontStyle:"normal"}),12:()=>({...So("#a8d08d","#e2efd9",{noBorder:!0}),containerBackgroundColor:void 0,...yt,cellBorderStyle:"solid",cellBorderWidth:1,cellBorderColor:"#a8d08d",cellVerticalBorderStyle:"solid",cellVerticalBorderWidth:1,headerRowNoBorder:!0,firstColumnBorderColor:"#a8d08d",firstColumnFontStyle:"normal"}),13:()=>({...So("#666666","#cccccc",{noBorder:!0,firstColumnBg:"#ffffff"}),containerBackgroundColor:void 0,...Nr,cellBorderStyle:"solid",cellBorderWidth:1,cellBorderColor:"#666666",cellVerticalBorderStyle:"solid",cellVerticalBorderWidth:1,headerRowNoBorder:!0,firstColumnBorderColor:"#666666"}),14:()=>({...So("#9cc2e5","#deeaf6",{noBorder:!0,firstColumnBg:"#ffffff"}),containerBackgroundColor:void 0,...Nr,firstColumnBorderColor:"#9cc2e5",cellBorderStyle:void 0,cellBorderWidth:void 0,cellBorderColor:void 0,cellVerticalBorderStyle:void 0,cellVerticalBorderWidth:void 0}),15:()=>({...So("#f4b083","#fbe4d5",{noBorder:!0,firstColumnBg:"#ffffff"}),containerBackgroundColor:void 0,...Nr,firstColumnBorderColor:"#f4b083",cellBorderStyle:void 0,cellBorderWidth:void 0,cellBorderColor:void 0,cellVerticalBorderStyle:void 0,cellVerticalBorderWidth:void 0}),16:()=>({...So("#c9c9c9","#ededed",{noBorder:!0,firstColumnBg:"#ffffff"}),containerBackgroundColor:void 0,...Nr,firstColumnBorderColor:"#c9c9c9",cellBorderStyle:void 0,cellBorderWidth:void 0,cellBorderColor:void 0,cellVerticalBorderStyle:void 0,cellVerticalBorderWidth:void 0}),17:()=>({...So("#ffd966","#fff2cc",{noBorder:!0,firstColumnBg:"#ffffff"}),containerBackgroundColor:void 0,...Nr,firstColumnBorderColor:"#ffd966",cellBorderStyle:void 0,cellBorderWidth:void 0,cellBorderColor:void 0,cellVerticalBorderStyle:void 0,cellVerticalBorderWidth:void 0}),18:()=>({...So("#a8d08d","#e2efd9",{noBorder:!0,firstColumnBg:"#ffffff"}),containerBackgroundColor:void 0,...Nr,firstColumnBorderColor:"#a8d08d",cellBorderStyle:void 0,cellBorderWidth:void 0,cellBorderColor:void 0,cellVerticalBorderStyle:void 0,cellVerticalBorderWidth:void 0}),19:()=>({...Hr("#666666","#cccccc","#000000"),containerBackgroundColor:void 0,firstColumnBorderColor:"#666666",firstColumnFontStyle:"normal",headerRowNoBorder:void 0,cellBorderStyle:void 0,cellBorderWidth:void 0,cellBorderColor:void 0,cellVerticalBorderStyle:void 0,cellVerticalBorderWidth:void 0}),20:()=>({...Hr("#9cc2e5","#deeaf6","#5b9bd5"),containerBackgroundColor:void 0,firstColumnBorderColor:"#9cc2e5",firstColumnFontStyle:"normal",headerRowNoBorder:void 0,cellBorderStyle:void 0,cellBorderWidth:void 0,cellBorderColor:void 0,cellVerticalBorderStyle:void 0,cellVerticalBorderWidth:void 0}),21:()=>({...Hr("#f4b083","#fbe4d5","#ed7d31"),containerBackgroundColor:void 0,firstColumnBorderColor:"#f4b083",firstColumnFontStyle:"normal",headerRowNoBorder:void 0,cellBorderStyle:void 0,cellBorderWidth:void 0,cellBorderColor:void 0,cellVerticalBorderStyle:void 0,cellVerticalBorderWidth:void 0}),22:()=>({...Hr("#c9c9c9","#ededed","#a5a5a5"),containerBackgroundColor:void 0,firstColumnBorderColor:"#c9c9c9",firstColumnFontStyle:"normal",headerRowNoBorder:void 0,cellBorderStyle:void 0,cellBorderWidth:void 0,cellBorderColor:void 0,cellVerticalBorderStyle:void 0,cellVerticalBorderWidth:void 0}),23:()=>({...Hr("#ffd966","#fff2cc","#ffc000"),containerBackgroundColor:void 0,firstColumnBorderColor:"#ffd966",firstColumnFontStyle:"normal",headerRowNoBorder:void 0,cellBorderStyle:void 0,cellBorderWidth:void 0,cellBorderColor:void 0,cellVerticalBorderStyle:void 0,cellVerticalBorderWidth:void 0}),24:()=>({...Hr("#a8d08d","#e2efd9","#70ad47"),containerBackgroundColor:void 0,firstColumnBorderColor:"#a8d08d",firstColumnFontStyle:"normal",headerRowNoBorder:void 0,cellBorderStyle:void 0,cellBorderWidth:void 0,cellBorderColor:void 0,cellVerticalBorderStyle:void 0,cellVerticalBorderWidth:void 0}),25:()=>({...Bt("#000000",2),containerBackgroundColor:"#cccccc",alternateRowColor:"#999999",headerRowBackgroundColor:"#000000",firstColumnBackgroundColor:"#000000",headerRowTextColor:"#ffffff",firstColumnTextColor:"#ffffff",textColor:"#000000",headerRowNoBorder:!0,headerRowBorderColor:"#ffffff",headerRowBorderWidth:1,...yt,cellBorderStyle:"solid",cellBorderWidth:1,cellBorderColor:"#ffffff",cellVerticalBorderStyle:"solid",cellVerticalBorderWidth:1,firstColumnBorderColor:"#ffffff",firstColumnFontStyle:"normal"}),26:()=>({...Bt("#000000",2),containerBackgroundColor:"#deeaf6",alternateRowColor:"#bdd6ee",headerRowBackgroundColor:"#5b9bd5",firstColumnBackgroundColor:"#5b9bd5",headerRowTextColor:"#ffffff",firstColumnTextColor:"#ffffff",textColor:"#000000",headerRowNoBorder:!0,headerRowBorderColor:"#ffffff",headerRowBorderWidth:1,...yt,cellBorderStyle:"solid",cellBorderWidth:1,cellBorderColor:"#ffffff",cellVerticalBorderStyle:"solid",cellVerticalBorderWidth:1,firstColumnBorderColor:"#ffffff",firstColumnFontStyle:"normal"}),27:()=>({...Bt("#000000",2),containerBackgroundColor:"#fbe4d5",alternateRowColor:"#f7caac",headerRowBackgroundColor:"#ed7d31",firstColumnBackgroundColor:"#ed7d31",headerRowTextColor:"#ffffff",firstColumnTextColor:"#ffffff",textColor:"#000000",headerRowNoBorder:!0,headerRowBorderColor:"#ffffff",headerRowBorderWidth:1,...yt,cellBorderStyle:"solid",cellBorderWidth:1,cellBorderColor:"#ffffff",cellVerticalBorderStyle:"solid",cellVerticalBorderWidth:1,firstColumnBorderColor:"#ffffff",firstColumnFontStyle:"normal"}),28:()=>({...Bt("#000000",2),containerBackgroundColor:"#ededed",alternateRowColor:"#dbdbdb",headerRowBackgroundColor:"#a5a5a5",firstColumnBackgroundColor:"#a5a5a5",headerRowTextColor:"#ffffff",firstColumnTextColor:"#ffffff",textColor:"#000000",headerRowNoBorder:!0,headerRowBorderColor:"#ffffff",headerRowBorderWidth:1,...yt,cellBorderStyle:"solid",cellBorderWidth:1,cellBorderColor:"#ffffff",cellVerticalBorderStyle:"solid",cellVerticalBorderWidth:1,firstColumnBorderColor:"#ffffff",firstColumnFontStyle:"normal"}),29:()=>({...Bt("#000000",2),containerBackgroundColor:"#fff2cc",alternateRowColor:"#ffe599",headerRowBackgroundColor:"#ffc000",firstColumnBackgroundColor:"#ffc000",headerRowTextColor:"#ffffff",firstColumnTextColor:"#ffffff",textColor:"#000000",headerRowNoBorder:!0,headerRowBorderColor:"#ffffff",headerRowBorderWidth:1,...yt,cellBorderStyle:"solid",cellBorderWidth:1,cellBorderColor:"#ffffff",cellVerticalBorderStyle:"solid",cellVerticalBorderWidth:1,firstColumnBorderColor:"#ffffff",firstColumnFontStyle:"normal"}),30:()=>({...Bt("#000000",2),containerBackgroundColor:"#e2efd9",alternateRowColor:"#c5e0b3",headerRowBackgroundColor:"#70ad47",firstColumnBackgroundColor:"#70ad47",headerRowTextColor:"#ffffff",firstColumnTextColor:"#ffffff",textColor:"#000000",headerRowNoBorder:!0,headerRowBorderColor:"#ffffff",headerRowBorderWidth:1,...yt,cellBorderStyle:"solid",cellBorderWidth:1,cellBorderColor:"#ffffff",cellVerticalBorderStyle:"solid",cellVerticalBorderWidth:1,firstColumnBorderColor:"#ffffff",firstColumnFontStyle:"normal"}),31:()=>({...Bt("#666666",2),containerBackgroundColor:void 0,alternateRowColor:"#cccccc",headerRowNoBorder:!0,firstColumnBorderColor:"#666666",textColor:"#222222",headerRowTextColor:"#222222",firstColumnTextColor:"#222222",firstColumnFontStyle:"normal",cellBorderStyle:void 0,cellBorderWidth:void 0,cellBorderColor:void 0,cellVerticalBorderStyle:void 0,cellVerticalBorderWidth:void 0}),32:()=>({...Bt("#9cc2e5",2),containerBackgroundColor:void 0,alternateRowColor:"#deeaf6",headerRowNoBorder:!0,firstColumnBorderColor:"#9cc2e5",textColor:"#2e74b5",headerRowTextColor:"#2e74b5",firstColumnTextColor:"#2e74b5",firstColumnFontStyle:"normal",cellBorderStyle:void 0,cellBorderWidth:void 0,cellBorderColor:void 0,cellVerticalBorderStyle:void 0,cellVerticalBorderWidth:void 0}),33:()=>({...Bt("#f4b083",2),containerBackgroundColor:void 0,alternateRowColor:"#fbe4d5",headerRowNoBorder:!0,firstColumnBorderColor:"#f4b083",textColor:"#c45911",headerRowTextColor:"#c45911",firstColumnTextColor:"#c45911",firstColumnFontStyle:"normal",cellBorderStyle:void 0,cellBorderWidth:void 0,cellBorderColor:void 0,cellVerticalBorderStyle:void 0,cellVerticalBorderWidth:void 0}),34:()=>({...Bt("#c9c9c9",2),containerBackgroundColor:void 0,alternateRowColor:"#ededed",headerRowNoBorder:!0,firstColumnBorderColor:"#c9c9c9",textColor:"#7b7b7b",headerRowTextColor:"#7b7b7b",firstColumnTextColor:"#7b7b7b",firstColumnFontStyle:"normal",cellBorderStyle:void 0,cellBorderWidth:void 0,cellBorderColor:void 0,cellVerticalBorderStyle:void 0,cellVerticalBorderWidth:void 0}),35:()=>({...Bt("#ffd966",2),containerBackgroundColor:void 0,alternateRowColor:"#fff2cc",headerRowNoBorder:!0,firstColumnBorderColor:"#ffd966",textColor:"#bf8f00",headerRowTextColor:"#bf8f00",firstColumnTextColor:"#bf8f00",firstColumnFontStyle:"normal",cellBorderStyle:void 0,cellBorderWidth:void 0,cellBorderColor:void 0,cellVerticalBorderStyle:void 0,cellVerticalBorderWidth:void 0}),36:()=>({...So("#a8d08d","#e2efd9",{noBorder:!0}),containerBackgroundColor:void 0,firstColumnBorderColor:"#a8d08d",textColor:"#538135",headerRowTextColor:"#538135",firstColumnTextColor:"#538135",firstColumnFontStyle:"normal",cellBorderStyle:void 0,cellBorderWidth:void 0,cellBorderColor:void 0,cellVerticalBorderStyle:void 0,cellVerticalBorderWidth:void 0}),37:()=>({...Vr("#666666","#cccccc","#222222"),containerBackgroundColor:void 0,firstColumnBorderColor:"#666666",cellBorderStyle:void 0,cellBorderWidth:void 0,cellBorderColor:void 0,cellVerticalBorderStyle:void 0,cellVerticalBorderWidth:void 0}),38:()=>({...Vr("#9cc2e5","#deeaf6","#2e74b5"),containerBackgroundColor:void 0,firstColumnBorderColor:"#9cc2e5",cellBorderStyle:void 0,cellBorderWidth:void 0,cellBorderColor:void 0,cellVerticalBorderStyle:void 0,cellVerticalBorderWidth:void 0}),39:()=>({...Vr("#f4b083","#fbe4d5","#c45911"),containerBackgroundColor:void 0,firstColumnBorderColor:"#f4b083",cellBorderStyle:void 0,cellBorderWidth:void 0,cellBorderColor:void 0,cellVerticalBorderStyle:void 0,cellVerticalBorderWidth:void 0}),40:()=>({...Vr("#c9c9c9","#ededed","#7b7b7b"),containerBackgroundColor:void 0,firstColumnBorderColor:"#c9c9c9",cellBorderStyle:void 0,cellBorderWidth:void 0,cellBorderColor:void 0,cellVerticalBorderStyle:void 0,cellVerticalBorderWidth:void 0}),41:()=>({...Vr("#ffd966","#fff2cc","#bf8f00"),containerBackgroundColor:void 0,firstColumnBorderColor:"#ffd966",cellBorderStyle:void 0,cellBorderWidth:void 0,cellBorderColor:void 0,cellVerticalBorderStyle:void 0,cellVerticalBorderWidth:void 0}),42:()=>({...Vr("#a8d08d","#e2efd9","#538135"),containerBackgroundColor:void 0,firstColumnBorderColor:"#a8d08d",cellBorderStyle:void 0,cellBorderWidth:void 0,cellBorderColor:void 0,cellVerticalBorderStyle:void 0,cellVerticalBorderWidth:void 0})};n[o]&&Object.assign(r,n[o]()),e.push({id:`grid-style-${o.toString().padStart(2,"0")}`,label:`Style ${o.toString().padStart(2,"0")}`,preview:Vo("grid",`style-${o.toString().padStart(2,"0")}`),style:r})}return e},WN=()=>{const e=[],t=dr();for(let o=1;o<=42;o++){const r={...t,borderStyle:"solid",borderWidth:ro.DEFAULT_BORDER_WIDTH,borderColor:ro.DEFAULT_BORDER_COLOR},n={1:()=>({...yt,containerBackgroundColor:"#ffffff",alternateRowColor:"#cccccc",cellBorderStyle:"solid",cellBorderWidth:0,cellBorderColor:"#cccccc",cellVerticalBorderStyle:"none",cellVerticalBorderWidth:0,headerRowNoBorder:!0,headerRowBorderColor:"#cccccc",headerRowBorderWidth:1,firstColumnBorderColor:void 0,firstColumnTextColor:void 0,firstColumnFontStyle:void 0,firstColumnFontWeight:void 0,firstColumnBackgroundColor:void 0,textColor:void 0,headerRowTextColor:void 0,headerRowFontWeight:void 0,headerRowBackgroundColor:void 0,borderColor:void 0}),2:()=>({...yt,containerBackgroundColor:"#ffffff",alternateRowColor:"#deeaf6",cellBorderStyle:"solid",cellBorderWidth:0,cellBorderColor:"#a3c6e7",cellVerticalBorderStyle:"none",cellVerticalBorderWidth:0,headerRowNoBorder:!0,headerRowBorderColor:"#a3c6e7",headerRowBorderWidth:1,firstColumnBorderColor:void 0,firstColumnTextColor:void 0,firstColumnFontStyle:void 0,firstColumnFontWeight:void 0,firstColumnBackgroundColor:void 0,textColor:void 0,headerRowTextColor:void 0,headerRowFontWeight:void 0,headerRowBackgroundColor:void 0,borderColor:void 0}),3:()=>({...yt,containerBackgroundColor:"#ffffff",alternateRowColor:"#fbe4d5",cellBorderStyle:"solid",cellBorderWidth:1,cellBorderColor:"#fbe4d5",cellVerticalBorderStyle:"none",cellVerticalBorderWidth:0,headerRowNoBorder:!0,headerRowBorderColor:"#fbe4d5",headerRowBorderWidth:1,firstColumnBorderColor:void 0,firstColumnTextColor:void 0,firstColumnFontStyle:void 0,firstColumnFontWeight:void 0,firstColumnBackgroundColor:void 0,textColor:void 0,headerRowTextColor:void 0,headerRowFontWeight:void 0,headerRowBackgroundColor:void 0,borderColor:void 0}),4:()=>({...yt,containerBackgroundColor:"#ffffff",alternateRowColor:"#ededed",cellBorderStyle:"solid",cellBorderWidth:1,cellBorderColor:"#ededed",cellVerticalBorderStyle:"none",cellVerticalBorderWidth:0,headerRowNoBorder:!0,headerRowBorderColor:"#ededed",headerRowBorderWidth:1,firstColumnBorderColor:void 0,firstColumnTextColor:void 0,firstColumnFontStyle:void 0,firstColumnFontWeight:void 0,firstColumnBackgroundColor:void 0,textColor:void 0,headerRowTextColor:void 0,headerRowFontWeight:void 0,headerRowBackgroundColor:void 0,borderColor:void 0}),5:()=>({...yt,containerBackgroundColor:"#ffffff",alternateRowColor:"#fff2cc",cellBorderStyle:"solid",cellBorderWidth:1,cellBorderColor:"#fff2cc",cellVerticalBorderStyle:"none",cellVerticalBorderWidth:0,headerRowNoBorder:!0,headerRowBorderColor:"#fff2cc",headerRowBorderWidth:1,firstColumnBorderColor:void 0,firstColumnTextColor:void 0,firstColumnFontStyle:void 0,firstColumnFontWeight:void 0,firstColumnBackgroundColor:void 0,textColor:void 0,headerRowTextColor:void 0,headerRowFontWeight:void 0,headerRowBackgroundColor:void 0,borderColor:void 0}),6:()=>({...yt,containerBackgroundColor:"#ffffff",alternateRowColor:"#e2efd9",cellBorderStyle:"solid",cellBorderWidth:1,cellBorderColor:"#e2efd9",cellVerticalBorderStyle:"none",cellVerticalBorderWidth:0,headerRowNoBorder:!0,headerRowBorderColor:"#e2efd9",headerRowBorderWidth:1,firstColumnBorderColor:void 0,firstColumnTextColor:void 0,firstColumnFontStyle:void 0,firstColumnFontWeight:void 0,firstColumnBackgroundColor:void 0,textColor:void 0,headerRowTextColor:void 0,headerRowFontWeight:void 0,headerRowBackgroundColor:void 0,borderColor:void 0}),7:()=>({...yt,containerBackgroundColor:"#ffffff",alternateRowColor:"#cccccc",cellBorderStyle:"solid",cellBorderWidth:1,cellBorderColor:"#717171",cellVerticalBorderStyle:"none",cellVerticalBorderWidth:0,headerRowNoBorder:!0,headerRowBorderColor:"#717171",headerRowBorderWidth:1,firstColumnBorderColor:void 0,firstColumnTextColor:void 0,firstColumnFontStyle:void 0,firstColumnFontWeight:void 0,firstColumnBackgroundColor:void 0,textColor:void 0,headerRowTextColor:void 0,headerRowFontWeight:void 0,headerRowBackgroundColor:void 0,borderColor:void 0}),8:()=>({...yt,containerBackgroundColor:"#ffffff",alternateRowColor:"#deeaf6",cellBorderStyle:"solid",cellBorderWidth:1,cellBorderColor:"#a3c6e7",cellVerticalBorderStyle:"none",cellVerticalBorderWidth:0,headerRowNoBorder:!0,headerRowBorderColor:"#a3c6e7",headerRowBorderWidth:1,firstColumnBorderColor:void 0,firstColumnTextColor:void 0,firstColumnFontStyle:void 0,firstColumnFontWeight:void 0,firstColumnBackgroundColor:void 0,textColor:void 0,headerRowTextColor:void 0,headerRowFontWeight:void 0,headerRowBackgroundColor:void 0,borderColor:void 0}),9:()=>({...yt,containerBackgroundColor:"#ffffff",alternateRowColor:"#fbe4d5",cellBorderStyle:"solid",cellBorderWidth:1,cellBorderColor:"#f5b68c",cellVerticalBorderStyle:"none",cellVerticalBorderWidth:0,headerRowNoBorder:!0,headerRowBorderColor:"#f5b68c",headerRowBorderWidth:1,firstColumnBorderColor:void 0,firstColumnTextColor:void 0,firstColumnFontStyle:void 0,firstColumnFontWeight:void 0,firstColumnBackgroundColor:void 0,textColor:void 0,headerRowTextColor:void 0,headerRowFontWeight:void 0,headerRowBackgroundColor:void 0,borderColor:void 0}),10:()=>({...yt,containerBackgroundColor:"#ffffff",alternateRowColor:"#ededed",cellBorderStyle:"solid",cellBorderWidth:1,cellBorderColor:"#cdcdcd",cellVerticalBorderStyle:"none",cellVerticalBorderWidth:0,headerRowNoBorder:!0,headerRowBorderColor:"#cdcdcd",headerRowBorderWidth:1,firstColumnBorderColor:void 0,firstColumnTextColor:void 0,firstColumnFontStyle:void 0,firstColumnFontWeight:void 0,firstColumnBackgroundColor:void 0,textColor:void 0,headerRowTextColor:void 0,headerRowFontWeight:void 0,headerRowBackgroundColor:void 0,borderColor:void 0}),11:()=>({...yt,containerBackgroundColor:"#ffffff",alternateRowColor:"#fff2cc",cellBorderStyle:"solid",cellBorderWidth:1,cellBorderColor:"#ffdc71",cellVerticalBorderStyle:"none",cellVerticalBorderWidth:0,headerRowNoBorder:!0,headerRowBorderColor:"#ffdc71",headerRowBorderWidth:1,firstColumnBorderColor:void 0,firstColumnTextColor:void 0,firstColumnFontStyle:void 0,firstColumnFontWeight:void 0,firstColumnBackgroundColor:void 0,textColor:void 0,headerRowTextColor:void 0,headerRowFontWeight:void 0,headerRowBackgroundColor:void 0,borderColor:void 0}),12:()=>({...yt,containerBackgroundColor:"#ffffff",alternateRowColor:"#e2efd9",cellBorderStyle:"solid",cellBorderWidth:1,cellBorderColor:"#aed395",cellVerticalBorderStyle:"none",cellVerticalBorderWidth:0,headerRowNoBorder:!0,headerRowBorderColor:"#aed395",headerRowBorderWidth:1,firstColumnBorderColor:void 0,firstColumnTextColor:void 0,firstColumnFontStyle:void 0,firstColumnFontWeight:void 0,firstColumnBackgroundColor:void 0,textColor:void 0,headerRowTextColor:void 0,headerRowFontWeight:void 0,headerRowBackgroundColor:void 0,borderColor:void 0}),13:()=>({containerBackgroundColor:"#ffffff",alternateRowColor:void 0,borderStyle:"solid",borderWidth:1,borderColor:"#000000",cellBorderStyle:"solid",cellBorderWidth:1,cellBorderColor:"#000000",cellVerticalBorderStyle:"none",cellVerticalBorderWidth:0,headerRowNoBorder:!0,headerRowBorderColor:"#000000",headerRowBorderWidth:1,headerRowBackgroundColor:"#000000",headerRowTextColor:"#ffffff",firstColumnBorderColor:void 0,firstColumnTextColor:void 0,firstColumnFontStyle:void 0,firstColumnFontWeight:"bold",firstColumnBackgroundColor:void 0,textColor:void 0,headerRowFontWeight:"bold"}),14:()=>({containerBackgroundColor:"#ffffff",alternateRowColor:void 0,borderStyle:"solid",borderWidth:1,borderColor:"#9cc2e5",cellBorderStyle:"solid",cellBorderWidth:1,cellBorderColor:"#9cc2e5",cellVerticalBorderStyle:"none",cellVerticalBorderWidth:0,headerRowNoBorder:!0,headerRowBorderColor:"#9cc2e5",headerRowBorderWidth:1,headerRowBackgroundColor:"#5b9bd5",headerRowTextColor:"#ffffff",firstColumnBorderColor:void 0,firstColumnTextColor:void 0,firstColumnFontStyle:void 0,firstColumnFontWeight:"bold",firstColumnBackgroundColor:void 0,textColor:void 0,headerRowFontWeight:"bold"}),15:()=>({containerBackgroundColor:"#ffffff",alternateRowColor:void 0,borderStyle:"solid",borderWidth:1,borderColor:"#f4b083",cellBorderStyle:"solid",cellBorderWidth:1,cellBorderColor:"#f4b083",cellVerticalBorderStyle:"none",cellVerticalBorderWidth:0,headerRowNoBorder:!0,headerRowBorderColor:"#f4b083",headerRowBorderWidth:1,headerRowBackgroundColor:"#ed7d31",headerRowTextColor:"#ffffff",firstColumnBorderColor:void 0,firstColumnTextColor:void 0,firstColumnFontStyle:void 0,firstColumnFontWeight:"bold",firstColumnBackgroundColor:void 0,textColor:void 0,headerRowFontWeight:"bold"}),16:()=>({containerBackgroundColor:"#ffffff",alternateRowColor:void 0,borderStyle:"solid",borderWidth:1,borderColor:"#c9c9c9",cellBorderStyle:"solid",cellBorderWidth:1,cellBorderColor:"#c9c9c9",cellVerticalBorderStyle:"none",cellVerticalBorderWidth:0,headerRowNoBorder:!0,headerRowBorderColor:"#c9c9c9",headerRowBorderWidth:1,headerRowBackgroundColor:"#a5a5a5",headerRowTextColor:"#ffffff",firstColumnBorderColor:void 0,firstColumnTextColor:void 0,firstColumnFontStyle:void 0,firstColumnFontWeight:"bold",firstColumnBackgroundColor:void 0,textColor:void 0,headerRowFontWeight:"bold"}),17:()=>({containerBackgroundColor:"#ffffff",alternateRowColor:void 0,borderStyle:"solid",borderWidth:1,borderColor:"#ffd966",cellBorderStyle:"solid",cellBorderWidth:1,cellBorderColor:"#ffd966",cellVerticalBorderStyle:"none",cellVerticalBorderWidth:0,headerRowNoBorder:!0,headerRowBorderColor:"#ffd966",headerRowBorderWidth:1,headerRowBackgroundColor:"#ffc000",headerRowTextColor:"#ffffff",firstColumnBorderColor:void 0,firstColumnTextColor:void 0,firstColumnFontStyle:void 0,firstColumnFontWeight:"bold",firstColumnBackgroundColor:void 0,textColor:void 0,headerRowFontWeight:"bold"}),18:()=>({containerBackgroundColor:"#ffffff",alternateRowColor:void 0,borderStyle:"solid",borderWidth:1,borderColor:"#a8d08d",cellBorderStyle:"solid",cellBorderWidth:1,cellBorderColor:"#a8d08d",cellVerticalBorderStyle:"none",cellVerticalBorderWidth:0,headerRowNoBorder:!0,headerRowBorderColor:"#a8d08d",headerRowBorderWidth:1,headerRowBackgroundColor:"#70ad47",headerRowTextColor:"#ffffff",firstColumnBorderColor:void 0,firstColumnTextColor:void 0,firstColumnFontStyle:void 0,firstColumnFontWeight:"bold",firstColumnBackgroundColor:void 0,textColor:void 0,headerRowFontWeight:"bold"}),19:()=>({containerBackgroundColor:"#ffffff",alternateRowColor:"#cccccc",borderStyle:"solid",borderWidth:1,borderColor:"#000000",cellBorderStyle:"solid",cellBorderWidth:1,cellBorderColor:"#666666",cellVerticalBorderStyle:"none",cellVerticalBorderWidth:0,headerRowNoBorder:!0,headerRowBorderColor:"#000000",headerRowBorderWidth:1,headerRowBackgroundColor:"#000000",headerRowTextColor:"#ffffff",headerRowFontWeight:"bold",firstColumnFontWeight:"bold",firstColumnBorderColor:void 0,firstColumnTextColor:void 0,firstColumnFontStyle:void 0,firstColumnBackgroundColor:void 0,textColor:void 0}),20:()=>({containerBackgroundColor:"#ffffff",alternateRowColor:"#deeaf6",borderStyle:"solid",borderWidth:1,borderColor:"#9cc2e5",cellBorderStyle:"solid",cellBorderWidth:1,cellBorderColor:"#9cc2e5",cellVerticalBorderStyle:"none",cellVerticalBorderWidth:0,headerRowNoBorder:!0,headerRowBorderColor:"#9cc2e5",headerRowBorderWidth:1,headerRowBackgroundColor:"#5b9bd5",headerRowTextColor:"#ffffff",headerRowFontWeight:"bold",firstColumnFontWeight:"bold",firstColumnBorderColor:void 0,firstColumnTextColor:void 0,firstColumnFontStyle:void 0,firstColumnBackgroundColor:void 0,textColor:void 0}),21:()=>({containerBackgroundColor:"#ffffff",alternateRowColor:"#fbe4d5",borderStyle:"solid",borderWidth:1,borderColor:"#f4b083",cellBorderStyle:"solid",cellBorderWidth:1,cellBorderColor:"#f4b083",cellVerticalBorderStyle:"none",cellVerticalBorderWidth:0,headerRowNoBorder:!0,headerRowBorderColor:"#f4b083",headerRowBorderWidth:1,headerRowBackgroundColor:"#ed7d31",headerRowTextColor:"#ffffff",headerRowFontWeight:"bold",firstColumnFontWeight:"bold",firstColumnBorderColor:void 0,firstColumnTextColor:void 0,firstColumnFontStyle:void 0,firstColumnBackgroundColor:void 0,textColor:void 0}),22:()=>({containerBackgroundColor:"#ffffff",alternateRowColor:"#ededed",borderStyle:"solid",borderWidth:1,borderColor:"#c9c9c9",cellBorderStyle:"solid",cellBorderWidth:1,cellBorderColor:"#c9c9c9",cellVerticalBorderStyle:"none",cellVerticalBorderWidth:0,headerRowNoBorder:!0,headerRowBorderColor:"#c9c9c9",headerRowBorderWidth:1,headerRowBackgroundColor:"#a5a5a5",headerRowTextColor:"#ffffff",headerRowFontWeight:"bold",firstColumnFontWeight:"bold",firstColumnBorderColor:void 0,firstColumnTextColor:void 0,firstColumnFontStyle:void 0,firstColumnBackgroundColor:void 0,textColor:void 0}),23:()=>({containerBackgroundColor:"#ffffff",alternateRowColor:"#fff2cc",borderStyle:"solid",borderWidth:1,borderColor:"#ffd966",cellBorderStyle:"solid",cellBorderWidth:1,cellBorderColor:"#ffd966",cellVerticalBorderStyle:"none",cellVerticalBorderWidth:0,headerRowNoBorder:!0,headerRowBorderColor:"#ffd966",headerRowBorderWidth:1,headerRowBackgroundColor:"#ffc000",headerRowTextColor:"#ffffff",headerRowFontWeight:"bold",firstColumnFontWeight:"bold",firstColumnBorderColor:void 0,firstColumnTextColor:void 0,firstColumnFontStyle:void 0,firstColumnBackgroundColor:void 0,textColor:void 0}),24:()=>({containerBackgroundColor:"#ffffff",alternateRowColor:"#e2efd9",borderStyle:"solid",borderWidth:1,borderColor:"#a8d08d",cellBorderStyle:"solid",cellBorderWidth:1,cellBorderColor:"#a8d08d",cellVerticalBorderStyle:"none",cellVerticalBorderWidth:0,headerRowNoBorder:!0,headerRowBorderColor:"#a8d08d",headerRowBorderWidth:1,headerRowBackgroundColor:"#70ad47",headerRowTextColor:"#ffffff",headerRowFontWeight:"bold",firstColumnFontWeight:"bold",firstColumnBorderColor:void 0,firstColumnTextColor:void 0,firstColumnFontStyle:void 0,firstColumnBackgroundColor:void 0,textColor:void 0}),25:()=>({containerBackgroundColor:"#000000",alternateRowColor:void 0,borderStyle:"solid",borderWidth:1,borderColor:"#ffffff",cellBorderStyle:"solid",cellBorderWidth:1,cellBorderColor:"#ffffff",cellVerticalBorderStyle:"none",cellVerticalBorderWidth:0,headerRowNoBorder:!0,headerRowBorderColor:"#ffffff",headerRowBorderWidth:3,headerRowBackgroundColor:"#000000",headerRowTextColor:"#ffffff",textColor:"#ffffff",headerRowFontWeight:"bold",firstColumnBorderColor:"#ffffff",firstColumnBorderWidth:1,firstColumnFontWeight:"bold",firstColumnTextColor:"#ffffff",firstColumnFontStyle:void 0,firstColumnBackgroundColor:void 0}),26:()=>({containerBackgroundColor:"#5b9bd5",alternateRowColor:void 0,borderStyle:"solid",borderWidth:1,borderColor:"#ffffff",cellBorderStyle:"solid",cellBorderWidth:1,cellBorderColor:"#ffffff",cellVerticalBorderStyle:"none",cellVerticalBorderWidth:0,headerRowNoBorder:!0,headerRowBorderColor:"#ffffff",headerRowBorderWidth:3,headerRowBackgroundColor:"#5b9bd5",headerRowTextColor:"#ffffff",textColor:"#ffffff",headerRowFontWeight:"bold",firstColumnBorderColor:"#ffffff",firstColumnBorderWidth:1,firstColumnFontWeight:"bold",firstColumnTextColor:"#ffffff",firstColumnFontStyle:void 0,firstColumnBackgroundColor:void 0}),27:()=>({containerBackgroundColor:"#ed7d31",alternateRowColor:void 0,borderStyle:"solid",borderWidth:1,borderColor:"#ffffff",cellBorderStyle:"solid",cellBorderWidth:1,cellBorderColor:"#ffffff",cellVerticalBorderStyle:"none",cellVerticalBorderWidth:0,headerRowNoBorder:!0,headerRowBorderColor:"#ffffff",headerRowBorderWidth:3,headerRowBackgroundColor:"#ed7d31",headerRowTextColor:"#ffffff",textColor:"#ffffff",headerRowFontWeight:"bold",firstColumnBorderColor:"#ffffff",firstColumnBorderWidth:1,firstColumnFontWeight:"bold",firstColumnTextColor:"#ffffff",firstColumnFontStyle:void 0,firstColumnBackgroundColor:void 0}),28:()=>({containerBackgroundColor:"#a5a5a5",alternateRowColor:void 0,borderStyle:"solid",borderWidth:1,borderColor:"#ffffff",cellBorderStyle:"solid",cellBorderWidth:1,cellBorderColor:"#ffffff",cellVerticalBorderStyle:"none",cellVerticalBorderWidth:0,headerRowNoBorder:!0,headerRowBorderColor:"#ffffff",headerRowBorderWidth:3,headerRowBackgroundColor:"#a5a5a5",headerRowTextColor:"#ffffff",textColor:"#ffffff",headerRowFontWeight:"bold",firstColumnBorderColor:"#ffffff",firstColumnBorderWidth:1,firstColumnFontWeight:"bold",firstColumnTextColor:"#ffffff",firstColumnFontStyle:void 0,firstColumnBackgroundColor:void 0}),29:()=>({containerBackgroundColor:"#ffc000",alternateRowColor:void 0,borderStyle:"solid",borderWidth:1,borderColor:"#ffffff",cellBorderStyle:"solid",cellBorderWidth:1,cellBorderColor:"#ffffff",cellVerticalBorderStyle:"none",cellVerticalBorderWidth:0,headerRowNoBorder:!0,headerRowBorderColor:"#ffffff",headerRowBorderWidth:3,headerRowBackgroundColor:"#ffc000",headerRowTextColor:"#ffffff",textColor:"#ffffff",headerRowFontWeight:"bold",firstColumnBorderColor:"#ffffff",firstColumnBorderWidth:1,firstColumnFontWeight:"bold",firstColumnTextColor:"#ffffff",firstColumnFontStyle:void 0,firstColumnBackgroundColor:void 0}),30:()=>({containerBackgroundColor:"#70ad47",alternateRowColor:void 0,borderStyle:"solid",borderWidth:1,borderColor:"#ffffff",cellBorderStyle:"solid",cellBorderWidth:1,cellBorderColor:"#ffffff",cellVerticalBorderStyle:"none",cellVerticalBorderWidth:0,headerRowNoBorder:!0,headerRowBorderColor:"#ffffff",headerRowBorderWidth:3,headerRowBackgroundColor:"#70ad47",headerRowTextColor:"#ffffff",textColor:"#ffffff",headerRowFontWeight:"bold",firstColumnBorderColor:"#ffffff",firstColumnBorderWidth:1,firstColumnFontWeight:"bold",firstColumnTextColor:"#ffffff",firstColumnFontStyle:void 0,firstColumnBackgroundColor:void 0}),31:()=>({containerBackgroundColor:"#ffffff",alternateRowColor:"#cccccc",borderStyle:"solid",borderWidth:1,borderColor:"#000000",borderLeft:"none",borderRight:"none",cellBorderStyle:"none",cellBorderWidth:0,cellBorderColor:"transparent",cellVerticalBorderStyle:"none",cellVerticalBorderWidth:0,headerRowNoBorder:!0,headerRowBorderColor:"#000000",headerRowBorderWidth:1,firstColumnBorderColor:void 0,firstColumnTextColor:void 0,firstColumnFontStyle:void 0,firstColumnFontWeight:"bold",firstColumnBackgroundColor:void 0,textColor:void 0,headerRowTextColor:void 0,headerRowFontWeight:"bold",headerRowBackgroundColor:void 0}),32:()=>({containerBackgroundColor:"#ffffff",alternateRowColor:"#deeaf6",borderStyle:"solid",borderWidth:1,borderColor:"#5b9bd5",borderLeft:"none",borderRight:"none",cellBorderStyle:"none",cellBorderWidth:0,cellBorderColor:"transparent",cellVerticalBorderStyle:"none",cellVerticalBorderWidth:0,headerRowNoBorder:!0,headerRowBorderColor:"#5b9bd5",headerRowBorderWidth:1,firstColumnBorderColor:void 0,firstColumnTextColor:void 0,firstColumnFontStyle:void 0,firstColumnFontWeight:"bold",firstColumnBackgroundColor:void 0,textColor:"#2e74b5",headerRowTextColor:void 0,headerRowFontWeight:"bold",headerRowBackgroundColor:void 0}),33:()=>({containerBackgroundColor:"#ffffff",alternateRowColor:"#fbe4d5",borderStyle:"solid",borderWidth:1,borderColor:"#a5a5a5",borderLeft:"none",borderRight:"none",cellBorderStyle:"none",cellBorderWidth:0,cellBorderColor:"transparent",cellVerticalBorderStyle:"none",cellVerticalBorderWidth:0,headerRowNoBorder:!0,headerRowBorderColor:"#a5a5a5",headerRowBorderWidth:1,firstColumnBorderColor:void 0,firstColumnTextColor:void 0,firstColumnFontStyle:void 0,firstColumnFontWeight:"bold",firstColumnBackgroundColor:void 0,textColor:"#c45911",headerRowTextColor:void 0,headerRowFontWeight:"bold",headerRowBackgroundColor:void 0}),34:()=>({containerBackgroundColor:"#ffffff",alternateRowColor:"#ededed",borderStyle:"solid",borderWidth:1,borderColor:"#a5a5a5",borderLeft:"none",borderRight:"none",cellBorderStyle:"none",cellBorderWidth:0,cellBorderColor:"transparent",cellVerticalBorderStyle:"none",cellVerticalBorderWidth:0,headerRowNoBorder:!0,headerRowBorderColor:"#a5a5a5",headerRowBorderWidth:1,firstColumnBorderColor:void 0,firstColumnTextColor:void 0,firstColumnFontStyle:void 0,firstColumnFontWeight:"bold",firstColumnBackgroundColor:void 0,textColor:"#7b7b7b",headerRowTextColor:void 0,headerRowFontWeight:"bold",headerRowBackgroundColor:void 0}),35:()=>({containerBackgroundColor:"#ffffff",alternateRowColor:"#fff2cc",borderStyle:"solid",borderWidth:1,borderColor:"#ffc000",borderLeft:"none",borderRight:"none",cellBorderStyle:"none",cellBorderWidth:0,cellBorderColor:"transparent",cellVerticalBorderStyle:"none",cellVerticalBorderWidth:0,headerRowNoBorder:!0,headerRowBorderColor:"#ffc000",headerRowBorderWidth:1,firstColumnBorderColor:void 0,firstColumnTextColor:void 0,firstColumnFontStyle:void 0,firstColumnFontWeight:"bold",firstColumnBackgroundColor:void 0,textColor:"#bf8f00",headerRowTextColor:void 0,headerRowFontWeight:"bold",headerRowBackgroundColor:void 0}),36:()=>({containerBackgroundColor:"#ffffff",alternateRowColor:"#e2efd9",borderStyle:"solid",borderWidth:1,borderColor:"#70ad47",borderLeft:"none",borderRight:"none",cellBorderStyle:"none",cellBorderWidth:0,cellBorderColor:"transparent",cellVerticalBorderStyle:"none",cellVerticalBorderWidth:0,headerRowNoBorder:!0,headerRowBorderColor:"#70ad47",headerRowBorderWidth:1,firstColumnBorderColor:void 0,firstColumnTextColor:void 0,firstColumnFontStyle:void 0,firstColumnFontWeight:"bold",firstColumnBackgroundColor:void 0,textColor:"#538135",headerRowTextColor:void 0,headerRowFontWeight:"bold",headerRowBackgroundColor:void 0}),37:()=>({containerBackgroundColor:"white",alternateRowColor:"#cccccc",borderStyle:"none",borderWidth:0,borderColor:"transparent",cellBorderStyle:"none",cellBorderWidth:0,cellBorderColor:"transparent",cellVerticalBorderStyle:"none",cellVerticalBorderWidth:0,headerRowNoBorder:!0,headerRowBorderColor:"#9a9a9a",headerRowBorderWidth:1,firstColumnBorderColor:"#9a9a9a",firstColumnBorderWidth:1,headerRowBackgroundColor:"#ffffff",firstColumnBackgroundColor:"#ffffff",firstColumnFontStyle:"italic",headerRowFontStyle:"italic",firstCellInHeaderRowFontStyle:"italic",cellPadding:8,firstColumnTextColor:"#000000",firstColumnFontWeight:void 0,headerRowTextColor:"#000000",headerRowFontWeight:void 0,textColor:"#000000"}),38:()=>({containerBackgroundColor:"white",alternateRowColor:"#deeaf6",borderStyle:"none",borderWidth:0,borderColor:"transparent",cellBorderStyle:"none",cellBorderWidth:0,cellBorderColor:"transparent",cellVerticalBorderStyle:"none",cellVerticalBorderWidth:0,headerRowNoBorder:!0,headerRowBorderColor:"#9cc2e5",headerRowBorderWidth:1,firstColumnBorderColor:"#9cc2e5",firstColumnBorderWidth:1,headerRowBackgroundColor:"#ffffff",firstColumnBackgroundColor:"#ffffff",firstColumnFontStyle:"italic",headerRowFontStyle:"italic",firstCellInHeaderRowFontStyle:"italic",cellPadding:8,firstColumnTextColor:"#2e74b5",firstColumnFontWeight:void 0,headerRowTextColor:"#2e74b5",headerRowFontWeight:void 0,textColor:"#2e74b5"}),39:()=>({containerBackgroundColor:"white",alternateRowColor:"#fbe4d5",borderStyle:"none",borderWidth:0,borderColor:"transparent",cellBorderStyle:"none",cellBorderWidth:0,cellBorderColor:"transparent",cellVerticalBorderStyle:"none",cellVerticalBorderWidth:0,headerRowNoBorder:!0,headerRowBorderColor:"#f4b083",headerRowBorderWidth:1,firstColumnBorderColor:"#f4b083",firstColumnBorderWidth:1,headerRowBackgroundColor:"#ffffff",firstColumnBackgroundColor:"#ffffff",firstColumnFontStyle:"italic",headerRowFontStyle:"italic",firstCellInHeaderRowFontStyle:"italic",cellPadding:8,firstColumnTextColor:"#c45911",firstColumnFontWeight:void 0,headerRowTextColor:"#c45911",headerRowFontWeight:void 0,textColor:"#c45911"}),40:()=>({containerBackgroundColor:"white",alternateRowColor:"#ededed",borderStyle:"none",borderWidth:0,borderColor:"transparent",cellBorderStyle:"none",cellBorderWidth:0,cellBorderColor:"transparent",cellVerticalBorderStyle:"none",cellVerticalBorderWidth:0,headerRowNoBorder:!0,headerRowBorderColor:"#c9c9c9",headerRowBorderWidth:1,firstColumnBorderColor:"#c9c9c9",firstColumnBorderWidth:1,headerRowBackgroundColor:"#ffffff",firstColumnBackgroundColor:"#ffffff",firstColumnFontStyle:"italic",headerRowFontStyle:"italic",firstCellInHeaderRowFontStyle:"italic",cellPadding:8,firstColumnTextColor:"#7b7b7b",firstColumnFontWeight:void 0,headerRowTextColor:"#7b7b7b",headerRowFontWeight:void 0,textColor:"#7b7b7b"}),41:()=>({containerBackgroundColor:"white",alternateRowColor:"#fff2cc",borderStyle:"none",borderWidth:0,borderColor:"transparent",cellBorderStyle:"none",cellBorderWidth:0,cellBorderColor:"transparent",cellVerticalBorderStyle:"none",cellVerticalBorderWidth:0,headerRowNoBorder:!0,headerRowBorderColor:"#ffd966",headerRowBorderWidth:1,firstColumnBorderColor:"#ffd966",firstColumnBorderWidth:1,headerRowBackgroundColor:"#ffffff",firstColumnBackgroundColor:"#ffffff",firstColumnFontStyle:"italic",headerRowFontStyle:"italic",firstCellInHeaderRowFontStyle:"italic",cellPadding:8,firstColumnTextColor:"#bf8f00",firstColumnFontWeight:void 0,headerRowTextColor:"#bf8f00",headerRowFontWeight:void 0,textColor:"#bf8f00"}),42:()=>({containerBackgroundColor:"white",alternateRowColor:"#e2efd9",borderStyle:"none",borderWidth:0,borderColor:"transparent",cellBorderStyle:"none",cellBorderWidth:0,cellBorderColor:"transparent",cellVerticalBorderStyle:"none",cellVerticalBorderWidth:0,headerRowNoBorder:!0,headerRowBorderColor:"#a8d08d",headerRowBorderWidth:1,firstColumnBorderColor:"#a8d08d",firstColumnBorderWidth:1,headerRowBackgroundColor:"#ffffff",firstColumnBackgroundColor:"#ffffff",firstColumnFontStyle:"italic",headerRowFontStyle:"italic",firstCellInHeaderRowFontStyle:"italic",cellPadding:8,firstColumnTextColor:"#538135",firstColumnFontWeight:void 0,headerRowTextColor:"#538135",headerRowFontWeight:void 0,textColor:"#538135"})};n[o]&&Object.assign(r,n[o]()),e.push({id:`list-style-${o.toString().padStart(2,"0")}`,label:`Style ${o.toString().padStart(2,"0")}`,preview:Vo("list",`style-${o.toString().padStart(2,"0")}`),style:r})}return e},Zc={plain:[{id:"plain-style-01",label:"Style 01",preview:Vo("plain","style-01"),style:{...dr(),borderStyle:"solid",borderWidth:ro.DEFAULT_BORDER_WIDTH,borderColor:"#000000",cellBorderStyle:"solid",cellBorderWidth:ro.DEFAULT_BORDER_WIDTH,cellBorderColor:"#000000",containerBackgroundColor:void 0,alternateRowColor:void 0,headerRowNoBorder:void 0,cellVerticalBorderStyle:void 0,cellVerticalBorderWidth:void 0,textColor:"#000000",headerRowTextColor:"#000000",headerRowFontWeight:void 0,firstColumnTextColor:"#000000",firstColumnFontWeight:void 0,firstColumnFontStyle:void 0,firstColumnBackgroundColor:void 0,firstColumnBorderColor:"#000000",headerRowBackgroundColor:void 0,headerRowBorderColor:void 0,headerRowBorderWidth:void 0}},{id:"plain-style-02",label:"Style 02",preview:Vo("plain","style-02"),style:{...dr(),borderStyle:"solid",borderWidth:ro.DEFAULT_BORDER_WIDTH,borderColor:"#cccccc",containerBackgroundColor:void 0,alternateRowColor:void 0,headerRowNoBorder:void 0,cellBorderStyle:void 0,cellBorderWidth:void 0,cellBorderColor:void 0,cellVerticalBorderStyle:void 0,cellVerticalBorderWidth:void 0,textColor:"#000000",headerRowTextColor:"#000000",headerRowFontWeight:void 0,firstColumnTextColor:"#000000",firstColumnFontWeight:void 0,firstColumnFontStyle:void 0,firstColumnBackgroundColor:void 0,firstColumnBorderColor:"#cccccc",headerRowBackgroundColor:void 0,headerRowBorderColor:void 0,headerRowBorderWidth:void 0}},{id:"plain-style-03",label:"Style 03",preview:Vo("plain","style-03"),style:{...Vs(),borderStyle:"solid",borderWidth:ro.DEFAULT_BORDER_WIDTH,borderColor:"#cccccc",alternateRowColor:"#f2f2f2",textColor:"#333333",headerRowNoBorder:void 0,cellBorderStyle:void 0,cellBorderWidth:void 0,cellBorderColor:"#cccccc",cellVerticalBorderStyle:void 0,cellVerticalBorderWidth:void 0,headerRowTextColor:void 0,headerRowFontWeight:"bold",firstColumnTextColor:void 0,firstColumnFontWeight:"bold",firstColumnFontStyle:void 0,firstColumnBackgroundColor:void 0,firstColumnBorderColor:void 0,headerRowBackgroundColor:void 0,containerBackgroundColor:void 0,headerRowBorderColor:void 0,headerRowBorderWidth:void 0}},{id:"plain-style-04",label:"Style 04",preview:Vo("plain","style-04"),style:{...Su(),cellBorderStyle:"solid",cellBorderWidth:ro.DEFAULT_BORDER_WIDTH,cellBorderColor:"#000000",cellVerticalBorderWidth:0,cellVerticalBorderStyle:"none",containerBackgroundColor:void 0,alternateRowColor:void 0,headerRowNoBorder:void 0,textColor:void 0,headerRowTextColor:void 0,headerRowFontWeight:void 0,firstColumnTextColor:void 0,firstColumnFontWeight:void 0,firstColumnFontStyle:void 0,firstColumnBackgroundColor:void 0,firstColumnBorderColor:void 0,headerRowBackgroundColor:void 0,headerRowBorderColor:void 0,headerRowBorderWidth:void 0}},{id:"plain-style-05",label:"Style 05",preview:Vo("plain","style-05"),style:{...Vs(),borderStyle:"none",borderWidth:0,borderColor:"transparent",headerRowBorderColor:"#9a9a9a",firstColumnBorderColor:"#9a9a9a",headerRowBorderWidth:1,firstColumnBorderWidth:1,alternateRowColor:"#f2f2f2",headerRowNoBorder:!0,cellBorderStyle:"none",cellBorderWidth:0,cellBorderColor:"transparent",cellVerticalBorderStyle:"none",cellVerticalBorderWidth:0,textColor:void 0,headerRowTextColor:void 0,headerRowFontWeight:void 0,firstColumnTextColor:void 0,firstColumnFontWeight:void 0,firstColumnFontStyle:void 0,firstColumnBackgroundColor:void 0,headerRowBackgroundColor:void 0,containerBackgroundColor:void 0}},{id:"plain-style-06",label:"Style 06",preview:Vo("plain","style-06"),style:{...Vs(),...Su(),headerRowNoBorder:void 0,cellBorderStyle:void 0,cellBorderWidth:void 0,cellBorderColor:void 0,cellVerticalBorderStyle:void 0,cellVerticalBorderWidth:void 0,textColor:void 0,headerRowTextColor:void 0,headerRowFontWeight:"bold",firstColumnTextColor:void 0,firstColumnFontWeight:"bold",firstColumnFontStyle:void 0,firstColumnBackgroundColor:void 0,firstColumnBorderColor:void 0,headerRowBackgroundColor:void 0,containerBackgroundColor:void 0,alternateRowColor:"#f2f2f2",headerRowBorderColor:void 0,headerRowBorderWidth:void 0}},{id:"plain-style-07",label:"Style 07",preview:Vo("plain","style-07"),style:{...dr(),borderStyle:"none",borderWidth:0,borderColor:"transparent",headerRowBorderColor:"#9a9a9a",firstColumnBorderColor:"#9a9a9a",headerRowBorderWidth:1,firstColumnBorderWidth:1,alternateRowColor:"#f2f2f2",headerRowNoBorder:!0,cellBorderStyle:"none",cellBorderWidth:0,cellBorderColor:"transparent",cellVerticalBorderStyle:"none",cellVerticalBorderWidth:0,headerRowBackgroundColor:"#ffffff",firstColumnBackgroundColor:"#ffffff",containerBackgroundColor:void 0,textColor:void 0,headerRowTextColor:void 0,headerRowFontWeight:void 0,firstColumnTextColor:void 0,firstColumnFontWeight:void 0,firstColumnFontStyle:void 0}}],grid:ON(),list:WN()},zN=["firstColumnBackgroundColor","headerRowNoBorder","headerRowBackgroundColor","firstCellInHeaderRowBackgroundColor","firstCellInHeaderRowTextColor","firstCellInHeaderRowFontWeight","alternateRowColor"],UN=e=>{const t={...e};return zN.forEach(o=>{o in t||(t[o]=void 0)}),t},VN=e=>({width:e.width,height:e.height,margin:e.margin,padding:e.padding}),HN=(e,t)=>{const o=VN(t),r=UN(e);return{...o,...r}},GN=({id:e,onApplyTemplate:t})=>{const{getComponentForRender:o}=Te(),r=o(e),[n,s]=S.useState({plain:!1,grid:!1,list:!1}),[a,l]=S.useState(null),d=S.useCallback((f,b)=>{const h=(r==null?void 0:r.style)||{},g=HN(f,h);l(b),t(g)},[r==null?void 0:r.style,t]),c=S.useCallback(f=>{s(b=>({...b,[f]:!b[f]}))},[]),u=S.useCallback((f,b)=>{const h=b?f:f.slice(0,6);return i.jsx("div",{className:"grid grid-cols-6 gap-2 mt-3",children:h.map(g=>i.jsx("button",{onClick:()=>d(g.style,g.id),className:`flex flex-col items-center p-2 hover:bg-gray-50 text-center transition-colors ${a===g.id?"border-blue-500 bg-blue-50":"border-gray-200"}`,title:g.label,children:i.jsx("div",{className:"w-12 h-12 mb-1 flex items-center justify-center",children:i.jsx("img",{src:g.preview,alt:g.label,className:"w-full h-full object-contain"})})},g.id))})},[d,a]),p=S.useMemo(()=>[{title:"Plain tables",templates:Zc.plain},{title:"Grid tables",templates:Zc.grid},{title:"List tables",templates:Zc.list}],[]),m=S.useCallback((f,b)=>{const h=n[b];return i.jsxs("div",{className:"border border-gray-200 rounded",children:[i.jsxs("div",{className:"flex items-center justify-between px-[10px] py-[5px] cursor-pointer hover:bg-gray-50",onClick:()=>c(b),children:[i.jsx("h3",{className:"text-sm font-medium text-gray-700",children:f.title}),i.jsx("button",{className:"w-6 h-6 rounded-full flex items-center justify-center",children:h?i.jsx("i",{className:`${t1} text-gray-600 text-xl bg-gray-200 rounded-full`}):i.jsx("i",{className:`${Qv} text-[#0000ff] text-xl`})})]}),i.jsx("div",{className:"p-3 pt-0",children:u(f.templates,h)})]},b)},[n,c,u]);return i.jsx("div",{className:"rsp-table-templates-container space-y-4",children:p.map((f,b)=>m(f,b===0?"plain":b===1?"grid":"list"))})},qN=({rowCount:e,columnCount:t,onRowCountChange:o,onColumnCountChange:r,onUpdate:n,error:s,maxColumns:a=8,blockCount:l=1})=>{const d={1:8,2:4,3:3,4:2,5:2};return i.jsxs("div",{className:"space-y-4",children:[i.jsx("div",{className:"flex-del items-center-del justify-between-del",children:i.jsx(et,{mainClass:"button-control-view",label:"Rows (max 20)",onClick:()=>{},onChange:c=>{let u=c||2;u=Math.min(20,Math.max(1,u)),o(u)},min:1,max:20,step:1,defaultValue:e||2,isShowLeftDescription:!1,leftDescription:"",buttonClass:"",labelClass:""})}),i.jsx("div",{className:"flex-del items-center-del justify-between-del",children:i.jsx(et,{mainClass:"button-control-view",label:`Columns (max ${d[l]||a})`,onClick:()=>{},onChange:c=>{let u=c||2;u=Math.min(a,Math.max(1,u)),r(u)},min:1,max:d[l]||a,step:1,defaultValue:t||2,isShowLeftDescription:!1,leftDescription:"",buttonClass:"",labelClass:""})}),s&&i.jsx("div",{className:"text-red-500 text-sm",children:s})]})},XN=({onInsertRow:e,onInsertColumn:t,currentColumnCount:o,currentRowCount:r,maxColumns:n=8,error:s})=>{const a=o>=n,l=r>=20;return i.jsx("div",{className:"space-y-4",children:i.jsxs("div",{className:"rsp-inside-bg p-2 bg-gray-50 rounded-lg space-y-3",children:[i.jsx("h3",{className:"marginB5 rsp-properties-lable block text-md color-primary-black",children:"Insert row"}),i.jsxs("div",{className:"rsp-insert-row marginT0 flex gap-2",children:[i.jsxs("button",{onClick:()=>e("above"),className:`flex flex-col flex-1 paddingY10 paddingX5 gap-1 bg-white border rounded ${l?"opacity-50 cursor-not-allowed":"hover-bg-tertiary-blue"}`,disabled:l,title:l?"Maximum 20 rows allowed":void 0,children:[i.jsx("div",{className:"mb-1 fill-primary-black",children:i.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",id:"a",width:"32",height:"32",viewBox:"0 0 32 32",children:[i.jsx("path",{d:"M29.25,6.01h-5.45c-.41,0-.75.34-.75.75s.34.75.75.75h4.7v6h-11v1.5h2.17v6h-7.33v-6h2.17v-1.5H3.5v-6h4.75c.41,0,.75-.34.75-.75s-.34-.75-.75-.75H2.75c-.41,0-.75.34-.75.75v22.49c0,.41.34.75.75.75h26.5c.41,0,.75-.34.75-.75V6.76c0-.41-.34-.75-.75-.75ZM10.83,28.5H3.5v-6h7.33v6ZM10.83,21H3.5v-6h7.33v6ZM19.67,28.5h-7.33v-6h7.33v6ZM28.5,28.5h-7.33v-6h7.33v6ZM28.5,21h-7.33v-6h7.33v6Z"}),i.jsx("path",{d:"M21.25,6.99l-4.87-4.77c-.14-.14-.37-.23-.54-.21-.2,0-.39.09-.53.23l-4.57,4.77c-.29.3-.28.77.02,1.06.15.14.33.21.52.21.2,0,.39-.08.54-.23l3.43-3.58v13.07c0,.41.34.75.75.75s.75-.34.75-.75V4.69l3.45,3.37c.29.29.77.29,1.06-.01.29-.3.28-.77-.01-1.06Z"})]})}),i.jsx("span",{className:"d-block text-center text-sm color-primary-black",children:"Insert at start"})]}),i.jsxs("button",{onClick:()=>e("below"),className:`flex flex-col flex-1 paddingY10 paddingX5 gap-1 bg-white border rounded ${l?"opacity-50 cursor-not-allowed":"hover-bg-tertiary-blue"}`,disabled:l,title:l?"Maximum 20 rows allowed":void 0,children:[i.jsx("div",{className:"mb-1 fill-primary-black",children:i.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",id:"a",width:"32",height:"32",viewBox:"0 0 32 32",children:[i.jsx("path",{d:"M30,25.24V2.76c0-.41-.34-.75-.75-.75H2.75c-.41,0-.75.34-.75.75v22.49c0,.41.34.75.75.75h5.5c.41,0,.75-.34.75-.75s-.34-.75-.75-.75H3.5v-6h11v-1.5h-2.17v-6h7.33v6h-2.17v1.5h11v6h-4.7c-.41,0-.75.34-.75.75s.34.75.75.75h5.45c.41,0,.75-.34.75-.75ZM10.83,9.5H3.5V3.51h7.33v6ZM10.83,17H3.5v-6h7.33v6ZM19.67,9.5h-7.33V3.51h7.33v6ZM28.5,9.5h-7.33V3.51h7.33v6ZM28.5,17h-7.33v-6h7.33v6Z"}),i.jsx("path",{d:"M21.25,25.01l-4.87,4.77c-.14.14-.37.23-.54.21-.2,0-.39-.09-.53-.23l-4.57-4.77c-.29-.3-.28-.77.02-1.06.15-.14.33-.21.52-.21.2,0,.39.08.54.23l3.43,3.58v-13.07c0-.41.34-.75.75-.75s.75.34.75.75v12.85l3.45-3.37c.29-.29.77-.29,1.06.01.29.3.28.77-.01,1.06Z"})]})}),i.jsx("span",{className:"d-block text-center text-sm color-primary-black",children:"Insert at end"})]})]}),l&&i.jsxs("p",{className:"text-sm text-amber-600",children:["Maximum ",20," rows allowed"]}),s&&i.jsx("p",{className:"text-sm text-red-500",children:s}),i.jsx("h3",{className:"marginB5 rsp-properties-lable block text-md color-primary-black",children:"Insert column"}),i.jsxs("div",{className:"rsp-insert-columns marginT0 flex gap-2",children:[i.jsxs("button",{onClick:()=>t("before"),className:`flex flex-col flex-1 paddingY10 paddingX5 gap-1 bg-white border rounded ${a?"opacity-50 cursor-not-allowed":"hover-bg-tertiary-blue"}`,disabled:a,title:a?`Maximum ${n} columns allowed`:void 0,children:[i.jsx("div",{className:"mb-1 fill-primary-black",children:i.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",id:"a",width:"32",height:"32",viewBox:"0 0 32 32",children:[i.jsx("path",{d:"M6.01,2.75v5.45c0,.41.34.75.75.75s.75-.34.75-.75V3.5h6v11h1.5v-2.17h6v7.33h-6v-2.17h-1.5v11h-6v-4.75c0-.41-.34-.75-.75-.75s-.75.34-.75.75v5.5c0,.41.34.75.75.75h22.49c.41,0,.75-.34.75-.75V2.75c0-.41-.34-.75-.75-.75H6.76c-.41,0-.75.34-.75.75ZM28.5,21.17v7.33h-6v-7.33h6ZM21,21.17v7.33h-6v-7.33h6ZM28.5,12.34v7.33h-6v-7.33h6ZM28.5,3.5v7.33h-6V3.5h6ZM21,3.5v7.33h-6V3.5h6Z"}),i.jsx("path",{d:"M6.99,10.76l-4.77,4.87c-.14.14-.23.37-.21.54,0,.2.09.39.23.53l4.77,4.57c.3.29.77.28,1.06-.02.14-.15.21-.33.21-.52,0-.2-.08-.39-.23-.54l-3.58-3.43h13.07c.41,0,.75-.34.75-.75s-.34-.75-.75-.75H4.69l3.37-3.45c.29-.29.29-.77-.01-1.06-.3-.29-.77-.28-1.06.01Z"})]})}),i.jsx("span",{className:"d-block text-center text-sm color-primary-black",children:"Insert at start"})]}),i.jsxs("button",{onClick:()=>t("after"),className:`flex flex-col flex-1 paddingY10 paddingX5 gap-1 bg-white border rounded ${a?"opacity-50 cursor-not-allowed":"hover-bg-tertiary-blue"}`,disabled:a,title:a?`Maximum ${n} columns allowed`:void 0,children:[i.jsx("div",{className:"mb-1 fill-primary-black",children:i.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",id:"a",width:"32",height:"32",viewBox:"0 0 32 32",children:[i.jsx("path",{d:"M25.24,2H2.75c-.41,0-.75.34-.75.75v26.5c0,.41.34.75.75.75h22.49c.41,0,.75-.34.75-.75v-5.5c0-.41-.34-.75-.75-.75s-.75.34-.75.75v4.75h-6v-11s-1.5,0-1.5,0v2.17h-6v-7.33h6v2.17s1.5,0,1.5,0V3.5h6v4.7c0,.41.34.75.75.75s.75-.34.75-.75V2.75c0-.41-.34-.75-.75-.75ZM9.5,21.17v7.33H3.5v-7.33h6ZM16.99,21.17v7.33h-6v-7.33h6ZM9.5,12.34v7.33H3.5v-7.33h6ZM9.5,3.5v7.33H3.5V3.5h6ZM16.99,3.5v7.33h-6V3.5h6Z"}),i.jsx("path",{d:"M25.01,10.76l4.77,4.87c.14.14.23.37.21.54,0,.2-.09.39-.23.53l-4.77,4.57c-.3.29-.77.28-1.06-.02-.14-.15-.21-.33-.21-.52s.08-.39.23-.54l3.58-3.43h-13.07c-.41,0-.75-.34-.75-.75,0-.41.34-.75.75-.75h12.85s-3.37-3.45-3.37-3.45c-.29-.29-.29-.77.01-1.06.3-.29.77-.28,1.06.01Z"})]})}),i.jsx("span",{className:"d-block text-center text-sm color-primary-black",children:"Insert at end"})]})]}),a&&i.jsxs("p",{className:"text-sm text-amber-600",children:["Maximum ",n," columns allowed"]}),s&&i.jsx("p",{className:"text-sm text-red-500",children:s})]})})},KN=({onDeleteRow:e,onDeleteColumn:t,rowCount:o,columnCount:r})=>{const n=o>1,s=r>1;return i.jsxs("div",{className:"rsp-inside-bg p-2 bg-gray-50 rounded-lg space-y-3",children:[i.jsx("h3",{className:"marginB5 rsp-properties-lable block text-md color-primary-black",children:"Delete"}),i.jsxs("div",{className:"flex gap-2 rsp-insert-delete",children:[i.jsxs("button",{onClick:e,className:`flex flex-col flex-1 paddingY10 paddingX5 gap-1 bg-white border rounded ${n?"hover-bg-tertiary-blue":"opacity-50 cursor-not-allowed"}`,disabled:!n,title:n?void 0:"Cannot delete the last row",children:[i.jsx("div",{className:"mb-1 flex justify-center",children:i.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[i.jsx("path",{d:"M3 6h18"}),i.jsx("path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6"}),i.jsx("path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2"}),i.jsx("line",{x1:"10",y1:"11",x2:"10",y2:"17"}),i.jsx("line",{x1:"14",y1:"11",x2:"14",y2:"17"})]})}),i.jsx("span",{className:"d-block text-center text-sm color-primary-black",children:"Delete last row"})]}),i.jsxs("button",{onClick:t,className:`flex flex-col flex-1 paddingY10 paddingX5 gap-1 bg-white border rounded ${s?"hover-bg-tertiary-blue":"opacity-50 cursor-not-allowed"}`,disabled:!s,title:s?void 0:"Cannot delete the last column",children:[i.jsx("div",{className:"mb-1 flex justify-center",children:i.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[i.jsx("path",{d:"M3 6h18"}),i.jsx("path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6"}),i.jsx("path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2"}),i.jsx("line",{x1:"10",y1:"11",x2:"10",y2:"17"}),i.jsx("line",{x1:"14",y1:"11",x2:"14",y2:"17"})]})}),i.jsx("span",{className:"d-block text-center text-sm color-primary-black",children:"Delete last column"})]})]})]})},ps=ro.MAX_COLUMNS,d0=({id:e,content:t,style:o={},onUpdate:r,columnCount:n=1})=>{var F,q,R,M,L,U,ee,Y,te,ie,ue,ne,ae,oe;const{updateComponent:s,getComponentForRender:a}=Te(),{updateBlockComponent:l}=Ye(),{currentSelection:d,execCommand:c,getCanvasEditor:u,restoreSelection:p,formatState:m,saveSelectionImmediate:f}=$o(),[b,h]=S.useState("content"),[g,x]=S.useState(((F=t==null?void 0:t.rows)==null?void 0:F.length)||2),[C,k]=S.useState(((R=(q=t==null?void 0:t.rows)==null?void 0:q[0])==null?void 0:R.length)||2),[v,A]=S.useState(""),w=a(e),y=((M=w==null?void 0:w.contentTarget)==null?void 0:M.hasTargeting)??!1,{activeTab:E}=qt(e,(L=w==null?void 0:w.contentTarget)==null?void 0:L.targetGroups);S.useRef(t),S.useRef(o);const j=y&&((Y=(ee=(U=w==null?void 0:w.contentTarget)==null?void 0:U.targetGroups)==null?void 0:ee[E])==null?void 0:Y.content)||t,B=y&&((ue=(ie=(te=w==null?void 0:w.contentTarget)==null?void 0:te.targetGroups)==null?void 0:ie[E])!=null&&ue.style)?{...o,...w.contentTarget.targetGroups[E].style}:o;S.useEffect(()=>{var G;j!=null&&j.rows&&(x(j.rows.length),k(((G=j.rows[0])==null?void 0:G.length)||2))},[j]);const $=G=>{if(r){r(G);return}const Q=G.style?{...B,...G.style}:B,J=document.querySelector(`[data-component-id="${e}"]`),T=J==null?void 0:J.getAttribute("data-parent-id"),X=J==null?void 0:J.getAttribute("data-column-index"),H={...G,style:Q};T&&X?l(T,e,H):s(e,H)},_=(G,Q)=>{if(G<1||Q<1){A("Row and column counts must be at least 1");return}if(G>ro.MAX_ROWS){A(`Maximum allowed rows is ${ro.MAX_ROWS}`);return}if(Q>ps){A(`Maximum allowed columns is ${ps}`);return}A(""),x(G),k(Q);const J=`${100/Q}%`,T=Array(G).fill(null).map((X,H)=>Array(Q).fill(null).map((D,W)=>{var I,V;return(V=(I=j==null?void 0:j.rows)==null?void 0:I[H])!=null&&V[W]?j.rows[H][W]:`Cell ${H+1}-${W+1}`}));$({content:{rows:T},style:{...B,columnWidth:J,tableLayout:"fixed"}})},z=G=>{const Q=[...j.rows],J=j.rows[0].length,T=Array(J).fill("").map((H,D)=>`Cell ${Q.length+1}-${D+1}`),X=G==="below"?Q.length:0;Q.splice(X,0,T),x(Q.length),$({content:{rows:Q}})},N=G=>{if(j.rows[0].length>=ps){A(`Maximum ${ps} columns allowed`);return}const Q=j.rows.map((T,X)=>{const H=[...T],D=G==="after"?H.length:0;return H.splice(D,0,`Cell ${X+1}-${H.length+1}`),H}),J=`${100/(j.rows[0].length+1)}%`;k(Q[0].length),A(""),$({content:{rows:Q},style:{...B,columnWidth:J}})},O=()=>{if(j.rows.length<=1){A("Cannot delete the last row");return}const G=[...j.rows];G.pop(),x(G.length),$({content:{rows:G}})},K=()=>{if(j.rows[0].length<=1){A("Cannot delete the last column");return}const G=j.rows.map(J=>{const T=[...J];return T.pop(),T}),Q=`${100/(j.rows[0].length-1)}%`;k(G[0].length),$({content:{rows:G},style:{...B,columnWidth:Q}})};return i.jsxs("div",{className:"space-y-6",children:[i.jsx("div",{className:"rsp-tab flex border-b border-gray-200",children:["content","style","templates"].map(G=>i.jsx("button",{onClick:()=>h(G),className:`w-full px-4 py-2 text-md border-b-2 -mb-px ${b===G?"active color-primary-blue border-primary-blue":"inactive text-gray-500 border-transparent hover:color-secondary-black hover-border-bottom-quaternary-blue"}`,children:G.charAt(0).toUpperCase()+G.slice(1)},G))}),b==="content"&&i.jsxs("div",{className:"space-y-6",children:[i.jsx("div",{className:"rsp-property-elements-block",children:i.jsx(qN,{rowCount:g,columnCount:C,blockCount:n,onRowCountChange:G=>_(G,C),onColumnCountChange:G=>_(g,G),error:v,onUpdate:$})}),i.jsx("div",{className:"rsp-property-elements-block",children:i.jsx(XN,{onInsertRow:z,onInsertColumn:N,currentColumnCount:((ne=j.rows[0])==null?void 0:ne.length)||0,currentRowCount:((ae=j==null?void 0:j.rows)==null?void 0:ae.length)||0,error:v})}),i.jsx(KN,{onDeleteRow:O,onDeleteColumn:K,rowCount:j.rows.length,columnCount:((oe=j.rows[0])==null?void 0:oe.length)||0})]}),b==="style"&&i.jsx(DN,{style:B,formatState:m,hasTextSelection:!!((d==null?void 0:d.componentId)===e&&(d!=null&&d.isCanvas)&&(d!=null&&d.range)&&!d.range.collapsed),onStyleChange:(G,Q)=>{var T;if((d==null?void 0:d.componentId)===e&&(d==null?void 0:d.isCanvas)&&(d==null?void 0:d.range)&&!d.range.collapsed){const X=u(e);X&&(f(),(T=X.saveSelection)==null||T.call(X),p(),G==="fontFamily"?setTimeout(()=>{p(),c("fontName",Q),setTimeout(()=>{var H;(H=X.saveSelection)==null||H.call(X),f()},50)},20):setTimeout(()=>{switch(G){case"bold":c("bold");break;case"italic":c("italic");break;case"underline":c("underline");break;case"textColor":c("foreColor",Q);break;case"fontSize":c("fontSize",Q.toString());break;case"textAlign":{const H=`justify${Q.charAt(0).toUpperCase()+Q.slice(1)}`;c(H);break}default:$({style:{...B,[G]:Q}})}setTimeout(()=>{var H;(H=X.saveSelection)==null||H.call(X),f()},50)},10))}else $({style:{...B,[G]:Q}})},onFontFamilyDropdownOpen:()=>{var Q;if((d==null?void 0:d.componentId)===e&&(d==null?void 0:d.isCanvas)&&(d==null?void 0:d.range)&&!d.range.collapsed){const J=u(e);J&&(f(),(Q=J.saveSelection)==null||Q.call(J))}}}),b==="templates"&&i.jsx(GN,{id:e,onApplyTemplate:G=>{$({style:{...B,...G}})}})]})},u0=({id:e,style:t={},onUpdate:o})=>{const{updateComponent:r}=Te(),{updateBlockComponent:n}=Ye(),s=l=>{if(o){o(l);return}const d=document.querySelector(`[data-component-id="${e}"]`),c=d==null?void 0:d.getAttribute("data-parent-id"),u=d==null?void 0:d.getAttribute("data-column-index");c&&u?n(c,e,l):r(e,l)},a=(l,d)=>{s({style:{...t,[l]:d}})};return i.jsxs("div",{className:"space-y-6",children:[i.jsx("div",{className:"rsp-property-elements-block",children:i.jsx(et,{mainClass:"button-control-view",label:"Height",leftDescription:"(px)",isShowLeftDescription:!0,onClick:()=>{},onChange:l=>a("height",`${l}`),min:5,max:100,step:5,defaultValue:parseInt(t.height)||5})}),i.jsxs("div",{className:"rsp-property-elements-block-del flex items-center justify-between",children:[i.jsx("label",{className:"rsp-properties-lable block text-md color-primary-black",children:"Container background"}),i.jsx("div",{className:"flex flex-col space-y-2",children:i.jsx(gt,{value:(t==null?void 0:t.containerBackgroundColor)||"transparent",onChange:l=>{a("containerBackgroundColor",l)}})})]}),i.jsxs("div",{className:"hidden",children:[i.jsx("label",{className:"block text-md font-regular color-primary-black mb-2",children:"Margin"}),i.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[i.jsx(et,{id:"radius-top-right",label:"",onClick:()=>{},onChange:l=>a("marginTop",l),min:1,max:10,step:1,defaultValue:t.marginTop||0}),i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("label",{className:"block text-xs text-gray-500 mb-1",children:"Bottom"}),i.jsx("input",{type:"number",value:t.marginBottom||0,onChange:l=>a("marginBottom",parseInt(l.target.value)),className:"w-full p-2 border rounded-md",min:"0",max:"100"})]})]})]})]})},Qc=[{id:"facebook",name:"Facebook",icon:"/assets/social/1/facebook.png",placeholder:"https://facebook.com/yourpage"},{id:"x",name:"X",icon:"/assets/social/1/x.png",placeholder:"https://x.com/yourhandle"},{id:"instagram",name:"Instagram",icon:"/assets/social/1/instagram.png",placeholder:"https://instagram.com/yourprofile"},{id:"linkedin",name:"LinkedIn",icon:"/assets/social/1/linkedin.png",placeholder:"https://linkedin.com/company/yourcompany"},{id:"youtube",name:"YouTube",icon:"/assets/social/1/youtube.png",placeholder:"https://youtube.com/yourchannel"},{id:"whatsapp",name:"WhatsApp",icon:"/assets/social/1/whatsapp.png",placeholder:"https://wa.me/yournumber"},{id:"telegram",name:"Telegram",icon:"/assets/social/1/telegram.png",placeholder:"https://t.me/yourusername"},{id:"pinterest",name:"Pinterest",icon:"/assets/social/1/pinterest.png",placeholder:"https://pinterest.com/yourprofile"},{id:"tiktok",name:"TikTok",icon:"/assets/social/1/tiktok.png",placeholder:"https://tiktok.com/yourprofile"}],YN=Array.from({length:29},(e,t)=>({id:t+1,src:`/assets/social/iconStyle/style-${String(t+1).padStart(2,"0")}.png`})),JN=({selectedStyle:e,onStyleSelect:t})=>i.jsxs("div",{className:"rsp-property-elements-block space-y-4 overflow-auto",children:[i.jsx("h3",{className:"rsp-properties-lable block text-md color-primary-black",children:"Icon style"}),i.jsx("div",{className:"rsp-social-icon-style grid grid-cols-3 gap-2",children:YN.map(o=>i.jsx("button",{onClick:()=>t(o.id),className:`p-2 border rounded relative ${e===o.id?"ring-2 ring-blue-500":""} ${(o==null?void 0:o.id)===20||(o==null?void 0:o.id)===28?"bg-secondary-grey":"hover:bg-gray-50"}`,children:i.jsx("img",{src:o.src,alt:`Style ${o.id}`,className:"w-full object-contain",style:{height:"40px"}})},o.id))})]}),ZN=({platform:e,link:t,onRemove:o,onLinkChange:r,dragHandleProps:n,error:s,disabled:a=!1})=>{const l=Qc.find(m=>m.id===e);if(!l)return null;const[d,c]=S.useState(!1),u=()=>{a||c(!0)},p=()=>{o(),c(!1)};return i.jsxs("div",{className:"rsp-social-inside-bg p-2 bg-gray-50 rounded-lg space-y-3",children:[i.jsxs("div",{className:"flex justify-between items-center mb-2",children:[i.jsxs("div",{className:"flex items-center gap-2-del",children:[i.jsx("div",{...n,className:"cursor-move p-1 hover:bg-primary-blue rounded marginL-7",children:i.jsx(wx,{className:"w-4 h-4 color-primary-blue"})}),i.jsx("h4",{className:"text-md font-regular color-primary-black",children:l.name})]}),i.jsx(Ie,{text:a?"Cannot remove the last social platform":`Remove ${l.name}`,position:"left",className:"line-block",children:i.jsx("div",{className:a?"opacity-50 cursor-not-allowed":"",children:i.jsx(ut,{icon:Lr,tooltip:"Version history",position:"bottom",size:"md",callBack:()=>u()})})})]}),i.jsxs("div",{className:"rsp-social-title-url",children:[i.jsx("div",{children:i.jsx(jt,{classWrapper:"marginT30",placeholder:"Title",value:(t==null?void 0:t.title)??(t!=null&&t.url?"":l.name),handleOnchange:m=>r("title",m.target.value),maxLength:80,required:!0})}),i.jsxs("div",{className:"marginT30",children:[i.jsx(jt,{classWrapper:"marginT40",placeholder:"URL",value:(t==null?void 0:t.url)||"",handleOnchange:m=>r("url",m.target.value),errMsg:s,maxLength:150,required:!0}),s&&i.jsx("p",{className:"marginT-10 text-xs text-red-500",children:s})]})]}),i.jsx(wo,{isOpen:d,onClose:()=>c(!1),onConfirm:p,title:"Confirmation",message:"Are you sure you want to remove this platform?"})]})},QN=({activeTab:e,onTabChange:t})=>{const o=[{id:"content",label:"Content"},{id:"style",label:"Style"},{id:"spacing",label:"Spacing"}];return i.jsx("div",{className:"rsp-tab flex border-b border-gray-200",children:o.map(r=>i.jsx("button",{onClick:()=>t(r.id),className:`w-full px-4 py-2 text-md ${e===r.id?"active color-primary-blue":"inactive color-secondary-black"}`,children:r.label},r.id))})},eB=({content:e,platforms:t,errors:o,onLinkChange:r,onRemovePlatform:n,onAddPlatform:s,onDragStart:a,onDragOver:l,onDragEnd:d})=>{const c=Qc.filter(u=>{var p;return!((p=e.links)!=null&&p[u.id])});return i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{className:"flex justify-between items-center",children:[i.jsx("h3",{className:"rsp-properties-lable block text-md color-primary-black",children:"Social links"}),i.jsx("div",{className:"relative",children:i.jsx(Tt,{label:"",widthDropdown:"w-[160px] right0",width:"w-[160px] right0",value:"Add platform",options:c.map(u=>({label:u.name,value:u.id})),onChange:(u,p)=>{const m=Qc.find(f=>f.id===u);m&&s(m)}})})]}),i.jsx("div",{className:"space-y-4",children:t.map(u=>i.jsx("div",{draggable:!1,onDragStart:p=>a(p,u),onDragOver:p=>l(p,u),onDragEnd:d,children:i.jsx(ZN,{platform:u,link:e.links[u],onRemove:()=>n(u),onLinkChange:(p,m)=>r(u,p,m),error:o[u],disabled:t.length===1,dragHandleProps:{draggable:!0,onDragStart:p=>{p.stopPropagation(),a(p,u)}}})},u))})]})},tB=({style:e,onStyleChange:t})=>{const[o,r]=S.useState(e.containerBackgroundColor==="transparent");return i.jsxs("div",{className:"space-y-6",children:[i.jsxs("div",{className:"rsp-property-elements-block flex items-center justify-between",children:[i.jsx("label",{className:"rsp-properties-lable block text-md color-primary-black",children:"Container background"}),i.jsx("div",{className:"flex flex-col space-y-2",children:i.jsx(gt,{value:(e==null?void 0:e.containerBackgroundColor)||"transparent",onChange:n=>t("containerBackgroundColor",n)})})]}),i.jsx(JN,{selectedStyle:e.iconStyle||1,onStyleSelect:n=>t("iconStyle",n)}),i.jsxs("div",{className:"rsp-property-elements-block space-y-6",children:[i.jsxs("div",{className:"rsp-select-dropdown flex items-center justify-between ",children:[i.jsx("label",{className:"rsp-properties-lable block text-md color-primary-black",children:"Icon size"}),i.jsx(Tt,{id:"iconSizeSelector",label:"",className:"",width:"w-[160px]",widthDropdown:"w-[160px] right0",value:(e.iconSize||24)+"px",options:Lv,onChange:n=>t("iconSize",parseInt(n))})]}),i.jsxs("div",{className:"rsp-select-dropdown flex items-center justify-between",children:[i.jsx("label",{className:"rsp-properties-lable block text-md color-primary-black",children:"Align"}),i.jsxs("div",{className:"flex items-center gap-1",children:[i.jsx(Ie,{text:"Left",position:"top",className:"line-block",children:i.jsx("button",{onClick:()=>t("alignment","left"),className:`p-1.5 rounded ${e.alignment==="left"?"bg-primary-blue text-white":"bg-tertiary-blue"}`,children:i.jsx(_o,{className:"w-4 h-4"})})}),i.jsx(Ie,{text:"Center",position:"top",className:"line-block",children:i.jsx("button",{onClick:()=>t("alignment","center"),className:`p-1.5 rounded ${e.alignment==="center"?"bg-primary-blue text-white":"bg-tertiary-blue"}`,children:i.jsx(Xo,{className:"w-4 h-4"})})}),i.jsx(Ie,{text:"Right",position:"top",className:"line-block",children:i.jsx("button",{onClick:()=>t("alignment","right"),className:`p-1.5 rounded ${e.alignment==="right"?"bg-primary-blue text-white":"bg-tertiary-blue"}`,children:i.jsx(Ro,{className:"w-4 h-4"})})})]})]})]})]})},oB=({style:e,onStyleChange:t})=>i.jsxs("div",{className:"space-y-6",children:[i.jsx("div",{className:"space-y-4",children:i.jsx(et,{mainClass:"button-control-view",label:"Icon spacing",onClick:()=>{},onChange:o=>t("spacing",o),min:5,max:50,step:5,defaultValue:e.spacing||16,isShowLeftDescription:!1,leftDescription:""})}),i.jsx(ao,{label:"Padding",id:"button-padding-control",marginSection:!1,paddingSection:!0,padding:e.paddingControl,isHideLeftRight:!0,onChange:o=>{t("paddingControl",o)}})]}),p0=S.forwardRef(({id:e,content:t,style:o={},onUpdate:r},n)=>{const{updateComponent:s}=Te(),{updateBlockComponent:a}=Ye(),[l,d]=S.useState("content"),[c,u]=S.useState(Object.keys(t.links||{})),[p,m]=S.useState(null),[f,b]=S.useState({});S.useEffect(()=>{u(Object.keys(t.links||{}))},[t==null?void 0:t.links]);const h=$=>{if(r){r($);return}const _=document.querySelector(`[data-component-id="${e}"]`),z=_==null?void 0:_.getAttribute("data-parent-id"),N=_==null?void 0:_.getAttribute("data-column-index");z&&N?a(z,e,$):s(e,$)},g=($,_)=>{h({style:{...o,[$]:_}})},x=$=>{h({content:{...t,...$}})},C=($,_)=>{if(!_.trim())return null;try{new URL(_)}catch{return"Please enter a valid URL"}switch($){case"facebook":if(!_.match(/^https?:\/\/(www\.)?(facebook|fb)\.com/i))return"Please enter a valid Facebook URL (e.g., https://facebook.com)";break;case"x":if(!_.match(/^https?:\/\/(www\.)?(twitter|x)\.com/i))return"Please enter a valid X URL (e.g., https://x.com)";break;case"instagram":if(!_.match(/^https?:\/\/(www\.)?instagram\.com/i))return"Please enter a valid Instagram URL (e.g., https://instagram.com)";break;case"linkedin":if(!_.match(/^https?:\/\/([a-z0-9-]+\.)*linkedin\.com/i))return"Please enter a valid LinkedIn URL (e.g., https://linkedin.com)";break;case"youtube":if(!_.match(/^https?:\/\/(www\.)?(youtube\.com|youtu\.be)/i))return"Please enter a valid YouTube URL (e.g., https://youtube.com)";break;case"whatsapp":if(!_.match(/^https?:\/\/(www\.)?whatsapp\.com(\/.*)?$/i)&&!_.match(/^https?:\/\/wa\.me\/\d+(\?.*)?$/i)&&!_.match(/^https?:\/\/api\.whatsapp\.com\/send\?phone=\d+(&text=.*)?$/i))return"Please enter a valid WhatsApp URL (e.g., https://whatsapp.com, https://wa.me/1234567890)";break;case"telegram":if(!_.trim().match(/^https?:\/\/(www\.)?(t\.me|telegram\.me)/i))return"Please enter a valid Telegram URL (e.g., https://t.me)";break;case"pinterest":if(!_.match(/^https?:\/\/(www\.)?pinterest\.(com|ca|co\.uk|fr|de|es)/i))return"Please enter a valid Pinterest URL (e.g., https://pinterest.com)";break;case"tiktok":if(!_.match(/^https?:\/\/(www\.)?(tiktok\.com|vm\.tiktok\.com)/i))return"Please enter a valid TikTok URL (e.g., https://tiktok.com)";break}return null},k=($,_,z)=>{let N=null;if(_==="url"){N=C($,z),b(F=>({...F,[$]:N||""}));const O={...t.links,[$]:{...t.links[$],[_]:z}};let K=!0;Object.entries(O).forEach(([F,q])=>{C(F,(q==null?void 0:q.url)||"")&&(K=!1)}),g("socialValid",K),x({links:O})}else{const O={...t.links,[$]:{...t.links[$],[_]:z}};x({links:O})}},v=$=>{const _={...t.links};delete _[$],x({links:_}),u(c.filter(z=>z!==$)),b(z=>{const N={...z};return delete N[$],N})},A=$=>{if(!t.links[$.id]){const _={...t.links,[$.id]:{url:"",title:$.name}};x({links:_}),u([...c,$.id])}},w=($,_)=>{m(_),$.dataTransfer.effectAllowed="move"},y=($,_)=>{if($.preventDefault(),!p||p===_)return;const z=[...c],N=z.indexOf(p),O=z.indexOf(_);z.splice(N,1),z.splice(O,0,p),u(z);const K={};z.forEach(F=>{t.links[F]&&(K[F]=t.links[F])}),x({links:K})},E=()=>{m(null)},j=()=>{const $={};let _=!0;return!t.links||Object.keys(t.links).length===0?_=!1:Object.entries(t.links||{}).forEach(([z,N])=>{const O=C(z,(N==null?void 0:N.url)||"");O&&($[z]=O,_=!1)}),b($),_};S.useEffect(()=>{j()},[t.links]),S.useImperativeHandle(n,()=>({validateBeforeSave:j}),[t.links]);const B=()=>{switch(l){case"content":return i.jsx(eB,{content:t,platforms:c,errors:f,onLinkChange:k,onRemovePlatform:v,onAddPlatform:A,onDragStart:w,onDragOver:y,onDragEnd:E});case"style":return i.jsx(tB,{style:o,onStyleChange:g});case"spacing":return i.jsx(oB,{style:o,onStyleChange:g});default:return null}};return i.jsxs("div",{className:"space-y-6","data-social-ref":!0,"data-valid":Object.keys(f).length===0&&Object.keys(t.links||{}).length>0,children:[i.jsx(QN,{activeTab:l,onTabChange:d}),B()]})}),h0=({id:e,content:t,style:o={}})=>{const{updateComponent:r}=Te(),n=(a,l)=>{r(e,{content:{...t,[a]:l}})},s=(a,l)=>{r(e,{style:{...o,[a]:l}})};return i.jsxs("div",{className:"space-y-6",children:[i.jsxs("div",{className:"space-y-4",children:[i.jsx("h3",{className:"text-md font-regular color-primary-black",children:"Content"}),i.jsxs("div",{children:[i.jsx("label",{className:"block text-md color-primary-black",children:"Address"}),i.jsx("input",{type:"text",value:t.address||"",onChange:a=>n("address",a.target.value),className:"w-full p-2 border rounded-md",placeholder:"Enter address"})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block text-md color-primary-black",children:"Phone number"}),i.jsx("input",{type:"tel",value:t.phone||"",onChange:a=>n("phone",a.target.value),className:"w-full p-2 border rounded-md",placeholder:"Enter phone number"})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block text-md color-primary-black",children:"Email"}),i.jsx("input",{type:"email",value:t.email||"",onChange:a=>n("email",a.target.value),className:"w-full p-2 border rounded-md",placeholder:"Enter email address"})]})]}),i.jsxs("div",{className:"space-y-4",children:[i.jsx("h3",{className:"text-md font-regular color-primary-black",children:"Style"}),i.jsxs("div",{children:[i.jsx("label",{className:"block text-md color-primary-black",children:"Text color"}),i.jsx("input",{type:"color",value:o.textColor||"#4B5563",onChange:a=>s("textColor",a.target.value),className:"w-full p-1 h-10 border rounded-md"})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block text-md color-primary-black",children:"Link color"}),i.jsx("input",{type:"color",value:o.linkColor||"#3B82F6",onChange:a=>s("linkColor",a.target.value),className:"w-full p-1 h-10 border rounded-md"})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block text-md color-primary-black",children:"Font size"}),i.jsx("input",{type:"number",value:o.fontSize||14,onChange:a=>s("fontSize",parseInt(a.target.value)),className:"w-full p-2 border rounded-md",min:"10",max:"24"})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block text-md color-primary-black",children:"Font family"}),i.jsxs("select",{value:o.fontFamily||"Arial, sans-serif",onChange:a=>s("fontFamily",a.target.value),className:"w-full p-2 border rounded-md",children:[i.jsx("option",{value:"Arial, sans-serif",children:"Arial"}),i.jsx("option",{value:"Lato, sans-serif",children:"Lato"}),i.jsx("option",{value:"Times New Roman, serif",children:"Times new roman"}),i.jsx("option",{value:"Courier New, monospace",children:"Courier new"}),i.jsx("option",{value:"Georgia, serif",children:"Georgia"}),i.jsx("option",{value:"Verdana, sans-serif",children:"Verdana"})]})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block text-md color-primary-black",children:"Align"}),i.jsxs("select",{value:o.textAlign||"center",onChange:a=>s("textAlign",a.target.value),className:"w-full p-2 border rounded-md",children:[i.jsx("option",{value:"left",children:"Left"}),i.jsx("option",{value:"center",children:"Center"}),i.jsx("option",{value:"right",children:"Right"})]})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block text-md color-primary-black",children:"Background color"}),i.jsx("input",{type:"color",value:o.backgroundColor||"#ffffff",onChange:a=>s("backgroundColor",a.target.value),className:"w-full p-1 h-10 border rounded-md"})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block text-md color-primary-black",children:"Padding"}),i.jsx("div",{className:"grid grid-cols-2 gap-4",children:["Top","Right","Bottom","Left"].map(a=>i.jsxs("div",{children:[i.jsx("label",{className:"block text-xs text-gray-500 mb-1",children:a}),i.jsx("input",{type:"number",value:o[`padding${a}`]||0,onChange:l=>s(`padding${a}`,parseInt(l.target.value)),className:"w-full p-2 border rounded-md",min:"0",max:"48"})]},a))})]})]})]})},f0=({id:e,content:t,style:o={}})=>{const{updateComponent:r}=Te(),n=new Date().getFullYear(),s=(l,d)=>{r(e,{content:{...t,[l]:d}})},a=(l,d)=>{r(e,{style:{...o,[l]:d}})};return i.jsxs("div",{className:"space-y-6",children:[i.jsxs("div",{className:"space-y-4",children:[i.jsx("h3",{className:"text-md font-regular color-primary-black",children:"Content"}),i.jsxs("div",{children:[i.jsx("label",{className:"block text-md color-primary-black",children:"Company name"}),i.jsx("input",{type:"text",value:t.companyName||"",onChange:l=>s("companyName",l.target.value),className:"w-full p-2 border rounded-md",placeholder:`© ${n} Company Name`})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block text-md color-primary-black",children:"Rights text"}),i.jsx("input",{type:"text",value:t.rightsText||"",onChange:l=>s("rightsText",l.target.value),className:"w-full p-2 border rounded-md",placeholder:"All rights reserved."})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block text-md color-primary-black",children:"Additional text"}),i.jsx("textarea",{value:t.additionalText||"",onChange:l=>s("additionalText",l.target.value),className:"w-full p-2 border rounded-md h-24 resize-vertical",placeholder:"Privacy Policy | Terms of Service"})]})]}),i.jsxs("div",{className:"space-y-4",children:[i.jsx("h3",{className:"text-md font-regular color-primary-black",children:"Style"}),i.jsxs("div",{children:[i.jsx("label",{className:"block text-md color-primary-black",children:"Text color"}),i.jsx("input",{type:"color",value:o.textColor||"#6B7280",onChange:l=>a("textColor",l.target.value),className:"w-full p-1 h-10 border rounded-md"})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block text-md color-primary-black",children:"Font size"}),i.jsx("input",{type:"number",value:o.fontSize||12,onChange:l=>a("fontSize",parseInt(l.target.value)),className:"w-full p-2 border rounded-md",min:"8",max:"18"})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block text-md color-primary-black",children:"Font family"}),i.jsxs("select",{value:o.fontFamily||"Arial, sans-serif",onChange:l=>a("fontFamily",l.target.value),className:"w-full p-2 border rounded-md",children:[i.jsx("option",{value:"Arial, sans-serif",children:"Arial"}),i.jsx("option",{value:"Lato, sans-serif",children:"Lato"}),i.jsx("option",{value:"Times New Roman, serif",children:"Times new roman"}),i.jsx("option",{value:"Courier New, monospace",children:"Courier new"}),i.jsx("option",{value:"Georgia, serif",children:"Georgia"}),i.jsx("option",{value:"Verdana, sans-serif",children:"Verdana"})]})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block text-md color-primary-black",children:"Align"}),i.jsxs("select",{value:o.textAlign||"center",onChange:l=>a("textAlign",l.target.value),className:"w-full p-2 border rounded-md",children:[i.jsx("option",{value:"left",children:"Left"}),i.jsx("option",{value:"center",children:"Center"}),i.jsx("option",{value:"right",children:"Right"})]})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block text-md color-primary-black",children:"Background color"}),i.jsx("input",{type:"color",value:o.backgroundColor||"#ffffff",onChange:l=>a("backgroundColor",l.target.value),className:"w-full p-1 h-10 border rounded-md"})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block text-md color-primary-black",children:"Padding"}),i.jsx("div",{className:"grid grid-cols-2 gap-4",children:["Top","Right","Bottom","Left"].map(l=>i.jsxs("div",{children:[i.jsx("label",{className:"block text-xs text-gray-500 mb-1",children:l}),i.jsx("input",{type:"number",value:o[`padding${l}`]||8,onChange:d=>a(`padding${l}`,parseInt(d.target.value)),className:"w-full p-2 border rounded-md",min:"0",max:"48"})]},l))})]})]})]})},rB=({style:e,onStyleChange:t})=>{const[o,r]=S.useState("Muktaregular"),n=()=>{const d=(e==null?void 0:e.paddingControl)||{};return d.isCustomPadding?d.left||d.right||0:d.all||0},s=()=>{var d;return((d=e==null?void 0:e.paddingControl)==null?void 0:d.btnspanheight)??5};function a(d,c){const u=d*Math.pow(10,c+1),p=Math.floor(u/10);return u>=p*10+5?(p+1)/Math.pow(10,c):p/Math.pow(10,c)}const l=[{label:"Standard Fonts",options:_t.standard},{label:"Non standard Fonts",options:_t.decorative}];return i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"rsp-property-elements-block space-y-4",children:[i.jsxs("div",{className:"rsp-property-elements-block flex items-center justify-between",children:[i.jsx("label",{className:"rsp-properties-lable block text-md color-primary-black",children:"Show icon"}),i.jsx(At,{id:"clicp-icon",isChecked:(e==null?void 0:e.clipIcon)||!1,onToggle:d=>{t("clipIcon",d)}})]}),i.jsxs("div",{className:"rsp-property-elements-block flex items-center justify-between",children:[i.jsx("label",{className:"rsp-properties-lable block text-md color-primary-black",children:"Show file info"}),i.jsx(At,{id:"file-info",isChecked:(e==null?void 0:e.showFileInfo)||!1,onToggle:d=>{t("showFileInfo",d)}})]}),i.jsx("div",{className:"rsp-property-elements-block",children:i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("label",{className:"rsp-properties-lable block text-md color-primary-black",children:"Container background"}),i.jsx("div",{className:"flex flex-col space-y-2",children:i.jsx(gt,{value:(e==null?void 0:e.containerBackgroundColor)||"transparent",onChange:d=>{t("containerBackgroundColor",d)}})})]})}),i.jsx("div",{children:i.jsx("div",{className:"rsp-property-elements-block",children:i.jsxs("div",{className:" flex items-center justify-between",children:[i.jsx("label",{className:"rsp-properties-lable block text-md color-primary-black",children:"Button background"}),i.jsx("div",{className:"flex flex-col space-y-2",children:i.jsx(gt,{value:(e==null?void 0:e.buttonColor)||"#f3f4f6",onChange:d=>{t("buttonColor",d)}})})]})})}),i.jsx("div",{className:"rsp-property-elements-block space-y-4",children:i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("label",{className:"rsp-properties-lable block text-md color-primary-black",children:"Full width"}),i.jsx(At,{id:"fullWidthButton",isChecked:(e==null?void 0:e.fullWidthButton)||!1,onToggle:d=>{t("fullWidthButton",d)}})]})}),!e.fullWidthButton&&i.jsx("div",{className:"rsp-property-elements-block ",children:i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("label",{className:"rsp-properties-lable block text-md color-primary-black",children:"Align"}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(Ie,{text:"Left",position:"top",className:"line-block",children:i.jsx("button",{onClick:()=>t("textAlign","start"),className:`p-1.5 rounded ${e.textAlign==="start"?"bg-primary-blue text-white":"bg-tertiary-blue color-primary-black"}`,children:i.jsx(_o,{className:"w-4 h-4"})})}),i.jsx(Ie,{text:"Center",position:"top",className:"line-block",children:i.jsx("button",{onClick:()=>t("textAlign","center"),className:`p-1.5 rounded ${e.textAlign==="center"?"bg-primary-blue text-white":"bg-tertiary-blue color-primary-black"}`,children:i.jsx(Xo,{className:"w-4 h-4"})})}),i.jsx(Ie,{text:"Right",position:"top",className:"line-block",children:i.jsx("button",{onClick:()=>t("textAlign","end"),className:`p-1.5 rounded ${e.textAlign==="end"?"bg-primary-blue text-white":"bg-tertiary-blue color-primary-black"}`,children:i.jsx(Ro,{className:"w-4 h-4"})})})]})]})}),i.jsx(Tt,{label:"Font family",width:"width170",value:e.fontFamily||"Arial, sans-serif",options:l,onChange:d=>t("fontFamily",d),previewFont:!0,isGrouped:!0}),i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("label",{className:"rsp-properties-lable block text-md color-primary-black",children:"Font size"}),i.jsx(et,{label:"",mainClass:"button-control-view",onClick:()=>{},onChange:d=>t("fontSize",d),min:11,max:72,step:1,defaultValue:e.fontSize||16})]}),i.jsxs("div",{className:" flex items-center justify-between",children:[i.jsx("label",{className:"rsp-properties-lable block text-md color-primary-black",children:"Text color"}),i.jsx("div",{className:"flex flex-col space-y-2",children:i.jsx(gt,{value:(e==null?void 0:e.buttonTextColor)||"#374151",onChange:d=>{t("buttonTextColor",d)}})})]}),i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("label",{className:"rsp-properties-lable block text-md color-primary-black",children:"Text style"}),i.jsxs("div",{className:"flex gap-2",children:[i.jsx(Ie,{text:"Bold",position:"top",className:"line-block",children:i.jsx("button",{onClick:()=>t("bold",!e.bold),className:`p-2 rounded ${e.bold?"bg-primary-blue text-white":"bg-tertiary-blue color-primary-black"}`,children:i.jsx(Ko,{className:"w-4 h-4"})})}),i.jsx(Ie,{text:"Italic",position:"top",className:"line-block",children:i.jsx("button",{onClick:()=>t("italic",!e.italic),className:`p-2 rounded ${e.italic?"bg-primary-blue text-white":"bg-tertiary-blue color-primary-black"}`,children:i.jsx(Yo,{className:"w-4 h-4"})})}),i.jsx(Ie,{text:"Underline",position:"left",className:"line-block",children:i.jsx("button",{onClick:()=>t("underline",!e.underline),className:`p-2 rounded ${e.underline?"bg-primary-blue text-white":"bg-tertiary-blue color-primary-black"}`,children:i.jsx(Jo,{className:"w-4 h-4"})})})]})]}),i.jsx(Tt,{label:"Text transform",width:"w-[160px]",value:e.textTransform||"None",options:li,onChange:d=>t("textTransform",d)}),i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("label",{className:"rsp-properties-lable block text-md color-primary-black",children:"Letter spacing"}),i.jsx(et,{label:"",mainClass:"button-control-view",onClick:()=>{},onChange:d=>t("letterSpacing",a(d,1)),min:-1,max:5,step:.5,defaultValue:e.letterSpacing||0})]}),i.jsxs("div",{className:"space-y-6",children:[!(e!=null&&e.fullWidthButton)&&i.jsx("div",{children:i.jsx(et,{actionButton:!0,label:"Width",mainClass:"button-control-view",isShowLeftDescription:!0,leftDescription:"Padding (left & right)",buttonClass:"",labelClass:"",onClick:()=>{},onChange:d=>{const u={...(e==null?void 0:e.paddingControl)||{},left:d,right:d,isCustomPadding:!0};t("paddingControl",u)},min:0,max:100,step:5,defaultValue:n()},`padding-lr-${n()}`)}),i.jsx("div",{children:i.jsx(et,{actionButton:!0,label:"Height",mainClass:"button-control-view",isShowLeftDescription:!0,leftDescription:"(px)",buttonClass:"",labelClass:"",onClick:()=>{},onChange:d=>{const u={...(e==null?void 0:e.paddingControl)||{},btnspanheight:d};t("paddingControl",u)},min:0,max:100,step:5,defaultValue:s()},`line-height-${s()}`)})]})]}),i.jsxs("div",{className:"space-y-4",children:[i.jsx(Jc,{id:"button-border-control",style:e,onStyleChange:(d,c)=>{t(d,c)}}),i.jsx(Tr,{id:"button-border-radius-control",borderRadius:e.buttonRadiusControl,onChange:d=>{t("buttonRadiusControl",d)}})]})]})},nB=({style:e,onStyleChange:t})=>i.jsxs("div",{className:"space-y-4",children:[i.jsx("div",{children:i.jsx(ao,{label:"Margin and Padding",id:"button-padding-control",marginSection:!0,paddingSection:!0,margin:e.containerPadding,padding:{...e.paddingControl,isPaddingEnabled:!1},onChange:(o,r)=>{o&&t("containerPadding",o)}})}),i.jsx("div",{className:"rsp-property-elements-block"}),i.jsx("div",{className:"space-y-4"})]}),m0=({id:e,content:t,style:o={},onUpdate:r})=>{const[n,s]=S.useState((o==null?void 0:o.showIcon)||!1),{updateComponent:a}=Te(),{updateBlockComponent:l}=Ye(),[d,c]=S.useState(""),[u,p]=S.useState(!1),[m,f]=S.useState("file"),[b,h]=S.useState("");S.useEffect(()=>{s((o==null?void 0:o.showIcon)||!1)},[o==null?void 0:o.showIcon]),S.useEffect(()=>{u&&c("")},[u]);const g=w=>{if(r){r(w);return}const y=document.querySelector(`[data-component-id="${e}"]`),E=y==null?void 0:y.getAttribute("data-parent-id"),j=y==null?void 0:y.getAttribute("data-column-index");E&&j?l(E,e,w):a(e,w)},x=(w,y)=>{var K,F,q,R;const E=document.querySelector(`[data-component-id="${e}"]`),j=E==null?void 0:E.getAttribute("data-parent-id"),B=E==null?void 0:E.getAttribute("data-column-index");let $=null;if(j&&B){const{getBlockComponents:M}=Ye.getState();$=M(j,parseInt(B)).find(U=>U.id===e)||null}else{const{getComponentForRender:M}=Te.getState();$=M(e)}const _=(K=$==null?void 0:$.contentTarget)==null?void 0:K.hasTargeting,z=((F=$==null?void 0:$.contentTarget)==null?void 0:F.activeTargetTabIndex)??0,N=(R=(q=$==null?void 0:$.contentTarget)==null?void 0:q.targetGroups)==null?void 0:R[z],O=_&&(N!=null&&N.style)?N.style:($==null?void 0:$.style)||o;g(w==="actionUpdates"?{style:{...O,...y}}:{style:{...O,[w]:y}})},C=w=>{g({content:{...t,...w}})},k=w=>{(w==null?void 0:w.imageUrl)!==void 0&&x("iconUrl",w.imageUrl),(w==null?void 0:w.imageAlt)!==void 0&&x("iconAltText",w.imageAlt)},v=w=>{if(w.toLowerCase().includes(".png")||w.toLowerCase().includes(".gif")||w.toLowerCase().includes(".jpeg")||w.toLowerCase().includes(".jpg"))return Vc;if(w.toLowerCase().includes(".zip"))return Wg;if(w.toLowerCase().includes(".pdf"))return ds},A=w=>{const y=w.match(/\.(pdf|png|jpg|jpeg|gif)(\?.*)?$/i);return y?y[1].toLowerCase():null};return i.jsxs("div",{className:"",children:[i.jsxs("div",{className:"rsp-tab flex border-b border-gray-200",children:[i.jsx("button",{className:`w-full px-4 py-2 text-md font-medium-del ${m==="file"?"active color-primary-blue":"inactive color-secondary-black"}`,onClick:()=>f("file"),children:"Content"}),i.jsx("button",{className:`w-full px-4 py-2 text-md font-medium-del ${m==="button"?"active color-primary-blue":"inactive color-secondary-black"}`,onClick:()=>f("button"),children:"Style"}),i.jsx("button",{className:`w-full px-4 py-2 text-md font-medium-del ${m==="display"?"active color-primary-blue":"inactive color-secondary-black"}`,onClick:()=>f("display"),children:"Spacing"})]}),i.jsxs("div",{className:"tab-content",children:[m==="file"&&i.jsxs("div",{className:"space-y-6",children:[i.jsxs("div",{className:"rsp-property-elements-block rsp-button-text flex items-baseline justify-between",children:[i.jsx("label",{className:"rsp-properties-lable block text-sm color-primary-black w-[220px]",children:"Button text"}),i.jsx(jt,{classWrapper:"marginT15",id:"rs_AudienceScore_Industry",placeholder:"Button text",defaultValue:"Banking",value:o.buttonText!==void 0?o.buttonText:"Download",handleOnchange:w=>x("buttonText",w.target.value),maxLength:50,required:!0})]}),i.jsxs("div",{className:"rsp-property-elements-block",children:[i.jsx("label",{className:"rsp-properties-lable marginB15 block color-primary-black",children:"Attachment"}),i.jsxs("div",{className:"space-y-4",children:[i.jsx("button",{onClick:()=>{c(""),p(!0)},className:"rsp-image-upload-properties w-full flex items-center justify-center px-4 py-2 border-2 border-dashed border-gray-300 rounded-lg hover:border-gray-400",children:i.jsxs("div",{className:"flex flex-col items-center",children:[i.jsx("h3",{children:"Click here to attach a file"}),i.jsx("small",{className:"",children:"Not more than 2MB"}),i.jsx("small",{className:"color-primary-grey",children:".zip, .jpg, .jpeg, .png, .gif, and .pdf only"})]})}),d&&i.jsxs("div",{className:"flex items-center text-red-500 text-sm gap-1 marginT5",children:[i.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",className:"w-4 h-4 mr-1",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[i.jsx("circle",{cx:"12",cy:"12",r:"10"}),i.jsx("line",{x1:"12",y1:"8",x2:"12",y2:"12"}),i.jsx("line",{x1:"12",y1:"16",x2:"12.01",y2:"16"})]}),d]}),t.fileName&&i.jsxs("div",{className:"rsp-attached-file-block relative flex text-sm color-secondary-black bg-gray-50 p-2 rounded-md",children:[i.jsx("img",{src:v(t.fileName),alt:""}),i.jsxs("div",{children:[i.jsx("p",{className:"ellispis",children:t.fileName}),i.jsxs("small",{children:[Math.round(t.fileSize/1024),"KB"]}),i.jsxs("small",{children:[(t==null?void 0:t.fileType)||"","/",A(t.fileUrl)||""]})]}),i.jsx("button",{onClick:()=>{c(""),C({fileName:"",fileSize:0,fileType:"",fileUrl:""})},className:"absolute right5 text-red-500 hover:text-red-600 text-sm",children:i.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"var(--th-primary-color)",children:[i.jsx("path",{d:"M5.45,21.93h13.1c.34,0,.62-.28.62-.62V6.08h2.13c.34,0,.62-.28.62-.62s-.28-.62-.62-.62h-4.89v-2.13c0-.34-.28-.62-.62-.62h-7.58c-.34,0-.62.28-.62.62v2.13H2.69c-.34,0-.62.28-.62.62s.28.62.62.62h2.13v15.23c0,.34.28.62.62.62ZM17.92,20.68H6.08V6.08h11.85v14.61ZM8.83,3.32h6.33v1.51h-6.33v-1.51Z"}),i.jsx("path",{d:"M8.21,18.42c.34,0,.62-.28.62-.62v-8.77c0-.34-.28-.62-.62-.62s-.62.28-.62.62v8.77c0,.34.28.62.62.62Z"}),i.jsx("path",{d:"M12,18.42c.34,0,.62-.28.62-.62v-8.77c0-.34-.28-.62-.62-.62s-.62.28-.62.62v8.77c0,.34.28.62.62.62Z"}),i.jsx("path",{d:"M15.79,18.42c.34,0,.62-.28.62-.62v-8.77c0-.34-.28-.62-.62-.62s-.62.28-.62.62v8.77c0,.34.28.62.62.62Z"})]})})]})]})]}),i.jsxs("div",{className:"space-y-6",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("label",{className:"rsp-properties-lable block text-md color-primary-black",children:"Button icon"}),i.jsx(At,{id:"showIcon",isChecked:n,onToggle:w=>{s(w),w?x("showIcon",w):x("actionUpdates",{showIcon:w,iconUrl:""})}})]}),n&&i.jsxs("div",{children:[i.jsx("div",{className:"rsp-property-elements-block",children:i.jsx(us,{content:t,style:o,onContentChange:k})}),i.jsx("div",{className:"marginT30 marginB25",children:i.jsx("div",{className:"flex items-center gap-1",children:i.jsx(jt,{placeholder:"Alternative Text",defaultValue:"Banking",value:(o==null?void 0:o.iconAltText)||"",required:!0,onChange:w=>{x("iconAltText",w),h(w)}})})}),i.jsx("div",{className:"marginB20",children:i.jsx(Yc,{style:o,onStyleChange:x})})]})]})]}),m==="display"&&i.jsx(nB,{style:o,onStyleChange:x}),m==="button"&&i.jsx(rB,{style:o,onStyleChange:x})]}),i.jsx(zn,{isOpen:u,onClose:()=>{c(""),p(!1)},onSelect:(w,y)=>{y&&C({fileName:y.name,fileSize:y.size||1024*1024,fileType:y.type,fileUrl:w}),c(""),p(!1)},allowAllFiles:!0})]})},g0=async e=>{try{const o=await(await fetch(e)).text(),n=new DOMParser().parseFromString(o,"text/xml");if(n.querySelector("parsererror"))throw new Error("Invalid RSS feed format");return{items:Array.from(n.querySelectorAll("item")).map(l=>{var d,c,u,p;return{title:((d=l.querySelector("title"))==null?void 0:d.textContent)||"",description:((c=l.querySelector("description"))==null?void 0:c.textContent)||"",link:((u=l.querySelector("link"))==null?void 0:u.textContent)||"",pubDate:((p=l.querySelector("pubDate"))==null?void 0:p.textContent)||new Date().toISOString()}})}}catch{try{const o=`https://api.rss2json.com/v1/api.json?rss_url=${encodeURIComponent(e)}`,r=await fetch(o),n=await r.json();if(!r.ok)throw new Error(n.message||"Failed to fetch RSS feed");return{items:n.items.map(s=>({title:s.title,description:s.description,link:s.link,pubDate:s.pubDate}))}}catch{throw new Error("Failed to fetch RSS feed. Please check the URL and try again.")}}},b0=({id:e,content:t,style:o={},onUpdate:r})=>{const{updateComponent:n}=Te(),{updateBlockComponent:s}=Ye(),[a,l]=S.useState(!1),[d,c]=S.useState(null),[u,p]=S.useState("");S.useEffect(()=>{(o==null?void 0:o.autoTitleLineHeightEnabled)===!0?x("titleLineHeight",void 0):(o==null?void 0:o.autoTitleLineHeightEnabled)===!1&&x("titleLineHeight",1.5)},[o==null?void 0:o.autoTitleLineHeightEnabled]),S.useEffect(()=>{(o==null?void 0:o.autoDescriptionLineHeightEnabled)===!0?x("descriptionLineHeight",void 0):(o==null?void 0:o.autoDescriptionLineHeightEnabled)===!1&&x("descriptionLineHeight",1.5)},[o==null?void 0:o.autoDescriptionLineHeightEnabled]),S.useEffect(()=>{(o==null?void 0:o.autoPubDateLineHeightEnabled)===!0?x("pubDateLineHeight",void 0):(o==null?void 0:o.autoPubDateLineHeightEnabled)===!1&&x("pubDateLineHeight",1.5)},[o==null?void 0:o.autoPubDateLineHeightEnabled]);const m=S.useRef(null),[f,b]=S.useState(t.feedUrl||""),h=A=>{if(r){r(A);return}const w=document.querySelector(`[data-component-id="${e}"]`),y=w==null?void 0:w.getAttribute("data-parent-id"),E=w==null?void 0:w.getAttribute("data-column-index");y&&E?s(y,e,A,{source:"RssFeedProp"}):n(e,A)},g=async A=>{l(!0),c(null);try{const w=await g0(A),y=t.maxItems||0;h({content:{...t,items:w.items.slice(0,y)}})}catch(w){c(w instanceof Error?w.message:"Failed to load RSS feed"),h({content:{...t,items:[]}})}finally{l(!1)}};S.useCallback(A=>{m.current&&clearTimeout(m.current),m.current=setTimeout(()=>{A&&A.trim()&&g(A)},1e3)},[t.maxItems]),S.useCallback(A=>{A&&A.trim()&&g(A)},[t.maxItems]),S.useEffect(()=>{b(t.feedUrl||"")},[]),S.useEffect(()=>()=>{m.current&&clearTimeout(m.current)},[]);const x=(A,w)=>{h({style:{...o,[A]:w}})},C=(A,w)=>{if(typeof w=="string"){if(!/^\d*$/.test(w)||w.length>1&&w.startsWith("0"))return;w=Number(w)}const y={...t,[A]:w};t.feedUrl?(l(!0),c(null),g0(t.feedUrl).then(E=>{h({content:{...y,items:E.items.slice(0,w)}})}).catch(E=>{c(E instanceof Error?E.message:"Failed to load RSS feed")}).finally(()=>{l(!1)})):h({content:y})};function k(A,w){const y=A*Math.pow(10,w+1),E=Math.floor(y/10);return y>=E*10+5?(E+1)/Math.pow(10,w):E/Math.pow(10,w)}const v=[{label:"Standard Fonts",options:_t.standard},{label:"Non standard Fonts",options:_t.decorative}];return i.jsx("div",{className:"space-y-6",children:i.jsxs("div",{className:"space-y-6",children:[i.jsxs("div",{className:"marginB30 relative",children:[i.jsx(jt,{classWrapper:"marginT10 marginB0 w-full",name:"feedUrl",type:"url",placeholder:"Feed URL",value:f,onChange:A=>{if(b(A),m.current&&clearTimeout(m.current),!A||!A.trim()){h({content:{...t,feedUrl:A,items:[]}});return}h({content:{...t,feedUrl:A}}),A&&A.trim()&&(m.current=setTimeout(()=>{g(A)},1e3))},handleOnchange:A=>{const w=A.target.value;if(b(w),m.current&&clearTimeout(m.current),!w||!w.trim()){h({content:{...t,feedUrl:w,items:[]}});return}h({content:{...t,feedUrl:w}}),w&&w.trim()&&(m.current=setTimeout(()=>{g(w)},1e3))},handleOnPaste:A=>{const w=A.clipboardData.getData("text");b(w),h({content:{...t,feedUrl:w}}),w&&w.trim()&&g(w)},onBlur:()=>{f!==(t.feedUrl||"")&&h({content:{...t,feedUrl:f}})},maxLength:2048}),a&&i.jsxs("div",{className:"absolute rsp-properties-loading flex items-center color-primary-grey text-xs",children:[i.jsx("div",{className:"segment_loader animate-spin"}),"Loading feed..."]}),d&&i.jsx("div",{className:"rsp-error-msg flex items-center color-primary-red text-sm marginT0",children:d})]}),f&&(t==null?void 0:t.items)&&t.items.length>0&&i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"rsp-property-elements-block flex items-center justify-between",children:[i.jsx("label",{className:"rsp-properties-lable block text-md color-primary-black",children:"No. of feed items (from first)"}),i.jsx(et,{mainClass:"button-control-view",id:"radius-top-right",label:"",onClick:()=>{},onChange:A=>C("maxItems",A),min:1,max:10,step:1,defaultValue:t.maxItems||1})]}),i.jsxs("div",{className:"rsp-property-elements-block space-y-6 paddingB0 borderB0",children:[i.jsx("div",{className:"flex items-center justify-between bg-tertiary-blue padding10 marginX-10 rounded",children:i.jsx("label",{className:"rsp-properties-lable block text-md color-primary-black",children:"Title"})}),i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("label",{className:"rsp-properties-lable block text-md color-primary-black",children:"Color"}),i.jsx("div",{className:"flex flex-col space-y-2",children:i.jsx(gt,{alpha:!1,value:(o==null?void 0:o.titleColor)||"#111827",onChange:A=>{x("titleColor",A)}})})]}),i.jsx(Tt,{label:"Font family",width:"width170",value:o.titleFontFamily||"Arial, sans-serif",options:v,onChange:A=>x("titleFontFamily",A),previewFont:!0,isGrouped:!0}),i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("label",{className:"rsp-properties-lable block text-md color-primary-black",children:"Font size"}),i.jsx(et,{mainClass:"button-control-view",label:"",onClick:()=>{},onChange:A=>x("titleFontSize",A),min:1,max:72,step:1,defaultValue:o.titleFontSize||12})]}),i.jsx("div",{children:i.jsxs("div",{className:"rsp-property-elements-block space-y-6",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("label",{className:"rsp-properties-lable block text-md color-primary-black",children:"Auto line height"}),i.jsx(At,{id:"auto-line-height-title",isChecked:(o==null?void 0:o.autoTitleLineHeightEnabled)||!1,onToggle:A=>{x("autoTitleLineHeightEnabled",A)}})]}),!(o!=null&&o.autoTitleLineHeightEnabled)&&i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("label",{className:"rsp-properties-lable block text-md color-primary-black",children:"Line height"}),i.jsx(et,{mainClass:"button-control-view",label:"",onClick:()=>{},onChange:A=>x("titleLineHeight",k(A,1)),min:-1,max:5,step:.1,defaultValue:(o==null?void 0:o.titleLineHeight)||1.5})]})]})}),i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("label",{className:"rsp-properties-lable block text-md color-primary-black",children:"Text style"}),i.jsxs("div",{className:"flex space-x-2",children:[i.jsx(Ie,{text:"Bold",position:"top",className:"line-block",children:i.jsx("button",{onClick:()=>x("titleBold",!o.titleBold),className:`p-2 rounded ${o.titleBold?"bg-primary-blue text-white":"bg-tertiary-blue color-primary-black"}`,children:i.jsx(Ko,{className:"w-4 h-4"})})}),i.jsx(Ie,{text:"Italic",position:"top",className:"line-block",children:i.jsx("button",{onClick:()=>x("titleItalic",!o.titleItalic),className:`p-2 rounded ${o.titleItalic?"bg-primary-blue text-white":"bg-tertiary-blue color-primary-black"}`,children:i.jsx(Yo,{className:"w-4 h-4"})})}),i.jsx(Ie,{text:"Underline",position:"left",className:"line-block",children:i.jsx("button",{onClick:()=>x("titleUnderline",!o.titleUnderline),className:`p-2 rounded ${o.titleUnderline?"bg-primary-blue text-white":"bg-tertiary-blue color-primary-black"}`,children:i.jsx(Jo,{className:"w-4 h-4"})})})]})]})]}),i.jsxs("div",{className:"rsp-property-elements-block space-y-6 paddingB0 borderB0",children:[i.jsx("div",{className:"flex items-center justify-between bg-tertiary-blue padding10 marginX-10 rounded",children:i.jsx("label",{className:"rsp-properties-lable block text-md color-primary-black",children:"Description"})}),i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("label",{className:"rsp-properties-lable block text-md color-primary-black",children:"Color"}),i.jsx("div",{className:"flex flex-col space-y-2",children:i.jsx(gt,{alpha:!1,value:(o==null?void 0:o.descriptionColor)||"#4B5563",onChange:A=>{x("descriptionColor",A)}})})]}),i.jsx(Tt,{label:"Font family",width:"width170",value:o.descriptionFontFamily||"Arial, sans-serif",options:v,onChange:A=>x("descriptionFontFamily",A),previewFont:!0,isGrouped:!0}),i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("label",{className:"rsp-properties-lable block text-md color-primary-black",children:"Font size"}),i.jsx(et,{mainClass:"button-control-view",label:"",onClick:()=>{},onChange:A=>x("descriptionFontSize",A),max:72,step:1,defaultValue:o.descriptionFontSize||14})]}),i.jsx("div",{children:i.jsxs("div",{className:"rsp-property-elements-block space-y-6",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("label",{className:"rsp-properties-lable block text-md color-primary-black",children:"Auto line height"}),i.jsx(At,{id:"auto-line-height-description",isChecked:(o==null?void 0:o.autoDescriptionLineHeightEnabled)||!1,onToggle:A=>{x("autoDescriptionLineHeightEnabled",A)}})]}),!(o!=null&&o.autoDescriptionLineHeightEnabled)&&i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("label",{className:"rsp-properties-lable block text-md color-primary-black",children:"Line height"}),i.jsx(et,{mainClass:"button-control-view",label:"",onClick:()=>{},onChange:A=>x("descriptionLineHeight",k(A,1)),min:-1,max:5,step:.1,defaultValue:(o==null?void 0:o.descriptionLineHeight)||1.5})]})]})}),i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("label",{className:"rsp-properties-lable block text-md color-primary-black",children:"Text style"}),i.jsxs("div",{className:"flex space-x-2",children:[i.jsx(Ie,{text:"Bold",position:"top",className:"line-block",children:i.jsx("button",{onClick:()=>x("descriptionBold",!o.descriptionBold),className:`p-2 rounded ${o.descriptionBold?"bg-primary-blue text-white":"bg-tertiary-blue color-primary-black"}`,title:"Bold",children:i.jsx(Ko,{className:"w-4 h-4"})})}),i.jsx(Ie,{text:"Italic",position:"top",className:"line-block",children:i.jsx("button",{onClick:()=>x("descriptionItalic",!o.descriptionItalic),className:`p-2 rounded ${o.descriptionItalic?"bg-primary-blue text-white":"bg-tertiary-blue color-primary-black"}`,children:i.jsx(Yo,{className:"w-4 h-4"})})}),i.jsx(Ie,{text:"Underline",position:"left",className:"line-block",children:i.jsx("button",{onClick:()=>x("descriptionUnderline",!o.descriptionUnderline),className:`p-2 rounded ${o.descriptionUnderline?"bg-primary-blue text-white":"bg-tertiary-blue color-primary-black"}`,children:i.jsx(Jo,{className:"w-4 h-4"})})})]})]})]}),i.jsxs("div",{className:"rsp-property-elements-block space-y-6",children:[i.jsx("div",{className:"flex items-center justify-between bg-tertiary-blue padding10 marginX-10 rounded",children:i.jsx("label",{className:"rsp-properties-lable block text-md color-primary-black",children:"Date"})}),i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("label",{className:"rsp-properties-lable block text-md color-primary-black",children:"Color"}),i.jsx("div",{className:"flex flex-col space-y-2",children:i.jsx(gt,{alpha:!1,value:(o==null?void 0:o.pubDateColor)||"#6B7280",onChange:A=>{x("pubDateColor",A)}})})]}),i.jsx(Tt,{label:"Font family",width:"width170",value:o.pubDateFontFamily||"Arial, sans-serif",options:v,onChange:A=>x("pubDateFontFamily",A),previewFont:!0,isGrouped:!0}),i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("label",{className:"rsp-properties-lable block text-md color-primary-black",children:"Font size"}),i.jsx(et,{mainClass:"button-control-view",label:"",onClick:()=>{},onChange:A=>x("pubDateFontSize",A),min:1,max:72,step:1,defaultValue:o.pubDateFontSize||12})]}),i.jsx("div",{children:i.jsxs("div",{className:"rsp-property-elements-block space-y-6",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("label",{className:"rsp-properties-lable block text-md color-primary-black",children:"Auto line height"}),i.jsx(At,{id:"auto-line-height-pubdate",isChecked:(o==null?void 0:o.autoPubDateLineHeightEnabled)||!1,onToggle:A=>{x("autoPubDateLineHeightEnabled",A)}})]}),!(o!=null&&o.autoPubDateLineHeightEnabled)&&i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("label",{className:"rsp-properties-lable block text-md color-primary-black",children:"Line height"}),i.jsx(et,{mainClass:"button-control-view",label:"",onClick:()=>{},onChange:A=>x("pubDateLineHeight",k(A,1)),min:-1,max:5,step:.1,defaultValue:(o==null?void 0:o.pubDateLineHeight)||1.5})]})]})}),i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("label",{className:"rsp-properties-lable block text-md color-primary-black",children:"Text style"}),i.jsxs("div",{className:"flex space-x-2",children:[i.jsx(Ie,{text:"Bold",position:"top",className:"line-block",children:i.jsx("button",{onClick:()=>x("pubDateBold",!o.pubDateBold),className:`p-2 rounded ${o.pubDateBold?"bg-primary-blue text-white":"bg-tertiary-blue color-primary-black"}`,children:i.jsx(Ko,{className:"w-4 h-4"})})}),i.jsx(Ie,{text:"Italic",position:"top",className:"line-block",children:i.jsx("button",{onClick:()=>x("pubDateItalic",!o.pubDateItalic),className:`p-2 rounded ${o.pubDateItalic?"bg-primary-blue text-white":"bg-tertiary-blue color-primary-black"}`,children:i.jsx(Yo,{className:"w-4 h-4"})})}),i.jsx(Ie,{text:"Underline",position:"left",className:"line-block",children:i.jsx("button",{onClick:()=>x("pubDateUnderline",!o.pubDateUnderline),className:`p-2 rounded ${o.pubDateUnderline?"bg-primary-blue text-white":"bg-tertiary-blue color-primary-black"}`,children:i.jsx(Jo,{className:"w-4 h-4"})})})]})]})]}),i.jsxs("div",{className:"rsp-property-elements-block flex items-center justify-between",children:[i.jsx("label",{className:"rsp-properties-lable block text-md color-primary-black",children:"Container background"}),i.jsx("div",{className:"flex flex-col space-y-2",children:i.jsx(gt,{value:(o==null?void 0:o.containerBackgroundColor)||"transparent",onChange:A=>{x("containerBackgroundColor",A)}})})]}),i.jsx(cs,{id:"border-control",style:o,onStyleChange:(A,w)=>{x(A,w)}}),i.jsx("div",{className:"rsp-property-elements-block",children:i.jsx(Tr,{id:"border-radius-control",borderRadius:o.borderRadiusControl,onChange:A=>{x("borderRadiusControl",A)}})}),i.jsx(ao,{label:"Padding",id:"padding-control",marginSection:!1,paddingSection:!0,padding:o.paddingControl,isHideLeftRight:!0,onChange:A=>{x("paddingControl",A)}})]})]})})},iB="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAACXBIWXMAAAHYAAAB2AH6XKZyAAAAGXRFWHRTb2Z0d2FyZQB3d3cuaW5rc2NhcGUub3Jnm+48GgAABGhJREFUeJztmstvG0Ucxz8zXpvm0bzTkGfTvJrgCEqQqhYhcUPlwBHOlRDlceuxB5C48A9UCkIcQIILAnFJUpCQQOICFKEKqGPaNE6TOm9XLXl6vfYOh7ROXCdpk4x3VsSf24zXv+93vp4dzz4EQGoofBrBR0pwBihDH/+CGAyt9r0v3vg6o7GuNix7uK9fCX4CSgtQvxLUJbssWgO8U4D6B0Yi5CUKM/gsAvW2fSX8YSE19osEXvVESfFBajj8nidae0AClV6JKcFle/iZ173SexKk53pCfJm80v+Kx7o74nUAACGh1Depob4BA9p5mAgA4Kgr5ffJkd4eQ/pZhD0SzmAuiHEUn3opqBAZqdTPodciV8F8ACb5PPR75M2cAFxZynLrRcO+CksgOUX5/BcACHjLyvlUBElWvGTCl2eErFF4EICCC48EIBBu0oQv71DO1tZATgABKWlp6/TWkMeoe0s4sWwzYO1yrHnsaVj6BVxbW0lh30eW1+OuJACFfwNYjcL0x49OWS1Yx3pQFU/jzEV8+veXvA0znxRk8A8RRyoIVDb5MIDUPMQHtU77nZDl9T4LIH0f4pchs+yJnAiW+CgANwnTg+Dc9U5TCZ8EoJyNwSfveC7tgwBcmP0M1saMqOf+DcoAZNa8dZD4Fpaveau5BWGPhDOytEoGak8gggW9N+o/FFjyqXKshj4QPjgbDCBldYs4rIMHhZRHqoRpGyaRyIBpDwbxyz7AIMUATBswTTEA0wbMog57AId+BhQD0HdTdOpmnKmxx1/Pt/e20dLZzPj1GDMTcxsmghZnz50GYCI6yXRsJu97UgpKykqob66jpaMZNO1ftQXgpBzWV9Yfe1za2XhXKmU7JNc2HsJYwU0bu9VZXVojMXsXe92ms79Dg2uNAVTXV9HeezynT7kud25N47ouAEIIyiuf/CU0IQRdz3aQSWeYjs1gr6cAuDMW918ANQ3V1DRUZ9tKKf7+NZIdPMDJgR7qGmv3VPdhqCVlpUSujgLgpNI4KYdgKHhg3wVZBJVSRH4bZX5qIdvX/VwXrV3N+6pnr6dIzCay7UAgkHPaHAT9T4YU/PPHDWYn57Ndnf0dtPe27b2UUvzw1Y95/XXNtQihZxXUPgNu/nmL+PjmKn78ZBsd4XZt9eub6+h7oVdbPa0zYOyvcSZvTGXbrd2t9Jzq2nc9IQQDL58CIGAFKD1aouW834q2AGKRCW5HJ7PtphON9D7ffeC6WxfWQqAlAHvdZvz6RE7fQnyRxXgi79i6phr6z4R1yGpBSwBKqby+tJPe9thM2t223whC6AnAClp5m6CdKK/cePZQ11ibPZ+l3FyLa45VIR7sczUt9LsiVPRC/s93iDj0V4PFAEwbME0xANMGTFMMwLQB0xQDMG3ANMUATBswjSRtF+6FXL+jMkqq1FrUtA9TqORyTKbtlfPK9dNFujco5eLaaxdl6MXvrmXuzZ1zk0uLbHNj43+HUih7dVUsL7xrnR0e+g8VZmJR3E4gxgAAAABJRU5ErkJggg==",Un=({id:e,style:t={}})=>{var O,K,F,q,R,M,L,U,ee,Y,te,ie,ue,ne,ae,oe,G,Q,J,T,X,H,D,W,I,V,Z,P,re,se,le,xe,Ce,je,ye,Ne,_e,Re,Be,ve,pe,be,ke,de,ce,me,Ae,Ee,Oe;const{pConfig:o,updateComponent:r,updateCanvasSettings:n,canvasSettings:s,components:a,componentsDuplicate:l,duplicateComponents:d,setComponents:c}=Te(),[u,p]=S.useState(""),m=S.useRef(null),f=S.useMemo(()=>{var fe;return((fe=o==null?void 0:o.templateDetails)==null?void 0:fe.resolution)||(o==null?void 0:o.resolution)||null},[(O=o==null?void 0:o.templateDetails)==null?void 0:O.resolution,o==null?void 0:o.resolution]),b=fe=>{if(!fe||typeof fe!="string")return null;const we=fe.split("x");if(we.length===0)return null;const $e=parseInt(we[0],10);return isNaN($e)||$e<=0?null:$e},h=S.useMemo(()=>o!=null&&o.offerBuilderEnabled&&f?b(f):null,[o==null?void 0:o.offerBuilderEnabled,f]),[g,x]=S.useState(()=>{var fe;if(o!=null&&o.offerBuilderEnabled&&f){const we=b(f);if(we)return we}return((fe=s==null?void 0:s.style)==null?void 0:fe.emailWidth)||600}),[C,k]=S.useState(!1),[v,A]=S.useState(!1);S.useEffect(()=>{var $e;if(!(o!=null&&o.offerBuilderEnabled)||!f)return;const fe=b(f);if(!fe)return;const we=($e=s==null?void 0:s.style)==null?void 0:$e.emailWidth;we!==fe||we===void 0?(x(fe),n({style:{...s.style,emailWidth:fe}})):g!==fe&&x(fe)},[o==null?void 0:o.offerBuilderEnabled,f]),S.useEffect(()=>{var we;const fe=(we=s==null?void 0:s.style)==null?void 0:we.emailWidth;if(!(fe===void 0||fe===g))if(o!=null&&o.offerBuilderEnabled&&f){const $e=b(f);(!$e||$e===fe)&&x(fe)}else x(fe)},[(K=s==null?void 0:s.style)==null?void 0:K.emailWidth]);function w(fe,we){const $e=new Map(we==null?void 0:we.map(He=>[He.id,He]));return fe.map(He=>{const Ue=$e==null?void 0:$e.get(He.id);return Ue&&(Ue!=null&&Ue.style)&&Ue.style.backgroundColor?{...He,style:{...He.style,backgroundColor:Ue.style.backgroundColor,contentBackgroundColor:Ue.style.contentBackgroundColor}}:He})}function y(fe){let we=a.map($e=>({...$e,style:{...$e.style,backgroundColor:fe,contentBackgroundColor:fe}}));c(we)}const E=async(fe,we)=>{if(r(e,{style:{...t,[fe]:we}}),n({style:{...s.style,[fe]:we}}),fe==="contentBackgroundColor"&&y(we),fe!=="canvasThemes"&&await d(),fe==="canvasThemes"&&we===!1){const $e=w(a,l);c($e),n({...s,style:{...(s==null?void 0:s.style)??{},canvasThemes:!1,backgroundColor:"#f8f9fa",contentBackgroundColor:"#ffffff"}})}else fe==="canvasThemes"&&we===!0&&await d()},j=fe=>{var He;if(fe.size>10*1024*1024)return"File size must not exceed 10MB";const we=(He=fe.name.split(".").pop())==null?void 0:He.toLowerCase();if(!we||!["zip","pdf","png","jpg","jpeg","gif"].includes(we))return"Only zip, pdf, png, jpg, jpeg and gif files are allowed";if(we==="zip"&&!["application/zip","application/x-zip","application/x-zip-compressed","application/octet-stream"].includes(fe.type)){const Pe=new File([fe],fe.name,{type:"application/zip"});return j(Pe)}return null},B=async fe=>{var He;const we=(He=fe.target.files)==null?void 0:He[0];if(p(""),!we)return;const $e=j(we);if($e){p($e),m.current&&(m.current.value="");return}try{if(we){const Pe=new FormData;Pe.append("file",we,we.name),o.emailAttachCallback(Pe)}const Ue=new FileReader;Ue.onload=Pe=>{var Ve;(Ve=Pe.target)!=null&&Ve.result&&E("attachment",{name:we.name,type:we.type,size:we.size,data:Pe.target.result})},Ue.onerror=()=>{p("Failed to read the file"),m.current&&(m.current.value="")},Ue.readAsDataURL(we)}catch{p("Failed to process file"),m.current&&(m.current.value="")}},$=fe=>{if(fe.toLowerCase().includes(".png")||fe.toLowerCase().includes(".gif")||fe.toLowerCase().includes(".jpeg")||fe.toLowerCase().includes(".jpg"))return Vc;if(fe.toLowerCase().includes(".zip"))return iB;if(fe.toLowerCase().includes(".pdf"))return ds},_=[{id:"light",name:"Light",backgroundColor:"#ffffff",contentBackgroundColor:"#f8f9fa"},{id:"dark",name:"Dark",backgroundColor:"#1a1a1a",contentBackgroundColor:"#2d2d2d"},{id:"blue",name:"Blue",backgroundColor:"#e3f2fd",contentBackgroundColor:"#bbdefb"},{id:"green",name:"Green",backgroundColor:"#e8f5e9",contentBackgroundColor:"#c8e6c9"},{id:"purple",name:"Purple",backgroundColor:"#f3e5f5",contentBackgroundColor:"#e1bee7"},{id:"orange",name:"Orange",backgroundColor:"#fff3e0",contentBackgroundColor:"#ffe0b2"},{id:"red",name:"Red",backgroundColor:"#ffebee",contentBackgroundColor:"#ffcdd2"},{id:"teal",name:"Teal",backgroundColor:"#e0f2f1",contentBackgroundColor:"#b2dfdb"},{id:"yellow",name:"Yellow",backgroundColor:"#fffde7",contentBackgroundColor:"#fff9c4"},{id:"indigo",name:"Indigo",backgroundColor:"#e8eaf6",contentBackgroundColor:"#c5cae9"},{id:"brown",name:"Brown",backgroundColor:"#efebe9",contentBackgroundColor:"#d7ccc8"},{id:"cyan",name:"Cyan",backgroundColor:"#e0f7fa",contentBackgroundColor:"#b2ebf2"},{id:"pink",name:"Pink",backgroundColor:"#fce4ec",contentBackgroundColor:"#f8bbd0"},{id:"gray",name:"Gray",backgroundColor:"#f5f5f5",contentBackgroundColor:"#e0e0e0"},{id:"lime",name:"Lime",backgroundColor:"#f9fbe7",contentBackgroundColor:"#dcedc8"},{id:"amber",name:"Amber",backgroundColor:"#fff8e1",contentBackgroundColor:"#ffecb3"},{id:"deepOrange",name:"Deep Orange",backgroundColor:"#fbe9e7",contentBackgroundColor:"#ffccbc"},{id:"deepPurple",name:"Deep Purple",backgroundColor:"#ede7f6",contentBackgroundColor:"#d1c4e9"},{id:"lightBlue",name:"Light Blue",backgroundColor:"#e1f5fe",contentBackgroundColor:"#b3e5fc"},{id:"lightGreen",name:"Light Green",backgroundColor:"#f1f8e9",contentBackgroundColor:"#dcedc8"},{id:"blueGray",name:"Blue Gray",backgroundColor:"#eceff1",contentBackgroundColor:"#cfd8dc"},{id:"warmGray",name:"Warm Gray",backgroundColor:"#fafafa",contentBackgroundColor:"#e0e0e0"},{id:"coolGray",name:"Cool Gray",backgroundColor:"#f3f4f6",contentBackgroundColor:"#d1d5db"},{id:"midnight",name:"Midnight",backgroundColor:"#121212",contentBackgroundColor:"#1f1f1f"},{id:"rose",name:"Rose",backgroundColor:"#fff1f2",contentBackgroundColor:"#fecdd3"},{id:"sky",name:"Sky",backgroundColor:"#e0f2fe",contentBackgroundColor:"#bae6fd"},{id:"charcoal",name:"Charcoal",backgroundColor:"#2e2e2e",contentBackgroundColor:"#3c3c3c"},{id:"ivory",name:"Ivory",backgroundColor:"#fffff0",contentBackgroundColor:"#fdf5e6"},{id:"peach",name:"Peach",backgroundColor:"#fff0e6",contentBackgroundColor:"#ffd9c0"},{id:"mint",name:"Mint",backgroundColor:"#e6fff5",contentBackgroundColor:"#b2f2e3"},{id:"steel",name:"Steel",backgroundColor:"#f4f6f8",contentBackgroundColor:"#d9e2ec"},{id:"plum",name:"Plum",backgroundColor:"#f3e0f7",contentBackgroundColor:"#d7aefb"},{id:"sand",name:"Sand",backgroundColor:"#fefae0",contentBackgroundColor:"#f5e6b3"},{id:"coffee",name:"Coffee",backgroundColor:"#ece0d1",contentBackgroundColor:"#c8b6a6"},{id:"forest",name:"Forest",backgroundColor:"#e6f2e6",contentBackgroundColor:"#b9d8b9"},{id:"coral",name:"Coral",backgroundColor:"#fff3f0",contentBackgroundColor:"#ffc1a1"},{id:"slate",name:"Slate",backgroundColor:"#f1f5f9",contentBackgroundColor:"#cbd5e1"},{id:"lavender",name:"Lavender",backgroundColor:"#f5f0ff",contentBackgroundColor:"#e6d6ff"}],z=[{value:"UTC",label:"UTC"},{value:"America/New_York",label:"Eastern Time (ET)"},{value:"America/Chicago",label:"Central Time (CT)"},{value:"America/Denver",label:"Mountain Time (MT)"},{value:"America/Los_Angeles",label:"Pacific Time (PT)"},{value:"Europe/London",label:"London (GMT)"},{value:"Europe/Paris",label:"Central European Time (CET)"},{value:"Asia/Tokyo",label:"Japan (JST)"},{value:"Asia/Shanghai",label:"China (CST)"},{value:"Australia/Sydney",label:"Sydney (AEST)"}];function N(fe){return fe<1024?`${fe} B`:fe<1024*1024?`${(fe/1024).toFixed(1)} KB`:`${(fe/(1024*1024)).toFixed(1)} MB`}return i.jsxs("div",{className:"space-y-6",children:[i.jsxs("div",{className:"rsp-property-elements-block space-y-2 hiddens",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("label",{className:"rsp-properties-lable block text-md color-primary-black",children:["Email width",i.jsx("span",{className:"rsp-mini-text text-xs text-gray-500",children:" (px)"})]}),i.jsx(et,{label:"",mainClass:"button-control-view",onClick:()=>{},onChange:fe=>{const we=o!=null&&o.offerBuilderEnabled?100:320,$e=h||(o!=null&&o.offerBuilderEnabled?800:600);fe>=we&&fe<=$e&&(x(fe),E("emailWidth",fe))},min:o!=null&&o.offerBuilderEnabled?100:320,max:h||(o!=null&&o.offerBuilderEnabled?800:600),step:20,defaultValue:g,isShowLeftDescription:!1,leftDescription:"",buttonClass:"",labelClass:"",actionButton:!0},g)]}),i.jsxs("p",{className:"rsp-alert-bg text-xs text-gray-500",children:["Recommended width: (",o!=null&&o.offerBuilderEnabled?"100px - 800px":"320px - 600px",")"]})]}),i.jsxs("div",{className:`rsp-property-elements-block space-y-2 hiddens ${o!=null&&o.emailFooter?"hidden":""}`,children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("label",{className:"rsp-properties-lable block text-md color-primary-black",children:"Themes"}),i.jsx(At,{isChecked:((F=s==null?void 0:s.style)==null?void 0:F.canvasThemes)||!1,id:"canvasThemes-switch",onToggle:fe=>{n({style:{...s.style,backgroundColor:"transparent",canvasThemes:fe,contentBackgroundColor:"transparent"}})}})]}),((q=s==null?void 0:s.style)==null?void 0:q.canvasThemes)&&i.jsxs("div",{className:`marginT20 ${o!=null&&o.emailFooter?"hidden":""}`,children:[i.jsx("div",{className:"mt0 grid grid-cols-5 gap-2",children:_.map(fe=>{var we;return i.jsx("div",{children:i.jsx(Ie,{text:fe.name,position:"top",mainClass:"inline-block w-full",children:i.jsx("button",{onClick:()=>{n({style:{...s.style,backgroundColor:fe.backgroundColor,contentBackgroundColor:fe.contentBackgroundColor}})},className:`rsp-theme-wrapper w-full padding5 border transition-colors ${((we=s==null?void 0:s.style)==null?void 0:we.backgroundColor)===fe.backgroundColor?"border-primary-blue":"border-quaternary-blue"}`,children:i.jsx("div",{className:"rsp-theme-block w-full h-8",style:{background:`linear-gradient(to right, ${fe.backgroundColor} 50%, ${fe.contentBackgroundColor} 50%)`}})},fe.id)})})})}),i.jsx("p",{className:"rsp-alert-bg text-xs text-gray-500 marginT10",children:"Applying a theme will automatically update the container and content background colors to match the selected theme."})]})]}),!((R=s==null?void 0:s.style)!=null&&R.canvasThemes)&&i.jsxs(i.Fragment,{children:[i.jsx("div",{className:`rsp-property-elements-block ${o!=null&&o.emailFooter?"hidden":""}`,children:i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("label",{className:"rsp-properties-lable block text-md color-primary-black ",children:"Background"}),i.jsx("div",{className:"flex flex-col space-y-2",children:i.jsx(gt,{value:((M=s==null?void 0:s.style)==null?void 0:M.backgroundColor)||"transparent",onChange:fe=>{E("backgroundColor",fe)}})})]})}),i.jsx("div",{className:"rsp-property-elements-block",children:i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("label",{className:"rsp-properties-lable block text-md color-primary-black ",children:"Content background"}),i.jsx("div",{className:"flex flex-col space-y-2",children:i.jsx(gt,{value:((L=s==null?void 0:s.style)==null?void 0:L.contentBackgroundColor)||"transparent",onChange:fe=>{E("contentBackgroundColor",fe)}})})]})})]}),i.jsxs("div",{className:"rsp-property-elements-block",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("label",{className:"rsp-properties-lable block text-md color-primary-black",children:"Mobile responsive"}),i.jsx(At,{isChecked:((U=s==null?void 0:s.style)==null?void 0:U.mobileResponsive)||!1,id:"mobileResponsive-switch",onToggle:fe=>{n({style:{...s.style,mobileResponsive:fe}})}})]}),((ee=s==null?void 0:s.style)==null?void 0:ee.mobileResponsive)&&i.jsx("div",{className:"",children:i.jsx("p",{className:"rsp-alert-bg text-xs text-gray-500",children:"Not supported by Outlook 2002 (XP), 2007, 2010, 2013, 2016, and 2019."})})]}),!((Y=s==null?void 0:s.style)!=null&&Y.emptyCanvas)&&((te=s==null?void 0:s.style)==null?void 0:te.emptyContentValid)&&i.jsx(i.Fragment,{children:i.jsxs("div",{className:"rsp-property-elements-block",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("label",{className:"rsp-properties-lable block text-md color-primary-black",children:"Content shadow"}),i.jsx(At,{isChecked:((ie=s==null?void 0:s.style)==null?void 0:ie.contentShadow)||!1,id:"contentShadow-switch",onToggle:fe=>{n({style:{...s.style,contentShadow:fe}})}})]}),((ue=s==null?void 0:s.style)==null?void 0:ue.contentShadow)&&i.jsxs("div",{className:"space-y-4 marginT15",children:[i.jsx("p",{className:"rsp-alert-bg text-xs text-gray-500",children:"Not supported by Outlook 2002 (XP), 2007, 2010, 2013, 2016, and 2019."}),i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("label",{className:"rsp-properties-lable block text-md color-primary-black",children:"Shadow color"}),i.jsx("div",{className:"flex items-center gap-2",children:i.jsx(gt,{value:((ne=s==null?void 0:s.style)==null?void 0:ne.shadowColor)||"#000000",onChange:fe=>{E("shadowColor",fe)},alpha:!0})})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("label",{className:"rsp-properties-lable block text-sm color-primary-black",children:"X"}),i.jsx("span",{className:"text-sm text-gray-600",children:((ae=s==null?void 0:s.style)==null?void 0:ae.shadowX)||0})]}),i.jsx("input",{type:"range",min:"-15",max:"15",step:"1",value:((oe=s==null?void 0:s.style)==null?void 0:oe.shadowX)||0,onChange:fe=>{E("shadowX",parseInt(fe.target.value))},className:"w-full h-2 bg-gray-200 rounded-lg appearance-none cursor-pointer shadow-slider",style:{background:(()=>{var $e;const we=(parseInt((($e=s==null?void 0:s.style)==null?void 0:$e.shadowX)||0)+15)/30*100;return`linear-gradient(to right, #e5e7eb 0%, #e5e7eb ${we}%, var(--th-primary-color) ${we}%, var(--th-primary-color) 100%)`})()}})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("label",{className:"rsp-properties-lable block text-sm color-primary-black",children:"Y"}),i.jsx("span",{className:"text-sm text-gray-600",children:((G=s==null?void 0:s.style)==null?void 0:G.shadowY)||0})]}),i.jsx("input",{type:"range",min:"-15",max:"15",step:"1",value:((Q=s==null?void 0:s.style)==null?void 0:Q.shadowY)||0,onChange:fe=>{E("shadowY",parseInt(fe.target.value))},className:"w-full h-2 bg-gray-200 rounded-lg appearance-none cursor-pointer shadow-slider",style:{background:(()=>{var $e;const we=(parseInt((($e=s==null?void 0:s.style)==null?void 0:$e.shadowY)||0)+15)/30*100;return`linear-gradient(to right, #e5e7eb 0%, #e5e7eb ${we}%, var(--th-primary-color) ${we}%, var(--th-primary-color) 100%)`})()}})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("label",{className:"rsp-properties-lable block text-sm color-primary-black",children:"BLUR"}),i.jsx("span",{className:"text-sm text-gray-600",children:((J=s==null?void 0:s.style)==null?void 0:J.shadowBlur)||0})]}),i.jsx("input",{type:"range",min:"0",max:"100",step:"1",value:((T=s==null?void 0:s.style)==null?void 0:T.shadowBlur)||0,onChange:fe=>{E("shadowBlur",parseInt(fe.target.value))},className:"w-full h-2 bg-gray-200 rounded-lg appearance-none cursor-pointer shadow-slider",style:{background:`linear-gradient(to right, var(--th-primary-color) 0%, var(--th-primary-color) ${(((X=s==null?void 0:s.style)==null?void 0:X.shadowBlur)||0)/100*100}%, #e5e7eb ${(((H=s==null?void 0:s.style)==null?void 0:H.shadowBlur)||0)/100*100}%, #e5e7eb 100%)`}})]})]})]})}),i.jsxs("div",{className:"rsp-property-elements-block hidden",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("label",{className:"rsp-properties-lable block text-md color-primary-black",children:"Google promo annotation"}),i.jsxs("div",{className:"relative inline-block w-10 align-middle select-none",children:[i.jsx("input",{type:"checkbox",checked:((D=s==null?void 0:s.style)==null?void 0:D.enableGooglePromo)||!1,onChange:fe=>E("enableGooglePromo",fe.target.checked),className:"toggle-checkbox absolute block w-6 h-6 rounded-full bg-white appearance-none cursor-pointer"}),i.jsx("label",{className:"toggle-label block overflow-hidden h-6 rounded-full bg-gray-300 cursor-pointer"})]})]}),i.jsx("p",{className:"rsp-alert-bg text-xs text-gray-500",children:"Not supported by Outlook 2002 (XP), 2007, 2010, 2013, 2016, and 2019."})]}),((W=s==null?void 0:s.style)==null?void 0:W.enableGooglePromo)&&i.jsxs("div",{className:"rsp-inside-bg space-y-4 p-4 bg-gray-50 rounded-lg",children:[i.jsxs("div",{children:[i.jsx("label",{className:"rsp-properties-lable block text-md color-primary-black ",children:"Promotion title"}),i.jsx("input",{type:"text",value:((I=s==null?void 0:s.style)==null?void 0:I.promoTitle)||"",onChange:fe=>E("promoTitle",fe.target.value),className:"w-full p-2 border rounded-md",placeholder:"e.g., 25% Off Summer Sale"})]}),i.jsxs("div",{children:[i.jsx("label",{className:"rsp-properties-lable block text-md color-primary-black ",children:"Promotion code"}),i.jsx("input",{type:"text",value:((V=s==null?void 0:s.style)==null?void 0:V.promoCode)||"",onChange:fe=>E("promoCode",fe.target.value),className:"w-full p-2 border rounded-md",placeholder:"e.g., SUMMER25"})]}),i.jsxs("div",{children:[i.jsx("label",{className:"rsp-properties-lable block text-md color-primary-black",children:"Expiration date & time"}),i.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[i.jsx("input",{type:"datetime-local",value:((Z=s==null?void 0:s.style)==null?void 0:Z.promoExpiration)||"",onChange:fe=>E("promoExpiration",fe.target.value),className:"w-full p-2 border rounded-md"}),i.jsx("select",{value:((P=s==null?void 0:s.style)==null?void 0:P.promoTimezone)||"UTC",onChange:fe=>E("promoTimezone",fe.target.value),className:"w-full p-2 border rounded-md",children:z.map(fe=>i.jsx("option",{value:fe.value,children:fe.label},fe.value))})]})]}),i.jsxs("div",{children:[i.jsx("label",{className:"rsp-properties-lable block text-md color-primary-black",children:"Sender logo"}),i.jsxs("div",{className:"flex items-center space-x-2",children:[t.senderLogo?i.jsxs("div",{className:"relative w-12 h-12 border rounded-md overflow-hidden group",children:[i.jsx("img",{src:(re=s==null?void 0:s.style)==null?void 0:re.senderLogo,alt:"Sender Logo",className:"w-full h-full object-cover"}),i.jsx("button",{onClick:()=>E("senderLogo",""),className:"absolute inset-0 bg-black/50 text-white opacity-0 group-hover:opacity-100 transition-opacity",children:"Remove"})]}):null,i.jsx("button",{onClick:()=>k(!0),className:"rsp-image-upload-properties bg-white flex-1 flex items-center justify-center px-4 py-2 border-gray-300 rounded-md hover:bg-gray-50",children:i.jsxs("div",{className:"flex flex-col items-center",children:[i.jsxs("h3",{children:["Click here to"," ",(se=s==null?void 0:s.style)!=null&&se.senderLogon?"change Logo":"upload Logo"]}),i.jsx("span",{children:"Not more than 2MB"}),i.jsx("small",{children:".jpg, .jpeg, .png and .gif only"})]})})]})]}),i.jsxs("div",{children:[i.jsx("label",{className:"rsp-properties-lable block text-md color-primary-black",children:"Promotion image"}),i.jsxs("div",{className:"flex items-center space-x-2",children:[(le=s==null?void 0:s.style)!=null&&le.promoImage?i.jsxs("div",{className:"relative w-12 h-12 border rounded-md overflow-hidden group",children:[i.jsx("img",{src:(xe=s==null?void 0:s.style)==null?void 0:xe.promoImage,alt:"Promo Image",className:"w-full h-full object-cover"}),i.jsx("button",{onClick:()=>E("promoImage",""),className:"absolute inset-0 bg-black/50 text-white opacity-0 group-hover:opacity-100 transition-opacity",children:"Remove"})]}):null,i.jsx("button",{onClick:()=>A(!0),className:"rsp-image-upload-properties bg-white flex-1 flex items-center justify-center px-4 py-2 border-gray-300 rounded-md hover:bg-gray-50",children:i.jsxs("div",{className:"flex flex-col items-center",children:[i.jsxs("h3",{children:["Click here to"," ",(Ce=s==null?void 0:s.style)!=null&&Ce.promoImage?"change image":"upload image"]}),i.jsx("span",{children:"Not more than 2MB"}),i.jsx("small",{children:".jpg, .jpeg, .png and .gif only"})]})})]})]})]}),!(o!=null&&o.emailFooter)&&!((je=s==null?void 0:s.style)!=null&&je.emptyCanvas)&&((ye=s==null?void 0:s.style)==null?void 0:ye.emptyContentValid)&&i.jsxs("div",{className:"rsp-property-elements-block-del",children:[i.jsx("label",{className:"rsp-properties-lable marginB10 block text-sm color-primary-black",children:"Inbox first line preview"}),i.jsx("textarea",{value:((Ne=s==null?void 0:s.style)==null?void 0:Ne.inboxPreview)||"",onChange:fe=>E("inboxPreview",fe.target.value),className:"w-full p-2 border rounded-md h-24 resize-none",placeholder:"Enter preview text that will appear in email clients..",maxLength:150}),((_e=s==null?void 0:s.style)==null?void 0:_e.inboxPreview)&&i.jsx("p",{className:"rsp-alert-bg text-xs text-gray-500 mt0",children:"Maximum 150 characters. This text appears after the subject line in most email clients."})]}),!((Re=s==null?void 0:s.style)!=null&&Re.emptyCanvas)&&((Be=s==null?void 0:s.style)==null?void 0:Be.emptyContentValid)&&i.jsx(cs,{style:s==null?void 0:s.style,maxValue:2,onStyleChange:(fe,we)=>{E(fe,we)}}),!(o!=null&&o.emailFooter)&&!((ve=s==null?void 0:s.style)!=null&&ve.emptyCanvas)&&((pe=s==null?void 0:s.style)==null?void 0:pe.emptyContentValid)&&i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{className:"flex items-center justify-between marginB15",children:[i.jsx("label",{className:"rsp-properties-lable block text-md color-primary-black",children:"Embed attachment"}),i.jsx(At,{isChecked:((be=s==null?void 0:s.style)==null?void 0:be.enableAttachment)||!1,id:"enableAttachment",onToggle:fe=>{n({style:{...s.style,enableAttachment:fe,...fe===!1?{attachment:null}:{}}}),r(e,{style:{...t,enableAttachment:fe,...fe===!1?{attachment:null}:{}}})}})]}),((ke=s==null?void 0:s.style)==null?void 0:ke.enableAttachment)&&i.jsxs("div",{className:"space-y-2",children:[!((de=s==null?void 0:s.style)!=null&&de.attachment)&&i.jsxs(i.Fragment,{children:[i.jsx("button",{onClick:()=>{var fe;return(fe=m.current)==null?void 0:fe.click()},className:"rsp-image-upload-properties w-full flex items-center justify-center px-4 py-2 border-gray-300 rounded-lg hover:border-gray-400",children:i.jsxs("div",{className:"flex flex-col items-center",children:[i.jsx("h3",{children:"Click here to attach a file"}),i.jsx("small",{children:"Not more than 10MB"}),i.jsx("small",{className:"color-primary-grey",children:".zip, .pdf, .png, .jpg, .jpeg,.gif only"})]})}),i.jsx("input",{ref:m,type:"file",className:"hidden",accept:".zip,.pdf,.png,.jpg,.jpeg,.gif",onChange:B})]}),u&&i.jsxs("div",{className:"flex items-center text-red-500 text-sm gap-1 marginT5",children:[i.jsx(Kt,{className:"w-4 h-4 mr-1"}),u]}),((ce=s==null?void 0:s.style)==null?void 0:ce.attachment)&&i.jsxs("div",{className:"rsp-attached-file-block relative flex text-sm text-gray-600 bg-gray-50 p-2 rounded-md",children:[i.jsx("img",{src:$((me=s==null?void 0:s.style.attachment)==null?void 0:me.name),alt:"",style:{maxWidth:"40px",maxHeight:"40px",objectFit:"contain"}}),i.jsxs("div",{children:[i.jsx("p",{className:"ellispis",children:((Ae=s==null?void 0:s.style.attachment)==null?void 0:Ae.name)||"Default"}),i.jsx("small",{children:N(((Oe=(Ee=s==null?void 0:s.style)==null?void 0:Ee.attachment)==null?void 0:Oe.size)||0)})]}),i.jsx("button",{onClick:()=>E("attachment",null),className:"absolute right5 text-red-500 hover:text-red-600 text-sm",children:i.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"var(--th-primary-color)",children:[i.jsx("path",{d:"M5.45,21.93h13.1c.34,0,.62-.28.62-.62V6.08h2.13c.34,0,.62-.28.62-.62s-.28-.62-.62-.62h-4.89v-2.13c0-.34-.28-.62-.62-.62h-7.58c-.34,0-.62.28-.62.62v2.13H2.69c-.34,0-.62.28-.62.62s.28.62.62.62h2.13v15.23c0,.34.28.62.62.62ZM17.92,20.68H6.08V6.08h11.85v14.61ZM8.83,3.32h6.33v1.51h-6.33v-1.51Z"}),i.jsx("path",{d:"M8.21,18.42c.34,0,.62-.28.62-.62v-8.77c0-.34-.28-.62-.62-.62s-.62.28-.62.62v8.77c0,.34.28.62.62.62Z"}),i.jsx("path",{d:"M12,18.42c.34,0,.62-.28.62-.62v-8.77c0-.34-.28-.62-.62-.62s-.62.28-.62.62v8.77c0,.34.28.62.62.62Z"}),i.jsx("path",{d:"M15.79,18.42c.34,0,.62-.28.62-.62v-8.77c0-.34-.28-.62-.62-.62s-.62.28-.62.62v8.77c0,.34.28.62.62.62Z"})]})})]})]})]}),i.jsx(zn,{isOpen:C,onClose:()=>k(!1),onSelect:fe=>{E("senderLogo",fe),k(!1)}}),i.jsx(zn,{isOpen:v,onClose:()=>A(!1),onSelect:fe=>{E("promoImage",fe),A(!1)}})]})},sB=({id:e,style:t={},onUpdate:o})=>{const{rows:r,setRows:n}=Te(),[s,a]=S.useState(null),[l,d]=S.useState("bgImage");S.useEffect(()=>{if(t!=null&&t.imageBackgroundUrl){const m=new Image;m.onload=()=>{const f=m.width/m.height;a(f),!t.imageWidth&&!t.imageHeight&&u({style:{...t,imageWidth:m.width,imageHeight:m.height}})},m.src=t==null?void 0:t.imageBackgroundUrl}},[t==null?void 0:t.imageBackgroundUrl]);const c=(m,f)=>{const b=r.map(h=>h.id===e?{...h,style:{...h.style,[m]:f}}:h);n(b)},u=m=>{if(o){o(m);return}const f=r.map(b=>b.id===e?{...b,...m}:b);n(f)},p=m=>{u({style:{...t,...m}})};return i.jsxs("div",{className:"space-y-6",children:[i.jsx("div",{className:"rsp-property-elements-block",children:i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("label",{className:"rsp-properties-lable block text-md color-primary-black ",children:"Background color"}),i.jsx("div",{className:"flex flex-col space-y-2",children:i.jsx(gt,{value:(t==null?void 0:t.backgroundColor)||"transparent",onChange:m=>{c("backgroundColor",m)}})})]})}),i.jsx("div",{className:"rsp-property-elements-block hidden-del",children:i.jsx(Xc,{content:t,style:t,onContentChange:p})}),i.jsxs("div",{className:"rsp-property-elements-block flex items-center justify-between",children:[i.jsx("label",{className:"rsp-properties-lable block text-md color-primary-black",children:"Content lock"}),i.jsx(At,{id:"rowContentLock",isChecked:(t==null?void 0:t.rowContentLock)||!1,onToggle:m=>{c("rowContentLock",m)}})]}),i.jsx(ao,{label:"Padding",id:"padding-control",marginSection:!1,paddingSection:!0,padding:t.paddingControl,isLockPaddingX:!1,onChange:m=>{c("paddingControl",m)}}),i.jsxs("div",{className:"rsp-property-elements-block space-y-4 hiddens hidden",children:[i.jsx("label",{className:"rsp-properties-lable block text-md color-primary-black",children:"Padding"}),i.jsx(et,{mainClass:"button-control-view",label:"Top",leftDescription:"(px)",isShowLeftDescription:!0,onClick:()=>{},onChange:m=>c("paddingTop",m),min:0,max:99,step:5,defaultValue:(t==null?void 0:t.paddingTop)||0}),i.jsx(et,{mainClass:"button-control-view",label:"Bottom",leftDescription:"(px)",isShowLeftDescription:!0,onClick:()=>{},onChange:m=>c("paddingBottom",m),min:0,max:99,step:5,defaultValue:(t==null?void 0:t.paddingBottom)||0})]})]})},x0=({id:e,content:t,style:o={}})=>{var f;const{updateComponent:r}=Te(),n=S.useRef(null),[s,a]=S.useState(""),l=(b,h)=>{r(e,{style:{...o,[b]:h}})},d=b=>{r(e,{content:{...t,...b}})},c=()=>{const b=[...t.slides||[],{imageUrl:"",alt:"",caption:""}];d({slides:b})},u=b=>{const h=t.slides.filter((g,x)=>x!==b);d({slides:h})},p=(b,h,g)=>{const x=[...t.slides];x[b]={...x[b],[h]:g},d({slides:x})},m=async(b,h)=>{var x;const g=(x=b.target.files)==null?void 0:x[0];if(a(""),g){if(!g.type.startsWith("image/")){a("Please upload an image file");return}if(g.size>2*1024*1024){a("File size must not exceed 2MB");return}const C=new FileReader;C.onload=k=>{var v;(v=k.target)!=null&&v.result&&p(h,"imageUrl",k.target.result)},C.onerror=()=>{a("Failed to read the image file")},C.readAsDataURL(g)}};return i.jsxs("div",{className:"space-y-6",children:[i.jsxs("div",{className:"space-y-4",children:[i.jsx("h3",{className:"text-md font-regular color-primary-black",children:"Carousel Settings"}),i.jsxs("div",{children:[i.jsx("label",{className:"block text-md color-primary-black",children:"Type"}),i.jsxs("select",{value:o.type||"slides",onChange:b=>l("type",b.target.value),className:"w-full p-2 border rounded-md",children:[i.jsx("option",{value:"slides",children:"Slides"}),i.jsx("option",{value:"carousel",children:"Carousel"})]})]}),i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("label",{className:"text-sm color-secondary-black",children:"Autoplay"}),i.jsxs("div",{className:"relative inline-block w-10 mr-2 align-middle select-none",children:[i.jsx("input",{type:"checkbox",checked:o.autoplay||!1,onChange:b=>l("autoplay",b.target.checked),className:"toggle-checkbox absolute block w-6 h-6 rounded-full bg-white appearance-none cursor-pointer"}),i.jsx("label",{className:"toggle-label block overflow-hidden h-6 rounded-full bg-gray-300 cursor-pointer"})]})]}),o.autoplay&&i.jsxs("div",{children:[i.jsx("label",{className:"block text-md color-primary-black",children:"Delay (ms)"}),i.jsx("input",{type:"number",value:o.delay||3e3,onChange:b=>l("delay",parseInt(b.target.value)),className:"w-full p-2 border rounded-md",min:"1000",step:"500"})]})]}),i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{className:"flex justify-between items-center",children:[i.jsx("h3",{className:"text-md font-regular color-primary-black",children:"Slides"}),i.jsx("button",{onClick:c,className:"p-1.5 bg-primary-blue text-white rounded hover:bg-blue-600",children:i.jsx(ei,{className:"w-4 h-4"})})]}),(f=t.slides)==null?void 0:f.map((b,h)=>i.jsxs("div",{className:"p-4 border rounded-lg space-y-3",children:[i.jsxs("div",{className:"flex justify-between items-center mb-2",children:[i.jsxs("h4",{className:"text-md font-regular color-primary-black",children:["Slide ",h+1]}),i.jsx("button",{onClick:()=>u(h),className:"p-1 text-red-500 hover:text-red-600",children:i.jsx(oo,{className:"w-4 h-4"})})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block text-md color-primary-black",children:"Image"}),i.jsxs("div",{className:"space-y-2",children:[i.jsxs("button",{onClick:()=>{var g;return(g=n.current)==null?void 0:g.click()},className:"w-full flex items-center justify-center px-4 py-2 border-2 border-dashed border-gray-300 rounded-lg hover:border-gray-400",children:[i.jsx(Pd,{className:"w-5 h-5 mr-2"}),i.jsx("span",{children:"Choose Image"})]}),i.jsx("input",{ref:n,type:"file",className:"hidden",accept:"image/*",onChange:g=>m(g,h)}),s&&i.jsxs("div",{className:"flex items-center text-red-500 text-sm gap-1 marginT5",children:[i.jsx(Kt,{className:"w-4 h-4 mr-1"}),s]}),b.imageUrl&&i.jsx("img",{src:b.imageUrl,alt:"Preview",className:"w-full h-32 object-cover rounded-md"})]})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block text-md color-primary-black",children:"Alt Text"}),i.jsx("input",{type:"text",value:b.alt||"",onChange:g=>p(h,"alt",g.target.value),className:"w-full p-2 border rounded-md",placeholder:"Enter image description"})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block text-md color-primary-black",children:"Caption"}),i.jsx("input",{type:"text",value:b.caption||"",onChange:g=>p(h,"caption",g.target.value),className:"w-full p-2 border rounded-md",placeholder:"Enter slide caption"})]})]},h))]}),i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{children:[i.jsx("label",{className:"block text-md color-primary-black",children:"Caption Color"}),i.jsx("input",{type:"color",value:o.captionColor||"#FFFFFF",onChange:b=>l("captionColor",b.target.value),className:"w-full p-1 h-10 border rounded-md"})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block text-md color-primary-black",children:"Caption Font Size"}),i.jsx("input",{type:"number",value:o.captionFontSize||16,onChange:b=>l("captionFontSize",parseInt(b.target.value)),className:"w-full p-2 border rounded-md",min:"12",max:"24"})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block text-md color-primary-black",children:"Caption Font Family"}),i.jsxs("select",{value:o.captionFontFamily||"inherit",onChange:b=>l("captionFontFamily",b.target.value),className:"w-full p-2 border rounded-md",children:[i.jsx("option",{value:"inherit",children:"Default"}),i.jsx("option",{value:"Arial, sans-serif",children:"Arial"}),i.jsx("option",{value:"Georgia, serif",children:"Georgia"}),i.jsx("option",{value:"monospace",children:"Monospace"})]})]})]})]})},C0=({id:e,content:t,style:o={}})=>{var c;const{updateComponent:r}=Te(),n=(u,p)=>{r(e,{style:{...o,[u]:p}})},s=u=>{r(e,{content:{...t,...u}})},a=()=>{const u=[...t.sections||[],{title:"New Section",content:"Enter content here",expanded:!1}];s({sections:u})},l=u=>{const p=t.sections.filter((m,f)=>f!==u);s({sections:p})},d=(u,p,m)=>{const f=[...t.sections];f[u]={...f[u],[p]:m},s({sections:f})};return i.jsxs("div",{className:"space-y-6",children:[i.jsxs("div",{className:"space-y-4",children:[i.jsx("h3",{className:"text-md font-regular color-primary-black",children:"Accordion Settings"}),i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("label",{className:"text-sm color-secondary-black",children:"Expand Single Section"}),i.jsxs("div",{className:"relative inline-block w-10 mr-2 align-middle select-none",children:[i.jsx("input",{type:"checkbox",checked:o.expandSingleSection||!1,onChange:u=>n("expandSingleSection",u.target.checked),className:"toggle-checkbox absolute block w-6 h-6 rounded-full bg-white appearance-none cursor-pointer"}),i.jsx("label",{className:"toggle-label block overflow-hidden h-6 rounded-full bg-gray-300 cursor-pointer"})]})]}),i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("label",{className:"text-sm color-secondary-black",children:"Animate"}),i.jsxs("div",{className:"relative inline-block w-10 mr-2 align-middle select-none",children:[i.jsx("input",{type:"checkbox",checked:o.animate!==!1,onChange:u=>n("animate",u.target.checked),className:"toggle-checkbox absolute block w-6 h-6 rounded-full bg-white appearance-none cursor-pointer"}),i.jsx("label",{className:"toggle-label block overflow-hidden h-6 rounded-full bg-gray-300 cursor-pointer"})]})]})]}),i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{className:"flex justify-between items-center",children:[i.jsx("h3",{className:"text-md font-regular color-primary-black",children:"Sections"}),i.jsx("button",{onClick:a,className:"p-1.5 bg-primary-blue text-white rounded hover:bg-blue-600",children:i.jsx(ei,{className:"w-4 h-4"})})]}),(c=t.sections)==null?void 0:c.map((u,p)=>i.jsxs("div",{className:"p-4 border rounded-lg space-y-3",children:[i.jsxs("div",{className:"flex justify-between items-center mb-2",children:[i.jsxs("h4",{className:"text-md font-regular color-primary-black",children:["Section ",p+1]}),i.jsx("button",{onClick:()=>l(p),className:"p-1 text-red-500 hover:text-red-600",children:i.jsx(oo,{className:"w-4 h-4"})})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block text-md color-primary-black",children:"Title"}),i.jsx("input",{type:"text",value:u.title||"",onChange:m=>d(p,"title",m.target.value),className:"w-full p-2 border rounded-md",placeholder:"Enter section title"})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block text-md color-primary-black",children:"Content"}),i.jsx("textarea",{value:u.content||"",onChange:m=>d(p,"content",m.target.value),className:"w-full p-2 border rounded-md h-24 resize-vertical",placeholder:"Enter section content"})]}),i.jsxs("div",{className:"flex items-center",children:[i.jsx("input",{type:"checkbox",checked:u.expanded||!1,onChange:m=>d(p,"expanded",m.target.checked),className:"rounded text-blue-500 focus:ring-blue-500"}),i.jsx("label",{className:"ml-2 text-sm color-secondary-black",children:"Expanded by default"})]})]},p))]}),i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{children:[i.jsx("label",{className:"block text-md color-primary-black",children:"Header Background"}),i.jsx("input",{type:"color",value:o.headerBgColor||"#f3f4f6",onChange:u=>n("headerBgColor",u.target.value),className:"w-full p-1 h-10 border rounded-md"})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block text-md color-primary-black",children:"Header Text Color"}),i.jsx("input",{type:"color",value:o.headerColor||"#111827",onChange:u=>n("headerColor",u.target.value),className:"w-full p-1 h-10 border rounded-md"})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block text-md color-primary-black",children:"Header Font Size"}),i.jsx("input",{type:"number",value:o.headerFontSize||16,onChange:u=>n("headerFontSize",parseInt(u.target.value)),className:"w-full p-2 border rounded-md",min:"12",max:"24"})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block text-md color-primary-black",children:"Content Background"}),i.jsx("input",{type:"color",value:o.contentBgColor||"#ffffff",onChange:u=>n("contentBgColor",u.target.value),className:"w-full p-1 h-10 border rounded-md"})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block text-md color-primary-black",children:"Content Text Color"}),i.jsx("input",{type:"color",value:o.contentColor||"#374151",onChange:u=>n("contentColor",u.target.value),className:"w-full p-1 h-10 border rounded-md"})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block text-md color-primary-black",children:"Content Font Size"}),i.jsx("input",{type:"number",value:o.contentFontSize||14,onChange:u=>n("contentFontSize",parseInt(u.target.value)),className:"w-full p-2 border rounded-md",min:"12",max:"20"})]})]})]})},v0=({id:e,content:t,style:o={}})=>{var c;const{updateComponent:r}=Te(),n=(u,p)=>{r(e,{style:{...o,[u]:p}})},s=u=>{r(e,{content:{...t,...u}})},a=()=>{const u={id:`field_${Date.now()}`,type:"text",label:"New Field",name:"",placeholder:"",required:!1,validations:[]};s({fields:[...t.fields||[],u]})},l=u=>{const p=t.fields.filter((m,f)=>f!==u);s({fields:p})},d=(u,p)=>{const m=[...t.fields];m[u]={...m[u],...p},s({fields:m})};return i.jsxs("div",{className:"space-y-6",children:[i.jsxs("div",{className:"space-y-4",children:[i.jsx("h3",{className:"text-md font-regular color-primary-black",children:"Form Settings"}),i.jsxs("div",{children:[i.jsx("label",{className:"block text-md color-primary-black mb-1",children:"Action URL"}),i.jsx("input",{type:"url",value:t.actionUrl||"",onChange:u=>s({actionUrl:u.target.value}),className:"w-full p-2 border rounded-md",placeholder:"https://example.com/submit"})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block text-md color-primary-black mb-1",children:"Success Message"}),i.jsx("input",{type:"text",value:t.successMessage||"",onChange:u=>s({successMessage:u.target.value}),className:"w-full p-2 border rounded-md",placeholder:"Form submitted successfully!"})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block text-md color-primary-black mb-1",children:"Error Message"}),i.jsx("input",{type:"text",value:t.errorMessage||"",onChange:u=>s({errorMessage:u.target.value}),className:"w-full p-2 border rounded-md",placeholder:"Error submitting form. Please try again."})]})]}),i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{className:"flex justify-between items-center",children:[i.jsx("h3",{className:"text-md font-regular color-primary-black",children:"Form Fields"}),i.jsx("button",{onClick:a,className:"p-1.5 bg-primary-blue text-white rounded hover:bg-blue-600",children:i.jsx(ei,{className:"w-4 h-4"})})]}),(c=t.fields)==null?void 0:c.map((u,p)=>{var m;return i.jsxs("div",{className:"p-4 border rounded-lg space-y-3",children:[i.jsxs("div",{className:"flex justify-between items-center",children:[i.jsx("h4",{className:"text-md font-regular color-primary-black",children:u.label}),i.jsx("button",{onClick:()=>l(p),className:"p-1 text-red-500 hover:text-red-600",children:i.jsx(oo,{className:"w-4 h-4"})})]}),i.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[i.jsxs("div",{children:[i.jsx("label",{className:"block text-md color-primary-black",children:"Field Type"}),i.jsxs("select",{value:u.type,onChange:f=>d(p,{type:f.target.value}),className:"w-full p-2 border rounded-md",children:[i.jsx("option",{value:"text",children:"Text"}),i.jsx("option",{value:"email",children:"Email"}),i.jsx("option",{value:"tel",children:"Phone"}),i.jsx("option",{value:"number",children:"Number"}),i.jsx("option",{value:"textarea",children:"Text Area"}),i.jsx("option",{value:"select",children:"Select"}),i.jsx("option",{value:"checkbox",children:"Checkbox"})]})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block text-md color-primary-black",children:"Field Name"}),i.jsx("input",{type:"text",value:u.name,onChange:f=>d(p,{name:f.target.value}),className:"w-full p-2 border rounded-md",placeholder:"field_name"})]})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block text-md color-primary-black",children:"Label"}),i.jsx("input",{type:"text",value:u.label,onChange:f=>d(p,{label:f.target.value}),className:"w-full p-2 border rounded-md",placeholder:"Enter field label"})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block text-md color-primary-black",children:"Placeholder"}),i.jsx("input",{type:"text",value:u.placeholder,onChange:f=>d(p,{placeholder:f.target.value}),className:"w-full p-2 border rounded-md",placeholder:"Enter placeholder text"})]}),u.type==="select"&&i.jsxs("div",{children:[i.jsx("label",{className:"block text-md color-primary-black",children:"Options (one per line)"}),i.jsx("textarea",{value:((m=u.options)==null?void 0:m.join(`
5017
+ ${u?"rs-popover-enabled":""}`,children:[$&&m&&i.jsx("div",{className:"validation-message",children:$}),i.jsx("div",{className:"radio-wrapper",children:i.jsxs("label",{htmlFor:n,className:B?"mr0":"",children:[i.jsx("input",{type:e,id:n,name:r,onChange:F,value:O,checked:q,className:`radio ${t}`,disabled:k}),i.jsxs("span",{className:`${t} ${E?"align-items-center d-flex position-relative top-15":""} lbl ${k?"color-secondary-grey":""}`,children:[v&&i.jsx("i",{className:l}),f&&w?i.jsxs(i.Fragment,{children:[i.jsx("i",{className:"d-none",children:O==null?void 0:O.slice(0,j)}),E&&i.jsx(Ie,{text:O.slice(j),children:i.jsx("span",{children:K(O.slice(j),25)})})]}):i.jsx("span",{className:`${B?"d-none":""}`,children:a}),A&&A]}),d]})})]})},s0=S.memo(_N),RN=S.memo(({isOpen:e,onClose:t,component:o})=>{var j,B,$,_,z;const[r,n]=S.useState(null),[s,a]=S.useState(null),[l,d]=S.useState(0),[c,u]=S.useState("common"),{pConfig:p,selectedComponent:m,components:f}=Te(),{blockComponents:b}=Ye(),h=S.useRef(!1),g=S.useRef(null),x=N=>N&&typeof N=="object"&&N.offerId&&N.offerName&&typeof N.offerId=="number"&&typeof N.offerName=="string",C=N=>N&&typeof N=="object"&&N.offerTypeId&&N.friendlyName&&typeof N.offerTypeId=="number"&&typeof N.friendlyName=="string",k=N=>{const{selectedComponent:O}=Te.getState(),{updateComponent:K}=Te.getState(),{updateBlockComponent:F}=Ye.getState();if(!O)return;const q=document.querySelector(`[data-component-id="${O}"]`),R=q==null?void 0:q.getAttribute("data-parent-id"),M=q==null?void 0:q.getAttribute("data-column-index");let L=null,U={};if(R&&M){const Y=`${R}-${M}`;L=(b[Y]||[]).find(ie=>ie.id===O),U=(L==null?void 0:L.content)||{}}else L=f.find(Y=>Y.id===O),U=(L==null?void 0:L.content)||{};const ee={content:{buttonText:"Offer Code",...U,...N}};R&&M?F(R,O,ee):K(O,ee)},v=N=>{const{selectedComponent:O}=Te.getState(),{updateComponent:K}=Te.getState(),{updateBlockComponent:F}=Ye.getState();if(!O)return;const q=document.querySelector(`[data-component-id="${O}"]`),R=q==null?void 0:q.getAttribute("data-parent-id"),M=q==null?void 0:q.getAttribute("data-column-index");let L=null,U={};if(R&&M){const Y=`${R}-${M}`;L=(b[Y]||[]).find(ie=>ie.id===O),U=(L==null?void 0:L.content)||{}}else L=f.find(Y=>Y.id===O),U=(L==null?void 0:L.content)||{};const ee={content:{buttonText:"Offer Code",...U,...N}};R&&M?F(R,O,ee):K(O,ee)},A=()=>{if(!g.current)return;const{selectedComponent:N}=Te.getState(),{updateComponent:O}=Te.getState(),{updateBlockComponent:K}=Ye.getState();if(!N)return;const F=document.querySelector(`[data-component-id="${N}"]`),q=F==null?void 0:F.getAttribute("data-parent-id"),R=F==null?void 0:F.getAttribute("data-column-index");let M=null,L={};if(q&&R){const ne=`${q}-${R}`;M=(b[ne]||[]).find(oe=>oe.id===N),L=(M==null?void 0:M.content)||{}}else M=f.find(ne=>ne.id===N),L=(M==null?void 0:M.content)||{};const{offerType:U,offer:ee,codeType:Y,offerListCountData:te,...ie}=L,ue={content:{buttonText:"Offer Code",...ie,...g.current}};q&&R?K(q,N,ue):O(N,ue)};if(S.useEffect(()=>{var N,O,K,F;if(e){h.current=!1;let q=null;if(m&&(q=f.find(Y=>Y.id===m),!q)){const Y=document.querySelector(`[data-component-id="${m}"]`),te=Y==null?void 0:Y.getAttribute("data-parent-id"),ie=Y==null?void 0:Y.getAttribute("data-column-index");if(te&&ie){const ue=`${te}-${ie}`;q=(b[ue]||[]).find(ae=>ae.id===m)}}const R=q||o,M=(N=R==null?void 0:R.content)==null?void 0:N.offerType,L=((O=R==null?void 0:R.content)==null?void 0:O.codeType)??"common",U=(K=R==null?void 0:R.content)==null?void 0:K.offer,ee=((F=R==null?void 0:R.content)==null?void 0:F.offerListCountData)??0;g.current={offerType:M,offer:U,codeType:L,offerListCountData:ee},n(M??null),u(L),d(ee),x(U)?a(U):a(null),C(M)?n(M):n(null),M&&(p!=null&&p.offerCallback)&&!h.current&&(p.offerCallback(2,{...M,codeType:L}),h.current=!0,x(U)&&setTimeout(async()=>{const Y=await p.offerCallback(3,{...U,codeType:L});Y!=null&&Y.status&&(Y!=null&&Y.data)&&d(Y.data)},100))}},[e,m]),S.useEffect(()=>{e||(h.current=!1)},[e]),S.useEffect(()=>{e||(n(null),a(null),d(0),u("common"),g.current=null)},[e]),!e)return null;const w=()=>{const N=C(r),O=x(s);if(!N||!O){console.error("handleSubmit - invalid data detected:",{offerType:r,offer:s,isValidOfferType:N,isValidOffer:O});return}v({offerType:r,offer:s,codeType:c,offerListCountData:l}),p==null||p.offerCallback(4,{selectedOfferType:r,selectedOffer:s,codeType:c}),t()},y=()=>{A(),t()},E=N=>{u(N),n(null),a(null),d(0),k({codeType:N,offerType:null,offer:null,offerListCountData:0}),p==null||p.offerCallback(1,N)};return i.jsx(i.Fragment,{children:kt.createPortal(i.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50",children:i.jsx("div",{id:"rsp-modal-backdrop",className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:i.jsxs("div",{className:"rsp-modal bg-white rounded-lg w-full max-w-[500px]",children:[i.jsxs("div",{className:"rsp-modal-header",children:[i.jsx("div",{className:"flex items-center space-x-1",children:i.jsx("h2",{className:"modal-title",children:"Select offer"})}),i.jsx(Pt,{className:"icon-md",color:"color-primary-blue",innerCloseContent:!1,handleClose:y})]}),i.jsxs("div",{className:"rsp-modal-body",children:[i.jsxs("div",{className:"form-group marginB41",children:[i.jsx("label",{className:"rsp-properties-lable marginB25 block fs19 color-primary-black",children:"Offer code type"}),i.jsxs("div",{className:"flex space-x-4",children:[i.jsx(s0,{name:"codeType",labelName:"common",value:c,onValueChange:E,className:"w-4 h-4 color-primary-black capitalize"}),i.jsx(s0,{name:"codeType",labelName:"unique",value:c,onValueChange:E,className:"w-4 h-4 color-primary-black capitalize"})]})]}),i.jsx(BN,{selectedType:r,onSelect:N=>{n(N),(r==null?void 0:r.offerTypeId)!==(N==null?void 0:N.offerTypeId)?(a(null),d(0),k({offerType:N,offer:null,offerListCountData:0})):k({offerType:N})},codeType:c}),i.jsx(SN,{selectedOffer:s,onSelect:N=>{if(N&&x(N)){a(N);const O={offerId:N.offerId,offerName:N.offerName};v({offer:O})}else a(null),v({offer:null})},component:o,setOfferListCountData:d,codeType:c}),((B=(j=p==null?void 0:p.offerData)==null?void 0:j.offerTypeData)==null?void 0:B.length)>0&&((_=($=p==null?void 0:p.offerData)==null?void 0:$.offerListData)==null?void 0:_.length)>0&&l>0&&i.jsx("p",{className:"padding0 color-primary-grey text-sm marginT-15",children:`${l||((z=p==null?void 0:p.offerData)==null?void 0:z.offerListCountData)} offer is available`})]}),i.jsxs("div",{className:"rsp-modal-footer flex justify-end",children:[i.jsx("button",{onClick:y,className:"rsp-button-secondary",children:"Cancel"}),i.jsx("button",{onClick:w,disabled:!r||!s,className:"rsp-button-primary disabled:opacity-50 disabled:cursor-not-allowed",children:"Save"})]})]})})}),document.body)})}),IN=({selectedType:e,onTypeChange:t,onSelectOffer:o,component:r})=>{const{isOpen:n,openModal:s,closeModal:a,selectOffer:l}=NN();return i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"rsp-property-elements-block flex items-center justify-between marginT10",children:[i.jsx("label",{className:"rsp-properties-lable block text-md color-primary-black",children:"Offer type"}),i.jsx("button",{onClick:s,className:"rsp-offer-button px-4 py-2 bg-[var(--th-primary-color)] text-white text-sm rounded-lg hover:bg-[var(--th-primary-color)] transition-colors",children:"Select Offer"})]}),i.jsx(RN,{isOpen:n,onClose:a,onSelect:l,component:r})]})},LN=({label:e,description:t,id:o,value:r,onChange:n,min:s,max:a,step:l})=>{const d=c=>{var m;let u=parseFloat(c.target.value);isNaN(u)&&(u=0);const p=l?((m=l.toString().split(".")[1])==null?void 0:m.length)||0:10;u=parseFloat(u.toFixed(p)),l&&(s!==void 0?u=Math.round((u-s)/l)*l+s:u=Math.round(u/l)*l),u=parseFloat(u.toFixed(p)),s!==void 0&&(u=Math.max(u,s)),a!==void 0&&(u=Math.min(u,a)),u=parseFloat(u.toFixed(p)),n(u)};return i.jsxs("div",{className:"flex items-center justify-between",children:[e&&i.jsxs("label",{htmlFor:o,className:"rsp-properties-lable block text-md color-primary-black",children:[e,t&&i.jsxs("span",{className:"text-xs text-gray-500",children:[" - (",t,")"]})]}),i.jsx("input",{id:o,type:"number",value:r,onChange:d,className:"w-20 p-2 border rounded",min:s,max:a,step:l})]})},$N=({style:e,onStyleChange:t})=>{const o=[{value:"none",label:"None"},{value:"uppercase",label:"Uppercase"},{value:"lowercase",label:"Lowercase"},{value:"capitalize",label:"Capitalize"}];(d=>o.some(c=>c.value===d))(e.textTransform)&&e.textTransform;function n(d,c){const u=d*Math.pow(10,c+1),p=Math.floor(u/10);return u>=p*10+5?(p+1)/Math.pow(10,c):p/Math.pow(10,c)}const s=[{label:"Standard Fonts",options:_t.standard},{label:"Non standard Fonts",options:_t.decorative}],a=()=>{const d=(e==null?void 0:e.paddingControl)||{};return d.isCustomPadding?d.left||d.right||0:d.all||0},l=()=>{var d;return((d=e==null?void 0:e.paddingControl)==null?void 0:d.btnspanheight)??5};return i.jsxs("div",{className:"space-y-6",children:[i.jsx("div",{className:"rsp-property-elements-block hidden",children:i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("label",{className:"rsp-properties-lable block text-md color-primary-black",children:"Button color"}),i.jsx("div",{className:"flex flex-col space-y-2",children:i.jsx(gt,{value:(e==null?void 0:e.buttonColor)||"#ffffff",onChange:d=>{t("buttonColor",d)}})})]})}),i.jsx("div",{className:"rsp-property-elements-block",children:i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("label",{className:"rsp-properties-lable block text-md color-primary-black",children:"Full width"}),i.jsx(At,{id:"buttonFullWidth",isChecked:(e==null?void 0:e.buttonFullWidth)||!1,onToggle:d=>{const c=(e==null?void 0:e.paddingControl)||{},u=13,p={...c,left:u,right:u,isCustomPadding:!0};t("actionUpdates",{buttonFullWidth:d,paddingControl:p})}})]})}),!(e!=null&&e.buttonFullWidth)&&i.jsx("div",{className:"rsp-property-elements-block",children:i.jsxs("div",{className:"rsp-select-dropdown flex items-center justify-between",children:[i.jsx("label",{className:"rsp-properties-lable block text-md color-primary-black",children:"Align"}),i.jsxs("div",{className:"flex items-center gap-1",children:[i.jsx(Ie,{text:"Left",position:"top",className:"line-block",children:i.jsx("button",{onClick:()=>t("textAlign","left"),className:`p-1.5 rounded ${e.textAlign==="left"?"bg-primary-blue text-white":"bg-tertiary-blue color-primary-black"}`,children:i.jsx(_o,{className:"w-4 h-4"})})}),i.jsx(Ie,{text:"Center",position:"top",className:"line-block",children:i.jsx("button",{onClick:()=>t("textAlign","center"),className:`p-1.5 rounded ${e.textAlign==="center"?"bg-primary-blue text-white":"bg-tertiary-blue color-primary-black"}`,children:i.jsx(Xo,{className:"w-4 h-4"})})}),i.jsx(Ie,{text:"Right",position:"top",className:"line-block",children:i.jsx("button",{onClick:()=>t("textAlign","right"),className:`p-1.5 rounded ${e.textAlign==="right"?"bg-primary-blue text-white":"bg-tertiary-blue color-primary-black"}`,children:i.jsx(Ro,{className:"w-4 h-4"})})})]})]})}),i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("label",{className:"rsp-properties-lable block text-md color-primary-black",children:"Text color"}),i.jsx("div",{className:"flex flex-col space-y-2",children:i.jsx(gt,{alpha:!1,value:(e==null?void 0:e.buttonTextColor)||"#ffffff",onChange:d=>{t("buttonTextColor",d)}})})]}),i.jsx(Tt,{label:"Font family",width:"width170",value:e.fontFamily||"Arial, sans-serif",options:s,onChange:d=>t("fontFamily",d),previewFont:!0,isGrouped:!0}),i.jsxs("div",{className:"rsp-button-text flex items-center justify-between hidden",children:[i.jsx("label",{className:"rsp-properties-lable block text-md color-primary-black",children:"Font family"}),i.jsxs("select",{value:e.fontFamily||"Arial, sans-serif",onChange:d=>t("fontFamily",d.target.value),className:"ai-email-input-field height33",children:[_t.standard.map(d=>i.jsx("option",{value:d.value,style:{fontFamily:d.value},children:d.label},d.value)),_t.decorative.map(d=>i.jsx("option",{value:d.value,style:{fontFamily:d.value},children:d.label},d.value))]})]}),i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("label",{className:"rsp-properties-lable block text-md color-primary-black",children:"Font size"}),i.jsx(et,{label:"",mainClass:"button-control-view",onClick:()=>{},onChange:d=>t("fontSize",d),min:16,max:72,step:1,defaultValue:e.fontSize||16})]}),i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("label",{className:"rsp-properties-lable block text-md color-primary-black",children:"Text style"}),i.jsxs("div",{className:"flex gap-2",children:[i.jsx(Ie,{text:"Bold",position:"top",className:"line-block",children:i.jsx("button",{onClick:()=>t("bold",!e.bold),className:`p-2 rounded ${e.bold?"bg-primary-blue text-white":"bg-tertiary-blue color-primary-black"}`,children:i.jsx(Ko,{className:"w-4 h-4"})})}),i.jsx(Ie,{text:"Italic",position:"top",className:"line-block",children:i.jsx("button",{onClick:()=>t("italic",!e.italic),className:`p-2 rounded ${e.italic?"bg-primary-blue text-white":"bg-tertiary-blue color-primary-black"}`,children:i.jsx(Yo,{className:"w-4 h-4"})})}),i.jsx(Ie,{text:"Underline",position:"left",className:"line-block",children:i.jsx("button",{onClick:()=>t("underline",!e.underline),className:`p-2 rounded ${e.underline?"bg-primary-blue text-white":"bg-tertiary-blue color-primary-black"}`,children:i.jsx(Jo,{className:"w-4 h-4"})})})]})]}),i.jsx(Tt,{label:"Text transform",width:"width130",value:e.textTransform||"None",options:li,onChange:d=>t("textTransform",d)}),i.jsx("div",{className:"rsp-select-dropdown flex items-center justify-between"}),i.jsxs("div",{className:"space-y-4 hidden",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("label",{className:"rsp-properties-lable block text-md color-primary-black",children:"Auto line height"}),i.jsx(At,{id:"autoLineHeightEnabled",isChecked:(e==null?void 0:e.autoLineHeightEnabled)||!1,onToggle:d=>{t("autoLineHeightEnabled",d)}})]}),!(e!=null&&e.autoLineHeightEnabled)&&i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("label",{className:"rsp-properties-lable block text-md color-primary-black",children:"Line height"}),i.jsx(LN,{label:"",id:"radius-top-right",value:e.lineHeight||1.5,min:1.2,max:1.5,step:.1,onChange:d=>{t("lineHeight",d)}})]})]}),i.jsxs("div",{className:"rsp-property-elements-block",children:[i.jsx(et,{label:"Letter spacing",mainClass:"button-control-view marginB20",id:"letter-spacing",onClick:()=>{},onChange:d=>t("letterSpacing",n(d,1)),min:-1,max:5,step:.5,defaultValue:e.letterSpacing||0}),i.jsxs("div",{className:"space-y-6",children:[!(e!=null&&e.buttonFullWidth)&&i.jsx("div",{children:i.jsx(et,{actionButton:!0,label:"Width",mainClass:"button-control-view",isShowLeftDescription:!0,leftDescription:"Padding (left & right)",buttonClass:"",labelClass:"",onClick:()=>{},onChange:d=>{const u={...(e==null?void 0:e.paddingControl)||{},left:d,right:d,isCustomPadding:!0};t("paddingControl",u)},min:0,max:100,step:5,defaultValue:a()},`padding-lr-${a()}`)}),i.jsx("div",{children:i.jsx(et,{actionButton:!0,label:"Height",mainClass:"button-control-view",isShowLeftDescription:!0,leftDescription:"(px)",buttonClass:"",labelClass:"",onClick:()=>{},onChange:d=>{const u={...(e==null?void 0:e.paddingControl)||{},btnspanheight:d};t("paddingControl",u)},min:5,max:100,step:5,defaultValue:l()},`line-height-${l()}`)})]})]}),i.jsx(Jc,{id:"button-border-control",style:e,onStyleChange:(d,c)=>{t(d,c)}}),i.jsx("div",{className:"rsp-property-elements-block",children:i.jsx(Tr,{id:"button-border-radius-control",borderRadius:e.buttonRadiusControl,onChange:d=>{t("buttonRadiusControl",d)}})}),i.jsx("div",{children:i.jsx(ao,{label:"Margin and Padding",id:"button-padding-control",marginSection:!0,paddingSection:!0,margin:e.containerPadding,padding:{...e.paddingControl,isPaddingEnabled:!1},onChange:(d,c)=>{d&&t("containerPadding",d)}})})]})},MN=({content:e,style:t,onStyleChange:o,onContentChange:r,component:n,handleSelectOffer:s,handleImageUrl:a})=>{const[l,d]=S.useState((t==null?void 0:t.showIcon)||!1),[c,u]=S.useState("");return S.useEffect(()=>{d((t==null?void 0:t.showIcon)||!1)},[t==null?void 0:t.showIcon]),i.jsxs("div",{className:"space-y-6",children:[i.jsx(IN,{selectedType:t.offerType||"code",onTypeChange:p=>o("offerType",p),onSelectOffer:s,component:n}),i.jsx("div",{children:i.jsxs("div",{className:"rsp-property-elements-block flex items-center justify-between",children:[i.jsx("label",{className:"rsp-properties-lable block text-md color-primary-black",children:"Container background"}),i.jsx("div",{className:"flex flex-col space-y-2",children:i.jsx(gt,{value:(t==null?void 0:t.containerBackgroundColor)||"#ffffff",onChange:p=>{o("containerBackgroundColor",p)}})})]})}),i.jsx("div",{className:"rsp-property-elements-block",children:i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("label",{className:"rsp-properties-lable block text-md color-primary-black",children:"Button background"}),i.jsx("div",{className:"flex flex-col space-y-2",children:i.jsx(gt,{value:(t==null?void 0:t.buttonColor)||"#ffffff",onChange:p=>{o("buttonColor",p)}})})]})}),i.jsxs("div",{className:"rsp-property-elements-block space-y-6",children:[i.jsxs("div",{className:"space-y-6",children:[i.jsxs("div",{className:"rsp-property-elements-block flex items-center justify-between",children:[i.jsx("label",{className:"rsp-properties-lable block text-md color-primary-black",children:"Button icon"}),i.jsx(At,{id:"showIcon",isChecked:l,onToggle:p=>{d(p),p?o("showIcon",p):o("actionUpdates",{showIcon:p,iconUrl:""})}})]}),l&&i.jsxs(i.Fragment,{children:[i.jsx(us,{content:e,style:t,onContentChange:a}),i.jsx("div",{className:"marginT30 marginB25",children:i.jsx("div",{className:"flex items-center gap-1",children:i.jsx(jt,{placeholder:"Alternative Text",defaultValue:"Banking",value:(t==null?void 0:t.iconAltText)||"",required:!0,onChange:p=>{o("iconAltText",p),u(p)}})})})]}),l&&i.jsx("div",{className:"mt20 space-y-6",children:i.jsx(Yc,{style:t,onStyleChange:o})})]}),i.jsx($N,{style:t,onStyleChange:o})]}),i.jsx("div",{className:"space-y-6"})]})},FN=({style:e,onStyleChange:t})=>{const{offerSnippets:o,pConfig:r}=Te(),n=S.useMemo(()=>!o||o.length===0?[]:o.map(s=>{let a="regular",l=null;try{s.jsonContent&&(l=JSON.parse(s.jsonContent),a=l.type||"regular")}catch{}return{...s,parsedType:a,parsedJsonContent:l}}).filter(s=>{var a,l;return((a=s.parsedType)==null?void 0:a.toLowerCase())==="row"||((l=s.parsedType)==null?void 0:l.toLowerCase())==="block"}),[o]);return i.jsx("div",{className:"offer-property offer-snippet-list",children:n.length>0?i.jsx("div",{className:"space-y-2",children:n.map(s=>i.jsx(aa,{snippet:s},s.snippetID))}):i.jsx("div",{className:"no-data-snippet",children:i.jsx("p",{className:"text-center",children:r!=null&&r.offersnippetData?"No offer snippets available":"Offer snippets not configured"})})})},a0=({id:e,content:t,style:o={},onUpdate:r,component:n})=>{const[s,a]=S.useState("content"),{updateComponent:l}=Te(),{updateBlockComponent:d}=Ye(),c=h=>{if(r){r(h);return}const g=document.querySelector(`[data-component-id="${e}"]`),x=g==null?void 0:g.getAttribute("data-parent-id"),C=g==null?void 0:g.getAttribute("data-column-index");x&&C?d(x,e,h):l(e,h)},u=(h,g)=>{c({content:{...t,[h]:g}})},p=(h,g)=>{var j,B,$,_;const x=document.querySelector(`[data-component-id="${e}"]`),C=x==null?void 0:x.getAttribute("data-parent-id"),k=x==null?void 0:x.getAttribute("data-column-index");let v=null;if(C&&k){const{getBlockComponents:z}=Ye.getState();v=z(C,parseInt(k)).find(O=>O.id===e)||null}else{const{getComponentForRender:z}=Te.getState();v=z(e)}const A=(j=v==null?void 0:v.contentTarget)==null?void 0:j.hasTargeting,w=((B=v==null?void 0:v.contentTarget)==null?void 0:B.activeTargetTabIndex)??0,y=(_=($=v==null?void 0:v.contentTarget)==null?void 0:$.targetGroups)==null?void 0:_[w],E=A&&(y!=null&&y.style)?y.style:(v==null?void 0:v.style)||o;c(h==="actionUpdates"?{style:{...E,...g}}:{style:{...E,[h]:g}})},m=()=>{},f=h=>{(h==null?void 0:h.imageUrl)!==void 0&&p("iconUrl",h.imageUrl),(h==null?void 0:h.imageAlt)!==void 0&&p("iconAltText",h.imageAlt)},b=()=>{switch(s){case"content":return i.jsx(MN,{content:t,style:o,onContentChange:u,onStyleChange:p,component:n,handleSelectOffer:m,handleImageUrl:f});case"templates":return i.jsx(FN,{style:o,onStyleChange:p});default:return null}};return i.jsxs("div",{className:"space-y-6",children:[i.jsx(TN,{activeTab:s,onTabChange:a}),b()]})},DN=({style:e,formatState:t,hasTextSelection:o=!1,onStyleChange:r,onFontFamilyDropdownOpen:n})=>{const s=[{label:"Standard Fonts",options:_t.standard},{label:"Non standard Fonts",options:_t.decorative}];return i.jsxs("div",{className:"space-y-4",children:[i.jsx("div",{className:"rsp-property-elements-block",children:i.jsx(et,{mainClass:"button-control-view",label:"Cell padding",onClick:()=>{},onChange:a=>{let l=a||8;l=Math.min(24,Math.max(2,l)),r("cellPadding",l)},min:2,max:24,step:1,defaultValue:e.cellPadding||8})}),i.jsxs("div",{className:"rsp-property-elements-block flex items-center justify-between hidden",children:[i.jsx("label",{className:"rsp-properties-lable block text-md color-primary-black",children:"Cell padding"}),i.jsx("input",{type:"number",value:e.cellPadding||8,onChange:a=>{let l=parseInt(a.target.value)||8;l=Math.min(24,Math.max(2,l)),r("cellPadding",l)},onInput:a=>{a.currentTarget.value=a.currentTarget.value.replace(/^0+/,"")},className:"w-28 p-2 border rounded-md",min:"2",max:"24"})]}),i.jsxs("div",{className:"rsp-property-elements-block rsp-select-dropdown flex items-center justify-between",children:[i.jsx("label",{className:"rsp-properties-lable block text-md color-primary-black",children:"Align"}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(Ie,{text:"Left",position:"top",className:"line-block",children:i.jsx("button",{onClick:()=>r("textAlign","left"),className:`p-1.5 rounded ${e.textAlign==="left"?"bg-primary-blue text-white":"bg-tertiary-blue color-primary-black"}`,children:i.jsx(_o,{className:"w-4 h-4"})})}),i.jsx(Ie,{text:"Center",position:"top",className:"line-block",children:i.jsx("button",{onClick:()=>r("textAlign","center"),className:`p-1.5 rounded ${e.textAlign==="center"?"bg-primary-blue text-white":"bg-tertiary-blue color-primary-black"}`,children:i.jsx(Xo,{className:"w-4 h-4"})})}),i.jsx(Ie,{text:"Right",position:"top",className:"line-block",children:i.jsx("button",{onClick:()=>r("textAlign","right"),className:`p-1.5 rounded ${e.textAlign==="right"?"bg-primary-blue text-white":"bg-tertiary-blue color-primary-black"}`,children:i.jsx(Ro,{className:"w-4 h-4"})})})]})]}),i.jsxs("div",{className:"rsp-property-elements-block flex items-center justify-between",children:[i.jsx("label",{className:"rsp-properties-lable block text-md color-primary-black",children:"Container background"}),i.jsx("div",{className:"flex flex-col space-y-2",children:i.jsx(gt,{value:(e==null?void 0:e.containerBackgroundColor)||"transparent",onChange:a=>{r("containerBackgroundColor",a)}})})]}),i.jsx(Tt,{className:"marginB20",label:"Font family",width:"width170",value:o&&(t!=null&&t.fontFamily)?t.fontFamily:e.fontFamily||"Arial, sans-serif",options:s,onChange:a=>r("fontFamily",a),onMouseDown:()=>{n==null||n()},previewFont:!0,isGrouped:!0}),i.jsxs("div",{className:"rsp-property-elements-block flex items-center justify-between",children:[i.jsx("label",{className:"rsp-properties-lable block text-md color-primary-black",children:"Font size"}),i.jsx(et,{label:"",mainClass:"button-control-view",onClick:()=>{},onChange:a=>r("fontSize",a),min:16,max:72,step:1,defaultValue:e.fontSize||16})]}),i.jsxs("div",{className:"rsp-property-elements-block flex items-center justify-between",children:[i.jsx("label",{className:"rsp-properties-lable block text-md color-primary-black",children:"Text color"}),i.jsx("div",{className:"flex flex-col space-y-2",children:i.jsx(gt,{alpha:!1,value:(e==null?void 0:e.textColor)||"#ffffff",onChange:a=>{r("textColor",a)}})})]}),i.jsxs("div",{className:"rsp-property-elements-block flex items-center justify-between",children:[i.jsx("label",{className:"rsp-properties-lable block text-md color-primary-black",children:"Text style"}),i.jsxs("div",{className:"flex gap-2",children:[i.jsx(Ie,{text:"Bold",position:"top",className:"line-block",children:i.jsx("button",{onClick:()=>r("bold",!e.bold),className:`p-2 rounded ${e.bold?"bg-primary-blue text-white":"bg-tertiary-blue color-primary-black"}`,children:i.jsx(Ko,{className:"w-4 h-4"})})}),i.jsx(Ie,{text:"Italic",position:"top",className:"line-block",children:i.jsx("button",{onClick:()=>r("italic",!e.italic),className:`p-2 rounded ${e.italic?"bg-primary-blue text-white":"bg-tertiary-blue color-primary-black"}`,children:i.jsx(Yo,{className:"w-4 h-4"})})}),i.jsx(Ie,{text:"Underline",position:"left",className:"line-block",children:i.jsx("button",{onClick:()=>r("underline",!e.underline),className:`p-2 rounded ${e.underline?"bg-primary-blue text-white":"bg-tertiary-blue color-primary-black"}`,children:i.jsx(Jo,{className:"w-4 h-4"})})})]})]}),i.jsx(dt,{label:"Border",style:{width:(e==null?void 0:e.borderWidth)||1,style:(e==null?void 0:e.borderStyle)||"solid",color:(e==null?void 0:e.borderColor)||"#E5E7EB",min:1},onStyleChange:(a,l)=>{switch(a){case"width":r("borderWidth",l);break;case"style":r("borderStyle",l);break;case"color":r("borderColor",l);break}}})]})},PN={plain:{"style-01":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAApAQMAAABawnhjAAAAAXNSR0IB2cksfwAAAAZQTFRFAAAA////pdmf3QAAACFJREFUeNpjgIH693//7//+DyedkMPbuMGMDV18VD8EAABYFMLjGS3ZgAAAAABJRU5ErkJggg==","style-02":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAApCAAAAABFZ7X8AAAAAXNSR0IB2cksfwAAADNJREFUeNpj2E8mYNj/Hw5IYQ41jQxgAOQQzRwYp47G42g8jsbjaDyOxuNoPI7GI/XiEQBoadGIwOs/+QAAAABJRU5ErkJggg==","style-03":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAApCAAAAABFZ7X8AAAAAXNSR0IB2cksfwAAAEJJREFUeNpj2E8mYNj/Hw5IYQ41jQxgAOQQzRwYp5Ifj5/ggBTmUNMIiRsgh2jmwDh1ND+O5sfR/DiaH0fz4+DIjwBZwrEIIFAx9gAAAABJRU5ErkJggg==","style-04":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAApAgMAAAAdYgKzAAAAAXNSR0IB2cksfwAAAAlQTFRF////f39/AAAAzPvRnQAAACNJREFUeNpjEA1FBgwUgVULmFY1cK1i0FoBZBJQO2rvSLIXAMaWNMMO+RuaAAAAAElFTkSuQmCC","style-05":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAApCAAAAABFZ7X8AAAAAXNSR0IB2cksfwAAAFNJREFUeNrtlTEOACAIA/vz/rkfwMQFJ4MMEiM3dWnSgQuwJPiliIkdxJqpzAGTQ8V5rYiJRI/ax5qpC7Q4nxTdMYZ9rJiaPoD2sX1sH2NTbzzWAUtWCQEZ+rfCAAAAAElFTkSuQmCC","style-06":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAApCAAAAABFZ7X8AAAAAXNSR0IB2cksfwAAADdJREFUeNpj+E8mYBgpGhnA4D8JzIFx6ifywIjRCIkbIINo5oA4dTQ/jubH0fw4mh9H8+Pg8CMAfh0wc+8qMBsAAAAASUVORK5CYII=","style-07":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAApCAAAAABFZ7X8AAAAAXNSR0IB2cksfwAAAE9JREFUeNpj+E8mYBgpGhnA4D8JzIFxaj15AMXG+k/Eg6GkERE3YI0QJlACP3Pg/UhCAhgpGhHxSEJ+pL9TyU4Ao/lxND+O5kfinEqPihUADt4QxnHQ91wAAAAASUVORK5CYII="},grid:{"style-01":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAApCAAAAABFZ7X8AAAAAXNSR0IB2cksfwAAADtJREFUeNpjmEkmYJj5Hw5IYQ41jQxgAOQQzRwgp6bBASlMsjWOxiNtnDqaH0fjcTQeR+NxNB4HRzwCAKe1WKTJTDjtAAAAAElFTkSuQmCC","style-02":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAApCAMAAABX0hoSAAAAAXNSR0IB2cksfwAAAAxQTFRFvdbu////nMLlAAAA9IvssgAAADdJREFUeNpjIB8wwgEpzKGmkRkMgByimQPkVCY4IIVJtsbReKSJU0fz42g8jsbjaDyOxuMgiUcAiB8ImQdJGSwAAAAASUVORK5CYII=","style-03":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAApCAMAAABX0hoSAAAAAXNSR0IB2cksfwAAAAxQTFRF98qs////9LCDAAAAaYSk9QAAADdJREFUeNpjIB8wwgEpzKGmkRkMgByimQPkVCY4IIVJtsbReKSJU0fz42g8jsbjaDyOxuMgiUcAiB8ImQdJGSwAAAAASUVORK5CYII=","style-04":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAApCAAAAABFZ7X8AAAAAXNSR0IB2cksfwAAADtJREFUeNpjuE0mYLj9Hw5IYQ41jQxgAOQQzRwgp56EA1KYZGscjUfaOHU0P47G42g8jsbjaDwOjngEAJ5M/zCxTwHCAAAAAElFTkSuQmCC","style-05":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAApCAMAAABX0hoSAAAAAXNSR0IB2cksfwAAAAxQTFRF/+WZ/////9lmAAAA63K0kwAAADdJREFUeNpjIB8wwgEpzKGmkRkMgByimQPkVCY4IIVJtsbReKSJU0fz42g8jsbjaDyOxuMgiUcAiB8ImQdJGSwAAAAASUVORK5CYII=","style-06":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAApCAMAAABX0hoSAAAAAXNSR0IB2cksfwAAAAxQTFRFxeCz////qNCNAAAAIaHJqgAAADdJREFUeNpjIB8wwgEpzKGmkRkMgByimQPkVCY4IIVJtsbReKSJU0fz42g8jsbjaDyOxuMgiUcAiB8ImQdJGSwAAAAASUVORK5CYII=","style-07":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAApCAAAAABFZ7X8AAAAAXNSR0IB2cksfwAAAE9JREFUeNpj+E8mYBgpGhnA4D8JzIFxahp5gAKNZxAgjQTmAGmExA1QnAQm/Z1KQXQggTQSmENLIyKPpZHApL9T6Z+tRvPjaH4czY9Uz48ACVjcErnC5AYAAAAASUVORK5CYII=","style-08":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAApCAMAAABX0hoSAAAAAXNSR0IB2cksfwAAAAxQTFRF////3ur2nMLlAAAAKSdyJQAAAEpJREFUeNpjGAUEADMYkMqkP2AiD1CgkREBmEhgDpBGSNwAxUlg0t+pZEcHaloggTm0NCLyGBMJTPo7lf7ZajQ/jubH0fxI9fwIAN+oB4rU/Ud4AAAAAElFTkSuQmCC","style-09":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAApCAMAAABX0hoSAAAAAXNSR0IB2cksfwAAAAxQTFRF////++TV9LCDAAAAc2YSvQAAAEpJREFUeNpjGAUEADMYkMqkP2AiD1CgkREBmEhgDpBGSNwAxUlg0t+pZEcHaloggTm0NCLyGBMJTPo7lf7ZajQ/jubH0fxI9fwIAN+oB4rU/Ud4AAAAAElFTkSuQmCC","style-10":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAApCAAAAABFZ7X8AAAAAXNSR0IB2cksfwAAAFBJREFUeNpj+E8mYBgpGhnA4D8JzIFx6knyAAUa3yLASRKYA6QREjdAcRKY9HcqBdGBBE6SwBxaGhF57CQJTPo7lf7ZajQ/jubH0fxI9fwIAE6k0z5Fc0COAAAAAElFTkSuQmCC","style-11":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAApCAMAAABX0hoSAAAAAXNSR0IB2cksfwAAAAxQTFRF//////LM/9lmAAAAeVz29QAAAEpJREFUeNpjGAUEADMYkMqkP2AiD1CgkREBmEhgDpBGSNwAxUlg0t+pZEcHaloggTm0NCLyGBMJTPo7lf7ZajQ/jubH0fxI9fwIAN+oB4rU/Ud4AAAAAElFTkSuQmCC","style-12":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAApCAMAAABX0hoSAAAAAXNSR0IB2cksfwAAAAxQTFRF////4u/ZqNCNAAAA625YRwAAAEpJREFUeNpjGAUEADMYkMqkP2AiD1CgkREBmEhgDpBGSNwAxUlg0t+pZEcHaloggTm0NCLyGBMJTPo7lf7ZajQ/jubH0fxI9fwIAN+oB4rU/Ud4AAAAAElFTkSuQmCC","style-13":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAApCAAAAABFZ7X8AAAAAXNSR0IB2cksfwAAAE1JREFUeNpj+E8mYBghGhlAAMggnjkwTk0jEyDbmHYGDggyh5ZGRNwAxSFMoDh+5oD7kfx4JIE5xDQi4pFo5oD7cTQ/jubH0fw4RPMjAOV9E1CylahcAAAAAElFTkSuQmCC","style-14":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAApCAMAAABX0hoSAAAAAXNSR0IB2cksfwAAAAxQTFRF////3ur2nMLlAAAAKSdyJQAAAEZJREFUeNpjGAX4ATMYkMqkP2AiE6CYwQgHBJlDSyMiboDiECZQHD9zwP1IfjySwBxiGhHxSDRzwP04mh9H8+Nofhyi+REA2I0Gs9tiU0QAAAAASUVORK5CYII=","style-15":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAApCAMAAABX0hoSAAAAAXNSR0IB2cksfwAAAAxQTFRF////++TV9LCDAAAAc2YSvQAAAEZJREFUeNpjGAX4ATMYkMqkP2AiE6CYwQgHBJlDSyMiboDiECZQHD9zwP1IfjySwBxiGhHxSDRzwP04mh9H8+Nofhyi+REA2I0Gs9tiU0QAAAAASUVORK5CYII=","style-16":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAApCAAAAABFZ7X8AAAAAXNSR0IB2cksfwAAAE1JREFUeNpj+E8mYBghGhlAAMggnjkwTj1JJkC28eRbOCDIHFoaEXEDFIcwgeL4mQPuR/LjkQTmENOIiEeimQPux9H8OJofR/PjEM2PAP9h5rhkNcWPAAAAAElFTkSuQmCC","style-17":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAApCAMAAABX0hoSAAAAAXNSR0IB2cksfwAAAAxQTFRF//////LM/9lmAAAAeVz29QAAAEZJREFUeNpjGAX4ATMYkMqkP2AiE6CYwQgHBJlDSyMiboDiECZQHD9zwP1IfjySwBxiGhHxSDRzwP04mh9H8+Nofhyi+REA2I0Gs9tiU0QAAAAASUVORK5CYII=","style-18":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAApCAMAAABX0hoSAAAAAXNSR0IB2cksfwAAAAxQTFRF////4u/ZqNCNAAAA625YRwAAAEZJREFUeNpjGAX4ATMYkMqkP2AiE6CYwQgHBJlDSyMiboDiECZQHD9zwP1IfjySwBxiGhHxSDRzwP04mh9H8+Nofhyi+REA2I0Gs9tiU0QAAAAASUVORK5CYII=","style-19":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAApCAAAAABFZ7X8AAAAAXNSR0IB2cksfwAAAEdJREFUeNpjGAX4wX8wIJVJf5BGLjPtDByQwhxqGiHeBXKIZg6QU8kDQI3/4YAU5lDTCMuVxDMHyKnkgdH8OJofR/PjIMqPABZTOEISDFodAAAAAElFTkSuQmCC","style-20":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAApCAMAAABX0hoSAAAAAXNSR0IB2cksfwAAAA9QTFRFnMLl////3ur2W5vVAAAARQeP3QAAAExJREFUeNrtkzkOADAIw8Lx/zdXYqArsFBUPHmJlMWQIvhkSIZIXHuu4npKAXYyOm2oBnNce67WISej04ZqEMW15WqV7XF73B4f6vEAGcQO+50f28QAAAAASUVORK5CYII=","style-21":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAApCAMAAABX0hoSAAAAAXNSR0IB2cksfwAAAA9QTFRF9LCD////++TV7X0xAAAAfASWdQAAAExJREFUeNrtkzkOADAIw8Lx/zdXYqArsFBUPHmJlMWQIvhkSIZIXHuu4npKAXYyOm2oBnNce67WISej04ZqEMW15WqV7XF73B4f6vEAGcQO+50f28QAAAAASUVORK5CYII=","style-22":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAApCAAAAABFZ7X8AAAAAXNSR0IB2cksfwAAAFBJREFUeNrtk7ENADAIw/L/HxzDMdxAJQa6AgtFxZOXSFkMKoJPhmoQxbXnKl9PKVicjE4bwhCJa9PVImB1MjptCEM1rk1Xa2yP2+P2+FCPB+DGUm5ppR1TAAAAAElFTkSuQmCC","style-23":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAApCAMAAABX0hoSAAAAAXNSR0IB2cksfwAAAA9QTFRF/9lm//////LM/8AAAAAAyG1M9AAAAExJREFUeNrtkzkOADAIw8Lx/zdXYqArsFBUPHmJlMWQIvhkSIZIXHuu4npKAXYyOm2oBnNce67WISej04ZqEMW15WqV7XF73B4f6vEAGcQO+50f28QAAAAASUVORK5CYII=","style-24":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAApCAMAAABX0hoSAAAAAXNSR0IB2cksfwAAAA9QTFRFqNCN////4u/ZcK1HAAAAPaNftgAAAExJREFUeNrtkzkOADAIw8Lx/zdXYqArsFBUPHmJlMWQIvhkSIZIXHuu4npKAXYyOm2oBnNce67WISej04ZqEMW15WqV7XF73B4f6vEAGcQO+50f28QAAAAASUVORK5CYII=","style-25":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAApCAAAAABFZ7X8AAAAAXNSR0IB2cksfwAAAFNJREFUeNpj+P+fgTwwxDT+BwMgh2jmwDiVTIBi4/+ZcECQOYQ0MqFFUzoYEMGkxMYBjcczcECQOYQ0osejCRgQwaTExtH8OJofR/PjiM2PZGsEAN5AVSEUxOaVAAAAAElFTkSuQmCC","style-26":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAApCAMAAABX0hoSAAAAAXNSR0IB2cksfwAAAA9QTFRF////3ur2vdbuW5vVAAAAx62pegAAAFRJREFUeNrt07EKwEAIA9Bo7v+/uZDB1dIe5wm+KUtAkAD8BOhVhJB8HUtO/YEBHtLYrQhRcYl7EitO3fRHC2nsVoSouMQsiRWnzh5nj7PHi/Z43gPTtQ6Vxo+FgAAAAABJRU5ErkJggg==","style-27":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAApCAMAAABX0hoSAAAAAXNSR0IB2cksfwAAAA9QTFRF////++TV98qs7X0xAAAAMAVLkgAAAFRJREFUeNrt07EKwEAIA9Bo7v+/uZDB1dIe5wm+KUtAkAD8BOhVhJB8HUtO/YEBHtLYrQhRcYl7EitO3fRHC2nsVoSouMQsiRWnzh5nj7PHi/Z43gPTtQ6Vxo+FgAAAAABJRU5ErkJggg==","style-28":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAApCAAAAABFZ7X8AAAAAXNSR0IB2cksfwAAAFpJREFUeNpj+L+ULPCfYWhp/A8GQB7RzAFyKnkAxcb/t+GAIHNoaUTEDVCcAQyA4oSY9HcqleLxLRwQZA4tjYh4BIpDogkoTohJf6eO5sfR/DiaH4dBfiRfIwC7Z096LHDqZAAAAABJRU5ErkJggg==","style-29":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAApCAMAAABX0hoSAAAAAXNSR0IB2cksfwAAAA9QTFRF//////LM/+WZ/8AAAAAAIfB8oQAAAFRJREFUeNrt07EKwEAIA9Bo7v+/uZDB1dIe5wm+KUtAkAD8BOhVhJB8HUtO/YEBHtLYrQhRcYl7EitO3fRHC2nsVoSouMQsiRWnzh5nj7PHi/Z43gPTtQ6Vxo+FgAAAAABJRU5ErkJggg==","style-30":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAApCAMAAABX0hoSAAAAAXNSR0IB2cksfwAAAA9QTFRF////4u/ZxeCzcK1HAAAABxcEXAAAAFRJREFUeNrt07EKwEAIA9Bo7v+/uZDB1dIe5wm+KUtAkAD8BOhVhJB8HUtO/YEBHtLYrQhRcYl7EitO3fRHC2nsVoSouMQsiRWnzh5nj7PHi/Z43gPTtQ6Vxo+FgAAAAABJRU5ErkJggg==","style-31":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAApCAAAAABFZ7X8AAAAAXNSR0IB2cksfwAAAEdJREFUeNpjSCMTMKT9hwNSmENNIwMYADlEMwfIqeQBSjSegQNSmAOkERI3QA7RzIFx6mh+HIn5kfJsNZofR/PjaH6kfn4EAENZgDs94rT1AAAAAElFTkSuQmCC","style-32":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAApCAMAAABX0hoSAAAAAXNSR0IB2cksfwAAAAxQTFRFnMLl////3ur2LnS1otaQUwAAAEFJREFUeNpjIB8wwgEpzKGmkRkMgByimQPkVPoDJjgghTlAGiFxA+SQwqS/U0fz44jMj5Rnq9H8OJofR/Mj9fMjAA9XCh/0gdfJAAAAAElFTkSuQmCC","style-33":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAApCAMAAABX0hoSAAAAAXNSR0IB2cksfwAAAAxQTFRF9LCD////++TVxFkR+Q1X/AAAAEFJREFUeNpjIB8wwgEpzKGmkRkMgByimQPkVPoDJjgghTlAGiFxA+SQwqS/U0fz44jMj5Rnq9H8OJofR/Mj9fMjAA9XCh/0gdfJAAAAAElFTkSuQmCC","style-34":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAApCAAAAABFZ7X8AAAAAXNSR0IB2cksfwAAAEdJREFUeNpjOEkmYDj5Hw5IYQ41jdVgAOQQzRwgp5IHKNH4Fg5IYQ6QRkjcADlEMwfGqaP5cSTmR8qz1Wh+HM2Po/mR+vkRAA37+uY4EkbpAAAAAElFTkSuQmCC","style-35":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAApCAMAAABX0hoSAAAAAXNSR0IB2cksfwAAAAxQTFRF/9lm//////LMv48AzptggQAAAEFJREFUeNpjIB8wwgEpzKGmkRkMgByimQPkVPoDJjgghTlAGiFxA+SQwqS/U0fz44jMj5Rnq9H8OJofR/Mj9fMjAA9XCh/0gdfJAAAAAElFTkSuQmCC","style-36":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAApCAMAAABX0hoSAAAAAXNSR0IB2cksfwAAAAxQTFRFqNCN////4u/ZU4E1GgA+swAAAEFJREFUeNpjIB8wwgEpzKGmkRkMgByimQPkVPoDJjgghTlAGiFxA+SQwqS/U0fz44jMj5Rnq9H8OJofR/Mj9fMjAA9XCh/0gdfJAAAAAElFTkSuQmCC","style-37":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAApCAAAAABFZ7X8AAAAAXNSR0IB2cksfwAAAE1JREFUeNpj+E8mYBghGhlAAMggnjkwTk0jEyDbmHYGDggyh5ZGRNwAxSFMoDh+5oD7kfx4JIE5xDQi4pFo5oD7cTQ/jubH0fw4RPMjAOV9E1CylahcAAAAAElFTkSuQmCC","style-38":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAApCAMAAABX0hoSAAAAAXNSR0IB2cksfwAAAAxQTFRF////3ur2nMLlLnS166ziPgAAAEZJREFUeNpjGAX4ATMYkMqkP2AiE6CYwQgHBJlDSyMiboDiECZQHD9zwP1IfjySwBxiGhHxSDRzwP04mh9H8+Nofhyi+REA2I0Gs9tiU0QAAAAASUVORK5CYII=","style-39":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAApCAMAAABX0hoSAAAAAXNSR0IB2cksfwAAAAxQTFRF////++TV9LCDxFkR5AnqzgAAAEZJREFUeNpjGAX4ATMYkMqkP2AiE6CYwQgHBJlDSyMiboDiECZQHD9zwP1IfjySwBxiGhHxSDRzwP04mh9H8+Nofhyi+REA2I0Gs9tiU0QAAAAASUVORK5CYII=","style-40":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAApCAAAAABFZ7X8AAAAAXNSR0IB2cksfwAAAE1JREFUeNpj+E8mYBghGqvBAMggmjkwTj1JJkC28eRbOCDIHFoaEXEDFIcwgeL4mQPuR/LjkQTmENOIiEeimQPux9H8OJofR/PjEM2PAPvfLtm5y6ZtAAAAAElFTkSuQmCC","style-41":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAApCAMAAABX0hoSAAAAAXNSR0IB2cksfwAAAAxQTFRF//////LM/9lmv48AC0XLXAAAAEZJREFUeNpjGAX4ATMYkMqkP2AiE6CYwQgHBJlDSyMiboDiECZQHD9zwP1IfjySwBxiGhHxSDRzwP04mh9H8+Nofhyi+REA2I0Gs9tiU0QAAAAASUVORK5CYII=","style-42":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAApCAMAAABX0hoSAAAAAXNSR0IB2cksfwAAAAxQTFRF////4u/ZqNCNU4E18b+lhwAAAEZJREFUeNpjGAX4ATMYkMqkP2AiE6CYwQgHBJlDSyMiboDiECZQHD9zwP1IfjySwBxiGhHxSDRzwP04mh9H8+Nofhyi+REA2I0Gs9tiU0QAAAAASUVORK5CYII="},list:{"style-01":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAApBAAAAACAl1j9AAAAAXNSR0IB2cksfwAAAEJJREFUeNpj+I8HMAyMJAMDkPjAwMCPzqTE2G9puAHDnzO4Ae0kgT46c+YAAwPPGTQmJcaOkPjEGwij8Tkw8UkrOwG+ctHvPFzDAgAAAABJRU5ErkJggg==","style-02":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAApAgMAAAAdYgKzAAAAAXNSR0IB2cksfwAAAAxQTFRF////3ur2nMLlAAAAKSdyJQAAAD9JREFUeNpjoCb4/4H5/wH+/wz2f4BMAmq1ViEDBtFQZEAi9//X8P9X4/+H1v8N/f8Vv+KB8i+aM4aBf0nSCQAFNW0OMyWcDgAAAABJRU5ErkJggg==","style-03":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAApAgMAAAAdYgKzAAAAAXNSR0IB2cksfwAAAAxQTFRF////++TV9LCDAAAAc2YSvQAAAD9JREFUeNpjoCb4/4H5/wH+/wz2f4BMAmq1ViEDBtFQZEAi9//X8P9X4/+H1v8N/f8Vv+KB8i+aM4aBf0nSCQAFNW0OMyWcDgAAAABJRU5ErkJggg==","style-04":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAApCAAAAABFZ7X8AAAAAXNSR0IB2cksfwAAAEBJREFUeNpj+E8mYBgpGhnA4D8JzIFx6knyAMP/t+SBoaYREjdABtHMAXHqaH4cFvmR7AQwmh9H8+Nofhw8fgQAQuYYs6IfNwkAAAAASUVORK5CYII=","style-05":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAApAgMAAAAdYgKzAAAAAXNSR0IB2cksfwAAAAxQTFRF//////LM/9lmAAAAeVz29QAAAD9JREFUeNpjoCb4/4H5/wH+/wz2f4BMAmq1ViEDBtFQZEAi9//X8P9X4/+H1v8N/f8Vv+KB8i+aM4aBf0nSCQAFNW0OMyWcDgAAAABJRU5ErkJggg==","style-06":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAApAgMAAAAdYgKzAAAAAXNSR0IB2cksfwAAAAxQTFRF////4u/ZqNCNAAAA625YRwAAAD9JREFUeNpjoCb4/4H5/wH+/wz2f4BMAmq1ViEDBtFQZEAi9//X8P9X4/+H1v8N/f8Vv+KB8i+aM4aBf0nSCQAFNW0OMyWcDgAAAABJRU5ErkJggg==","style-07":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAApBAAAAACAl1j9AAAAAXNSR0IB2cksfwAAAD5JREFUeNpj+JaGGzD8xwNoJ8nAACQ+MDDwozMpMRavP/+cwQ1oJwn00ZkzBxgYeM6gMSkxdjQ+R+NzuMUnACEhhnf/RQYHAAAAAElFTkSuQmCC","style-08":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAApAgMAAAAdYgKzAAAAAXNSR0IB2cksfwAAAAxQTFRF////3ur2nMLlAAAAKSdyJQAAADxJREFUeNpj0FqFDBgoAv8/MP8/wP+fwf4PkElALZq9oqHIgETu/6/h/6/G/w+t/xv6/ysBxaP+HQj/AgBeMJSkvkJu9AAAAABJRU5ErkJggg==","style-09":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAApAgMAAAAdYgKzAAAAAXNSR0IB2cksfwAAAAxQTFRF////++TV9LCDAAAAc2YSvQAAADxJREFUeNpj0FqFDBgoAv8/MP8/wP+fwf4PkElALZq9oqHIgETu/6/h/6/G/w+t/xv6/ysBxaP+HQj/AgBeMJSkvkJu9AAAAABJRU5ErkJggg==","style-10":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAApCAAAAABFZ7X8AAAAAXNSR0IB2cksfwAAAD5JREFUeNpj+H+SPMDwn0ww1DQygMF/EpgD4lTy4/EteWCoaYTEDZBBNHNAnDqaH0fz42h+HM2Po/lxcORHAL+C4oBsiT46AAAAAElFTkSuQmCC","style-11":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAApAgMAAAAdYgKzAAAAAXNSR0IB2cksfwAAAAxQTFRF//////LM/9lmAAAAeVz29QAAADxJREFUeNpj0FqFDBgoAv8/MP8/wP+fwf4PkElALZq9oqHIgETu/6/h/6/G/w+t/xv6/ysBxaP+HQj/AgBeMJSkvkJu9AAAAABJRU5ErkJggg==","style-12":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAApAgMAAAAdYgKzAAAAAXNSR0IB2cksfwAAAAxQTFRF////4u/ZqNCNAAAA625YRwAAADxJREFUeNpj0FqFDBgoAv8/MP8/wP+fwf4PkElALZq9oqHIgETu/6/h/6/G/w+t/xv6/ysBxaP+HQj/AgBeMJSkvkJu9AAAAABJRU5ErkJggg==","style-13":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAApAQAAAABId9eNAAAAAXNSR0IB2cksfwAAACtJREFUeNpjIBbIN3+o4z/4A0O8/gGU/g8C/3DSCTX8jR/s2NDFgTqHhX4AgLyq+JZ2N5oAAAAASUVORK5CYII=","style-14":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAApAgMAAAAdYgKzAAAAAXNSR0IB2cksfwAAAAlQTFRFW5vV////AAAACNDYnwAAADFJREFUeNpjoCJgDHVgDWUQDWEIDQAyCSgWDQ1B5SKBECZUtQS4qPZiGIUBRu2lu70ARMUw80s2fjwAAAAASUVORK5CYII=","style-15":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAApAgMAAAAdYgKzAAAAAXNSR0IB2cksfwAAAAlQTFRF7X0x////AAAAgf7PagAAADFJREFUeNpjoCJgDHVgDWUQDWEIDQAyCSgWDQ1B5SKBECZUtQS4qPZiGIUBRu2lu70ARMUw80s2fjwAAAAASUVORK5CYII=","style-16":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAApCAAAAABFZ7X8AAAAAXNSR0IB2cksfwAAAD1JREFUeNpjWEomYBghGv+DAZBBNHOAnPofDkjVSBYYahoZwADII5o5QE5FgNF4HI3H0XgcjcfReBzAeAQAF2dyWmTlDSEAAAAASUVORK5CYII=","style-17":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAApAgMAAAAdYgKzAAAAAXNSR0IB2cksfwAAAAlQTFRF/8AA////AAAAQC/IDQAAADFJREFUeNpjoCJgDHVgDWUQDWEIDQAyCSgWDQ1B5SKBECZUtQS4qPZiGIUBRu2lu70ARMUw80s2fjwAAAAASUVORK5CYII=","style-18":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAApAgMAAAAdYgKzAAAAAXNSR0IB2cksfwAAAAlQTFRFcK1H////AAAAM4H5DgAAADFJREFUeNpjoCJgDHVgDWUQDWEIDQAyCSgWDQ1B5SKBECZUtQS4qPZiGIUBRu2lu70ARMUw80s2fjwAAAAASUVORK5CYII=","style-19":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAApCAAAAABFZ7X8AAAAAXNSR0IB2cksfwAAAERJREFUeNpjGAX4wX8wIJVJf5BGrra0M2SBoaYR4l0gj2jmADmVPADU+J8sMNQ0wnMl0cwBcip5YDQ/jubH0fw4iPIjAJdEbnKbHwk5AAAAAElFTkSuQmCC","style-20":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAApCAMAAABX0hoSAAAAAXNSR0IB2cksfwAAAA9QTFRFnMLl////3ur2W5vVAAAARQeP3QAAAEdJREFUeNrtk7ENADAIw5LQ/2+uxAUoC0XFUxZLWYwwwScik4j67LkK14MspoknkVSePVd9aDFNPAnJ8my56rI9bo/b40M9XgvbD6+zDd1aAAAAAElFTkSuQmCC","style-21":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAApCAMAAABX0hoSAAAAAXNSR0IB2cksfwAAAA9QTFRF9LCD////++TV7X0xAAAAfASWdQAAAEdJREFUeNrtk7ENADAIw5LQ/2+uxAUoC0XFUxZLWYwwwScik4j67LkK14MspoknkVSePVd9aDFNPAnJ8my56rI9bo/b40M9XgvbD6+zDd1aAAAAAElFTkSuQmCC","style-22":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAApCAAAAABFZ7X8AAAAAXNSR0IB2cksfwAAAE1JREFUeNrt0zENAEAMAkD8+6iYikEDn1RBw9L/fG9iIWEBYcInRZWIfpyZmmFJJC2vFVFItuPQVBNSlteKKJLacWiqZ/+4f9w/XvTHA6TlZY7DXYWJAAAAAElFTkSuQmCC","style-23":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAApCAMAAABX0hoSAAAAAXNSR0IB2cksfwAAAA9QTFRF/9lm//////LM/8AAAAAAyG1M9AAAAEdJREFUeNrtk7ENADAIw5LQ/2+uxAUoC0XFUxZLWYwwwScik4j67LkK14MspoknkVSePVd9aDFNPAnJ8my56rI9bo/b40M9XgvbD6+zDd1aAAAAAElFTkSuQmCC","style-24":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAApCAMAAABX0hoSAAAAAXNSR0IB2cksfwAAAA9QTFRFqNCN////4u/ZcK1HAAAAPaNftgAAAEdJREFUeNrtk7ENADAIw5LQ/2+uxAUoC0XFUxZLWYwwwScik4j67LkK14MspoknkVSePVd9aDFNPAnJ8my56rI9bo/b40M9XgvbD6+zDd1aAAAAAElFTkSuQmCC","style-25":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAApAQAAAABId9eNAAAAAXNSR0IB2cksfwAAAC1JREFUeNpjIATs2R/8kW/+gCFe/x8E/sBpBgWwMAZtrw7Wjy6Orm+w6yekDgCM9jZz+D9F6wAAAABJRU5ErkJggg==","style-26":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAApAQMAAABawnhjAAAAAXNSR0IB2cksfwAAAAZQTFRFW5vV////dMw4QwAAAC1JREFUeNpjIBbYsz/4I9/8AUO8/j8I/IHTDApgYQzaXh2sH10cXd9g149LHgDZiDZTXPUkUQAAAABJRU5ErkJggg==","style-27":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAApAQMAAABawnhjAAAAAXNSR0IB2cksfwAAAAZQTFRF7X0x////RtYsOwAAAC1JREFUeNpjIBbYsz/4I9/8AUO8/j8I/IHTDApgYQzaXh2sH10cXd9g149LHgDZiDZTXPUkUQAAAABJRU5ErkJggg==","style-28":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAApAQMAAABawnhjAAAAAXNSR0IB2cksfwAAAAZQTFRFpaWl////LnrmUQAAAC1JREFUeNpjIBbYsz/4I9/8AUO8/j8I/IHTDApgYQzaXh2sH10cXd9g149LHgDZiDZTXPUkUQAAAABJRU5ErkJggg==","style-29":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAApAQMAAABawnhjAAAAAXNSR0IB2cksfwAAAAZQTFRF/8AA////qAjcygAAAC1JREFUeNpjIBbYsz/4I9/8AUO8/j8I/IHTDApgYQzaXh2sH10cXd9g149LHgDZiDZTXPUkUQAAAABJRU5ErkJggg==","style-30":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAApAQMAAABawnhjAAAAAXNSR0IB2cksfwAAAAZQTFRFcK1H////II+pvwAAAC1JREFUeNpjIBbYsz/4I9/8AUO8/j8I/IHTDApgYQzaXh2sH10cXd9g149LHgDZiDZTXPUkUQAAAABJRU5ErkJggg==","style-31":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAApBAAAAACAl1j9AAAAAXNSR0IB2cksfwAAAEFJREFUeNpj+MCAB/zHA2gnCbYY6C5+dCYlxuL1558zuAHtJIEWnzlzgIGB5wwakwJj8QbCMIpPvIEwGp/DK38CAPKPkT8XrNsjAAAAAElFTkSuQmCC","style-32":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAApCAMAAABX0hoSAAAAAXNSR0IB2cksfwAAAAxQTFRF////3ur2W5vVLnS1ImmZKQAAADtJREFUeNpjYGAiDzCMFMAMBiQy6Q/Ij0dG8sBQ0wiJGyCDaOaAOHUUDIv8SHYCGM2Po/lxND8OnvoRADEoBgrX1LMZAAAAAElFTkSuQmCC","style-33":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAApCAMAAABX0hoSAAAAAXNSR0IB2cksfwAAAAxQTFRF////++TV7X0xxFkRZi4T5gAAADtJREFUeNpjYGAiDzCMFMAMBiQy6Q/Ij0dG8sBQ0wiJGyCDaOaAOHUUDIv8SHYCGM2Po/lxND8OnvoRADEoBgrX1LMZAAAAAElFTkSuQmCC","style-34":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAApCAAAAABFZ7X8AAAAAXNSR0IB2cksfwAAAERJREFUeNpj+L+UPMDwn0ww1DRWg8F/EpgD4lTy4/EteWCoaYTEDZBBNHNgnEomGM2Pgyo/kp0ARvPjaH4czY+Dp34EAITbMl3NzzFwAAAAAElFTkSuQmCC","style-35":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAApCAMAAABX0hoSAAAAAXNSR0IB2cksfwAAAAxQTFRF//////LM/8AAv48AePiWcAAAADtJREFUeNpjYGAiDzCMFMAMBiQy6Q/Ij0dG8sBQ0wiJGyCDaOaAOHUUDIv8SHYCGM2Po/lxND8OnvoRADEoBgrX1LMZAAAAAElFTkSuQmCC","style-36":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAApCAMAAABX0hoSAAAAAXNSR0IB2cksfwAAAAxQTFRF////4u/ZcK1HU4E1F2AR2QAAADtJREFUeNpjYGAiDzCMFMAMBiQy6Q/Ij0dG8sBQ0wiJGyCDaOaAOHUUDIv8SHYCGM2Po/lxND8OnvoRADEoBgrX1LMZAAAAAElFTkSuQmCC","style-37":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAApCAAAAABFZ7X8AAAAAXNSR0IB2cksfwAAAE1JREFUeNpj+E8mYBgpGhnA4D8JzIFxKgOZAMWUM8SDIaYRETdAPhgAJfAzB8Sp5KaGkaIREY8k5Ef6O5XsBDCaH0fz42h+JM6p9KhYAfIwjW/iZfngAAAAAElFTkSuQmCC","style-38":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAApAgMAAAAdYgKzAAAAAXNSR0IB2cksfwAAAAxQTFRF////3ur2W5vVLnS1ImmZKQAAAEtJREFUeNpjoCJg/n+A/z+D/R+G/x+ATAKKVyGDFUABplA4CCGJC7T3UPz/0Pq/of+/hv+/Qlgvkiso4YLsRfIvfsVozhie/sUd2wAZfGLz3FsOPAAAAABJRU5ErkJggg==","style-39":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAApAgMAAAAdYgKzAAAAAXNSR0IB2cksfwAAAAxQTFRF////++TV7X0xxFkRZi4T5gAAAEpJREFUeNpjoCb4/4H5/wH+/wz2f4BMAmq1ViEDkMjUUDggiQuyd/r/q/H/Q+v/hv7/SlhvA8IVlHBB9jYj/ItfMZozhql/ccY2ALl2buds2hazAAAAAElFTkSuQmCC","style-40":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAApCAAAAABFZ7X8AAAAAXNSR0IB2cksfwAAAE9JREFUeNpj+E8mYBgpGqvB4D8JzIFx6lLyAIqNS98SD4aSRkTcgDVCmEAJ/MyB9yMJCWCkaETEIwn5kf5OJTsBjObH0fw4mh+Jcyo9KlYAoIVZ89e1ioIAAAAASUVORK5CYII=","style-41":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAApAgMAAAAdYgKzAAAAAXNSR0IB2cksfwAAAAxQTFRF//////LM/8AAv48AePiWcAAAAEpJREFUeNpjoCb4/4H5/wH+/wz2f4BMAmq1ViEDkMjUUDggiQuyd/r/q/H/Q+v/hv7/SlhvA8IVlHBB9jYj/ItfMZozhql/ccY2ALl2buds2hazAAAAAElFTkSuQmCC","style-42":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAApAgMAAAAdYgKzAAAAAXNSR0IB2cksfwAAAAxQTFRF////4u/ZcK1HU4E1F2AR2QAAAEpJREFUeNpjoCb4/4H5/wH+/wz2f4BMAmq1ViEDkMjUUDggiQuyd/r/q/H/Q+v/hv7/SlhvA8IVlHBB9jYj/ItfMZozhql/ccY2ALl2buds2hazAAAAAElFTkSuQmCC"}},Vo=(e,t)=>{const o=PN[e];return o&&o[t]||""},Bt=(e,t=ro.DEFAULT_BORDER_WIDTH)=>({borderColor:e,cellBorderColor:e,headerRowBorderColor:e,headerRowBorderWidth:t,headerRowTextColor:l0,headerRowFontWeight:c0,firstColumnTextColor:l0,firstColumnFontWeight:c0}),So=(e,t,o={})=>({...Bt(e,o.headerBorderWidth??2),alternateRowColor:t,firstColumnBackgroundColor:o.firstColumnBg,headerRowNoBorder:o.noBorder}),l0="#000000",c0="bold",yt={borderStyle:"none",borderWidth:0,borderColor:"transparent"},Nr={firstColumnFontStyle:"italic",firstColumnFontWeight:"normal"},Vr=(e,t,o)=>({...So(e,t,{noBorder:!0,firstColumnBg:"#ffffff"}),textColor:o,headerRowTextColor:o,firstColumnTextColor:o,...Nr}),Hr=(e,t,o)=>({...So(e,t,{noBorder:!0}),headerRowBackgroundColor:o,headerRowTextColor:"#ffffff"}),ON=()=>{const e=[],t=dr();for(let o=1;o<=42;o++){const r={...t,borderStyle:"solid",borderWidth:ro.DEFAULT_BORDER_WIDTH,borderColor:ro.DEFAULT_BORDER_COLOR},n={1:()=>({...Bt("#666666",2),containerBackgroundColor:void 0,alternateRowColor:void 0,firstColumnFontStyle:"normal",firstColumnBorderColor:"#666666",headerRowNoBorder:void 0,cellBorderStyle:void 0,cellBorderWidth:void 0,cellBorderColor:void 0,cellVerticalBorderStyle:void 0,cellVerticalBorderWidth:void 0}),2:()=>({...Bt("#9cc2e5",2),containerBackgroundColor:void 0,alternateRowColor:void 0,firstColumnFontStyle:"normal",firstColumnBorderColor:"#9cc2e5",headerRowNoBorder:void 0,cellBorderStyle:void 0,cellBorderWidth:void 0,cellBorderColor:void 0,cellVerticalBorderStyle:void 0,cellVerticalBorderWidth:void 0}),3:()=>({...Bt("#f4b083",2),containerBackgroundColor:void 0,alternateRowColor:void 0,firstColumnFontStyle:"normal",firstColumnBorderColor:"#f4b083",headerRowNoBorder:void 0,cellBorderStyle:void 0,cellBorderWidth:void 0,cellBorderColor:void 0,cellVerticalBorderStyle:void 0,cellVerticalBorderWidth:void 0}),4:()=>({...Bt("#c9c9c9",2),containerBackgroundColor:void 0,alternateRowColor:void 0,firstColumnFontStyle:"normal",firstColumnBorderColor:"#c9c9c9",headerRowNoBorder:void 0,cellBorderStyle:void 0,cellBorderWidth:void 0,cellBorderColor:void 0,cellVerticalBorderStyle:void 0,cellVerticalBorderWidth:void 0}),5:()=>({...Bt("#ffd966",2),containerBackgroundColor:void 0,alternateRowColor:void 0,firstColumnFontStyle:"normal",firstColumnBorderColor:"#ffd966",headerRowNoBorder:void 0,cellBorderStyle:void 0,cellBorderWidth:void 0,cellBorderColor:void 0,cellVerticalBorderStyle:void 0,cellVerticalBorderWidth:void 0}),6:()=>({...Bt("#a8d08d",2),containerBackgroundColor:void 0,alternateRowColor:void 0,firstColumnFontStyle:"normal",firstColumnBorderColor:"#a8d08d",headerRowNoBorder:void 0,cellBorderStyle:void 0,cellBorderWidth:void 0,cellBorderColor:void 0,cellVerticalBorderStyle:void 0,cellVerticalBorderWidth:void 0}),7:()=>({...Bt("#666666",2),containerBackgroundColor:void 0,alternateRowColor:"#cccccc",headerRowNoBorder:!0,...yt,cellBorderStyle:"solid",cellBorderWidth:1,cellBorderColor:"#666666",cellVerticalBorderStyle:"solid",cellVerticalBorderWidth:1,firstColumnBorderColor:"#666666",firstColumnFontStyle:"normal"}),8:()=>({...Bt("#9cc2e5",2),containerBackgroundColor:void 0,alternateRowColor:"#deeaf6",headerRowNoBorder:!0,...yt,cellBorderStyle:"solid",cellBorderWidth:1,cellBorderColor:"#9cc2e5",cellVerticalBorderStyle:"solid",cellVerticalBorderWidth:1,firstColumnBorderColor:"#9cc2e5",firstColumnFontStyle:"normal"}),9:()=>({...Bt("#f4b083",2),containerBackgroundColor:void 0,alternateRowColor:"#fbe4d5",headerRowNoBorder:!0,...yt,cellBorderStyle:"solid",cellBorderWidth:1,cellBorderColor:"#f4b083",cellVerticalBorderStyle:"solid",cellVerticalBorderWidth:1,firstColumnBorderColor:"#f4b083",firstColumnFontStyle:"normal"}),10:()=>({...Bt("#c9c9c9",2),containerBackgroundColor:void 0,alternateRowColor:"#ededed",headerRowNoBorder:!0,...yt,cellBorderStyle:"solid",cellBorderWidth:1,cellBorderColor:"#c9c9c9",cellVerticalBorderStyle:"solid",cellVerticalBorderWidth:1,firstColumnBorderColor:"#c9c9c9",firstColumnFontStyle:"normal"}),11:()=>({...Bt("#ffd966",2),containerBackgroundColor:void 0,alternateRowColor:"#fff2cc",headerRowNoBorder:!0,...yt,cellBorderStyle:"solid",cellBorderWidth:1,cellBorderColor:"#ffd966",cellVerticalBorderStyle:"solid",cellVerticalBorderWidth:1,firstColumnBorderColor:"#ffd966",firstColumnFontStyle:"normal"}),12:()=>({...So("#a8d08d","#e2efd9",{noBorder:!0}),containerBackgroundColor:void 0,...yt,cellBorderStyle:"solid",cellBorderWidth:1,cellBorderColor:"#a8d08d",cellVerticalBorderStyle:"solid",cellVerticalBorderWidth:1,headerRowNoBorder:!0,firstColumnBorderColor:"#a8d08d",firstColumnFontStyle:"normal"}),13:()=>({...So("#666666","#cccccc",{noBorder:!0,firstColumnBg:"#ffffff"}),containerBackgroundColor:void 0,...Nr,cellBorderStyle:"solid",cellBorderWidth:1,cellBorderColor:"#666666",cellVerticalBorderStyle:"solid",cellVerticalBorderWidth:1,headerRowNoBorder:!0,firstColumnBorderColor:"#666666"}),14:()=>({...So("#9cc2e5","#deeaf6",{noBorder:!0,firstColumnBg:"#ffffff"}),containerBackgroundColor:void 0,...Nr,firstColumnBorderColor:"#9cc2e5",cellBorderStyle:void 0,cellBorderWidth:void 0,cellBorderColor:void 0,cellVerticalBorderStyle:void 0,cellVerticalBorderWidth:void 0}),15:()=>({...So("#f4b083","#fbe4d5",{noBorder:!0,firstColumnBg:"#ffffff"}),containerBackgroundColor:void 0,...Nr,firstColumnBorderColor:"#f4b083",cellBorderStyle:void 0,cellBorderWidth:void 0,cellBorderColor:void 0,cellVerticalBorderStyle:void 0,cellVerticalBorderWidth:void 0}),16:()=>({...So("#c9c9c9","#ededed",{noBorder:!0,firstColumnBg:"#ffffff"}),containerBackgroundColor:void 0,...Nr,firstColumnBorderColor:"#c9c9c9",cellBorderStyle:void 0,cellBorderWidth:void 0,cellBorderColor:void 0,cellVerticalBorderStyle:void 0,cellVerticalBorderWidth:void 0}),17:()=>({...So("#ffd966","#fff2cc",{noBorder:!0,firstColumnBg:"#ffffff"}),containerBackgroundColor:void 0,...Nr,firstColumnBorderColor:"#ffd966",cellBorderStyle:void 0,cellBorderWidth:void 0,cellBorderColor:void 0,cellVerticalBorderStyle:void 0,cellVerticalBorderWidth:void 0}),18:()=>({...So("#a8d08d","#e2efd9",{noBorder:!0,firstColumnBg:"#ffffff"}),containerBackgroundColor:void 0,...Nr,firstColumnBorderColor:"#a8d08d",cellBorderStyle:void 0,cellBorderWidth:void 0,cellBorderColor:void 0,cellVerticalBorderStyle:void 0,cellVerticalBorderWidth:void 0}),19:()=>({...Hr("#666666","#cccccc","#000000"),containerBackgroundColor:void 0,firstColumnBorderColor:"#666666",firstColumnFontStyle:"normal",headerRowNoBorder:void 0,cellBorderStyle:void 0,cellBorderWidth:void 0,cellBorderColor:void 0,cellVerticalBorderStyle:void 0,cellVerticalBorderWidth:void 0}),20:()=>({...Hr("#9cc2e5","#deeaf6","#5b9bd5"),containerBackgroundColor:void 0,firstColumnBorderColor:"#9cc2e5",firstColumnFontStyle:"normal",headerRowNoBorder:void 0,cellBorderStyle:void 0,cellBorderWidth:void 0,cellBorderColor:void 0,cellVerticalBorderStyle:void 0,cellVerticalBorderWidth:void 0}),21:()=>({...Hr("#f4b083","#fbe4d5","#ed7d31"),containerBackgroundColor:void 0,firstColumnBorderColor:"#f4b083",firstColumnFontStyle:"normal",headerRowNoBorder:void 0,cellBorderStyle:void 0,cellBorderWidth:void 0,cellBorderColor:void 0,cellVerticalBorderStyle:void 0,cellVerticalBorderWidth:void 0}),22:()=>({...Hr("#c9c9c9","#ededed","#a5a5a5"),containerBackgroundColor:void 0,firstColumnBorderColor:"#c9c9c9",firstColumnFontStyle:"normal",headerRowNoBorder:void 0,cellBorderStyle:void 0,cellBorderWidth:void 0,cellBorderColor:void 0,cellVerticalBorderStyle:void 0,cellVerticalBorderWidth:void 0}),23:()=>({...Hr("#ffd966","#fff2cc","#ffc000"),containerBackgroundColor:void 0,firstColumnBorderColor:"#ffd966",firstColumnFontStyle:"normal",headerRowNoBorder:void 0,cellBorderStyle:void 0,cellBorderWidth:void 0,cellBorderColor:void 0,cellVerticalBorderStyle:void 0,cellVerticalBorderWidth:void 0}),24:()=>({...Hr("#a8d08d","#e2efd9","#70ad47"),containerBackgroundColor:void 0,firstColumnBorderColor:"#a8d08d",firstColumnFontStyle:"normal",headerRowNoBorder:void 0,cellBorderStyle:void 0,cellBorderWidth:void 0,cellBorderColor:void 0,cellVerticalBorderStyle:void 0,cellVerticalBorderWidth:void 0}),25:()=>({...Bt("#000000",2),containerBackgroundColor:"#cccccc",alternateRowColor:"#999999",headerRowBackgroundColor:"#000000",firstColumnBackgroundColor:"#000000",headerRowTextColor:"#ffffff",firstColumnTextColor:"#ffffff",textColor:"#000000",headerRowNoBorder:!0,headerRowBorderColor:"#ffffff",headerRowBorderWidth:1,...yt,cellBorderStyle:"solid",cellBorderWidth:1,cellBorderColor:"#ffffff",cellVerticalBorderStyle:"solid",cellVerticalBorderWidth:1,firstColumnBorderColor:"#ffffff",firstColumnFontStyle:"normal"}),26:()=>({...Bt("#000000",2),containerBackgroundColor:"#deeaf6",alternateRowColor:"#bdd6ee",headerRowBackgroundColor:"#5b9bd5",firstColumnBackgroundColor:"#5b9bd5",headerRowTextColor:"#ffffff",firstColumnTextColor:"#ffffff",textColor:"#000000",headerRowNoBorder:!0,headerRowBorderColor:"#ffffff",headerRowBorderWidth:1,...yt,cellBorderStyle:"solid",cellBorderWidth:1,cellBorderColor:"#ffffff",cellVerticalBorderStyle:"solid",cellVerticalBorderWidth:1,firstColumnBorderColor:"#ffffff",firstColumnFontStyle:"normal"}),27:()=>({...Bt("#000000",2),containerBackgroundColor:"#fbe4d5",alternateRowColor:"#f7caac",headerRowBackgroundColor:"#ed7d31",firstColumnBackgroundColor:"#ed7d31",headerRowTextColor:"#ffffff",firstColumnTextColor:"#ffffff",textColor:"#000000",headerRowNoBorder:!0,headerRowBorderColor:"#ffffff",headerRowBorderWidth:1,...yt,cellBorderStyle:"solid",cellBorderWidth:1,cellBorderColor:"#ffffff",cellVerticalBorderStyle:"solid",cellVerticalBorderWidth:1,firstColumnBorderColor:"#ffffff",firstColumnFontStyle:"normal"}),28:()=>({...Bt("#000000",2),containerBackgroundColor:"#ededed",alternateRowColor:"#dbdbdb",headerRowBackgroundColor:"#a5a5a5",firstColumnBackgroundColor:"#a5a5a5",headerRowTextColor:"#ffffff",firstColumnTextColor:"#ffffff",textColor:"#000000",headerRowNoBorder:!0,headerRowBorderColor:"#ffffff",headerRowBorderWidth:1,...yt,cellBorderStyle:"solid",cellBorderWidth:1,cellBorderColor:"#ffffff",cellVerticalBorderStyle:"solid",cellVerticalBorderWidth:1,firstColumnBorderColor:"#ffffff",firstColumnFontStyle:"normal"}),29:()=>({...Bt("#000000",2),containerBackgroundColor:"#fff2cc",alternateRowColor:"#ffe599",headerRowBackgroundColor:"#ffc000",firstColumnBackgroundColor:"#ffc000",headerRowTextColor:"#ffffff",firstColumnTextColor:"#ffffff",textColor:"#000000",headerRowNoBorder:!0,headerRowBorderColor:"#ffffff",headerRowBorderWidth:1,...yt,cellBorderStyle:"solid",cellBorderWidth:1,cellBorderColor:"#ffffff",cellVerticalBorderStyle:"solid",cellVerticalBorderWidth:1,firstColumnBorderColor:"#ffffff",firstColumnFontStyle:"normal"}),30:()=>({...Bt("#000000",2),containerBackgroundColor:"#e2efd9",alternateRowColor:"#c5e0b3",headerRowBackgroundColor:"#70ad47",firstColumnBackgroundColor:"#70ad47",headerRowTextColor:"#ffffff",firstColumnTextColor:"#ffffff",textColor:"#000000",headerRowNoBorder:!0,headerRowBorderColor:"#ffffff",headerRowBorderWidth:1,...yt,cellBorderStyle:"solid",cellBorderWidth:1,cellBorderColor:"#ffffff",cellVerticalBorderStyle:"solid",cellVerticalBorderWidth:1,firstColumnBorderColor:"#ffffff",firstColumnFontStyle:"normal"}),31:()=>({...Bt("#666666",2),containerBackgroundColor:void 0,alternateRowColor:"#cccccc",headerRowNoBorder:!0,firstColumnBorderColor:"#666666",textColor:"#222222",headerRowTextColor:"#222222",firstColumnTextColor:"#222222",firstColumnFontStyle:"normal",cellBorderStyle:void 0,cellBorderWidth:void 0,cellBorderColor:void 0,cellVerticalBorderStyle:void 0,cellVerticalBorderWidth:void 0}),32:()=>({...Bt("#9cc2e5",2),containerBackgroundColor:void 0,alternateRowColor:"#deeaf6",headerRowNoBorder:!0,firstColumnBorderColor:"#9cc2e5",textColor:"#2e74b5",headerRowTextColor:"#2e74b5",firstColumnTextColor:"#2e74b5",firstColumnFontStyle:"normal",cellBorderStyle:void 0,cellBorderWidth:void 0,cellBorderColor:void 0,cellVerticalBorderStyle:void 0,cellVerticalBorderWidth:void 0}),33:()=>({...Bt("#f4b083",2),containerBackgroundColor:void 0,alternateRowColor:"#fbe4d5",headerRowNoBorder:!0,firstColumnBorderColor:"#f4b083",textColor:"#c45911",headerRowTextColor:"#c45911",firstColumnTextColor:"#c45911",firstColumnFontStyle:"normal",cellBorderStyle:void 0,cellBorderWidth:void 0,cellBorderColor:void 0,cellVerticalBorderStyle:void 0,cellVerticalBorderWidth:void 0}),34:()=>({...Bt("#c9c9c9",2),containerBackgroundColor:void 0,alternateRowColor:"#ededed",headerRowNoBorder:!0,firstColumnBorderColor:"#c9c9c9",textColor:"#7b7b7b",headerRowTextColor:"#7b7b7b",firstColumnTextColor:"#7b7b7b",firstColumnFontStyle:"normal",cellBorderStyle:void 0,cellBorderWidth:void 0,cellBorderColor:void 0,cellVerticalBorderStyle:void 0,cellVerticalBorderWidth:void 0}),35:()=>({...Bt("#ffd966",2),containerBackgroundColor:void 0,alternateRowColor:"#fff2cc",headerRowNoBorder:!0,firstColumnBorderColor:"#ffd966",textColor:"#bf8f00",headerRowTextColor:"#bf8f00",firstColumnTextColor:"#bf8f00",firstColumnFontStyle:"normal",cellBorderStyle:void 0,cellBorderWidth:void 0,cellBorderColor:void 0,cellVerticalBorderStyle:void 0,cellVerticalBorderWidth:void 0}),36:()=>({...So("#a8d08d","#e2efd9",{noBorder:!0}),containerBackgroundColor:void 0,firstColumnBorderColor:"#a8d08d",textColor:"#538135",headerRowTextColor:"#538135",firstColumnTextColor:"#538135",firstColumnFontStyle:"normal",cellBorderStyle:void 0,cellBorderWidth:void 0,cellBorderColor:void 0,cellVerticalBorderStyle:void 0,cellVerticalBorderWidth:void 0}),37:()=>({...Vr("#666666","#cccccc","#222222"),containerBackgroundColor:void 0,firstColumnBorderColor:"#666666",cellBorderStyle:void 0,cellBorderWidth:void 0,cellBorderColor:void 0,cellVerticalBorderStyle:void 0,cellVerticalBorderWidth:void 0}),38:()=>({...Vr("#9cc2e5","#deeaf6","#2e74b5"),containerBackgroundColor:void 0,firstColumnBorderColor:"#9cc2e5",cellBorderStyle:void 0,cellBorderWidth:void 0,cellBorderColor:void 0,cellVerticalBorderStyle:void 0,cellVerticalBorderWidth:void 0}),39:()=>({...Vr("#f4b083","#fbe4d5","#c45911"),containerBackgroundColor:void 0,firstColumnBorderColor:"#f4b083",cellBorderStyle:void 0,cellBorderWidth:void 0,cellBorderColor:void 0,cellVerticalBorderStyle:void 0,cellVerticalBorderWidth:void 0}),40:()=>({...Vr("#c9c9c9","#ededed","#7b7b7b"),containerBackgroundColor:void 0,firstColumnBorderColor:"#c9c9c9",cellBorderStyle:void 0,cellBorderWidth:void 0,cellBorderColor:void 0,cellVerticalBorderStyle:void 0,cellVerticalBorderWidth:void 0}),41:()=>({...Vr("#ffd966","#fff2cc","#bf8f00"),containerBackgroundColor:void 0,firstColumnBorderColor:"#ffd966",cellBorderStyle:void 0,cellBorderWidth:void 0,cellBorderColor:void 0,cellVerticalBorderStyle:void 0,cellVerticalBorderWidth:void 0}),42:()=>({...Vr("#a8d08d","#e2efd9","#538135"),containerBackgroundColor:void 0,firstColumnBorderColor:"#a8d08d",cellBorderStyle:void 0,cellBorderWidth:void 0,cellBorderColor:void 0,cellVerticalBorderStyle:void 0,cellVerticalBorderWidth:void 0})};n[o]&&Object.assign(r,n[o]()),e.push({id:`grid-style-${o.toString().padStart(2,"0")}`,label:`Style ${o.toString().padStart(2,"0")}`,preview:Vo("grid",`style-${o.toString().padStart(2,"0")}`),style:r})}return e},WN=()=>{const e=[],t=dr();for(let o=1;o<=42;o++){const r={...t,borderStyle:"solid",borderWidth:ro.DEFAULT_BORDER_WIDTH,borderColor:ro.DEFAULT_BORDER_COLOR},n={1:()=>({...yt,containerBackgroundColor:"#ffffff",alternateRowColor:"#cccccc",cellBorderStyle:"solid",cellBorderWidth:0,cellBorderColor:"#cccccc",cellVerticalBorderStyle:"none",cellVerticalBorderWidth:0,headerRowNoBorder:!0,headerRowBorderColor:"#cccccc",headerRowBorderWidth:1,firstColumnBorderColor:void 0,firstColumnTextColor:void 0,firstColumnFontStyle:void 0,firstColumnFontWeight:void 0,firstColumnBackgroundColor:void 0,textColor:void 0,headerRowTextColor:void 0,headerRowFontWeight:void 0,headerRowBackgroundColor:void 0,borderColor:void 0}),2:()=>({...yt,containerBackgroundColor:"#ffffff",alternateRowColor:"#deeaf6",cellBorderStyle:"solid",cellBorderWidth:0,cellBorderColor:"#a3c6e7",cellVerticalBorderStyle:"none",cellVerticalBorderWidth:0,headerRowNoBorder:!0,headerRowBorderColor:"#a3c6e7",headerRowBorderWidth:1,firstColumnBorderColor:void 0,firstColumnTextColor:void 0,firstColumnFontStyle:void 0,firstColumnFontWeight:void 0,firstColumnBackgroundColor:void 0,textColor:void 0,headerRowTextColor:void 0,headerRowFontWeight:void 0,headerRowBackgroundColor:void 0,borderColor:void 0}),3:()=>({...yt,containerBackgroundColor:"#ffffff",alternateRowColor:"#fbe4d5",cellBorderStyle:"solid",cellBorderWidth:1,cellBorderColor:"#fbe4d5",cellVerticalBorderStyle:"none",cellVerticalBorderWidth:0,headerRowNoBorder:!0,headerRowBorderColor:"#fbe4d5",headerRowBorderWidth:1,firstColumnBorderColor:void 0,firstColumnTextColor:void 0,firstColumnFontStyle:void 0,firstColumnFontWeight:void 0,firstColumnBackgroundColor:void 0,textColor:void 0,headerRowTextColor:void 0,headerRowFontWeight:void 0,headerRowBackgroundColor:void 0,borderColor:void 0}),4:()=>({...yt,containerBackgroundColor:"#ffffff",alternateRowColor:"#ededed",cellBorderStyle:"solid",cellBorderWidth:1,cellBorderColor:"#ededed",cellVerticalBorderStyle:"none",cellVerticalBorderWidth:0,headerRowNoBorder:!0,headerRowBorderColor:"#ededed",headerRowBorderWidth:1,firstColumnBorderColor:void 0,firstColumnTextColor:void 0,firstColumnFontStyle:void 0,firstColumnFontWeight:void 0,firstColumnBackgroundColor:void 0,textColor:void 0,headerRowTextColor:void 0,headerRowFontWeight:void 0,headerRowBackgroundColor:void 0,borderColor:void 0}),5:()=>({...yt,containerBackgroundColor:"#ffffff",alternateRowColor:"#fff2cc",cellBorderStyle:"solid",cellBorderWidth:1,cellBorderColor:"#fff2cc",cellVerticalBorderStyle:"none",cellVerticalBorderWidth:0,headerRowNoBorder:!0,headerRowBorderColor:"#fff2cc",headerRowBorderWidth:1,firstColumnBorderColor:void 0,firstColumnTextColor:void 0,firstColumnFontStyle:void 0,firstColumnFontWeight:void 0,firstColumnBackgroundColor:void 0,textColor:void 0,headerRowTextColor:void 0,headerRowFontWeight:void 0,headerRowBackgroundColor:void 0,borderColor:void 0}),6:()=>({...yt,containerBackgroundColor:"#ffffff",alternateRowColor:"#e2efd9",cellBorderStyle:"solid",cellBorderWidth:1,cellBorderColor:"#e2efd9",cellVerticalBorderStyle:"none",cellVerticalBorderWidth:0,headerRowNoBorder:!0,headerRowBorderColor:"#e2efd9",headerRowBorderWidth:1,firstColumnBorderColor:void 0,firstColumnTextColor:void 0,firstColumnFontStyle:void 0,firstColumnFontWeight:void 0,firstColumnBackgroundColor:void 0,textColor:void 0,headerRowTextColor:void 0,headerRowFontWeight:void 0,headerRowBackgroundColor:void 0,borderColor:void 0}),7:()=>({...yt,containerBackgroundColor:"#ffffff",alternateRowColor:"#cccccc",cellBorderStyle:"solid",cellBorderWidth:1,cellBorderColor:"#717171",cellVerticalBorderStyle:"none",cellVerticalBorderWidth:0,headerRowNoBorder:!0,headerRowBorderColor:"#717171",headerRowBorderWidth:1,firstColumnBorderColor:void 0,firstColumnTextColor:void 0,firstColumnFontStyle:void 0,firstColumnFontWeight:void 0,firstColumnBackgroundColor:void 0,textColor:void 0,headerRowTextColor:void 0,headerRowFontWeight:void 0,headerRowBackgroundColor:void 0,borderColor:void 0}),8:()=>({...yt,containerBackgroundColor:"#ffffff",alternateRowColor:"#deeaf6",cellBorderStyle:"solid",cellBorderWidth:1,cellBorderColor:"#a3c6e7",cellVerticalBorderStyle:"none",cellVerticalBorderWidth:0,headerRowNoBorder:!0,headerRowBorderColor:"#a3c6e7",headerRowBorderWidth:1,firstColumnBorderColor:void 0,firstColumnTextColor:void 0,firstColumnFontStyle:void 0,firstColumnFontWeight:void 0,firstColumnBackgroundColor:void 0,textColor:void 0,headerRowTextColor:void 0,headerRowFontWeight:void 0,headerRowBackgroundColor:void 0,borderColor:void 0}),9:()=>({...yt,containerBackgroundColor:"#ffffff",alternateRowColor:"#fbe4d5",cellBorderStyle:"solid",cellBorderWidth:1,cellBorderColor:"#f5b68c",cellVerticalBorderStyle:"none",cellVerticalBorderWidth:0,headerRowNoBorder:!0,headerRowBorderColor:"#f5b68c",headerRowBorderWidth:1,firstColumnBorderColor:void 0,firstColumnTextColor:void 0,firstColumnFontStyle:void 0,firstColumnFontWeight:void 0,firstColumnBackgroundColor:void 0,textColor:void 0,headerRowTextColor:void 0,headerRowFontWeight:void 0,headerRowBackgroundColor:void 0,borderColor:void 0}),10:()=>({...yt,containerBackgroundColor:"#ffffff",alternateRowColor:"#ededed",cellBorderStyle:"solid",cellBorderWidth:1,cellBorderColor:"#cdcdcd",cellVerticalBorderStyle:"none",cellVerticalBorderWidth:0,headerRowNoBorder:!0,headerRowBorderColor:"#cdcdcd",headerRowBorderWidth:1,firstColumnBorderColor:void 0,firstColumnTextColor:void 0,firstColumnFontStyle:void 0,firstColumnFontWeight:void 0,firstColumnBackgroundColor:void 0,textColor:void 0,headerRowTextColor:void 0,headerRowFontWeight:void 0,headerRowBackgroundColor:void 0,borderColor:void 0}),11:()=>({...yt,containerBackgroundColor:"#ffffff",alternateRowColor:"#fff2cc",cellBorderStyle:"solid",cellBorderWidth:1,cellBorderColor:"#ffdc71",cellVerticalBorderStyle:"none",cellVerticalBorderWidth:0,headerRowNoBorder:!0,headerRowBorderColor:"#ffdc71",headerRowBorderWidth:1,firstColumnBorderColor:void 0,firstColumnTextColor:void 0,firstColumnFontStyle:void 0,firstColumnFontWeight:void 0,firstColumnBackgroundColor:void 0,textColor:void 0,headerRowTextColor:void 0,headerRowFontWeight:void 0,headerRowBackgroundColor:void 0,borderColor:void 0}),12:()=>({...yt,containerBackgroundColor:"#ffffff",alternateRowColor:"#e2efd9",cellBorderStyle:"solid",cellBorderWidth:1,cellBorderColor:"#aed395",cellVerticalBorderStyle:"none",cellVerticalBorderWidth:0,headerRowNoBorder:!0,headerRowBorderColor:"#aed395",headerRowBorderWidth:1,firstColumnBorderColor:void 0,firstColumnTextColor:void 0,firstColumnFontStyle:void 0,firstColumnFontWeight:void 0,firstColumnBackgroundColor:void 0,textColor:void 0,headerRowTextColor:void 0,headerRowFontWeight:void 0,headerRowBackgroundColor:void 0,borderColor:void 0}),13:()=>({containerBackgroundColor:"#ffffff",alternateRowColor:void 0,borderStyle:"solid",borderWidth:1,borderColor:"#000000",cellBorderStyle:"solid",cellBorderWidth:1,cellBorderColor:"#000000",cellVerticalBorderStyle:"none",cellVerticalBorderWidth:0,headerRowNoBorder:!0,headerRowBorderColor:"#000000",headerRowBorderWidth:1,headerRowBackgroundColor:"#000000",headerRowTextColor:"#ffffff",firstColumnBorderColor:void 0,firstColumnTextColor:void 0,firstColumnFontStyle:void 0,firstColumnFontWeight:"bold",firstColumnBackgroundColor:void 0,textColor:void 0,headerRowFontWeight:"bold"}),14:()=>({containerBackgroundColor:"#ffffff",alternateRowColor:void 0,borderStyle:"solid",borderWidth:1,borderColor:"#9cc2e5",cellBorderStyle:"solid",cellBorderWidth:1,cellBorderColor:"#9cc2e5",cellVerticalBorderStyle:"none",cellVerticalBorderWidth:0,headerRowNoBorder:!0,headerRowBorderColor:"#9cc2e5",headerRowBorderWidth:1,headerRowBackgroundColor:"#5b9bd5",headerRowTextColor:"#ffffff",firstColumnBorderColor:void 0,firstColumnTextColor:void 0,firstColumnFontStyle:void 0,firstColumnFontWeight:"bold",firstColumnBackgroundColor:void 0,textColor:void 0,headerRowFontWeight:"bold"}),15:()=>({containerBackgroundColor:"#ffffff",alternateRowColor:void 0,borderStyle:"solid",borderWidth:1,borderColor:"#f4b083",cellBorderStyle:"solid",cellBorderWidth:1,cellBorderColor:"#f4b083",cellVerticalBorderStyle:"none",cellVerticalBorderWidth:0,headerRowNoBorder:!0,headerRowBorderColor:"#f4b083",headerRowBorderWidth:1,headerRowBackgroundColor:"#ed7d31",headerRowTextColor:"#ffffff",firstColumnBorderColor:void 0,firstColumnTextColor:void 0,firstColumnFontStyle:void 0,firstColumnFontWeight:"bold",firstColumnBackgroundColor:void 0,textColor:void 0,headerRowFontWeight:"bold"}),16:()=>({containerBackgroundColor:"#ffffff",alternateRowColor:void 0,borderStyle:"solid",borderWidth:1,borderColor:"#c9c9c9",cellBorderStyle:"solid",cellBorderWidth:1,cellBorderColor:"#c9c9c9",cellVerticalBorderStyle:"none",cellVerticalBorderWidth:0,headerRowNoBorder:!0,headerRowBorderColor:"#c9c9c9",headerRowBorderWidth:1,headerRowBackgroundColor:"#a5a5a5",headerRowTextColor:"#ffffff",firstColumnBorderColor:void 0,firstColumnTextColor:void 0,firstColumnFontStyle:void 0,firstColumnFontWeight:"bold",firstColumnBackgroundColor:void 0,textColor:void 0,headerRowFontWeight:"bold"}),17:()=>({containerBackgroundColor:"#ffffff",alternateRowColor:void 0,borderStyle:"solid",borderWidth:1,borderColor:"#ffd966",cellBorderStyle:"solid",cellBorderWidth:1,cellBorderColor:"#ffd966",cellVerticalBorderStyle:"none",cellVerticalBorderWidth:0,headerRowNoBorder:!0,headerRowBorderColor:"#ffd966",headerRowBorderWidth:1,headerRowBackgroundColor:"#ffc000",headerRowTextColor:"#ffffff",firstColumnBorderColor:void 0,firstColumnTextColor:void 0,firstColumnFontStyle:void 0,firstColumnFontWeight:"bold",firstColumnBackgroundColor:void 0,textColor:void 0,headerRowFontWeight:"bold"}),18:()=>({containerBackgroundColor:"#ffffff",alternateRowColor:void 0,borderStyle:"solid",borderWidth:1,borderColor:"#a8d08d",cellBorderStyle:"solid",cellBorderWidth:1,cellBorderColor:"#a8d08d",cellVerticalBorderStyle:"none",cellVerticalBorderWidth:0,headerRowNoBorder:!0,headerRowBorderColor:"#a8d08d",headerRowBorderWidth:1,headerRowBackgroundColor:"#70ad47",headerRowTextColor:"#ffffff",firstColumnBorderColor:void 0,firstColumnTextColor:void 0,firstColumnFontStyle:void 0,firstColumnFontWeight:"bold",firstColumnBackgroundColor:void 0,textColor:void 0,headerRowFontWeight:"bold"}),19:()=>({containerBackgroundColor:"#ffffff",alternateRowColor:"#cccccc",borderStyle:"solid",borderWidth:1,borderColor:"#000000",cellBorderStyle:"solid",cellBorderWidth:1,cellBorderColor:"#666666",cellVerticalBorderStyle:"none",cellVerticalBorderWidth:0,headerRowNoBorder:!0,headerRowBorderColor:"#000000",headerRowBorderWidth:1,headerRowBackgroundColor:"#000000",headerRowTextColor:"#ffffff",headerRowFontWeight:"bold",firstColumnFontWeight:"bold",firstColumnBorderColor:void 0,firstColumnTextColor:void 0,firstColumnFontStyle:void 0,firstColumnBackgroundColor:void 0,textColor:void 0}),20:()=>({containerBackgroundColor:"#ffffff",alternateRowColor:"#deeaf6",borderStyle:"solid",borderWidth:1,borderColor:"#9cc2e5",cellBorderStyle:"solid",cellBorderWidth:1,cellBorderColor:"#9cc2e5",cellVerticalBorderStyle:"none",cellVerticalBorderWidth:0,headerRowNoBorder:!0,headerRowBorderColor:"#9cc2e5",headerRowBorderWidth:1,headerRowBackgroundColor:"#5b9bd5",headerRowTextColor:"#ffffff",headerRowFontWeight:"bold",firstColumnFontWeight:"bold",firstColumnBorderColor:void 0,firstColumnTextColor:void 0,firstColumnFontStyle:void 0,firstColumnBackgroundColor:void 0,textColor:void 0}),21:()=>({containerBackgroundColor:"#ffffff",alternateRowColor:"#fbe4d5",borderStyle:"solid",borderWidth:1,borderColor:"#f4b083",cellBorderStyle:"solid",cellBorderWidth:1,cellBorderColor:"#f4b083",cellVerticalBorderStyle:"none",cellVerticalBorderWidth:0,headerRowNoBorder:!0,headerRowBorderColor:"#f4b083",headerRowBorderWidth:1,headerRowBackgroundColor:"#ed7d31",headerRowTextColor:"#ffffff",headerRowFontWeight:"bold",firstColumnFontWeight:"bold",firstColumnBorderColor:void 0,firstColumnTextColor:void 0,firstColumnFontStyle:void 0,firstColumnBackgroundColor:void 0,textColor:void 0}),22:()=>({containerBackgroundColor:"#ffffff",alternateRowColor:"#ededed",borderStyle:"solid",borderWidth:1,borderColor:"#c9c9c9",cellBorderStyle:"solid",cellBorderWidth:1,cellBorderColor:"#c9c9c9",cellVerticalBorderStyle:"none",cellVerticalBorderWidth:0,headerRowNoBorder:!0,headerRowBorderColor:"#c9c9c9",headerRowBorderWidth:1,headerRowBackgroundColor:"#a5a5a5",headerRowTextColor:"#ffffff",headerRowFontWeight:"bold",firstColumnFontWeight:"bold",firstColumnBorderColor:void 0,firstColumnTextColor:void 0,firstColumnFontStyle:void 0,firstColumnBackgroundColor:void 0,textColor:void 0}),23:()=>({containerBackgroundColor:"#ffffff",alternateRowColor:"#fff2cc",borderStyle:"solid",borderWidth:1,borderColor:"#ffd966",cellBorderStyle:"solid",cellBorderWidth:1,cellBorderColor:"#ffd966",cellVerticalBorderStyle:"none",cellVerticalBorderWidth:0,headerRowNoBorder:!0,headerRowBorderColor:"#ffd966",headerRowBorderWidth:1,headerRowBackgroundColor:"#ffc000",headerRowTextColor:"#ffffff",headerRowFontWeight:"bold",firstColumnFontWeight:"bold",firstColumnBorderColor:void 0,firstColumnTextColor:void 0,firstColumnFontStyle:void 0,firstColumnBackgroundColor:void 0,textColor:void 0}),24:()=>({containerBackgroundColor:"#ffffff",alternateRowColor:"#e2efd9",borderStyle:"solid",borderWidth:1,borderColor:"#a8d08d",cellBorderStyle:"solid",cellBorderWidth:1,cellBorderColor:"#a8d08d",cellVerticalBorderStyle:"none",cellVerticalBorderWidth:0,headerRowNoBorder:!0,headerRowBorderColor:"#a8d08d",headerRowBorderWidth:1,headerRowBackgroundColor:"#70ad47",headerRowTextColor:"#ffffff",headerRowFontWeight:"bold",firstColumnFontWeight:"bold",firstColumnBorderColor:void 0,firstColumnTextColor:void 0,firstColumnFontStyle:void 0,firstColumnBackgroundColor:void 0,textColor:void 0}),25:()=>({containerBackgroundColor:"#000000",alternateRowColor:void 0,borderStyle:"solid",borderWidth:1,borderColor:"#ffffff",cellBorderStyle:"solid",cellBorderWidth:1,cellBorderColor:"#ffffff",cellVerticalBorderStyle:"none",cellVerticalBorderWidth:0,headerRowNoBorder:!0,headerRowBorderColor:"#ffffff",headerRowBorderWidth:3,headerRowBackgroundColor:"#000000",headerRowTextColor:"#ffffff",textColor:"#ffffff",headerRowFontWeight:"bold",firstColumnBorderColor:"#ffffff",firstColumnBorderWidth:1,firstColumnFontWeight:"bold",firstColumnTextColor:"#ffffff",firstColumnFontStyle:void 0,firstColumnBackgroundColor:void 0}),26:()=>({containerBackgroundColor:"#5b9bd5",alternateRowColor:void 0,borderStyle:"solid",borderWidth:1,borderColor:"#ffffff",cellBorderStyle:"solid",cellBorderWidth:1,cellBorderColor:"#ffffff",cellVerticalBorderStyle:"none",cellVerticalBorderWidth:0,headerRowNoBorder:!0,headerRowBorderColor:"#ffffff",headerRowBorderWidth:3,headerRowBackgroundColor:"#5b9bd5",headerRowTextColor:"#ffffff",textColor:"#ffffff",headerRowFontWeight:"bold",firstColumnBorderColor:"#ffffff",firstColumnBorderWidth:1,firstColumnFontWeight:"bold",firstColumnTextColor:"#ffffff",firstColumnFontStyle:void 0,firstColumnBackgroundColor:void 0}),27:()=>({containerBackgroundColor:"#ed7d31",alternateRowColor:void 0,borderStyle:"solid",borderWidth:1,borderColor:"#ffffff",cellBorderStyle:"solid",cellBorderWidth:1,cellBorderColor:"#ffffff",cellVerticalBorderStyle:"none",cellVerticalBorderWidth:0,headerRowNoBorder:!0,headerRowBorderColor:"#ffffff",headerRowBorderWidth:3,headerRowBackgroundColor:"#ed7d31",headerRowTextColor:"#ffffff",textColor:"#ffffff",headerRowFontWeight:"bold",firstColumnBorderColor:"#ffffff",firstColumnBorderWidth:1,firstColumnFontWeight:"bold",firstColumnTextColor:"#ffffff",firstColumnFontStyle:void 0,firstColumnBackgroundColor:void 0}),28:()=>({containerBackgroundColor:"#a5a5a5",alternateRowColor:void 0,borderStyle:"solid",borderWidth:1,borderColor:"#ffffff",cellBorderStyle:"solid",cellBorderWidth:1,cellBorderColor:"#ffffff",cellVerticalBorderStyle:"none",cellVerticalBorderWidth:0,headerRowNoBorder:!0,headerRowBorderColor:"#ffffff",headerRowBorderWidth:3,headerRowBackgroundColor:"#a5a5a5",headerRowTextColor:"#ffffff",textColor:"#ffffff",headerRowFontWeight:"bold",firstColumnBorderColor:"#ffffff",firstColumnBorderWidth:1,firstColumnFontWeight:"bold",firstColumnTextColor:"#ffffff",firstColumnFontStyle:void 0,firstColumnBackgroundColor:void 0}),29:()=>({containerBackgroundColor:"#ffc000",alternateRowColor:void 0,borderStyle:"solid",borderWidth:1,borderColor:"#ffffff",cellBorderStyle:"solid",cellBorderWidth:1,cellBorderColor:"#ffffff",cellVerticalBorderStyle:"none",cellVerticalBorderWidth:0,headerRowNoBorder:!0,headerRowBorderColor:"#ffffff",headerRowBorderWidth:3,headerRowBackgroundColor:"#ffc000",headerRowTextColor:"#ffffff",textColor:"#ffffff",headerRowFontWeight:"bold",firstColumnBorderColor:"#ffffff",firstColumnBorderWidth:1,firstColumnFontWeight:"bold",firstColumnTextColor:"#ffffff",firstColumnFontStyle:void 0,firstColumnBackgroundColor:void 0}),30:()=>({containerBackgroundColor:"#70ad47",alternateRowColor:void 0,borderStyle:"solid",borderWidth:1,borderColor:"#ffffff",cellBorderStyle:"solid",cellBorderWidth:1,cellBorderColor:"#ffffff",cellVerticalBorderStyle:"none",cellVerticalBorderWidth:0,headerRowNoBorder:!0,headerRowBorderColor:"#ffffff",headerRowBorderWidth:3,headerRowBackgroundColor:"#70ad47",headerRowTextColor:"#ffffff",textColor:"#ffffff",headerRowFontWeight:"bold",firstColumnBorderColor:"#ffffff",firstColumnBorderWidth:1,firstColumnFontWeight:"bold",firstColumnTextColor:"#ffffff",firstColumnFontStyle:void 0,firstColumnBackgroundColor:void 0}),31:()=>({containerBackgroundColor:"#ffffff",alternateRowColor:"#cccccc",borderStyle:"solid",borderWidth:1,borderColor:"#000000",borderLeft:"none",borderRight:"none",cellBorderStyle:"none",cellBorderWidth:0,cellBorderColor:"transparent",cellVerticalBorderStyle:"none",cellVerticalBorderWidth:0,headerRowNoBorder:!0,headerRowBorderColor:"#000000",headerRowBorderWidth:1,firstColumnBorderColor:void 0,firstColumnTextColor:void 0,firstColumnFontStyle:void 0,firstColumnFontWeight:"bold",firstColumnBackgroundColor:void 0,textColor:void 0,headerRowTextColor:void 0,headerRowFontWeight:"bold",headerRowBackgroundColor:void 0}),32:()=>({containerBackgroundColor:"#ffffff",alternateRowColor:"#deeaf6",borderStyle:"solid",borderWidth:1,borderColor:"#5b9bd5",borderLeft:"none",borderRight:"none",cellBorderStyle:"none",cellBorderWidth:0,cellBorderColor:"transparent",cellVerticalBorderStyle:"none",cellVerticalBorderWidth:0,headerRowNoBorder:!0,headerRowBorderColor:"#5b9bd5",headerRowBorderWidth:1,firstColumnBorderColor:void 0,firstColumnTextColor:void 0,firstColumnFontStyle:void 0,firstColumnFontWeight:"bold",firstColumnBackgroundColor:void 0,textColor:"#2e74b5",headerRowTextColor:void 0,headerRowFontWeight:"bold",headerRowBackgroundColor:void 0}),33:()=>({containerBackgroundColor:"#ffffff",alternateRowColor:"#fbe4d5",borderStyle:"solid",borderWidth:1,borderColor:"#a5a5a5",borderLeft:"none",borderRight:"none",cellBorderStyle:"none",cellBorderWidth:0,cellBorderColor:"transparent",cellVerticalBorderStyle:"none",cellVerticalBorderWidth:0,headerRowNoBorder:!0,headerRowBorderColor:"#a5a5a5",headerRowBorderWidth:1,firstColumnBorderColor:void 0,firstColumnTextColor:void 0,firstColumnFontStyle:void 0,firstColumnFontWeight:"bold",firstColumnBackgroundColor:void 0,textColor:"#c45911",headerRowTextColor:void 0,headerRowFontWeight:"bold",headerRowBackgroundColor:void 0}),34:()=>({containerBackgroundColor:"#ffffff",alternateRowColor:"#ededed",borderStyle:"solid",borderWidth:1,borderColor:"#a5a5a5",borderLeft:"none",borderRight:"none",cellBorderStyle:"none",cellBorderWidth:0,cellBorderColor:"transparent",cellVerticalBorderStyle:"none",cellVerticalBorderWidth:0,headerRowNoBorder:!0,headerRowBorderColor:"#a5a5a5",headerRowBorderWidth:1,firstColumnBorderColor:void 0,firstColumnTextColor:void 0,firstColumnFontStyle:void 0,firstColumnFontWeight:"bold",firstColumnBackgroundColor:void 0,textColor:"#7b7b7b",headerRowTextColor:void 0,headerRowFontWeight:"bold",headerRowBackgroundColor:void 0}),35:()=>({containerBackgroundColor:"#ffffff",alternateRowColor:"#fff2cc",borderStyle:"solid",borderWidth:1,borderColor:"#ffc000",borderLeft:"none",borderRight:"none",cellBorderStyle:"none",cellBorderWidth:0,cellBorderColor:"transparent",cellVerticalBorderStyle:"none",cellVerticalBorderWidth:0,headerRowNoBorder:!0,headerRowBorderColor:"#ffc000",headerRowBorderWidth:1,firstColumnBorderColor:void 0,firstColumnTextColor:void 0,firstColumnFontStyle:void 0,firstColumnFontWeight:"bold",firstColumnBackgroundColor:void 0,textColor:"#bf8f00",headerRowTextColor:void 0,headerRowFontWeight:"bold",headerRowBackgroundColor:void 0}),36:()=>({containerBackgroundColor:"#ffffff",alternateRowColor:"#e2efd9",borderStyle:"solid",borderWidth:1,borderColor:"#70ad47",borderLeft:"none",borderRight:"none",cellBorderStyle:"none",cellBorderWidth:0,cellBorderColor:"transparent",cellVerticalBorderStyle:"none",cellVerticalBorderWidth:0,headerRowNoBorder:!0,headerRowBorderColor:"#70ad47",headerRowBorderWidth:1,firstColumnBorderColor:void 0,firstColumnTextColor:void 0,firstColumnFontStyle:void 0,firstColumnFontWeight:"bold",firstColumnBackgroundColor:void 0,textColor:"#538135",headerRowTextColor:void 0,headerRowFontWeight:"bold",headerRowBackgroundColor:void 0}),37:()=>({containerBackgroundColor:"white",alternateRowColor:"#cccccc",borderStyle:"none",borderWidth:0,borderColor:"transparent",cellBorderStyle:"none",cellBorderWidth:0,cellBorderColor:"transparent",cellVerticalBorderStyle:"none",cellVerticalBorderWidth:0,headerRowNoBorder:!0,headerRowBorderColor:"#9a9a9a",headerRowBorderWidth:1,firstColumnBorderColor:"#9a9a9a",firstColumnBorderWidth:1,headerRowBackgroundColor:"#ffffff",firstColumnBackgroundColor:"#ffffff",firstColumnFontStyle:"italic",headerRowFontStyle:"italic",firstCellInHeaderRowFontStyle:"italic",cellPadding:8,firstColumnTextColor:"#000000",firstColumnFontWeight:void 0,headerRowTextColor:"#000000",headerRowFontWeight:void 0,textColor:"#000000"}),38:()=>({containerBackgroundColor:"white",alternateRowColor:"#deeaf6",borderStyle:"none",borderWidth:0,borderColor:"transparent",cellBorderStyle:"none",cellBorderWidth:0,cellBorderColor:"transparent",cellVerticalBorderStyle:"none",cellVerticalBorderWidth:0,headerRowNoBorder:!0,headerRowBorderColor:"#9cc2e5",headerRowBorderWidth:1,firstColumnBorderColor:"#9cc2e5",firstColumnBorderWidth:1,headerRowBackgroundColor:"#ffffff",firstColumnBackgroundColor:"#ffffff",firstColumnFontStyle:"italic",headerRowFontStyle:"italic",firstCellInHeaderRowFontStyle:"italic",cellPadding:8,firstColumnTextColor:"#2e74b5",firstColumnFontWeight:void 0,headerRowTextColor:"#2e74b5",headerRowFontWeight:void 0,textColor:"#2e74b5"}),39:()=>({containerBackgroundColor:"white",alternateRowColor:"#fbe4d5",borderStyle:"none",borderWidth:0,borderColor:"transparent",cellBorderStyle:"none",cellBorderWidth:0,cellBorderColor:"transparent",cellVerticalBorderStyle:"none",cellVerticalBorderWidth:0,headerRowNoBorder:!0,headerRowBorderColor:"#f4b083",headerRowBorderWidth:1,firstColumnBorderColor:"#f4b083",firstColumnBorderWidth:1,headerRowBackgroundColor:"#ffffff",firstColumnBackgroundColor:"#ffffff",firstColumnFontStyle:"italic",headerRowFontStyle:"italic",firstCellInHeaderRowFontStyle:"italic",cellPadding:8,firstColumnTextColor:"#c45911",firstColumnFontWeight:void 0,headerRowTextColor:"#c45911",headerRowFontWeight:void 0,textColor:"#c45911"}),40:()=>({containerBackgroundColor:"white",alternateRowColor:"#ededed",borderStyle:"none",borderWidth:0,borderColor:"transparent",cellBorderStyle:"none",cellBorderWidth:0,cellBorderColor:"transparent",cellVerticalBorderStyle:"none",cellVerticalBorderWidth:0,headerRowNoBorder:!0,headerRowBorderColor:"#c9c9c9",headerRowBorderWidth:1,firstColumnBorderColor:"#c9c9c9",firstColumnBorderWidth:1,headerRowBackgroundColor:"#ffffff",firstColumnBackgroundColor:"#ffffff",firstColumnFontStyle:"italic",headerRowFontStyle:"italic",firstCellInHeaderRowFontStyle:"italic",cellPadding:8,firstColumnTextColor:"#7b7b7b",firstColumnFontWeight:void 0,headerRowTextColor:"#7b7b7b",headerRowFontWeight:void 0,textColor:"#7b7b7b"}),41:()=>({containerBackgroundColor:"white",alternateRowColor:"#fff2cc",borderStyle:"none",borderWidth:0,borderColor:"transparent",cellBorderStyle:"none",cellBorderWidth:0,cellBorderColor:"transparent",cellVerticalBorderStyle:"none",cellVerticalBorderWidth:0,headerRowNoBorder:!0,headerRowBorderColor:"#ffd966",headerRowBorderWidth:1,firstColumnBorderColor:"#ffd966",firstColumnBorderWidth:1,headerRowBackgroundColor:"#ffffff",firstColumnBackgroundColor:"#ffffff",firstColumnFontStyle:"italic",headerRowFontStyle:"italic",firstCellInHeaderRowFontStyle:"italic",cellPadding:8,firstColumnTextColor:"#bf8f00",firstColumnFontWeight:void 0,headerRowTextColor:"#bf8f00",headerRowFontWeight:void 0,textColor:"#bf8f00"}),42:()=>({containerBackgroundColor:"white",alternateRowColor:"#e2efd9",borderStyle:"none",borderWidth:0,borderColor:"transparent",cellBorderStyle:"none",cellBorderWidth:0,cellBorderColor:"transparent",cellVerticalBorderStyle:"none",cellVerticalBorderWidth:0,headerRowNoBorder:!0,headerRowBorderColor:"#a8d08d",headerRowBorderWidth:1,firstColumnBorderColor:"#a8d08d",firstColumnBorderWidth:1,headerRowBackgroundColor:"#ffffff",firstColumnBackgroundColor:"#ffffff",firstColumnFontStyle:"italic",headerRowFontStyle:"italic",firstCellInHeaderRowFontStyle:"italic",cellPadding:8,firstColumnTextColor:"#538135",firstColumnFontWeight:void 0,headerRowTextColor:"#538135",headerRowFontWeight:void 0,textColor:"#538135"})};n[o]&&Object.assign(r,n[o]()),e.push({id:`list-style-${o.toString().padStart(2,"0")}`,label:`Style ${o.toString().padStart(2,"0")}`,preview:Vo("list",`style-${o.toString().padStart(2,"0")}`),style:r})}return e},Zc={plain:[{id:"plain-style-01",label:"Style 01",preview:Vo("plain","style-01"),style:{...dr(),borderStyle:"solid",borderWidth:ro.DEFAULT_BORDER_WIDTH,borderColor:"#000000",cellBorderStyle:"solid",cellBorderWidth:ro.DEFAULT_BORDER_WIDTH,cellBorderColor:"#000000",containerBackgroundColor:void 0,alternateRowColor:void 0,headerRowNoBorder:void 0,cellVerticalBorderStyle:void 0,cellVerticalBorderWidth:void 0,textColor:"#000000",headerRowTextColor:"#000000",headerRowFontWeight:void 0,firstColumnTextColor:"#000000",firstColumnFontWeight:void 0,firstColumnFontStyle:void 0,firstColumnBackgroundColor:void 0,firstColumnBorderColor:"#000000",headerRowBackgroundColor:void 0,headerRowBorderColor:void 0,headerRowBorderWidth:void 0}},{id:"plain-style-02",label:"Style 02",preview:Vo("plain","style-02"),style:{...dr(),borderStyle:"solid",borderWidth:ro.DEFAULT_BORDER_WIDTH,borderColor:"#cccccc",containerBackgroundColor:void 0,alternateRowColor:void 0,headerRowNoBorder:void 0,cellBorderStyle:void 0,cellBorderWidth:void 0,cellBorderColor:void 0,cellVerticalBorderStyle:void 0,cellVerticalBorderWidth:void 0,textColor:"#000000",headerRowTextColor:"#000000",headerRowFontWeight:void 0,firstColumnTextColor:"#000000",firstColumnFontWeight:void 0,firstColumnFontStyle:void 0,firstColumnBackgroundColor:void 0,firstColumnBorderColor:"#cccccc",headerRowBackgroundColor:void 0,headerRowBorderColor:void 0,headerRowBorderWidth:void 0}},{id:"plain-style-03",label:"Style 03",preview:Vo("plain","style-03"),style:{...Vs(),borderStyle:"solid",borderWidth:ro.DEFAULT_BORDER_WIDTH,borderColor:"#cccccc",alternateRowColor:"#f2f2f2",textColor:"#333333",headerRowNoBorder:void 0,cellBorderStyle:void 0,cellBorderWidth:void 0,cellBorderColor:"#cccccc",cellVerticalBorderStyle:void 0,cellVerticalBorderWidth:void 0,headerRowTextColor:void 0,headerRowFontWeight:"bold",firstColumnTextColor:void 0,firstColumnFontWeight:"bold",firstColumnFontStyle:void 0,firstColumnBackgroundColor:void 0,firstColumnBorderColor:void 0,headerRowBackgroundColor:void 0,containerBackgroundColor:void 0,headerRowBorderColor:void 0,headerRowBorderWidth:void 0}},{id:"plain-style-04",label:"Style 04",preview:Vo("plain","style-04"),style:{...Su(),cellBorderStyle:"solid",cellBorderWidth:ro.DEFAULT_BORDER_WIDTH,cellBorderColor:"#000000",cellVerticalBorderWidth:0,cellVerticalBorderStyle:"none",containerBackgroundColor:void 0,alternateRowColor:void 0,headerRowNoBorder:void 0,textColor:void 0,headerRowTextColor:void 0,headerRowFontWeight:void 0,firstColumnTextColor:void 0,firstColumnFontWeight:void 0,firstColumnFontStyle:void 0,firstColumnBackgroundColor:void 0,firstColumnBorderColor:void 0,headerRowBackgroundColor:void 0,headerRowBorderColor:void 0,headerRowBorderWidth:void 0}},{id:"plain-style-05",label:"Style 05",preview:Vo("plain","style-05"),style:{...Vs(),borderStyle:"none",borderWidth:0,borderColor:"transparent",headerRowBorderColor:"#9a9a9a",firstColumnBorderColor:"#9a9a9a",headerRowBorderWidth:1,firstColumnBorderWidth:1,alternateRowColor:"#f2f2f2",headerRowNoBorder:!0,cellBorderStyle:"none",cellBorderWidth:0,cellBorderColor:"transparent",cellVerticalBorderStyle:"none",cellVerticalBorderWidth:0,textColor:void 0,headerRowTextColor:void 0,headerRowFontWeight:void 0,firstColumnTextColor:void 0,firstColumnFontWeight:void 0,firstColumnFontStyle:void 0,firstColumnBackgroundColor:void 0,headerRowBackgroundColor:void 0,containerBackgroundColor:void 0}},{id:"plain-style-06",label:"Style 06",preview:Vo("plain","style-06"),style:{...Vs(),...Su(),headerRowNoBorder:void 0,cellBorderStyle:void 0,cellBorderWidth:void 0,cellBorderColor:void 0,cellVerticalBorderStyle:void 0,cellVerticalBorderWidth:void 0,textColor:void 0,headerRowTextColor:void 0,headerRowFontWeight:"bold",firstColumnTextColor:void 0,firstColumnFontWeight:"bold",firstColumnFontStyle:void 0,firstColumnBackgroundColor:void 0,firstColumnBorderColor:void 0,headerRowBackgroundColor:void 0,containerBackgroundColor:void 0,alternateRowColor:"#f2f2f2",headerRowBorderColor:void 0,headerRowBorderWidth:void 0}},{id:"plain-style-07",label:"Style 07",preview:Vo("plain","style-07"),style:{...dr(),borderStyle:"none",borderWidth:0,borderColor:"transparent",headerRowBorderColor:"#9a9a9a",firstColumnBorderColor:"#9a9a9a",headerRowBorderWidth:1,firstColumnBorderWidth:1,alternateRowColor:"#f2f2f2",headerRowNoBorder:!0,cellBorderStyle:"none",cellBorderWidth:0,cellBorderColor:"transparent",cellVerticalBorderStyle:"none",cellVerticalBorderWidth:0,headerRowBackgroundColor:"#ffffff",firstColumnBackgroundColor:"#ffffff",containerBackgroundColor:void 0,textColor:void 0,headerRowTextColor:void 0,headerRowFontWeight:void 0,firstColumnTextColor:void 0,firstColumnFontWeight:void 0,firstColumnFontStyle:void 0}}],grid:ON(),list:WN()},zN=["firstColumnBackgroundColor","headerRowNoBorder","headerRowBackgroundColor","firstCellInHeaderRowBackgroundColor","firstCellInHeaderRowTextColor","firstCellInHeaderRowFontWeight","alternateRowColor"],UN=e=>{const t={...e};return zN.forEach(o=>{o in t||(t[o]=void 0)}),t},VN=e=>({width:e.width,height:e.height,margin:e.margin,padding:e.padding}),HN=(e,t)=>{const o=VN(t),r=UN(e);return{...o,...r}},GN=({id:e,onApplyTemplate:t})=>{const{getComponentForRender:o}=Te(),r=o(e),[n,s]=S.useState({plain:!1,grid:!1,list:!1}),[a,l]=S.useState(null),d=S.useCallback((f,b)=>{const h=(r==null?void 0:r.style)||{},g=HN(f,h);l(b),t(g)},[r==null?void 0:r.style,t]),c=S.useCallback(f=>{s(b=>({...b,[f]:!b[f]}))},[]),u=S.useCallback((f,b)=>{const h=b?f:f.slice(0,6);return i.jsx("div",{className:"grid grid-cols-6 gap-2 mt-3",children:h.map(g=>i.jsx("button",{onClick:()=>d(g.style,g.id),className:`flex flex-col items-center p-2 hover:bg-gray-50 text-center transition-colors ${a===g.id?"border-blue-500 bg-blue-50":"border-gray-200"}`,title:g.label,children:i.jsx("div",{className:"w-12 h-12 mb-1 flex items-center justify-center",children:i.jsx("img",{src:g.preview,alt:g.label,className:"w-full h-full object-contain"})})},g.id))})},[d,a]),p=S.useMemo(()=>[{title:"Plain tables",templates:Zc.plain},{title:"Grid tables",templates:Zc.grid},{title:"List tables",templates:Zc.list}],[]),m=S.useCallback((f,b)=>{const h=n[b];return i.jsxs("div",{className:"border border-gray-200 rounded",children:[i.jsxs("div",{className:"flex items-center justify-between px-[10px] py-[5px] cursor-pointer hover:bg-gray-50",onClick:()=>c(b),children:[i.jsx("h3",{className:"text-sm font-medium text-gray-700",children:f.title}),i.jsx("button",{className:"w-6 h-6 rounded-full flex items-center justify-center",children:h?i.jsx("i",{className:`${t1} text-gray-600 text-xl bg-gray-200 rounded-full`}):i.jsx("i",{className:`${Qv} text-[#0000ff] text-xl`})})]}),i.jsx("div",{className:"p-3 pt-0",children:u(f.templates,h)})]},b)},[n,c,u]);return i.jsx("div",{className:"rsp-table-templates-container space-y-4",children:p.map((f,b)=>m(f,b===0?"plain":b===1?"grid":"list"))})},qN=({rowCount:e,columnCount:t,onRowCountChange:o,onColumnCountChange:r,onUpdate:n,error:s,maxColumns:a=8,blockCount:l=1})=>{const d={1:8,2:4,3:3,4:2,5:2};return i.jsxs("div",{className:"space-y-4",children:[i.jsx("div",{className:"flex-del items-center-del justify-between-del",children:i.jsx(et,{mainClass:"button-control-view",label:"Rows (max 20)",onClick:()=>{},onChange:c=>{let u=c||2;u=Math.min(20,Math.max(1,u)),o(u)},min:1,max:20,step:1,defaultValue:e||2,isShowLeftDescription:!1,leftDescription:"",buttonClass:"",labelClass:""})}),i.jsx("div",{className:"flex-del items-center-del justify-between-del",children:i.jsx(et,{mainClass:"button-control-view",label:`Columns (max ${d[l]||a})`,onClick:()=>{},onChange:c=>{let u=c||2;u=Math.min(a,Math.max(1,u)),r(u)},min:1,max:d[l]||a,step:1,defaultValue:t||2,isShowLeftDescription:!1,leftDescription:"",buttonClass:"",labelClass:""})}),s&&i.jsx("div",{className:"text-red-500 text-sm",children:s})]})},XN=({onInsertRow:e,onInsertColumn:t,currentColumnCount:o,currentRowCount:r,maxColumns:n=8,error:s})=>{const a=o>=n,l=r>=20;return i.jsx("div",{className:"space-y-4",children:i.jsxs("div",{className:"rsp-inside-bg p-2 bg-gray-50 rounded-lg space-y-3",children:[i.jsx("h3",{className:"marginB5 rsp-properties-lable block text-md color-primary-black",children:"Insert row"}),i.jsxs("div",{className:"rsp-insert-row marginT0 flex gap-2",children:[i.jsxs("button",{onClick:()=>e("above"),className:`flex flex-col flex-1 paddingY10 paddingX5 gap-1 bg-white border rounded ${l?"opacity-50 cursor-not-allowed":"hover-bg-tertiary-blue"}`,disabled:l,title:l?"Maximum 20 rows allowed":void 0,children:[i.jsx("div",{className:"mb-1 fill-primary-black",children:i.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",id:"a",width:"32",height:"32",viewBox:"0 0 32 32",children:[i.jsx("path",{d:"M29.25,6.01h-5.45c-.41,0-.75.34-.75.75s.34.75.75.75h4.7v6h-11v1.5h2.17v6h-7.33v-6h2.17v-1.5H3.5v-6h4.75c.41,0,.75-.34.75-.75s-.34-.75-.75-.75H2.75c-.41,0-.75.34-.75.75v22.49c0,.41.34.75.75.75h26.5c.41,0,.75-.34.75-.75V6.76c0-.41-.34-.75-.75-.75ZM10.83,28.5H3.5v-6h7.33v6ZM10.83,21H3.5v-6h7.33v6ZM19.67,28.5h-7.33v-6h7.33v6ZM28.5,28.5h-7.33v-6h7.33v6ZM28.5,21h-7.33v-6h7.33v6Z"}),i.jsx("path",{d:"M21.25,6.99l-4.87-4.77c-.14-.14-.37-.23-.54-.21-.2,0-.39.09-.53.23l-4.57,4.77c-.29.3-.28.77.02,1.06.15.14.33.21.52.21.2,0,.39-.08.54-.23l3.43-3.58v13.07c0,.41.34.75.75.75s.75-.34.75-.75V4.69l3.45,3.37c.29.29.77.29,1.06-.01.29-.3.28-.77-.01-1.06Z"})]})}),i.jsx("span",{className:"d-block text-center text-sm color-primary-black",children:"Insert at start"})]}),i.jsxs("button",{onClick:()=>e("below"),className:`flex flex-col flex-1 paddingY10 paddingX5 gap-1 bg-white border rounded ${l?"opacity-50 cursor-not-allowed":"hover-bg-tertiary-blue"}`,disabled:l,title:l?"Maximum 20 rows allowed":void 0,children:[i.jsx("div",{className:"mb-1 fill-primary-black",children:i.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",id:"a",width:"32",height:"32",viewBox:"0 0 32 32",children:[i.jsx("path",{d:"M30,25.24V2.76c0-.41-.34-.75-.75-.75H2.75c-.41,0-.75.34-.75.75v22.49c0,.41.34.75.75.75h5.5c.41,0,.75-.34.75-.75s-.34-.75-.75-.75H3.5v-6h11v-1.5h-2.17v-6h7.33v6h-2.17v1.5h11v6h-4.7c-.41,0-.75.34-.75.75s.34.75.75.75h5.45c.41,0,.75-.34.75-.75ZM10.83,9.5H3.5V3.51h7.33v6ZM10.83,17H3.5v-6h7.33v6ZM19.67,9.5h-7.33V3.51h7.33v6ZM28.5,9.5h-7.33V3.51h7.33v6ZM28.5,17h-7.33v-6h7.33v6Z"}),i.jsx("path",{d:"M21.25,25.01l-4.87,4.77c-.14.14-.37.23-.54.21-.2,0-.39-.09-.53-.23l-4.57-4.77c-.29-.3-.28-.77.02-1.06.15-.14.33-.21.52-.21.2,0,.39.08.54.23l3.43,3.58v-13.07c0-.41.34-.75.75-.75s.75.34.75.75v12.85l3.45-3.37c.29-.29.77-.29,1.06.01.29.3.28.77-.01,1.06Z"})]})}),i.jsx("span",{className:"d-block text-center text-sm color-primary-black",children:"Insert at end"})]})]}),l&&i.jsxs("p",{className:"text-sm text-amber-600",children:["Maximum ",20," rows allowed"]}),s&&i.jsx("p",{className:"text-sm text-red-500",children:s}),i.jsx("h3",{className:"marginB5 rsp-properties-lable block text-md color-primary-black",children:"Insert column"}),i.jsxs("div",{className:"rsp-insert-columns marginT0 flex gap-2",children:[i.jsxs("button",{onClick:()=>t("before"),className:`flex flex-col flex-1 paddingY10 paddingX5 gap-1 bg-white border rounded ${a?"opacity-50 cursor-not-allowed":"hover-bg-tertiary-blue"}`,disabled:a,title:a?`Maximum ${n} columns allowed`:void 0,children:[i.jsx("div",{className:"mb-1 fill-primary-black",children:i.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",id:"a",width:"32",height:"32",viewBox:"0 0 32 32",children:[i.jsx("path",{d:"M6.01,2.75v5.45c0,.41.34.75.75.75s.75-.34.75-.75V3.5h6v11h1.5v-2.17h6v7.33h-6v-2.17h-1.5v11h-6v-4.75c0-.41-.34-.75-.75-.75s-.75.34-.75.75v5.5c0,.41.34.75.75.75h22.49c.41,0,.75-.34.75-.75V2.75c0-.41-.34-.75-.75-.75H6.76c-.41,0-.75.34-.75.75ZM28.5,21.17v7.33h-6v-7.33h6ZM21,21.17v7.33h-6v-7.33h6ZM28.5,12.34v7.33h-6v-7.33h6ZM28.5,3.5v7.33h-6V3.5h6ZM21,3.5v7.33h-6V3.5h6Z"}),i.jsx("path",{d:"M6.99,10.76l-4.77,4.87c-.14.14-.23.37-.21.54,0,.2.09.39.23.53l4.77,4.57c.3.29.77.28,1.06-.02.14-.15.21-.33.21-.52,0-.2-.08-.39-.23-.54l-3.58-3.43h13.07c.41,0,.75-.34.75-.75s-.34-.75-.75-.75H4.69l3.37-3.45c.29-.29.29-.77-.01-1.06-.3-.29-.77-.28-1.06.01Z"})]})}),i.jsx("span",{className:"d-block text-center text-sm color-primary-black",children:"Insert at start"})]}),i.jsxs("button",{onClick:()=>t("after"),className:`flex flex-col flex-1 paddingY10 paddingX5 gap-1 bg-white border rounded ${a?"opacity-50 cursor-not-allowed":"hover-bg-tertiary-blue"}`,disabled:a,title:a?`Maximum ${n} columns allowed`:void 0,children:[i.jsx("div",{className:"mb-1 fill-primary-black",children:i.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",id:"a",width:"32",height:"32",viewBox:"0 0 32 32",children:[i.jsx("path",{d:"M25.24,2H2.75c-.41,0-.75.34-.75.75v26.5c0,.41.34.75.75.75h22.49c.41,0,.75-.34.75-.75v-5.5c0-.41-.34-.75-.75-.75s-.75.34-.75.75v4.75h-6v-11s-1.5,0-1.5,0v2.17h-6v-7.33h6v2.17s1.5,0,1.5,0V3.5h6v4.7c0,.41.34.75.75.75s.75-.34.75-.75V2.75c0-.41-.34-.75-.75-.75ZM9.5,21.17v7.33H3.5v-7.33h6ZM16.99,21.17v7.33h-6v-7.33h6ZM9.5,12.34v7.33H3.5v-7.33h6ZM9.5,3.5v7.33H3.5V3.5h6ZM16.99,3.5v7.33h-6V3.5h6Z"}),i.jsx("path",{d:"M25.01,10.76l4.77,4.87c.14.14.23.37.21.54,0,.2-.09.39-.23.53l-4.77,4.57c-.3.29-.77.28-1.06-.02-.14-.15-.21-.33-.21-.52s.08-.39.23-.54l3.58-3.43h-13.07c-.41,0-.75-.34-.75-.75,0-.41.34-.75.75-.75h12.85s-3.37-3.45-3.37-3.45c-.29-.29-.29-.77.01-1.06.3-.29.77-.28,1.06.01Z"})]})}),i.jsx("span",{className:"d-block text-center text-sm color-primary-black",children:"Insert at end"})]})]}),a&&i.jsxs("p",{className:"text-sm text-amber-600",children:["Maximum ",n," columns allowed"]}),s&&i.jsx("p",{className:"text-sm text-red-500",children:s})]})})},KN=({onDeleteRow:e,onDeleteColumn:t,rowCount:o,columnCount:r})=>{const n=o>1,s=r>1;return i.jsxs("div",{className:"rsp-inside-bg p-2 bg-gray-50 rounded-lg space-y-3",children:[i.jsx("h3",{className:"marginB5 rsp-properties-lable block text-md color-primary-black",children:"Delete"}),i.jsxs("div",{className:"flex gap-2 rsp-insert-delete",children:[i.jsxs("button",{onClick:e,className:`flex flex-col flex-1 paddingY10 paddingX5 gap-1 bg-white border rounded ${n?"hover-bg-tertiary-blue":"opacity-50 cursor-not-allowed"}`,disabled:!n,title:n?void 0:"Cannot delete the last row",children:[i.jsx("div",{className:"mb-1 flex justify-center",children:i.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[i.jsx("path",{d:"M3 6h18"}),i.jsx("path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6"}),i.jsx("path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2"}),i.jsx("line",{x1:"10",y1:"11",x2:"10",y2:"17"}),i.jsx("line",{x1:"14",y1:"11",x2:"14",y2:"17"})]})}),i.jsx("span",{className:"d-block text-center text-sm color-primary-black",children:"Delete last row"})]}),i.jsxs("button",{onClick:t,className:`flex flex-col flex-1 paddingY10 paddingX5 gap-1 bg-white border rounded ${s?"hover-bg-tertiary-blue":"opacity-50 cursor-not-allowed"}`,disabled:!s,title:s?void 0:"Cannot delete the last column",children:[i.jsx("div",{className:"mb-1 flex justify-center",children:i.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[i.jsx("path",{d:"M3 6h18"}),i.jsx("path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6"}),i.jsx("path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2"}),i.jsx("line",{x1:"10",y1:"11",x2:"10",y2:"17"}),i.jsx("line",{x1:"14",y1:"11",x2:"14",y2:"17"})]})}),i.jsx("span",{className:"d-block text-center text-sm color-primary-black",children:"Delete last column"})]})]})]})},ps=ro.MAX_COLUMNS,d0=({id:e,content:t,style:o={},onUpdate:r,columnCount:n=1})=>{var F,q,R,M,L,U,ee,Y,te,ie,ue,ne,ae,oe;const{updateComponent:s,getComponentForRender:a}=Te(),{updateBlockComponent:l}=Ye(),{currentSelection:d,execCommand:c,getCanvasEditor:u,restoreSelection:p,formatState:m,saveSelectionImmediate:f}=$o(),[b,h]=S.useState("content"),[g,x]=S.useState(((F=t==null?void 0:t.rows)==null?void 0:F.length)||2),[C,k]=S.useState(((R=(q=t==null?void 0:t.rows)==null?void 0:q[0])==null?void 0:R.length)||2),[v,A]=S.useState(""),w=a(e),y=((M=w==null?void 0:w.contentTarget)==null?void 0:M.hasTargeting)??!1,{activeTab:E}=qt(e,(L=w==null?void 0:w.contentTarget)==null?void 0:L.targetGroups);S.useRef(t),S.useRef(o);const j=y&&((Y=(ee=(U=w==null?void 0:w.contentTarget)==null?void 0:U.targetGroups)==null?void 0:ee[E])==null?void 0:Y.content)||t,B=y&&((ue=(ie=(te=w==null?void 0:w.contentTarget)==null?void 0:te.targetGroups)==null?void 0:ie[E])!=null&&ue.style)?{...o,...w.contentTarget.targetGroups[E].style}:o;S.useEffect(()=>{var G;j!=null&&j.rows&&(x(j.rows.length),k(((G=j.rows[0])==null?void 0:G.length)||2))},[j]);const $=G=>{if(r){r(G);return}const Q=G.style?{...B,...G.style}:B,J=document.querySelector(`[data-component-id="${e}"]`),T=J==null?void 0:J.getAttribute("data-parent-id"),X=J==null?void 0:J.getAttribute("data-column-index"),H={...G,style:Q};T&&X?l(T,e,H):s(e,H)},_=(G,Q)=>{if(G<1||Q<1){A("Row and column counts must be at least 1");return}if(G>ro.MAX_ROWS){A(`Maximum allowed rows is ${ro.MAX_ROWS}`);return}if(Q>ps){A(`Maximum allowed columns is ${ps}`);return}A(""),x(G),k(Q);const J=`${100/Q}%`,T=Array(G).fill(null).map((X,H)=>Array(Q).fill(null).map((D,W)=>{var I,V;return(V=(I=j==null?void 0:j.rows)==null?void 0:I[H])!=null&&V[W]?j.rows[H][W]:`Cell ${H+1}-${W+1}`}));$({content:{rows:T},style:{...B,columnWidth:J,tableLayout:"fixed"}})},z=G=>{const Q=[...j.rows],J=j.rows[0].length,T=Array(J).fill("").map((H,D)=>`Cell ${Q.length+1}-${D+1}`),X=G==="below"?Q.length:0;Q.splice(X,0,T),x(Q.length),$({content:{rows:Q}})},N=G=>{if(j.rows[0].length>=ps){A(`Maximum ${ps} columns allowed`);return}const Q=j.rows.map((T,X)=>{const H=[...T],D=G==="after"?H.length:0;return H.splice(D,0,`Cell ${X+1}-${H.length+1}`),H}),J=`${100/(j.rows[0].length+1)}%`;k(Q[0].length),A(""),$({content:{rows:Q},style:{...B,columnWidth:J}})},O=()=>{if(j.rows.length<=1){A("Cannot delete the last row");return}const G=[...j.rows];G.pop(),x(G.length),$({content:{rows:G}})},K=()=>{if(j.rows[0].length<=1){A("Cannot delete the last column");return}const G=j.rows.map(J=>{const T=[...J];return T.pop(),T}),Q=`${100/(j.rows[0].length-1)}%`;k(G[0].length),$({content:{rows:G},style:{...B,columnWidth:Q}})};return i.jsxs("div",{className:"space-y-6",children:[i.jsx("div",{className:"rsp-tab flex border-b border-gray-200",children:["content","style","templates"].map(G=>i.jsx("button",{onClick:()=>h(G),className:`w-full px-4 py-2 text-md border-b-2 -mb-px ${b===G?"active color-primary-blue border-primary-blue":"inactive text-gray-500 border-transparent hover:color-secondary-black hover-border-bottom-quaternary-blue"}`,children:G.charAt(0).toUpperCase()+G.slice(1)},G))}),b==="content"&&i.jsxs("div",{className:"space-y-6",children:[i.jsx("div",{className:"rsp-property-elements-block",children:i.jsx(qN,{rowCount:g,columnCount:C,blockCount:n,onRowCountChange:G=>_(G,C),onColumnCountChange:G=>_(g,G),error:v,onUpdate:$})}),i.jsx("div",{className:"rsp-property-elements-block",children:i.jsx(XN,{onInsertRow:z,onInsertColumn:N,currentColumnCount:((ne=j.rows[0])==null?void 0:ne.length)||0,currentRowCount:((ae=j==null?void 0:j.rows)==null?void 0:ae.length)||0,error:v})}),i.jsx(KN,{onDeleteRow:O,onDeleteColumn:K,rowCount:j.rows.length,columnCount:((oe=j.rows[0])==null?void 0:oe.length)||0})]}),b==="style"&&i.jsx(DN,{style:B,formatState:m,hasTextSelection:!!((d==null?void 0:d.componentId)===e&&(d!=null&&d.isCanvas)&&(d!=null&&d.range)&&!d.range.collapsed),onStyleChange:(G,Q)=>{var T;if((d==null?void 0:d.componentId)===e&&(d==null?void 0:d.isCanvas)&&(d==null?void 0:d.range)&&!d.range.collapsed){const X=u(e);X&&(f(),(T=X.saveSelection)==null||T.call(X),p(),G==="fontFamily"?setTimeout(()=>{p(),c("fontName",Q),setTimeout(()=>{var H;(H=X.saveSelection)==null||H.call(X),f()},50)},20):setTimeout(()=>{switch(G){case"bold":c("bold");break;case"italic":c("italic");break;case"underline":c("underline");break;case"textColor":c("foreColor",Q);break;case"fontSize":c("fontSize",Q.toString());break;case"textAlign":{const H=`justify${Q.charAt(0).toUpperCase()+Q.slice(1)}`;c(H);break}default:$({style:{...B,[G]:Q}})}setTimeout(()=>{var H;(H=X.saveSelection)==null||H.call(X),f()},50)},10))}else $({style:{...B,[G]:Q}})},onFontFamilyDropdownOpen:()=>{var Q;if((d==null?void 0:d.componentId)===e&&(d==null?void 0:d.isCanvas)&&(d==null?void 0:d.range)&&!d.range.collapsed){const J=u(e);J&&(f(),(Q=J.saveSelection)==null||Q.call(J))}}}),b==="templates"&&i.jsx(GN,{id:e,onApplyTemplate:G=>{$({style:{...B,...G}})}})]})},u0=({id:e,style:t={},onUpdate:o})=>{const{updateComponent:r}=Te(),{updateBlockComponent:n}=Ye(),s=l=>{if(o){o(l);return}const d=document.querySelector(`[data-component-id="${e}"]`),c=d==null?void 0:d.getAttribute("data-parent-id"),u=d==null?void 0:d.getAttribute("data-column-index");c&&u?n(c,e,l):r(e,l)},a=(l,d)=>{s({style:{...t,[l]:d}})};return i.jsxs("div",{className:"space-y-6",children:[i.jsx("div",{className:"rsp-property-elements-block",children:i.jsx(et,{mainClass:"button-control-view",label:"Height",leftDescription:"(px)",isShowLeftDescription:!0,onClick:()=>{},onChange:l=>a("height",`${l}`),min:5,max:100,step:5,defaultValue:parseInt(t.height)||5})}),i.jsxs("div",{className:"rsp-property-elements-block-del flex items-center justify-between",children:[i.jsx("label",{className:"rsp-properties-lable block text-md color-primary-black",children:"Container background"}),i.jsx("div",{className:"flex flex-col space-y-2",children:i.jsx(gt,{value:(t==null?void 0:t.containerBackgroundColor)||"transparent",onChange:l=>{a("containerBackgroundColor",l)}})})]}),i.jsxs("div",{className:"hidden",children:[i.jsx("label",{className:"block text-md font-regular color-primary-black mb-2",children:"Margin"}),i.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[i.jsx(et,{id:"radius-top-right",label:"",onClick:()=>{},onChange:l=>a("marginTop",l),min:1,max:10,step:1,defaultValue:t.marginTop||0}),i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("label",{className:"block text-xs text-gray-500 mb-1",children:"Bottom"}),i.jsx("input",{type:"number",value:t.marginBottom||0,onChange:l=>a("marginBottom",parseInt(l.target.value)),className:"w-full p-2 border rounded-md",min:"0",max:"100"})]})]})]})]})},Qc=[{id:"facebook",name:"Facebook",icon:"/assets/social/1/facebook.png",placeholder:"https://facebook.com/yourpage"},{id:"x",name:"X",icon:"/assets/social/1/x.png",placeholder:"https://x.com/yourhandle"},{id:"instagram",name:"Instagram",icon:"/assets/social/1/instagram.png",placeholder:"https://instagram.com/yourprofile"},{id:"linkedin",name:"LinkedIn",icon:"/assets/social/1/linkedin.png",placeholder:"https://linkedin.com/company/yourcompany"},{id:"youtube",name:"YouTube",icon:"/assets/social/1/youtube.png",placeholder:"https://youtube.com/yourchannel"},{id:"whatsapp",name:"WhatsApp",icon:"/assets/social/1/whatsapp.png",placeholder:"https://wa.me/yournumber"},{id:"telegram",name:"Telegram",icon:"/assets/social/1/telegram.png",placeholder:"https://t.me/yourusername"},{id:"pinterest",name:"Pinterest",icon:"/assets/social/1/pinterest.png",placeholder:"https://pinterest.com/yourprofile"},{id:"tiktok",name:"TikTok",icon:"/assets/social/1/tiktok.png",placeholder:"https://tiktok.com/yourprofile"}],YN=Array.from({length:29},(e,t)=>({id:t+1,src:`/assets/social/iconStyle/style-${String(t+1).padStart(2,"0")}.png`})),JN=({selectedStyle:e,onStyleSelect:t})=>i.jsxs("div",{className:"rsp-property-elements-block space-y-4 overflow-auto",children:[i.jsx("h3",{className:"rsp-properties-lable block text-md color-primary-black",children:"Icon style"}),i.jsx("div",{className:"rsp-social-icon-style grid grid-cols-3 gap-2",children:YN.map(o=>i.jsx("button",{onClick:()=>t(o.id),className:`p-2 border rounded relative ${e===o.id?"ring-2 ring-blue-500":""} ${(o==null?void 0:o.id)===20||(o==null?void 0:o.id)===28?"bg-secondary-grey":"hover:bg-gray-50"}`,children:i.jsx("img",{src:o.src,alt:`Style ${o.id}`,className:"w-full object-contain",style:{height:"40px"}})},o.id))})]}),ZN=({platform:e,link:t,onRemove:o,onLinkChange:r,dragHandleProps:n,error:s,disabled:a=!1})=>{const l=Qc.find(m=>m.id===e);if(!l)return null;const[d,c]=S.useState(!1),u=()=>{a||c(!0)},p=()=>{o(),c(!1)};return i.jsxs("div",{className:"rsp-social-inside-bg p-2 bg-gray-50 rounded-lg space-y-3",children:[i.jsxs("div",{className:"flex justify-between items-center mb-2",children:[i.jsxs("div",{className:"flex items-center gap-2-del",children:[i.jsx("div",{...n,className:"cursor-move p-1 hover:bg-primary-blue rounded marginL-7",children:i.jsx(wx,{className:"w-4 h-4 color-primary-blue"})}),i.jsx("h4",{className:"text-md font-regular color-primary-black",children:l.name})]}),i.jsx(Ie,{text:a?"Cannot remove the last social platform":`Remove ${l.name}`,position:"left",className:"line-block",children:i.jsx("div",{className:a?"opacity-50 cursor-not-allowed":"",children:i.jsx(ut,{icon:Lr,tooltip:"Version history",position:"bottom",size:"md",callBack:()=>u()})})})]}),i.jsxs("div",{className:"rsp-social-title-url",children:[i.jsx("div",{children:i.jsx(jt,{classWrapper:"marginT30",placeholder:"Title",value:(t==null?void 0:t.title)??(t!=null&&t.url?"":l.name),handleOnchange:m=>r("title",m.target.value),maxLength:80,required:!0})}),i.jsxs("div",{className:"marginT30",children:[i.jsx(jt,{classWrapper:"marginT40",placeholder:"URL",value:(t==null?void 0:t.url)||"",handleOnchange:m=>r("url",m.target.value),errMsg:s,maxLength:150,required:!0}),s&&i.jsx("p",{className:"marginT-10 text-xs text-red-500",children:s})]})]}),i.jsx(wo,{isOpen:d,onClose:()=>c(!1),onConfirm:p,title:"Confirmation",message:"Are you sure you want to remove this platform?"})]})},QN=({activeTab:e,onTabChange:t})=>{const o=[{id:"content",label:"Content"},{id:"style",label:"Style"},{id:"spacing",label:"Spacing"}];return i.jsx("div",{className:"rsp-tab flex border-b border-gray-200",children:o.map(r=>i.jsx("button",{onClick:()=>t(r.id),className:`w-full px-4 py-2 text-md ${e===r.id?"active color-primary-blue":"inactive color-secondary-black"}`,children:r.label},r.id))})},eB=({content:e,platforms:t,errors:o,onLinkChange:r,onRemovePlatform:n,onAddPlatform:s,onDragStart:a,onDragOver:l,onDragEnd:d})=>{const c=Qc.filter(u=>{var p;return!((p=e.links)!=null&&p[u.id])});return i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{className:"flex justify-between items-center",children:[i.jsx("h3",{className:"rsp-properties-lable block text-md color-primary-black",children:"Social links"}),i.jsx("div",{className:"relative",children:i.jsx(Tt,{label:"",widthDropdown:"w-[160px] right0",width:"w-[160px] right0",value:"Add platform",options:c.map(u=>({label:u.name,value:u.id})),onChange:(u,p)=>{const m=Qc.find(f=>f.id===u);m&&s(m)}})})]}),i.jsx("div",{className:"space-y-4",children:t.map(u=>i.jsx("div",{draggable:!1,onDragStart:p=>a(p,u),onDragOver:p=>l(p,u),onDragEnd:d,children:i.jsx(ZN,{platform:u,link:e.links[u],onRemove:()=>n(u),onLinkChange:(p,m)=>r(u,p,m),error:o[u],disabled:t.length===1,dragHandleProps:{draggable:!0,onDragStart:p=>{p.stopPropagation(),a(p,u)}}})},u))})]})},tB=({style:e,onStyleChange:t})=>{const[o,r]=S.useState(e.containerBackgroundColor==="transparent");return i.jsxs("div",{className:"space-y-6",children:[i.jsxs("div",{className:"rsp-property-elements-block flex items-center justify-between",children:[i.jsx("label",{className:"rsp-properties-lable block text-md color-primary-black",children:"Container background"}),i.jsx("div",{className:"flex flex-col space-y-2",children:i.jsx(gt,{value:(e==null?void 0:e.containerBackgroundColor)||"transparent",onChange:n=>t("containerBackgroundColor",n)})})]}),i.jsx(JN,{selectedStyle:e.iconStyle||1,onStyleSelect:n=>t("iconStyle",n)}),i.jsxs("div",{className:"rsp-property-elements-block space-y-6",children:[i.jsxs("div",{className:"rsp-select-dropdown flex items-center justify-between ",children:[i.jsx("label",{className:"rsp-properties-lable block text-md color-primary-black",children:"Icon size"}),i.jsx(Tt,{id:"iconSizeSelector",label:"",className:"",width:"w-[160px]",widthDropdown:"w-[160px] right0",value:(e.iconSize||24)+"px",options:Lv,onChange:n=>t("iconSize",parseInt(n))})]}),i.jsxs("div",{className:"rsp-select-dropdown flex items-center justify-between",children:[i.jsx("label",{className:"rsp-properties-lable block text-md color-primary-black",children:"Align"}),i.jsxs("div",{className:"flex items-center gap-1",children:[i.jsx(Ie,{text:"Left",position:"top",className:"line-block",children:i.jsx("button",{onClick:()=>t("alignment","left"),className:`p-1.5 rounded ${e.alignment==="left"?"bg-primary-blue text-white":"bg-tertiary-blue"}`,children:i.jsx(_o,{className:"w-4 h-4"})})}),i.jsx(Ie,{text:"Center",position:"top",className:"line-block",children:i.jsx("button",{onClick:()=>t("alignment","center"),className:`p-1.5 rounded ${e.alignment==="center"?"bg-primary-blue text-white":"bg-tertiary-blue"}`,children:i.jsx(Xo,{className:"w-4 h-4"})})}),i.jsx(Ie,{text:"Right",position:"top",className:"line-block",children:i.jsx("button",{onClick:()=>t("alignment","right"),className:`p-1.5 rounded ${e.alignment==="right"?"bg-primary-blue text-white":"bg-tertiary-blue"}`,children:i.jsx(Ro,{className:"w-4 h-4"})})})]})]})]})]})},oB=({style:e,onStyleChange:t})=>i.jsxs("div",{className:"space-y-6",children:[i.jsx("div",{className:"space-y-4",children:i.jsx(et,{mainClass:"button-control-view",label:"Icon spacing",onClick:()=>{},onChange:o=>t("spacing",o),min:5,max:50,step:5,defaultValue:e.spacing||16,isShowLeftDescription:!1,leftDescription:""})}),i.jsx(ao,{label:"Padding",id:"button-padding-control",marginSection:!1,paddingSection:!0,padding:e.paddingControl,isHideLeftRight:!0,onChange:o=>{t("paddingControl",o)}})]}),p0=S.forwardRef(({id:e,content:t,style:o={},onUpdate:r},n)=>{const{updateComponent:s}=Te(),{updateBlockComponent:a}=Ye(),[l,d]=S.useState("content"),[c,u]=S.useState(Object.keys(t.links||{})),[p,m]=S.useState(null),[f,b]=S.useState({});S.useEffect(()=>{u(Object.keys(t.links||{}))},[t==null?void 0:t.links]);const h=$=>{if(r){r($);return}const _=document.querySelector(`[data-component-id="${e}"]`),z=_==null?void 0:_.getAttribute("data-parent-id"),N=_==null?void 0:_.getAttribute("data-column-index");z&&N?a(z,e,$):s(e,$)},g=($,_)=>{h({style:{...o,[$]:_}})},x=$=>{h({content:{...t,...$}})},C=($,_)=>{if(!_.trim())return null;try{new URL(_)}catch{return"Please enter a valid URL"}switch($){case"facebook":if(!_.match(/^https?:\/\/(www\.)?(facebook|fb)\.com/i))return"Please enter a valid Facebook URL (e.g., https://facebook.com)";break;case"x":if(!_.match(/^https?:\/\/(www\.)?(twitter|x)\.com/i))return"Please enter a valid X URL (e.g., https://x.com)";break;case"instagram":if(!_.match(/^https?:\/\/(www\.)?instagram\.com/i))return"Please enter a valid Instagram URL (e.g., https://instagram.com)";break;case"linkedin":if(!_.match(/^https?:\/\/([a-z0-9-]+\.)*linkedin\.com/i))return"Please enter a valid LinkedIn URL (e.g., https://linkedin.com)";break;case"youtube":if(!_.match(/^https?:\/\/(www\.)?(youtube\.com|youtu\.be)/i))return"Please enter a valid YouTube URL (e.g., https://youtube.com)";break;case"whatsapp":if(!_.match(/^https?:\/\/(www\.)?whatsapp\.com(\/.*)?$/i)&&!_.match(/^https?:\/\/wa\.me\/\d+(\?.*)?$/i)&&!_.match(/^https?:\/\/api\.whatsapp\.com\/send\?phone=\d+(&text=.*)?$/i))return"Please enter a valid WhatsApp URL (e.g., https://whatsapp.com, https://wa.me/1234567890)";break;case"telegram":if(!_.trim().match(/^https?:\/\/(www\.)?(t\.me|telegram\.me)/i))return"Please enter a valid Telegram URL (e.g., https://t.me)";break;case"pinterest":if(!_.match(/^https?:\/\/(www\.)?pinterest\.(com|ca|co\.uk|fr|de|es)/i))return"Please enter a valid Pinterest URL (e.g., https://pinterest.com)";break;case"tiktok":if(!_.match(/^https?:\/\/(www\.)?(tiktok\.com|vm\.tiktok\.com)/i))return"Please enter a valid TikTok URL (e.g., https://tiktok.com)";break}return null},k=($,_,z)=>{let N=null;if(_==="url"){N=C($,z),b(F=>({...F,[$]:N||""}));const O={...t.links,[$]:{...t.links[$],[_]:z}};let K=!0;Object.entries(O).forEach(([F,q])=>{C(F,(q==null?void 0:q.url)||"")&&(K=!1)}),g("socialValid",K),x({links:O})}else{const O={...t.links,[$]:{...t.links[$],[_]:z}};x({links:O})}},v=$=>{const _={...t.links};delete _[$],x({links:_}),u(c.filter(z=>z!==$)),b(z=>{const N={...z};return delete N[$],N})},A=$=>{if(!t.links[$.id]){const _={...t.links,[$.id]:{url:"",title:$.name}};x({links:_}),u([...c,$.id])}},w=($,_)=>{m(_),$.dataTransfer.effectAllowed="move"},y=($,_)=>{if($.preventDefault(),!p||p===_)return;const z=[...c],N=z.indexOf(p),O=z.indexOf(_);z.splice(N,1),z.splice(O,0,p),u(z);const K={};z.forEach(F=>{t.links[F]&&(K[F]=t.links[F])}),x({links:K})},E=()=>{m(null)},j=()=>{const $={};let _=!0;return!t.links||Object.keys(t.links).length===0?_=!1:Object.entries(t.links||{}).forEach(([z,N])=>{const O=C(z,(N==null?void 0:N.url)||"");O&&($[z]=O,_=!1)}),b($),_};S.useEffect(()=>{j()},[t.links]),S.useImperativeHandle(n,()=>({validateBeforeSave:j}),[t.links]);const B=()=>{switch(l){case"content":return i.jsx(eB,{content:t,platforms:c,errors:f,onLinkChange:k,onRemovePlatform:v,onAddPlatform:A,onDragStart:w,onDragOver:y,onDragEnd:E});case"style":return i.jsx(tB,{style:o,onStyleChange:g});case"spacing":return i.jsx(oB,{style:o,onStyleChange:g});default:return null}};return i.jsxs("div",{className:"space-y-6","data-social-ref":!0,"data-valid":Object.keys(f).length===0&&Object.keys(t.links||{}).length>0,children:[i.jsx(QN,{activeTab:l,onTabChange:d}),B()]})}),h0=({id:e,content:t,style:o={}})=>{const{updateComponent:r}=Te(),n=(a,l)=>{r(e,{content:{...t,[a]:l}})},s=(a,l)=>{r(e,{style:{...o,[a]:l}})};return i.jsxs("div",{className:"space-y-6",children:[i.jsxs("div",{className:"space-y-4",children:[i.jsx("h3",{className:"text-md font-regular color-primary-black",children:"Content"}),i.jsxs("div",{children:[i.jsx("label",{className:"block text-md color-primary-black",children:"Address"}),i.jsx("input",{type:"text",value:t.address||"",onChange:a=>n("address",a.target.value),className:"w-full p-2 border rounded-md",placeholder:"Enter address"})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block text-md color-primary-black",children:"Phone number"}),i.jsx("input",{type:"tel",value:t.phone||"",onChange:a=>n("phone",a.target.value),className:"w-full p-2 border rounded-md",placeholder:"Enter phone number"})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block text-md color-primary-black",children:"Email"}),i.jsx("input",{type:"email",value:t.email||"",onChange:a=>n("email",a.target.value),className:"w-full p-2 border rounded-md",placeholder:"Enter email address"})]})]}),i.jsxs("div",{className:"space-y-4",children:[i.jsx("h3",{className:"text-md font-regular color-primary-black",children:"Style"}),i.jsxs("div",{children:[i.jsx("label",{className:"block text-md color-primary-black",children:"Text color"}),i.jsx("input",{type:"color",value:o.textColor||"#4B5563",onChange:a=>s("textColor",a.target.value),className:"w-full p-1 h-10 border rounded-md"})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block text-md color-primary-black",children:"Link color"}),i.jsx("input",{type:"color",value:o.linkColor||"#3B82F6",onChange:a=>s("linkColor",a.target.value),className:"w-full p-1 h-10 border rounded-md"})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block text-md color-primary-black",children:"Font size"}),i.jsx("input",{type:"number",value:o.fontSize||14,onChange:a=>s("fontSize",parseInt(a.target.value)),className:"w-full p-2 border rounded-md",min:"10",max:"24"})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block text-md color-primary-black",children:"Font family"}),i.jsxs("select",{value:o.fontFamily||"Arial, sans-serif",onChange:a=>s("fontFamily",a.target.value),className:"w-full p-2 border rounded-md",children:[i.jsx("option",{value:"Arial, sans-serif",children:"Arial"}),i.jsx("option",{value:"Lato, sans-serif",children:"Lato"}),i.jsx("option",{value:"Times New Roman, serif",children:"Times new roman"}),i.jsx("option",{value:"Courier New, monospace",children:"Courier new"}),i.jsx("option",{value:"Georgia, serif",children:"Georgia"}),i.jsx("option",{value:"Verdana, sans-serif",children:"Verdana"})]})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block text-md color-primary-black",children:"Align"}),i.jsxs("select",{value:o.textAlign||"center",onChange:a=>s("textAlign",a.target.value),className:"w-full p-2 border rounded-md",children:[i.jsx("option",{value:"left",children:"Left"}),i.jsx("option",{value:"center",children:"Center"}),i.jsx("option",{value:"right",children:"Right"})]})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block text-md color-primary-black",children:"Background color"}),i.jsx("input",{type:"color",value:o.backgroundColor||"#ffffff",onChange:a=>s("backgroundColor",a.target.value),className:"w-full p-1 h-10 border rounded-md"})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block text-md color-primary-black",children:"Padding"}),i.jsx("div",{className:"grid grid-cols-2 gap-4",children:["Top","Right","Bottom","Left"].map(a=>i.jsxs("div",{children:[i.jsx("label",{className:"block text-xs text-gray-500 mb-1",children:a}),i.jsx("input",{type:"number",value:o[`padding${a}`]||0,onChange:l=>s(`padding${a}`,parseInt(l.target.value)),className:"w-full p-2 border rounded-md",min:"0",max:"48"})]},a))})]})]})]})},f0=({id:e,content:t,style:o={}})=>{const{updateComponent:r}=Te(),n=new Date().getFullYear(),s=(l,d)=>{r(e,{content:{...t,[l]:d}})},a=(l,d)=>{r(e,{style:{...o,[l]:d}})};return i.jsxs("div",{className:"space-y-6",children:[i.jsxs("div",{className:"space-y-4",children:[i.jsx("h3",{className:"text-md font-regular color-primary-black",children:"Content"}),i.jsxs("div",{children:[i.jsx("label",{className:"block text-md color-primary-black",children:"Company name"}),i.jsx("input",{type:"text",value:t.companyName||"",onChange:l=>s("companyName",l.target.value),className:"w-full p-2 border rounded-md",placeholder:`© ${n} Company Name`})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block text-md color-primary-black",children:"Rights text"}),i.jsx("input",{type:"text",value:t.rightsText||"",onChange:l=>s("rightsText",l.target.value),className:"w-full p-2 border rounded-md",placeholder:"All rights reserved."})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block text-md color-primary-black",children:"Additional text"}),i.jsx("textarea",{value:t.additionalText||"",onChange:l=>s("additionalText",l.target.value),className:"w-full p-2 border rounded-md h-24 resize-vertical",placeholder:"Privacy Policy | Terms of Service"})]})]}),i.jsxs("div",{className:"space-y-4",children:[i.jsx("h3",{className:"text-md font-regular color-primary-black",children:"Style"}),i.jsxs("div",{children:[i.jsx("label",{className:"block text-md color-primary-black",children:"Text color"}),i.jsx("input",{type:"color",value:o.textColor||"#6B7280",onChange:l=>a("textColor",l.target.value),className:"w-full p-1 h-10 border rounded-md"})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block text-md color-primary-black",children:"Font size"}),i.jsx("input",{type:"number",value:o.fontSize||12,onChange:l=>a("fontSize",parseInt(l.target.value)),className:"w-full p-2 border rounded-md",min:"8",max:"18"})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block text-md color-primary-black",children:"Font family"}),i.jsxs("select",{value:o.fontFamily||"Arial, sans-serif",onChange:l=>a("fontFamily",l.target.value),className:"w-full p-2 border rounded-md",children:[i.jsx("option",{value:"Arial, sans-serif",children:"Arial"}),i.jsx("option",{value:"Lato, sans-serif",children:"Lato"}),i.jsx("option",{value:"Times New Roman, serif",children:"Times new roman"}),i.jsx("option",{value:"Courier New, monospace",children:"Courier new"}),i.jsx("option",{value:"Georgia, serif",children:"Georgia"}),i.jsx("option",{value:"Verdana, sans-serif",children:"Verdana"})]})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block text-md color-primary-black",children:"Align"}),i.jsxs("select",{value:o.textAlign||"center",onChange:l=>a("textAlign",l.target.value),className:"w-full p-2 border rounded-md",children:[i.jsx("option",{value:"left",children:"Left"}),i.jsx("option",{value:"center",children:"Center"}),i.jsx("option",{value:"right",children:"Right"})]})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block text-md color-primary-black",children:"Background color"}),i.jsx("input",{type:"color",value:o.backgroundColor||"#ffffff",onChange:l=>a("backgroundColor",l.target.value),className:"w-full p-1 h-10 border rounded-md"})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block text-md color-primary-black",children:"Padding"}),i.jsx("div",{className:"grid grid-cols-2 gap-4",children:["Top","Right","Bottom","Left"].map(l=>i.jsxs("div",{children:[i.jsx("label",{className:"block text-xs text-gray-500 mb-1",children:l}),i.jsx("input",{type:"number",value:o[`padding${l}`]||8,onChange:d=>a(`padding${l}`,parseInt(d.target.value)),className:"w-full p-2 border rounded-md",min:"0",max:"48"})]},l))})]})]})]})},rB=({style:e,onStyleChange:t})=>{const[o,r]=S.useState("Muktaregular"),n=()=>{const d=(e==null?void 0:e.paddingControl)||{};return d.isCustomPadding?d.left||d.right||0:d.all||0},s=()=>{var d;return((d=e==null?void 0:e.paddingControl)==null?void 0:d.btnspanheight)??5};function a(d,c){const u=d*Math.pow(10,c+1),p=Math.floor(u/10);return u>=p*10+5?(p+1)/Math.pow(10,c):p/Math.pow(10,c)}const l=[{label:"Standard Fonts",options:_t.standard},{label:"Non standard Fonts",options:_t.decorative}];return i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"rsp-property-elements-block space-y-4",children:[i.jsxs("div",{className:"rsp-property-elements-block flex items-center justify-between",children:[i.jsx("label",{className:"rsp-properties-lable block text-md color-primary-black",children:"Show icon"}),i.jsx(At,{id:"clicp-icon",isChecked:(e==null?void 0:e.clipIcon)||!1,onToggle:d=>{t("clipIcon",d)}})]}),i.jsxs("div",{className:"rsp-property-elements-block flex items-center justify-between",children:[i.jsx("label",{className:"rsp-properties-lable block text-md color-primary-black",children:"Show file info"}),i.jsx(At,{id:"file-info",isChecked:(e==null?void 0:e.showFileInfo)||!1,onToggle:d=>{t("showFileInfo",d)}})]}),i.jsx("div",{className:"rsp-property-elements-block",children:i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("label",{className:"rsp-properties-lable block text-md color-primary-black",children:"Container background"}),i.jsx("div",{className:"flex flex-col space-y-2",children:i.jsx(gt,{value:(e==null?void 0:e.containerBackgroundColor)||"transparent",onChange:d=>{t("containerBackgroundColor",d)}})})]})}),i.jsx("div",{children:i.jsx("div",{className:"rsp-property-elements-block",children:i.jsxs("div",{className:" flex items-center justify-between",children:[i.jsx("label",{className:"rsp-properties-lable block text-md color-primary-black",children:"Button background"}),i.jsx("div",{className:"flex flex-col space-y-2",children:i.jsx(gt,{value:(e==null?void 0:e.buttonColor)||"#f3f4f6",onChange:d=>{t("buttonColor",d)}})})]})})}),i.jsx("div",{className:"rsp-property-elements-block space-y-4",children:i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("label",{className:"rsp-properties-lable block text-md color-primary-black",children:"Full width"}),i.jsx(At,{id:"fullWidthButton",isChecked:(e==null?void 0:e.fullWidthButton)||!1,onToggle:d=>{t("fullWidthButton",d)}})]})}),!e.fullWidthButton&&i.jsx("div",{className:"rsp-property-elements-block ",children:i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("label",{className:"rsp-properties-lable block text-md color-primary-black",children:"Align"}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(Ie,{text:"Left",position:"top",className:"line-block",children:i.jsx("button",{onClick:()=>t("textAlign","start"),className:`p-1.5 rounded ${e.textAlign==="start"?"bg-primary-blue text-white":"bg-tertiary-blue color-primary-black"}`,children:i.jsx(_o,{className:"w-4 h-4"})})}),i.jsx(Ie,{text:"Center",position:"top",className:"line-block",children:i.jsx("button",{onClick:()=>t("textAlign","center"),className:`p-1.5 rounded ${e.textAlign==="center"?"bg-primary-blue text-white":"bg-tertiary-blue color-primary-black"}`,children:i.jsx(Xo,{className:"w-4 h-4"})})}),i.jsx(Ie,{text:"Right",position:"top",className:"line-block",children:i.jsx("button",{onClick:()=>t("textAlign","end"),className:`p-1.5 rounded ${e.textAlign==="end"?"bg-primary-blue text-white":"bg-tertiary-blue color-primary-black"}`,children:i.jsx(Ro,{className:"w-4 h-4"})})})]})]})}),i.jsx(Tt,{label:"Font family",width:"width170",value:e.fontFamily||"Arial, sans-serif",options:l,onChange:d=>t("fontFamily",d),previewFont:!0,isGrouped:!0}),i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("label",{className:"rsp-properties-lable block text-md color-primary-black",children:"Font size"}),i.jsx(et,{label:"",mainClass:"button-control-view",onClick:()=>{},onChange:d=>t("fontSize",d),min:11,max:72,step:1,defaultValue:e.fontSize||16})]}),i.jsxs("div",{className:" flex items-center justify-between",children:[i.jsx("label",{className:"rsp-properties-lable block text-md color-primary-black",children:"Text color"}),i.jsx("div",{className:"flex flex-col space-y-2",children:i.jsx(gt,{value:(e==null?void 0:e.buttonTextColor)||"#374151",onChange:d=>{t("buttonTextColor",d)}})})]}),i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("label",{className:"rsp-properties-lable block text-md color-primary-black",children:"Text style"}),i.jsxs("div",{className:"flex gap-2",children:[i.jsx(Ie,{text:"Bold",position:"top",className:"line-block",children:i.jsx("button",{onClick:()=>t("bold",!e.bold),className:`p-2 rounded ${e.bold?"bg-primary-blue text-white":"bg-tertiary-blue color-primary-black"}`,children:i.jsx(Ko,{className:"w-4 h-4"})})}),i.jsx(Ie,{text:"Italic",position:"top",className:"line-block",children:i.jsx("button",{onClick:()=>t("italic",!e.italic),className:`p-2 rounded ${e.italic?"bg-primary-blue text-white":"bg-tertiary-blue color-primary-black"}`,children:i.jsx(Yo,{className:"w-4 h-4"})})}),i.jsx(Ie,{text:"Underline",position:"left",className:"line-block",children:i.jsx("button",{onClick:()=>t("underline",!e.underline),className:`p-2 rounded ${e.underline?"bg-primary-blue text-white":"bg-tertiary-blue color-primary-black"}`,children:i.jsx(Jo,{className:"w-4 h-4"})})})]})]}),i.jsx(Tt,{label:"Text transform",width:"w-[160px]",value:e.textTransform||"None",options:li,onChange:d=>t("textTransform",d)}),i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("label",{className:"rsp-properties-lable block text-md color-primary-black",children:"Letter spacing"}),i.jsx(et,{label:"",mainClass:"button-control-view",onClick:()=>{},onChange:d=>t("letterSpacing",a(d,1)),min:-1,max:5,step:.5,defaultValue:e.letterSpacing||0})]}),i.jsxs("div",{className:"space-y-6",children:[!(e!=null&&e.fullWidthButton)&&i.jsx("div",{children:i.jsx(et,{actionButton:!0,label:"Width",mainClass:"button-control-view",isShowLeftDescription:!0,leftDescription:"Padding (left & right)",buttonClass:"",labelClass:"",onClick:()=>{},onChange:d=>{const u={...(e==null?void 0:e.paddingControl)||{},left:d,right:d,isCustomPadding:!0};t("paddingControl",u)},min:0,max:100,step:5,defaultValue:n()},`padding-lr-${n()}`)}),i.jsx("div",{children:i.jsx(et,{actionButton:!0,label:"Height",mainClass:"button-control-view",isShowLeftDescription:!0,leftDescription:"(px)",buttonClass:"",labelClass:"",onClick:()=>{},onChange:d=>{const u={...(e==null?void 0:e.paddingControl)||{},btnspanheight:d};t("paddingControl",u)},min:5,max:100,step:5,defaultValue:s()},`line-height-${s()}`)})]})]}),i.jsxs("div",{className:"space-y-4",children:[i.jsx(Jc,{id:"button-border-control",style:e,onStyleChange:(d,c)=>{t(d,c)}}),i.jsx(Tr,{id:"button-border-radius-control",borderRadius:e.buttonRadiusControl,onChange:d=>{t("buttonRadiusControl",d)}})]})]})},nB=({style:e,onStyleChange:t})=>i.jsxs("div",{className:"space-y-4",children:[i.jsx("div",{children:i.jsx(ao,{label:"Margin and Padding",id:"button-padding-control",marginSection:!0,paddingSection:!0,margin:e.containerPadding,padding:{...e.paddingControl,isPaddingEnabled:!1},onChange:(o,r)=>{o&&t("containerPadding",o)}})}),i.jsx("div",{className:"rsp-property-elements-block"}),i.jsx("div",{className:"space-y-4"})]}),m0=({id:e,content:t,style:o={},onUpdate:r})=>{const[n,s]=S.useState((o==null?void 0:o.showIcon)||!1),{updateComponent:a}=Te(),{updateBlockComponent:l}=Ye(),[d,c]=S.useState(""),[u,p]=S.useState(!1),[m,f]=S.useState("file"),[b,h]=S.useState("");S.useEffect(()=>{s((o==null?void 0:o.showIcon)||!1)},[o==null?void 0:o.showIcon]),S.useEffect(()=>{u&&c("")},[u]);const g=w=>{if(r){r(w);return}const y=document.querySelector(`[data-component-id="${e}"]`),E=y==null?void 0:y.getAttribute("data-parent-id"),j=y==null?void 0:y.getAttribute("data-column-index");E&&j?l(E,e,w):a(e,w)},x=(w,y)=>{var K,F,q,R;const E=document.querySelector(`[data-component-id="${e}"]`),j=E==null?void 0:E.getAttribute("data-parent-id"),B=E==null?void 0:E.getAttribute("data-column-index");let $=null;if(j&&B){const{getBlockComponents:M}=Ye.getState();$=M(j,parseInt(B)).find(U=>U.id===e)||null}else{const{getComponentForRender:M}=Te.getState();$=M(e)}const _=(K=$==null?void 0:$.contentTarget)==null?void 0:K.hasTargeting,z=((F=$==null?void 0:$.contentTarget)==null?void 0:F.activeTargetTabIndex)??0,N=(R=(q=$==null?void 0:$.contentTarget)==null?void 0:q.targetGroups)==null?void 0:R[z],O=_&&(N!=null&&N.style)?N.style:($==null?void 0:$.style)||o;g(w==="actionUpdates"?{style:{...O,...y}}:{style:{...O,[w]:y}})},C=w=>{g({content:{...t,...w}})},k=w=>{(w==null?void 0:w.imageUrl)!==void 0&&x("iconUrl",w.imageUrl),(w==null?void 0:w.imageAlt)!==void 0&&x("iconAltText",w.imageAlt)},v=w=>{if(w.toLowerCase().includes(".png")||w.toLowerCase().includes(".gif")||w.toLowerCase().includes(".jpeg")||w.toLowerCase().includes(".jpg"))return Vc;if(w.toLowerCase().includes(".zip"))return Wg;if(w.toLowerCase().includes(".pdf"))return ds},A=w=>{const y=w.match(/\.(pdf|png|jpg|jpeg|gif)(\?.*)?$/i);return y?y[1].toLowerCase():null};return i.jsxs("div",{className:"",children:[i.jsxs("div",{className:"rsp-tab flex border-b border-gray-200",children:[i.jsx("button",{className:`w-full px-4 py-2 text-md font-medium-del ${m==="file"?"active color-primary-blue":"inactive color-secondary-black"}`,onClick:()=>f("file"),children:"Content"}),i.jsx("button",{className:`w-full px-4 py-2 text-md font-medium-del ${m==="button"?"active color-primary-blue":"inactive color-secondary-black"}`,onClick:()=>f("button"),children:"Style"}),i.jsx("button",{className:`w-full px-4 py-2 text-md font-medium-del ${m==="display"?"active color-primary-blue":"inactive color-secondary-black"}`,onClick:()=>f("display"),children:"Spacing"})]}),i.jsxs("div",{className:"tab-content",children:[m==="file"&&i.jsxs("div",{className:"space-y-6",children:[i.jsxs("div",{className:"rsp-property-elements-block rsp-button-text flex items-baseline justify-between",children:[i.jsx("label",{className:"rsp-properties-lable block text-sm color-primary-black w-[220px]",children:"Button text"}),i.jsx(jt,{classWrapper:"marginT15",id:"rs_AudienceScore_Industry",placeholder:"Button text",defaultValue:"Banking",value:o.buttonText!==void 0?o.buttonText:"Download",handleOnchange:w=>x("buttonText",w.target.value),maxLength:50,required:!0})]}),i.jsxs("div",{className:"rsp-property-elements-block",children:[i.jsx("label",{className:"rsp-properties-lable marginB15 block color-primary-black",children:"Attachment"}),i.jsxs("div",{className:"space-y-4",children:[i.jsx("button",{onClick:()=>{c(""),p(!0)},className:"rsp-image-upload-properties w-full flex items-center justify-center px-4 py-2 border-2 border-dashed border-gray-300 rounded-lg hover:border-gray-400",children:i.jsxs("div",{className:"flex flex-col items-center",children:[i.jsx("h3",{children:"Click here to attach a file"}),i.jsx("small",{className:"",children:"Not more than 2MB"}),i.jsx("small",{className:"color-primary-grey",children:".zip, .jpg, .jpeg, .png, .gif, and .pdf only"})]})}),d&&i.jsxs("div",{className:"flex items-center text-red-500 text-sm gap-1 marginT5",children:[i.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",className:"w-4 h-4 mr-1",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[i.jsx("circle",{cx:"12",cy:"12",r:"10"}),i.jsx("line",{x1:"12",y1:"8",x2:"12",y2:"12"}),i.jsx("line",{x1:"12",y1:"16",x2:"12.01",y2:"16"})]}),d]}),t.fileName&&i.jsxs("div",{className:"rsp-attached-file-block relative flex text-sm color-secondary-black bg-gray-50 p-2 rounded-md",children:[i.jsx("img",{src:v(t.fileName),alt:""}),i.jsxs("div",{children:[i.jsx("p",{className:"ellispis",children:t.fileName}),i.jsxs("small",{children:[Math.round(t.fileSize/1024),"KB"]}),i.jsxs("small",{children:[(t==null?void 0:t.fileType)||"","/",A(t.fileUrl)||""]})]}),i.jsx("button",{onClick:()=>{c(""),C({fileName:"",fileSize:0,fileType:"",fileUrl:""})},className:"absolute right5 text-red-500 hover:text-red-600 text-sm",children:i.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"var(--th-primary-color)",children:[i.jsx("path",{d:"M5.45,21.93h13.1c.34,0,.62-.28.62-.62V6.08h2.13c.34,0,.62-.28.62-.62s-.28-.62-.62-.62h-4.89v-2.13c0-.34-.28-.62-.62-.62h-7.58c-.34,0-.62.28-.62.62v2.13H2.69c-.34,0-.62.28-.62.62s.28.62.62.62h2.13v15.23c0,.34.28.62.62.62ZM17.92,20.68H6.08V6.08h11.85v14.61ZM8.83,3.32h6.33v1.51h-6.33v-1.51Z"}),i.jsx("path",{d:"M8.21,18.42c.34,0,.62-.28.62-.62v-8.77c0-.34-.28-.62-.62-.62s-.62.28-.62.62v8.77c0,.34.28.62.62.62Z"}),i.jsx("path",{d:"M12,18.42c.34,0,.62-.28.62-.62v-8.77c0-.34-.28-.62-.62-.62s-.62.28-.62.62v8.77c0,.34.28.62.62.62Z"}),i.jsx("path",{d:"M15.79,18.42c.34,0,.62-.28.62-.62v-8.77c0-.34-.28-.62-.62-.62s-.62.28-.62.62v8.77c0,.34.28.62.62.62Z"})]})})]})]})]}),i.jsxs("div",{className:"space-y-6",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("label",{className:"rsp-properties-lable block text-md color-primary-black",children:"Button icon"}),i.jsx(At,{id:"showIcon",isChecked:n,onToggle:w=>{s(w),w?x("showIcon",w):x("actionUpdates",{showIcon:w,iconUrl:""})}})]}),n&&i.jsxs("div",{children:[i.jsx("div",{className:"rsp-property-elements-block",children:i.jsx(us,{content:t,style:o,onContentChange:k})}),i.jsx("div",{className:"marginT30 marginB25",children:i.jsx("div",{className:"flex items-center gap-1",children:i.jsx(jt,{placeholder:"Alternative Text",defaultValue:"Banking",value:(o==null?void 0:o.iconAltText)||"",required:!0,onChange:w=>{x("iconAltText",w),h(w)}})})}),i.jsx("div",{className:"marginB20",children:i.jsx(Yc,{style:o,onStyleChange:x})})]})]})]}),m==="display"&&i.jsx(nB,{style:o,onStyleChange:x}),m==="button"&&i.jsx(rB,{style:o,onStyleChange:x})]}),i.jsx(zn,{isOpen:u,onClose:()=>{c(""),p(!1)},onSelect:(w,y)=>{y&&C({fileName:y.name,fileSize:y.size||1024*1024,fileType:y.type,fileUrl:w}),c(""),p(!1)},allowAllFiles:!0})]})},g0=async e=>{try{const o=await(await fetch(e)).text(),n=new DOMParser().parseFromString(o,"text/xml");if(n.querySelector("parsererror"))throw new Error("Invalid RSS feed format");return{items:Array.from(n.querySelectorAll("item")).map(l=>{var d,c,u,p;return{title:((d=l.querySelector("title"))==null?void 0:d.textContent)||"",description:((c=l.querySelector("description"))==null?void 0:c.textContent)||"",link:((u=l.querySelector("link"))==null?void 0:u.textContent)||"",pubDate:((p=l.querySelector("pubDate"))==null?void 0:p.textContent)||new Date().toISOString()}})}}catch{try{const o=`https://api.rss2json.com/v1/api.json?rss_url=${encodeURIComponent(e)}`,r=await fetch(o),n=await r.json();if(!r.ok)throw new Error(n.message||"Failed to fetch RSS feed");return{items:n.items.map(s=>({title:s.title,description:s.description,link:s.link,pubDate:s.pubDate}))}}catch{throw new Error("Failed to fetch RSS feed. Please check the URL and try again.")}}},b0=({id:e,content:t,style:o={},onUpdate:r})=>{const{updateComponent:n}=Te(),{updateBlockComponent:s}=Ye(),[a,l]=S.useState(!1),[d,c]=S.useState(null),[u,p]=S.useState("");S.useEffect(()=>{(o==null?void 0:o.autoTitleLineHeightEnabled)===!0?x("titleLineHeight",void 0):(o==null?void 0:o.autoTitleLineHeightEnabled)===!1&&x("titleLineHeight",1.5)},[o==null?void 0:o.autoTitleLineHeightEnabled]),S.useEffect(()=>{(o==null?void 0:o.autoDescriptionLineHeightEnabled)===!0?x("descriptionLineHeight",void 0):(o==null?void 0:o.autoDescriptionLineHeightEnabled)===!1&&x("descriptionLineHeight",1.5)},[o==null?void 0:o.autoDescriptionLineHeightEnabled]),S.useEffect(()=>{(o==null?void 0:o.autoPubDateLineHeightEnabled)===!0?x("pubDateLineHeight",void 0):(o==null?void 0:o.autoPubDateLineHeightEnabled)===!1&&x("pubDateLineHeight",1.5)},[o==null?void 0:o.autoPubDateLineHeightEnabled]);const m=S.useRef(null),[f,b]=S.useState(t.feedUrl||""),h=A=>{if(r){r(A);return}const w=document.querySelector(`[data-component-id="${e}"]`),y=w==null?void 0:w.getAttribute("data-parent-id"),E=w==null?void 0:w.getAttribute("data-column-index");y&&E?s(y,e,A,{source:"RssFeedProp"}):n(e,A)},g=async A=>{l(!0),c(null);try{const w=await g0(A),y=t.maxItems||0;h({content:{...t,items:w.items.slice(0,y)}})}catch(w){c(w instanceof Error?w.message:"Failed to load RSS feed"),h({content:{...t,items:[]}})}finally{l(!1)}};S.useCallback(A=>{m.current&&clearTimeout(m.current),m.current=setTimeout(()=>{A&&A.trim()&&g(A)},1e3)},[t.maxItems]),S.useCallback(A=>{A&&A.trim()&&g(A)},[t.maxItems]),S.useEffect(()=>{b(t.feedUrl||"")},[]),S.useEffect(()=>()=>{m.current&&clearTimeout(m.current)},[]);const x=(A,w)=>{h({style:{...o,[A]:w}})},C=(A,w)=>{if(typeof w=="string"){if(!/^\d*$/.test(w)||w.length>1&&w.startsWith("0"))return;w=Number(w)}const y={...t,[A]:w};t.feedUrl?(l(!0),c(null),g0(t.feedUrl).then(E=>{h({content:{...y,items:E.items.slice(0,w)}})}).catch(E=>{c(E instanceof Error?E.message:"Failed to load RSS feed")}).finally(()=>{l(!1)})):h({content:y})};function k(A,w){const y=A*Math.pow(10,w+1),E=Math.floor(y/10);return y>=E*10+5?(E+1)/Math.pow(10,w):E/Math.pow(10,w)}const v=[{label:"Standard Fonts",options:_t.standard},{label:"Non standard Fonts",options:_t.decorative}];return i.jsx("div",{className:"space-y-6",children:i.jsxs("div",{className:"space-y-6",children:[i.jsxs("div",{className:"marginB30 relative",children:[i.jsx(jt,{classWrapper:"marginT10 marginB0 w-full",name:"feedUrl",type:"url",placeholder:"Feed URL",value:f,onChange:A=>{if(b(A),m.current&&clearTimeout(m.current),!A||!A.trim()){h({content:{...t,feedUrl:A,items:[]}});return}h({content:{...t,feedUrl:A}}),A&&A.trim()&&(m.current=setTimeout(()=>{g(A)},1e3))},handleOnchange:A=>{const w=A.target.value;if(b(w),m.current&&clearTimeout(m.current),!w||!w.trim()){h({content:{...t,feedUrl:w,items:[]}});return}h({content:{...t,feedUrl:w}}),w&&w.trim()&&(m.current=setTimeout(()=>{g(w)},1e3))},handleOnPaste:A=>{const w=A.clipboardData.getData("text");b(w),h({content:{...t,feedUrl:w}}),w&&w.trim()&&g(w)},onBlur:()=>{f!==(t.feedUrl||"")&&h({content:{...t,feedUrl:f}})},maxLength:2048}),a&&i.jsxs("div",{className:"absolute rsp-properties-loading flex items-center color-primary-grey text-xs",children:[i.jsx("div",{className:"segment_loader animate-spin"}),"Loading feed..."]}),d&&i.jsx("div",{className:"rsp-error-msg flex items-center color-primary-red text-sm marginT0",children:d})]}),f&&(t==null?void 0:t.items)&&t.items.length>0&&i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"rsp-property-elements-block flex items-center justify-between",children:[i.jsx("label",{className:"rsp-properties-lable block text-md color-primary-black",children:"No. of feed items (from first)"}),i.jsx(et,{mainClass:"button-control-view",id:"radius-top-right",label:"",onClick:()=>{},onChange:A=>C("maxItems",A),min:1,max:10,step:1,defaultValue:t.maxItems||1})]}),i.jsxs("div",{className:"rsp-property-elements-block space-y-6 paddingB0 borderB0",children:[i.jsx("div",{className:"flex items-center justify-between bg-tertiary-blue padding10 marginX-10 rounded",children:i.jsx("label",{className:"rsp-properties-lable block text-md color-primary-black",children:"Title"})}),i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("label",{className:"rsp-properties-lable block text-md color-primary-black",children:"Color"}),i.jsx("div",{className:"flex flex-col space-y-2",children:i.jsx(gt,{alpha:!1,value:(o==null?void 0:o.titleColor)||"#111827",onChange:A=>{x("titleColor",A)}})})]}),i.jsx(Tt,{label:"Font family",width:"width170",value:o.titleFontFamily||"Arial, sans-serif",options:v,onChange:A=>x("titleFontFamily",A),previewFont:!0,isGrouped:!0}),i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("label",{className:"rsp-properties-lable block text-md color-primary-black",children:"Font size"}),i.jsx(et,{mainClass:"button-control-view",label:"",onClick:()=>{},onChange:A=>x("titleFontSize",A),min:1,max:72,step:1,defaultValue:o.titleFontSize||12})]}),i.jsx("div",{children:i.jsxs("div",{className:"rsp-property-elements-block space-y-6",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("label",{className:"rsp-properties-lable block text-md color-primary-black",children:"Auto line height"}),i.jsx(At,{id:"auto-line-height-title",isChecked:(o==null?void 0:o.autoTitleLineHeightEnabled)||!1,onToggle:A=>{x("autoTitleLineHeightEnabled",A)}})]}),!(o!=null&&o.autoTitleLineHeightEnabled)&&i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("label",{className:"rsp-properties-lable block text-md color-primary-black",children:"Line height"}),i.jsx(et,{mainClass:"button-control-view",label:"",onClick:()=>{},onChange:A=>x("titleLineHeight",k(A,1)),min:-1,max:5,step:.1,defaultValue:(o==null?void 0:o.titleLineHeight)||1.5})]})]})}),i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("label",{className:"rsp-properties-lable block text-md color-primary-black",children:"Text style"}),i.jsxs("div",{className:"flex space-x-2",children:[i.jsx(Ie,{text:"Bold",position:"top",className:"line-block",children:i.jsx("button",{onClick:()=>x("titleBold",!o.titleBold),className:`p-2 rounded ${o.titleBold?"bg-primary-blue text-white":"bg-tertiary-blue color-primary-black"}`,children:i.jsx(Ko,{className:"w-4 h-4"})})}),i.jsx(Ie,{text:"Italic",position:"top",className:"line-block",children:i.jsx("button",{onClick:()=>x("titleItalic",!o.titleItalic),className:`p-2 rounded ${o.titleItalic?"bg-primary-blue text-white":"bg-tertiary-blue color-primary-black"}`,children:i.jsx(Yo,{className:"w-4 h-4"})})}),i.jsx(Ie,{text:"Underline",position:"left",className:"line-block",children:i.jsx("button",{onClick:()=>x("titleUnderline",!o.titleUnderline),className:`p-2 rounded ${o.titleUnderline?"bg-primary-blue text-white":"bg-tertiary-blue color-primary-black"}`,children:i.jsx(Jo,{className:"w-4 h-4"})})})]})]})]}),i.jsxs("div",{className:"rsp-property-elements-block space-y-6 paddingB0 borderB0",children:[i.jsx("div",{className:"flex items-center justify-between bg-tertiary-blue padding10 marginX-10 rounded",children:i.jsx("label",{className:"rsp-properties-lable block text-md color-primary-black",children:"Description"})}),i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("label",{className:"rsp-properties-lable block text-md color-primary-black",children:"Color"}),i.jsx("div",{className:"flex flex-col space-y-2",children:i.jsx(gt,{alpha:!1,value:(o==null?void 0:o.descriptionColor)||"#4B5563",onChange:A=>{x("descriptionColor",A)}})})]}),i.jsx(Tt,{label:"Font family",width:"width170",value:o.descriptionFontFamily||"Arial, sans-serif",options:v,onChange:A=>x("descriptionFontFamily",A),previewFont:!0,isGrouped:!0}),i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("label",{className:"rsp-properties-lable block text-md color-primary-black",children:"Font size"}),i.jsx(et,{mainClass:"button-control-view",label:"",onClick:()=>{},onChange:A=>x("descriptionFontSize",A),max:72,step:1,defaultValue:o.descriptionFontSize||14})]}),i.jsx("div",{children:i.jsxs("div",{className:"rsp-property-elements-block space-y-6",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("label",{className:"rsp-properties-lable block text-md color-primary-black",children:"Auto line height"}),i.jsx(At,{id:"auto-line-height-description",isChecked:(o==null?void 0:o.autoDescriptionLineHeightEnabled)||!1,onToggle:A=>{x("autoDescriptionLineHeightEnabled",A)}})]}),!(o!=null&&o.autoDescriptionLineHeightEnabled)&&i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("label",{className:"rsp-properties-lable block text-md color-primary-black",children:"Line height"}),i.jsx(et,{mainClass:"button-control-view",label:"",onClick:()=>{},onChange:A=>x("descriptionLineHeight",k(A,1)),min:-1,max:5,step:.1,defaultValue:(o==null?void 0:o.descriptionLineHeight)||1.5})]})]})}),i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("label",{className:"rsp-properties-lable block text-md color-primary-black",children:"Text style"}),i.jsxs("div",{className:"flex space-x-2",children:[i.jsx(Ie,{text:"Bold",position:"top",className:"line-block",children:i.jsx("button",{onClick:()=>x("descriptionBold",!o.descriptionBold),className:`p-2 rounded ${o.descriptionBold?"bg-primary-blue text-white":"bg-tertiary-blue color-primary-black"}`,title:"Bold",children:i.jsx(Ko,{className:"w-4 h-4"})})}),i.jsx(Ie,{text:"Italic",position:"top",className:"line-block",children:i.jsx("button",{onClick:()=>x("descriptionItalic",!o.descriptionItalic),className:`p-2 rounded ${o.descriptionItalic?"bg-primary-blue text-white":"bg-tertiary-blue color-primary-black"}`,children:i.jsx(Yo,{className:"w-4 h-4"})})}),i.jsx(Ie,{text:"Underline",position:"left",className:"line-block",children:i.jsx("button",{onClick:()=>x("descriptionUnderline",!o.descriptionUnderline),className:`p-2 rounded ${o.descriptionUnderline?"bg-primary-blue text-white":"bg-tertiary-blue color-primary-black"}`,children:i.jsx(Jo,{className:"w-4 h-4"})})})]})]})]}),i.jsxs("div",{className:"rsp-property-elements-block space-y-6",children:[i.jsx("div",{className:"flex items-center justify-between bg-tertiary-blue padding10 marginX-10 rounded",children:i.jsx("label",{className:"rsp-properties-lable block text-md color-primary-black",children:"Date"})}),i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("label",{className:"rsp-properties-lable block text-md color-primary-black",children:"Color"}),i.jsx("div",{className:"flex flex-col space-y-2",children:i.jsx(gt,{alpha:!1,value:(o==null?void 0:o.pubDateColor)||"#6B7280",onChange:A=>{x("pubDateColor",A)}})})]}),i.jsx(Tt,{label:"Font family",width:"width170",value:o.pubDateFontFamily||"Arial, sans-serif",options:v,onChange:A=>x("pubDateFontFamily",A),previewFont:!0,isGrouped:!0}),i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("label",{className:"rsp-properties-lable block text-md color-primary-black",children:"Font size"}),i.jsx(et,{mainClass:"button-control-view",label:"",onClick:()=>{},onChange:A=>x("pubDateFontSize",A),min:1,max:72,step:1,defaultValue:o.pubDateFontSize||12})]}),i.jsx("div",{children:i.jsxs("div",{className:"rsp-property-elements-block space-y-6",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("label",{className:"rsp-properties-lable block text-md color-primary-black",children:"Auto line height"}),i.jsx(At,{id:"auto-line-height-pubdate",isChecked:(o==null?void 0:o.autoPubDateLineHeightEnabled)||!1,onToggle:A=>{x("autoPubDateLineHeightEnabled",A)}})]}),!(o!=null&&o.autoPubDateLineHeightEnabled)&&i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("label",{className:"rsp-properties-lable block text-md color-primary-black",children:"Line height"}),i.jsx(et,{mainClass:"button-control-view",label:"",onClick:()=>{},onChange:A=>x("pubDateLineHeight",k(A,1)),min:-1,max:5,step:.1,defaultValue:(o==null?void 0:o.pubDateLineHeight)||1.5})]})]})}),i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("label",{className:"rsp-properties-lable block text-md color-primary-black",children:"Text style"}),i.jsxs("div",{className:"flex space-x-2",children:[i.jsx(Ie,{text:"Bold",position:"top",className:"line-block",children:i.jsx("button",{onClick:()=>x("pubDateBold",!o.pubDateBold),className:`p-2 rounded ${o.pubDateBold?"bg-primary-blue text-white":"bg-tertiary-blue color-primary-black"}`,children:i.jsx(Ko,{className:"w-4 h-4"})})}),i.jsx(Ie,{text:"Italic",position:"top",className:"line-block",children:i.jsx("button",{onClick:()=>x("pubDateItalic",!o.pubDateItalic),className:`p-2 rounded ${o.pubDateItalic?"bg-primary-blue text-white":"bg-tertiary-blue color-primary-black"}`,children:i.jsx(Yo,{className:"w-4 h-4"})})}),i.jsx(Ie,{text:"Underline",position:"left",className:"line-block",children:i.jsx("button",{onClick:()=>x("pubDateUnderline",!o.pubDateUnderline),className:`p-2 rounded ${o.pubDateUnderline?"bg-primary-blue text-white":"bg-tertiary-blue color-primary-black"}`,children:i.jsx(Jo,{className:"w-4 h-4"})})})]})]})]}),i.jsxs("div",{className:"rsp-property-elements-block flex items-center justify-between",children:[i.jsx("label",{className:"rsp-properties-lable block text-md color-primary-black",children:"Container background"}),i.jsx("div",{className:"flex flex-col space-y-2",children:i.jsx(gt,{value:(o==null?void 0:o.containerBackgroundColor)||"transparent",onChange:A=>{x("containerBackgroundColor",A)}})})]}),i.jsx(cs,{id:"border-control",style:o,onStyleChange:(A,w)=>{x(A,w)}}),i.jsx("div",{className:"rsp-property-elements-block",children:i.jsx(Tr,{id:"border-radius-control",borderRadius:o.borderRadiusControl,onChange:A=>{x("borderRadiusControl",A)}})}),i.jsx(ao,{label:"Padding",id:"padding-control",marginSection:!1,paddingSection:!0,padding:o.paddingControl,isHideLeftRight:!0,onChange:A=>{x("paddingControl",A)}})]})]})})},iB="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAACXBIWXMAAAHYAAAB2AH6XKZyAAAAGXRFWHRTb2Z0d2FyZQB3d3cuaW5rc2NhcGUub3Jnm+48GgAABGhJREFUeJztmstvG0Ucxz8zXpvm0bzTkGfTvJrgCEqQqhYhcUPlwBHOlRDlceuxB5C48A9UCkIcQIILAnFJUpCQQOICFKEKqGPaNE6TOm9XLXl6vfYOh7ROXCdpk4x3VsSf24zXv+93vp4dzz4EQGoofBrBR0pwBihDH/+CGAyt9r0v3vg6o7GuNix7uK9fCX4CSgtQvxLUJbssWgO8U4D6B0Yi5CUKM/gsAvW2fSX8YSE19osEXvVESfFBajj8nidae0AClV6JKcFle/iZ173SexKk53pCfJm80v+Kx7o74nUAACGh1Depob4BA9p5mAgA4Kgr5ffJkd4eQ/pZhD0SzmAuiHEUn3opqBAZqdTPodciV8F8ACb5PPR75M2cAFxZynLrRcO+CksgOUX5/BcACHjLyvlUBElWvGTCl2eErFF4EICCC48EIBBu0oQv71DO1tZATgABKWlp6/TWkMeoe0s4sWwzYO1yrHnsaVj6BVxbW0lh30eW1+OuJACFfwNYjcL0x49OWS1Yx3pQFU/jzEV8+veXvA0znxRk8A8RRyoIVDb5MIDUPMQHtU77nZDl9T4LIH0f4pchs+yJnAiW+CgANwnTg+Dc9U5TCZ8EoJyNwSfveC7tgwBcmP0M1saMqOf+DcoAZNa8dZD4Fpaveau5BWGPhDOytEoGak8gggW9N+o/FFjyqXKshj4QPjgbDCBldYs4rIMHhZRHqoRpGyaRyIBpDwbxyz7AIMUATBswTTEA0wbMog57AId+BhQD0HdTdOpmnKmxx1/Pt/e20dLZzPj1GDMTcxsmghZnz50GYCI6yXRsJu97UgpKykqob66jpaMZNO1ftQXgpBzWV9Yfe1za2XhXKmU7JNc2HsJYwU0bu9VZXVojMXsXe92ms79Dg2uNAVTXV9HeezynT7kud25N47ouAEIIyiuf/CU0IQRdz3aQSWeYjs1gr6cAuDMW918ANQ3V1DRUZ9tKKf7+NZIdPMDJgR7qGmv3VPdhqCVlpUSujgLgpNI4KYdgKHhg3wVZBJVSRH4bZX5qIdvX/VwXrV3N+6pnr6dIzCay7UAgkHPaHAT9T4YU/PPHDWYn57Ndnf0dtPe27b2UUvzw1Y95/XXNtQihZxXUPgNu/nmL+PjmKn78ZBsd4XZt9eub6+h7oVdbPa0zYOyvcSZvTGXbrd2t9Jzq2nc9IQQDL58CIGAFKD1aouW834q2AGKRCW5HJ7PtphON9D7ffeC6WxfWQqAlAHvdZvz6RE7fQnyRxXgi79i6phr6z4R1yGpBSwBKqby+tJPe9thM2t223whC6AnAClp5m6CdKK/cePZQ11ibPZ+l3FyLa45VIR7sczUt9LsiVPRC/s93iDj0V4PFAEwbME0xANMGTFMMwLQB0xQDMG3ANMUATBswjSRtF+6FXL+jMkqq1FrUtA9TqORyTKbtlfPK9dNFujco5eLaaxdl6MXvrmXuzZ1zk0uLbHNj43+HUih7dVUsL7xrnR0e+g8VZmJR3E4gxgAAAABJRU5ErkJggg==",Un=({id:e,style:t={}})=>{var O,K,F,q,R,M,L,U,ee,Y,te,ie,ue,ne,ae,oe,G,Q,J,T,X,H,D,W,I,V,Z,P,re,se,le,xe,Ce,je,ye,Ne,_e,Re,Be,ve,pe,be,ke,de,ce,me,Ae,Ee,Oe;const{pConfig:o,updateComponent:r,updateCanvasSettings:n,canvasSettings:s,components:a,componentsDuplicate:l,duplicateComponents:d,setComponents:c}=Te(),[u,p]=S.useState(""),m=S.useRef(null),f=S.useMemo(()=>{var fe;return((fe=o==null?void 0:o.templateDetails)==null?void 0:fe.resolution)||(o==null?void 0:o.resolution)||null},[(O=o==null?void 0:o.templateDetails)==null?void 0:O.resolution,o==null?void 0:o.resolution]),b=fe=>{if(!fe||typeof fe!="string")return null;const we=fe.split("x");if(we.length===0)return null;const $e=parseInt(we[0],10);return isNaN($e)||$e<=0?null:$e},h=S.useMemo(()=>o!=null&&o.offerBuilderEnabled&&f?b(f):null,[o==null?void 0:o.offerBuilderEnabled,f]),[g,x]=S.useState(()=>{var fe;if(o!=null&&o.offerBuilderEnabled&&f){const we=b(f);if(we)return we}return((fe=s==null?void 0:s.style)==null?void 0:fe.emailWidth)||600}),[C,k]=S.useState(!1),[v,A]=S.useState(!1);S.useEffect(()=>{var $e;if(!(o!=null&&o.offerBuilderEnabled)||!f)return;const fe=b(f);if(!fe)return;const we=($e=s==null?void 0:s.style)==null?void 0:$e.emailWidth;we!==fe||we===void 0?(x(fe),n({style:{...s.style,emailWidth:fe}})):g!==fe&&x(fe)},[o==null?void 0:o.offerBuilderEnabled,f]),S.useEffect(()=>{var we;const fe=(we=s==null?void 0:s.style)==null?void 0:we.emailWidth;if(!(fe===void 0||fe===g))if(o!=null&&o.offerBuilderEnabled&&f){const $e=b(f);(!$e||$e===fe)&&x(fe)}else x(fe)},[(K=s==null?void 0:s.style)==null?void 0:K.emailWidth]);function w(fe,we){const $e=new Map(we==null?void 0:we.map(He=>[He.id,He]));return fe.map(He=>{const Ue=$e==null?void 0:$e.get(He.id);return Ue&&(Ue!=null&&Ue.style)&&Ue.style.backgroundColor?{...He,style:{...He.style,backgroundColor:Ue.style.backgroundColor,contentBackgroundColor:Ue.style.contentBackgroundColor}}:He})}function y(fe){let we=a.map($e=>({...$e,style:{...$e.style,backgroundColor:fe,contentBackgroundColor:fe}}));c(we)}const E=async(fe,we)=>{if(r(e,{style:{...t,[fe]:we}}),n({style:{...s.style,[fe]:we}}),fe==="contentBackgroundColor"&&y(we),fe!=="canvasThemes"&&await d(),fe==="canvasThemes"&&we===!1){const $e=w(a,l);c($e),n({...s,style:{...(s==null?void 0:s.style)??{},canvasThemes:!1,backgroundColor:"#f8f9fa",contentBackgroundColor:"#ffffff"}})}else fe==="canvasThemes"&&we===!0&&await d()},j=fe=>{var He;if(fe.size>10*1024*1024)return"File size must not exceed 10MB";const we=(He=fe.name.split(".").pop())==null?void 0:He.toLowerCase();if(!we||!["zip","pdf","png","jpg","jpeg","gif"].includes(we))return"Only zip, pdf, png, jpg, jpeg and gif files are allowed";if(we==="zip"&&!["application/zip","application/x-zip","application/x-zip-compressed","application/octet-stream"].includes(fe.type)){const Pe=new File([fe],fe.name,{type:"application/zip"});return j(Pe)}return null},B=async fe=>{var He;const we=(He=fe.target.files)==null?void 0:He[0];if(p(""),!we)return;const $e=j(we);if($e){p($e),m.current&&(m.current.value="");return}try{if(we){const Pe=new FormData;Pe.append("file",we,we.name),o.emailAttachCallback(Pe)}const Ue=new FileReader;Ue.onload=Pe=>{var Ve;(Ve=Pe.target)!=null&&Ve.result&&E("attachment",{name:we.name,type:we.type,size:we.size,data:Pe.target.result})},Ue.onerror=()=>{p("Failed to read the file"),m.current&&(m.current.value="")},Ue.readAsDataURL(we)}catch{p("Failed to process file"),m.current&&(m.current.value="")}},$=fe=>{if(fe.toLowerCase().includes(".png")||fe.toLowerCase().includes(".gif")||fe.toLowerCase().includes(".jpeg")||fe.toLowerCase().includes(".jpg"))return Vc;if(fe.toLowerCase().includes(".zip"))return iB;if(fe.toLowerCase().includes(".pdf"))return ds},_=[{id:"light",name:"Light",backgroundColor:"#ffffff",contentBackgroundColor:"#f8f9fa"},{id:"dark",name:"Dark",backgroundColor:"#1a1a1a",contentBackgroundColor:"#2d2d2d"},{id:"blue",name:"Blue",backgroundColor:"#e3f2fd",contentBackgroundColor:"#bbdefb"},{id:"green",name:"Green",backgroundColor:"#e8f5e9",contentBackgroundColor:"#c8e6c9"},{id:"purple",name:"Purple",backgroundColor:"#f3e5f5",contentBackgroundColor:"#e1bee7"},{id:"orange",name:"Orange",backgroundColor:"#fff3e0",contentBackgroundColor:"#ffe0b2"},{id:"red",name:"Red",backgroundColor:"#ffebee",contentBackgroundColor:"#ffcdd2"},{id:"teal",name:"Teal",backgroundColor:"#e0f2f1",contentBackgroundColor:"#b2dfdb"},{id:"yellow",name:"Yellow",backgroundColor:"#fffde7",contentBackgroundColor:"#fff9c4"},{id:"indigo",name:"Indigo",backgroundColor:"#e8eaf6",contentBackgroundColor:"#c5cae9"},{id:"brown",name:"Brown",backgroundColor:"#efebe9",contentBackgroundColor:"#d7ccc8"},{id:"cyan",name:"Cyan",backgroundColor:"#e0f7fa",contentBackgroundColor:"#b2ebf2"},{id:"pink",name:"Pink",backgroundColor:"#fce4ec",contentBackgroundColor:"#f8bbd0"},{id:"gray",name:"Gray",backgroundColor:"#f5f5f5",contentBackgroundColor:"#e0e0e0"},{id:"lime",name:"Lime",backgroundColor:"#f9fbe7",contentBackgroundColor:"#dcedc8"},{id:"amber",name:"Amber",backgroundColor:"#fff8e1",contentBackgroundColor:"#ffecb3"},{id:"deepOrange",name:"Deep Orange",backgroundColor:"#fbe9e7",contentBackgroundColor:"#ffccbc"},{id:"deepPurple",name:"Deep Purple",backgroundColor:"#ede7f6",contentBackgroundColor:"#d1c4e9"},{id:"lightBlue",name:"Light Blue",backgroundColor:"#e1f5fe",contentBackgroundColor:"#b3e5fc"},{id:"lightGreen",name:"Light Green",backgroundColor:"#f1f8e9",contentBackgroundColor:"#dcedc8"},{id:"blueGray",name:"Blue Gray",backgroundColor:"#eceff1",contentBackgroundColor:"#cfd8dc"},{id:"warmGray",name:"Warm Gray",backgroundColor:"#fafafa",contentBackgroundColor:"#e0e0e0"},{id:"coolGray",name:"Cool Gray",backgroundColor:"#f3f4f6",contentBackgroundColor:"#d1d5db"},{id:"midnight",name:"Midnight",backgroundColor:"#121212",contentBackgroundColor:"#1f1f1f"},{id:"rose",name:"Rose",backgroundColor:"#fff1f2",contentBackgroundColor:"#fecdd3"},{id:"sky",name:"Sky",backgroundColor:"#e0f2fe",contentBackgroundColor:"#bae6fd"},{id:"charcoal",name:"Charcoal",backgroundColor:"#2e2e2e",contentBackgroundColor:"#3c3c3c"},{id:"ivory",name:"Ivory",backgroundColor:"#fffff0",contentBackgroundColor:"#fdf5e6"},{id:"peach",name:"Peach",backgroundColor:"#fff0e6",contentBackgroundColor:"#ffd9c0"},{id:"mint",name:"Mint",backgroundColor:"#e6fff5",contentBackgroundColor:"#b2f2e3"},{id:"steel",name:"Steel",backgroundColor:"#f4f6f8",contentBackgroundColor:"#d9e2ec"},{id:"plum",name:"Plum",backgroundColor:"#f3e0f7",contentBackgroundColor:"#d7aefb"},{id:"sand",name:"Sand",backgroundColor:"#fefae0",contentBackgroundColor:"#f5e6b3"},{id:"coffee",name:"Coffee",backgroundColor:"#ece0d1",contentBackgroundColor:"#c8b6a6"},{id:"forest",name:"Forest",backgroundColor:"#e6f2e6",contentBackgroundColor:"#b9d8b9"},{id:"coral",name:"Coral",backgroundColor:"#fff3f0",contentBackgroundColor:"#ffc1a1"},{id:"slate",name:"Slate",backgroundColor:"#f1f5f9",contentBackgroundColor:"#cbd5e1"},{id:"lavender",name:"Lavender",backgroundColor:"#f5f0ff",contentBackgroundColor:"#e6d6ff"}],z=[{value:"UTC",label:"UTC"},{value:"America/New_York",label:"Eastern Time (ET)"},{value:"America/Chicago",label:"Central Time (CT)"},{value:"America/Denver",label:"Mountain Time (MT)"},{value:"America/Los_Angeles",label:"Pacific Time (PT)"},{value:"Europe/London",label:"London (GMT)"},{value:"Europe/Paris",label:"Central European Time (CET)"},{value:"Asia/Tokyo",label:"Japan (JST)"},{value:"Asia/Shanghai",label:"China (CST)"},{value:"Australia/Sydney",label:"Sydney (AEST)"}];function N(fe){return fe<1024?`${fe} B`:fe<1024*1024?`${(fe/1024).toFixed(1)} KB`:`${(fe/(1024*1024)).toFixed(1)} MB`}return i.jsxs("div",{className:"space-y-6",children:[i.jsxs("div",{className:"rsp-property-elements-block space-y-2 hiddens",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("label",{className:"rsp-properties-lable block text-md color-primary-black",children:["Email width",i.jsx("span",{className:"rsp-mini-text text-xs text-gray-500",children:" (px)"})]}),i.jsx(et,{label:"",mainClass:"button-control-view",onClick:()=>{},onChange:fe=>{const we=o!=null&&o.offerBuilderEnabled?100:320,$e=h||(o!=null&&o.offerBuilderEnabled?800:600);fe>=we&&fe<=$e&&(x(fe),E("emailWidth",fe))},min:o!=null&&o.offerBuilderEnabled?100:320,max:h||(o!=null&&o.offerBuilderEnabled?800:600),step:20,defaultValue:g,isShowLeftDescription:!1,leftDescription:"",buttonClass:"",labelClass:"",actionButton:!0},g)]}),i.jsxs("p",{className:"rsp-alert-bg text-xs text-gray-500",children:["Recommended width: (",o!=null&&o.offerBuilderEnabled?"100px - 800px":"320px - 600px",")"]})]}),i.jsxs("div",{className:`rsp-property-elements-block space-y-2 hiddens ${o!=null&&o.emailFooter?"hidden":""}`,children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("label",{className:"rsp-properties-lable block text-md color-primary-black",children:"Themes"}),i.jsx(At,{isChecked:((F=s==null?void 0:s.style)==null?void 0:F.canvasThemes)||!1,id:"canvasThemes-switch",onToggle:fe=>{n({style:{...s.style,backgroundColor:"transparent",canvasThemes:fe,contentBackgroundColor:"transparent"}})}})]}),((q=s==null?void 0:s.style)==null?void 0:q.canvasThemes)&&i.jsxs("div",{className:`marginT20 ${o!=null&&o.emailFooter?"hidden":""}`,children:[i.jsx("div",{className:"mt0 grid grid-cols-5 gap-2",children:_.map(fe=>{var we;return i.jsx("div",{children:i.jsx(Ie,{text:fe.name,position:"top",mainClass:"inline-block w-full",children:i.jsx("button",{onClick:()=>{n({style:{...s.style,backgroundColor:fe.backgroundColor,contentBackgroundColor:fe.contentBackgroundColor}})},className:`rsp-theme-wrapper w-full padding5 border transition-colors ${((we=s==null?void 0:s.style)==null?void 0:we.backgroundColor)===fe.backgroundColor?"border-primary-blue":"border-quaternary-blue"}`,children:i.jsx("div",{className:"rsp-theme-block w-full h-8",style:{background:`linear-gradient(to right, ${fe.backgroundColor} 50%, ${fe.contentBackgroundColor} 50%)`}})},fe.id)})})})}),i.jsx("p",{className:"rsp-alert-bg text-xs text-gray-500 marginT10",children:"Applying a theme will automatically update the container and content background colors to match the selected theme."})]})]}),!((R=s==null?void 0:s.style)!=null&&R.canvasThemes)&&i.jsxs(i.Fragment,{children:[i.jsx("div",{className:`rsp-property-elements-block ${o!=null&&o.emailFooter?"hidden":""}`,children:i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("label",{className:"rsp-properties-lable block text-md color-primary-black ",children:"Background"}),i.jsx("div",{className:"flex flex-col space-y-2",children:i.jsx(gt,{value:((M=s==null?void 0:s.style)==null?void 0:M.backgroundColor)||"transparent",onChange:fe=>{E("backgroundColor",fe)}})})]})}),i.jsx("div",{className:"rsp-property-elements-block",children:i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("label",{className:"rsp-properties-lable block text-md color-primary-black ",children:"Content background"}),i.jsx("div",{className:"flex flex-col space-y-2",children:i.jsx(gt,{value:((L=s==null?void 0:s.style)==null?void 0:L.contentBackgroundColor)||"transparent",onChange:fe=>{E("contentBackgroundColor",fe)}})})]})})]}),i.jsxs("div",{className:"rsp-property-elements-block",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("label",{className:"rsp-properties-lable block text-md color-primary-black",children:"Mobile responsive"}),i.jsx(At,{isChecked:((U=s==null?void 0:s.style)==null?void 0:U.mobileResponsive)||!1,id:"mobileResponsive-switch",onToggle:fe=>{n({style:{...s.style,mobileResponsive:fe}})}})]}),((ee=s==null?void 0:s.style)==null?void 0:ee.mobileResponsive)&&i.jsx("div",{className:"",children:i.jsx("p",{className:"rsp-alert-bg text-xs text-gray-500",children:"Not supported by Outlook 2002 (XP), 2007, 2010, 2013, 2016, and 2019."})})]}),!((Y=s==null?void 0:s.style)!=null&&Y.emptyCanvas)&&((te=s==null?void 0:s.style)==null?void 0:te.emptyContentValid)&&i.jsx(i.Fragment,{children:i.jsxs("div",{className:"rsp-property-elements-block",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("label",{className:"rsp-properties-lable block text-md color-primary-black",children:"Content shadow"}),i.jsx(At,{isChecked:((ie=s==null?void 0:s.style)==null?void 0:ie.contentShadow)||!1,id:"contentShadow-switch",onToggle:fe=>{n({style:{...s.style,contentShadow:fe}})}})]}),((ue=s==null?void 0:s.style)==null?void 0:ue.contentShadow)&&i.jsxs("div",{className:"space-y-4 marginT15",children:[i.jsx("p",{className:"rsp-alert-bg text-xs text-gray-500",children:"Not supported by Outlook 2002 (XP), 2007, 2010, 2013, 2016, and 2019."}),i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("label",{className:"rsp-properties-lable block text-md color-primary-black",children:"Shadow color"}),i.jsx("div",{className:"flex items-center gap-2",children:i.jsx(gt,{value:((ne=s==null?void 0:s.style)==null?void 0:ne.shadowColor)||"#000000",onChange:fe=>{E("shadowColor",fe)},alpha:!0})})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("label",{className:"rsp-properties-lable block text-sm color-primary-black",children:"X"}),i.jsx("span",{className:"text-sm text-gray-600",children:((ae=s==null?void 0:s.style)==null?void 0:ae.shadowX)||0})]}),i.jsx("input",{type:"range",min:"-15",max:"15",step:"1",value:((oe=s==null?void 0:s.style)==null?void 0:oe.shadowX)||0,onChange:fe=>{E("shadowX",parseInt(fe.target.value))},className:"w-full h-2 bg-gray-200 rounded-lg appearance-none cursor-pointer shadow-slider",style:{background:(()=>{var $e;const we=(parseInt((($e=s==null?void 0:s.style)==null?void 0:$e.shadowX)||0)+15)/30*100;return`linear-gradient(to right, #e5e7eb 0%, #e5e7eb ${we}%, var(--th-primary-color) ${we}%, var(--th-primary-color) 100%)`})()}})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("label",{className:"rsp-properties-lable block text-sm color-primary-black",children:"Y"}),i.jsx("span",{className:"text-sm text-gray-600",children:((G=s==null?void 0:s.style)==null?void 0:G.shadowY)||0})]}),i.jsx("input",{type:"range",min:"-15",max:"15",step:"1",value:((Q=s==null?void 0:s.style)==null?void 0:Q.shadowY)||0,onChange:fe=>{E("shadowY",parseInt(fe.target.value))},className:"w-full h-2 bg-gray-200 rounded-lg appearance-none cursor-pointer shadow-slider",style:{background:(()=>{var $e;const we=(parseInt((($e=s==null?void 0:s.style)==null?void 0:$e.shadowY)||0)+15)/30*100;return`linear-gradient(to right, #e5e7eb 0%, #e5e7eb ${we}%, var(--th-primary-color) ${we}%, var(--th-primary-color) 100%)`})()}})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("label",{className:"rsp-properties-lable block text-sm color-primary-black",children:"BLUR"}),i.jsx("span",{className:"text-sm text-gray-600",children:((J=s==null?void 0:s.style)==null?void 0:J.shadowBlur)||0})]}),i.jsx("input",{type:"range",min:"0",max:"100",step:"1",value:((T=s==null?void 0:s.style)==null?void 0:T.shadowBlur)||0,onChange:fe=>{E("shadowBlur",parseInt(fe.target.value))},className:"w-full h-2 bg-gray-200 rounded-lg appearance-none cursor-pointer shadow-slider",style:{background:`linear-gradient(to right, var(--th-primary-color) 0%, var(--th-primary-color) ${(((X=s==null?void 0:s.style)==null?void 0:X.shadowBlur)||0)/100*100}%, #e5e7eb ${(((H=s==null?void 0:s.style)==null?void 0:H.shadowBlur)||0)/100*100}%, #e5e7eb 100%)`}})]})]})]})}),i.jsxs("div",{className:"rsp-property-elements-block hidden",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("label",{className:"rsp-properties-lable block text-md color-primary-black",children:"Google promo annotation"}),i.jsxs("div",{className:"relative inline-block w-10 align-middle select-none",children:[i.jsx("input",{type:"checkbox",checked:((D=s==null?void 0:s.style)==null?void 0:D.enableGooglePromo)||!1,onChange:fe=>E("enableGooglePromo",fe.target.checked),className:"toggle-checkbox absolute block w-6 h-6 rounded-full bg-white appearance-none cursor-pointer"}),i.jsx("label",{className:"toggle-label block overflow-hidden h-6 rounded-full bg-gray-300 cursor-pointer"})]})]}),i.jsx("p",{className:"rsp-alert-bg text-xs text-gray-500",children:"Not supported by Outlook 2002 (XP), 2007, 2010, 2013, 2016, and 2019."})]}),((W=s==null?void 0:s.style)==null?void 0:W.enableGooglePromo)&&i.jsxs("div",{className:"rsp-inside-bg space-y-4 p-4 bg-gray-50 rounded-lg",children:[i.jsxs("div",{children:[i.jsx("label",{className:"rsp-properties-lable block text-md color-primary-black ",children:"Promotion title"}),i.jsx("input",{type:"text",value:((I=s==null?void 0:s.style)==null?void 0:I.promoTitle)||"",onChange:fe=>E("promoTitle",fe.target.value),className:"w-full p-2 border rounded-md",placeholder:"e.g., 25% Off Summer Sale"})]}),i.jsxs("div",{children:[i.jsx("label",{className:"rsp-properties-lable block text-md color-primary-black ",children:"Promotion code"}),i.jsx("input",{type:"text",value:((V=s==null?void 0:s.style)==null?void 0:V.promoCode)||"",onChange:fe=>E("promoCode",fe.target.value),className:"w-full p-2 border rounded-md",placeholder:"e.g., SUMMER25"})]}),i.jsxs("div",{children:[i.jsx("label",{className:"rsp-properties-lable block text-md color-primary-black",children:"Expiration date & time"}),i.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[i.jsx("input",{type:"datetime-local",value:((Z=s==null?void 0:s.style)==null?void 0:Z.promoExpiration)||"",onChange:fe=>E("promoExpiration",fe.target.value),className:"w-full p-2 border rounded-md"}),i.jsx("select",{value:((P=s==null?void 0:s.style)==null?void 0:P.promoTimezone)||"UTC",onChange:fe=>E("promoTimezone",fe.target.value),className:"w-full p-2 border rounded-md",children:z.map(fe=>i.jsx("option",{value:fe.value,children:fe.label},fe.value))})]})]}),i.jsxs("div",{children:[i.jsx("label",{className:"rsp-properties-lable block text-md color-primary-black",children:"Sender logo"}),i.jsxs("div",{className:"flex items-center space-x-2",children:[t.senderLogo?i.jsxs("div",{className:"relative w-12 h-12 border rounded-md overflow-hidden group",children:[i.jsx("img",{src:(re=s==null?void 0:s.style)==null?void 0:re.senderLogo,alt:"Sender Logo",className:"w-full h-full object-cover"}),i.jsx("button",{onClick:()=>E("senderLogo",""),className:"absolute inset-0 bg-black/50 text-white opacity-0 group-hover:opacity-100 transition-opacity",children:"Remove"})]}):null,i.jsx("button",{onClick:()=>k(!0),className:"rsp-image-upload-properties bg-white flex-1 flex items-center justify-center px-4 py-2 border-gray-300 rounded-md hover:bg-gray-50",children:i.jsxs("div",{className:"flex flex-col items-center",children:[i.jsxs("h3",{children:["Click here to"," ",(se=s==null?void 0:s.style)!=null&&se.senderLogon?"change Logo":"upload Logo"]}),i.jsx("span",{children:"Not more than 2MB"}),i.jsx("small",{children:".jpg, .jpeg, .png and .gif only"})]})})]})]}),i.jsxs("div",{children:[i.jsx("label",{className:"rsp-properties-lable block text-md color-primary-black",children:"Promotion image"}),i.jsxs("div",{className:"flex items-center space-x-2",children:[(le=s==null?void 0:s.style)!=null&&le.promoImage?i.jsxs("div",{className:"relative w-12 h-12 border rounded-md overflow-hidden group",children:[i.jsx("img",{src:(xe=s==null?void 0:s.style)==null?void 0:xe.promoImage,alt:"Promo Image",className:"w-full h-full object-cover"}),i.jsx("button",{onClick:()=>E("promoImage",""),className:"absolute inset-0 bg-black/50 text-white opacity-0 group-hover:opacity-100 transition-opacity",children:"Remove"})]}):null,i.jsx("button",{onClick:()=>A(!0),className:"rsp-image-upload-properties bg-white flex-1 flex items-center justify-center px-4 py-2 border-gray-300 rounded-md hover:bg-gray-50",children:i.jsxs("div",{className:"flex flex-col items-center",children:[i.jsxs("h3",{children:["Click here to"," ",(Ce=s==null?void 0:s.style)!=null&&Ce.promoImage?"change image":"upload image"]}),i.jsx("span",{children:"Not more than 2MB"}),i.jsx("small",{children:".jpg, .jpeg, .png and .gif only"})]})})]})]})]}),!(o!=null&&o.emailFooter)&&!((je=s==null?void 0:s.style)!=null&&je.emptyCanvas)&&((ye=s==null?void 0:s.style)==null?void 0:ye.emptyContentValid)&&i.jsxs("div",{className:"rsp-property-elements-block-del",children:[i.jsx("label",{className:"rsp-properties-lable marginB10 block text-sm color-primary-black",children:"Inbox first line preview"}),i.jsx("textarea",{value:((Ne=s==null?void 0:s.style)==null?void 0:Ne.inboxPreview)||"",onChange:fe=>E("inboxPreview",fe.target.value),className:"w-full p-2 border rounded-md h-24 resize-none",placeholder:"Enter preview text that will appear in email clients..",maxLength:150}),((_e=s==null?void 0:s.style)==null?void 0:_e.inboxPreview)&&i.jsx("p",{className:"rsp-alert-bg text-xs text-gray-500 mt0",children:"Maximum 150 characters. This text appears after the subject line in most email clients."})]}),!((Re=s==null?void 0:s.style)!=null&&Re.emptyCanvas)&&((Be=s==null?void 0:s.style)==null?void 0:Be.emptyContentValid)&&i.jsx(cs,{style:s==null?void 0:s.style,maxValue:2,onStyleChange:(fe,we)=>{E(fe,we)}}),!(o!=null&&o.emailFooter)&&!((ve=s==null?void 0:s.style)!=null&&ve.emptyCanvas)&&((pe=s==null?void 0:s.style)==null?void 0:pe.emptyContentValid)&&i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{className:"flex items-center justify-between marginB15",children:[i.jsx("label",{className:"rsp-properties-lable block text-md color-primary-black",children:"Embed attachment"}),i.jsx(At,{isChecked:((be=s==null?void 0:s.style)==null?void 0:be.enableAttachment)||!1,id:"enableAttachment",onToggle:fe=>{n({style:{...s.style,enableAttachment:fe,...fe===!1?{attachment:null}:{}}}),r(e,{style:{...t,enableAttachment:fe,...fe===!1?{attachment:null}:{}}})}})]}),((ke=s==null?void 0:s.style)==null?void 0:ke.enableAttachment)&&i.jsxs("div",{className:"space-y-2",children:[!((de=s==null?void 0:s.style)!=null&&de.attachment)&&i.jsxs(i.Fragment,{children:[i.jsx("button",{onClick:()=>{var fe;return(fe=m.current)==null?void 0:fe.click()},className:"rsp-image-upload-properties w-full flex items-center justify-center px-4 py-2 border-gray-300 rounded-lg hover:border-gray-400",children:i.jsxs("div",{className:"flex flex-col items-center",children:[i.jsx("h3",{children:"Click here to attach a file"}),i.jsx("small",{children:"Not more than 10MB"}),i.jsx("small",{className:"color-primary-grey",children:".zip, .pdf, .png, .jpg, .jpeg,.gif only"})]})}),i.jsx("input",{ref:m,type:"file",className:"hidden",accept:".zip,.pdf,.png,.jpg,.jpeg,.gif",onChange:B})]}),u&&i.jsxs("div",{className:"flex items-center text-red-500 text-sm gap-1 marginT5",children:[i.jsx(Kt,{className:"w-4 h-4 mr-1"}),u]}),((ce=s==null?void 0:s.style)==null?void 0:ce.attachment)&&i.jsxs("div",{className:"rsp-attached-file-block relative flex text-sm text-gray-600 bg-gray-50 p-2 rounded-md",children:[i.jsx("img",{src:$((me=s==null?void 0:s.style.attachment)==null?void 0:me.name),alt:"",style:{maxWidth:"40px",maxHeight:"40px",objectFit:"contain"}}),i.jsxs("div",{children:[i.jsx("p",{className:"ellispis",children:((Ae=s==null?void 0:s.style.attachment)==null?void 0:Ae.name)||"Default"}),i.jsx("small",{children:N(((Oe=(Ee=s==null?void 0:s.style)==null?void 0:Ee.attachment)==null?void 0:Oe.size)||0)})]}),i.jsx("button",{onClick:()=>E("attachment",null),className:"absolute right5 text-red-500 hover:text-red-600 text-sm",children:i.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"var(--th-primary-color)",children:[i.jsx("path",{d:"M5.45,21.93h13.1c.34,0,.62-.28.62-.62V6.08h2.13c.34,0,.62-.28.62-.62s-.28-.62-.62-.62h-4.89v-2.13c0-.34-.28-.62-.62-.62h-7.58c-.34,0-.62.28-.62.62v2.13H2.69c-.34,0-.62.28-.62.62s.28.62.62.62h2.13v15.23c0,.34.28.62.62.62ZM17.92,20.68H6.08V6.08h11.85v14.61ZM8.83,3.32h6.33v1.51h-6.33v-1.51Z"}),i.jsx("path",{d:"M8.21,18.42c.34,0,.62-.28.62-.62v-8.77c0-.34-.28-.62-.62-.62s-.62.28-.62.62v8.77c0,.34.28.62.62.62Z"}),i.jsx("path",{d:"M12,18.42c.34,0,.62-.28.62-.62v-8.77c0-.34-.28-.62-.62-.62s-.62.28-.62.62v8.77c0,.34.28.62.62.62Z"}),i.jsx("path",{d:"M15.79,18.42c.34,0,.62-.28.62-.62v-8.77c0-.34-.28-.62-.62-.62s-.62.28-.62.62v8.77c0,.34.28.62.62.62Z"})]})})]})]})]}),i.jsx(zn,{isOpen:C,onClose:()=>k(!1),onSelect:fe=>{E("senderLogo",fe),k(!1)}}),i.jsx(zn,{isOpen:v,onClose:()=>A(!1),onSelect:fe=>{E("promoImage",fe),A(!1)}})]})},sB=({id:e,style:t={},onUpdate:o})=>{const{rows:r,setRows:n}=Te(),[s,a]=S.useState(null),[l,d]=S.useState("bgImage");S.useEffect(()=>{if(t!=null&&t.imageBackgroundUrl){const m=new Image;m.onload=()=>{const f=m.width/m.height;a(f),!t.imageWidth&&!t.imageHeight&&u({style:{...t,imageWidth:m.width,imageHeight:m.height}})},m.src=t==null?void 0:t.imageBackgroundUrl}},[t==null?void 0:t.imageBackgroundUrl]);const c=(m,f)=>{const b=r.map(h=>h.id===e?{...h,style:{...h.style,[m]:f}}:h);n(b)},u=m=>{if(o){o(m);return}const f=r.map(b=>b.id===e?{...b,...m}:b);n(f)},p=m=>{u({style:{...t,...m}})};return i.jsxs("div",{className:"space-y-6",children:[i.jsx("div",{className:"rsp-property-elements-block",children:i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("label",{className:"rsp-properties-lable block text-md color-primary-black ",children:"Background color"}),i.jsx("div",{className:"flex flex-col space-y-2",children:i.jsx(gt,{value:(t==null?void 0:t.backgroundColor)||"transparent",onChange:m=>{c("backgroundColor",m)}})})]})}),i.jsx("div",{className:"rsp-property-elements-block hidden-del",children:i.jsx(Xc,{content:t,style:t,onContentChange:p})}),i.jsxs("div",{className:"rsp-property-elements-block flex items-center justify-between",children:[i.jsx("label",{className:"rsp-properties-lable block text-md color-primary-black",children:"Content lock"}),i.jsx(At,{id:"rowContentLock",isChecked:(t==null?void 0:t.rowContentLock)||!1,onToggle:m=>{c("rowContentLock",m)}})]}),i.jsx(ao,{label:"Padding",id:"padding-control",marginSection:!1,paddingSection:!0,padding:t.paddingControl,isLockPaddingX:!1,onChange:m=>{c("paddingControl",m)}}),i.jsxs("div",{className:"rsp-property-elements-block space-y-4 hiddens hidden",children:[i.jsx("label",{className:"rsp-properties-lable block text-md color-primary-black",children:"Padding"}),i.jsx(et,{mainClass:"button-control-view",label:"Top",leftDescription:"(px)",isShowLeftDescription:!0,onClick:()=>{},onChange:m=>c("paddingTop",m),min:0,max:99,step:5,defaultValue:(t==null?void 0:t.paddingTop)||0}),i.jsx(et,{mainClass:"button-control-view",label:"Bottom",leftDescription:"(px)",isShowLeftDescription:!0,onClick:()=>{},onChange:m=>c("paddingBottom",m),min:0,max:99,step:5,defaultValue:(t==null?void 0:t.paddingBottom)||0})]})]})},x0=({id:e,content:t,style:o={}})=>{var f;const{updateComponent:r}=Te(),n=S.useRef(null),[s,a]=S.useState(""),l=(b,h)=>{r(e,{style:{...o,[b]:h}})},d=b=>{r(e,{content:{...t,...b}})},c=()=>{const b=[...t.slides||[],{imageUrl:"",alt:"",caption:""}];d({slides:b})},u=b=>{const h=t.slides.filter((g,x)=>x!==b);d({slides:h})},p=(b,h,g)=>{const x=[...t.slides];x[b]={...x[b],[h]:g},d({slides:x})},m=async(b,h)=>{var x;const g=(x=b.target.files)==null?void 0:x[0];if(a(""),g){if(!g.type.startsWith("image/")){a("Please upload an image file");return}if(g.size>2*1024*1024){a("File size must not exceed 2MB");return}const C=new FileReader;C.onload=k=>{var v;(v=k.target)!=null&&v.result&&p(h,"imageUrl",k.target.result)},C.onerror=()=>{a("Failed to read the image file")},C.readAsDataURL(g)}};return i.jsxs("div",{className:"space-y-6",children:[i.jsxs("div",{className:"space-y-4",children:[i.jsx("h3",{className:"text-md font-regular color-primary-black",children:"Carousel Settings"}),i.jsxs("div",{children:[i.jsx("label",{className:"block text-md color-primary-black",children:"Type"}),i.jsxs("select",{value:o.type||"slides",onChange:b=>l("type",b.target.value),className:"w-full p-2 border rounded-md",children:[i.jsx("option",{value:"slides",children:"Slides"}),i.jsx("option",{value:"carousel",children:"Carousel"})]})]}),i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("label",{className:"text-sm color-secondary-black",children:"Autoplay"}),i.jsxs("div",{className:"relative inline-block w-10 mr-2 align-middle select-none",children:[i.jsx("input",{type:"checkbox",checked:o.autoplay||!1,onChange:b=>l("autoplay",b.target.checked),className:"toggle-checkbox absolute block w-6 h-6 rounded-full bg-white appearance-none cursor-pointer"}),i.jsx("label",{className:"toggle-label block overflow-hidden h-6 rounded-full bg-gray-300 cursor-pointer"})]})]}),o.autoplay&&i.jsxs("div",{children:[i.jsx("label",{className:"block text-md color-primary-black",children:"Delay (ms)"}),i.jsx("input",{type:"number",value:o.delay||3e3,onChange:b=>l("delay",parseInt(b.target.value)),className:"w-full p-2 border rounded-md",min:"1000",step:"500"})]})]}),i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{className:"flex justify-between items-center",children:[i.jsx("h3",{className:"text-md font-regular color-primary-black",children:"Slides"}),i.jsx("button",{onClick:c,className:"p-1.5 bg-primary-blue text-white rounded hover:bg-blue-600",children:i.jsx(ei,{className:"w-4 h-4"})})]}),(f=t.slides)==null?void 0:f.map((b,h)=>i.jsxs("div",{className:"p-4 border rounded-lg space-y-3",children:[i.jsxs("div",{className:"flex justify-between items-center mb-2",children:[i.jsxs("h4",{className:"text-md font-regular color-primary-black",children:["Slide ",h+1]}),i.jsx("button",{onClick:()=>u(h),className:"p-1 text-red-500 hover:text-red-600",children:i.jsx(oo,{className:"w-4 h-4"})})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block text-md color-primary-black",children:"Image"}),i.jsxs("div",{className:"space-y-2",children:[i.jsxs("button",{onClick:()=>{var g;return(g=n.current)==null?void 0:g.click()},className:"w-full flex items-center justify-center px-4 py-2 border-2 border-dashed border-gray-300 rounded-lg hover:border-gray-400",children:[i.jsx(Pd,{className:"w-5 h-5 mr-2"}),i.jsx("span",{children:"Choose Image"})]}),i.jsx("input",{ref:n,type:"file",className:"hidden",accept:"image/*",onChange:g=>m(g,h)}),s&&i.jsxs("div",{className:"flex items-center text-red-500 text-sm gap-1 marginT5",children:[i.jsx(Kt,{className:"w-4 h-4 mr-1"}),s]}),b.imageUrl&&i.jsx("img",{src:b.imageUrl,alt:"Preview",className:"w-full h-32 object-cover rounded-md"})]})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block text-md color-primary-black",children:"Alt Text"}),i.jsx("input",{type:"text",value:b.alt||"",onChange:g=>p(h,"alt",g.target.value),className:"w-full p-2 border rounded-md",placeholder:"Enter image description"})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block text-md color-primary-black",children:"Caption"}),i.jsx("input",{type:"text",value:b.caption||"",onChange:g=>p(h,"caption",g.target.value),className:"w-full p-2 border rounded-md",placeholder:"Enter slide caption"})]})]},h))]}),i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{children:[i.jsx("label",{className:"block text-md color-primary-black",children:"Caption Color"}),i.jsx("input",{type:"color",value:o.captionColor||"#FFFFFF",onChange:b=>l("captionColor",b.target.value),className:"w-full p-1 h-10 border rounded-md"})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block text-md color-primary-black",children:"Caption Font Size"}),i.jsx("input",{type:"number",value:o.captionFontSize||16,onChange:b=>l("captionFontSize",parseInt(b.target.value)),className:"w-full p-2 border rounded-md",min:"12",max:"24"})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block text-md color-primary-black",children:"Caption Font Family"}),i.jsxs("select",{value:o.captionFontFamily||"inherit",onChange:b=>l("captionFontFamily",b.target.value),className:"w-full p-2 border rounded-md",children:[i.jsx("option",{value:"inherit",children:"Default"}),i.jsx("option",{value:"Arial, sans-serif",children:"Arial"}),i.jsx("option",{value:"Georgia, serif",children:"Georgia"}),i.jsx("option",{value:"monospace",children:"Monospace"})]})]})]})]})},C0=({id:e,content:t,style:o={}})=>{var c;const{updateComponent:r}=Te(),n=(u,p)=>{r(e,{style:{...o,[u]:p}})},s=u=>{r(e,{content:{...t,...u}})},a=()=>{const u=[...t.sections||[],{title:"New Section",content:"Enter content here",expanded:!1}];s({sections:u})},l=u=>{const p=t.sections.filter((m,f)=>f!==u);s({sections:p})},d=(u,p,m)=>{const f=[...t.sections];f[u]={...f[u],[p]:m},s({sections:f})};return i.jsxs("div",{className:"space-y-6",children:[i.jsxs("div",{className:"space-y-4",children:[i.jsx("h3",{className:"text-md font-regular color-primary-black",children:"Accordion Settings"}),i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("label",{className:"text-sm color-secondary-black",children:"Expand Single Section"}),i.jsxs("div",{className:"relative inline-block w-10 mr-2 align-middle select-none",children:[i.jsx("input",{type:"checkbox",checked:o.expandSingleSection||!1,onChange:u=>n("expandSingleSection",u.target.checked),className:"toggle-checkbox absolute block w-6 h-6 rounded-full bg-white appearance-none cursor-pointer"}),i.jsx("label",{className:"toggle-label block overflow-hidden h-6 rounded-full bg-gray-300 cursor-pointer"})]})]}),i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("label",{className:"text-sm color-secondary-black",children:"Animate"}),i.jsxs("div",{className:"relative inline-block w-10 mr-2 align-middle select-none",children:[i.jsx("input",{type:"checkbox",checked:o.animate!==!1,onChange:u=>n("animate",u.target.checked),className:"toggle-checkbox absolute block w-6 h-6 rounded-full bg-white appearance-none cursor-pointer"}),i.jsx("label",{className:"toggle-label block overflow-hidden h-6 rounded-full bg-gray-300 cursor-pointer"})]})]})]}),i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{className:"flex justify-between items-center",children:[i.jsx("h3",{className:"text-md font-regular color-primary-black",children:"Sections"}),i.jsx("button",{onClick:a,className:"p-1.5 bg-primary-blue text-white rounded hover:bg-blue-600",children:i.jsx(ei,{className:"w-4 h-4"})})]}),(c=t.sections)==null?void 0:c.map((u,p)=>i.jsxs("div",{className:"p-4 border rounded-lg space-y-3",children:[i.jsxs("div",{className:"flex justify-between items-center mb-2",children:[i.jsxs("h4",{className:"text-md font-regular color-primary-black",children:["Section ",p+1]}),i.jsx("button",{onClick:()=>l(p),className:"p-1 text-red-500 hover:text-red-600",children:i.jsx(oo,{className:"w-4 h-4"})})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block text-md color-primary-black",children:"Title"}),i.jsx("input",{type:"text",value:u.title||"",onChange:m=>d(p,"title",m.target.value),className:"w-full p-2 border rounded-md",placeholder:"Enter section title"})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block text-md color-primary-black",children:"Content"}),i.jsx("textarea",{value:u.content||"",onChange:m=>d(p,"content",m.target.value),className:"w-full p-2 border rounded-md h-24 resize-vertical",placeholder:"Enter section content"})]}),i.jsxs("div",{className:"flex items-center",children:[i.jsx("input",{type:"checkbox",checked:u.expanded||!1,onChange:m=>d(p,"expanded",m.target.checked),className:"rounded text-blue-500 focus:ring-blue-500"}),i.jsx("label",{className:"ml-2 text-sm color-secondary-black",children:"Expanded by default"})]})]},p))]}),i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{children:[i.jsx("label",{className:"block text-md color-primary-black",children:"Header Background"}),i.jsx("input",{type:"color",value:o.headerBgColor||"#f3f4f6",onChange:u=>n("headerBgColor",u.target.value),className:"w-full p-1 h-10 border rounded-md"})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block text-md color-primary-black",children:"Header Text Color"}),i.jsx("input",{type:"color",value:o.headerColor||"#111827",onChange:u=>n("headerColor",u.target.value),className:"w-full p-1 h-10 border rounded-md"})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block text-md color-primary-black",children:"Header Font Size"}),i.jsx("input",{type:"number",value:o.headerFontSize||16,onChange:u=>n("headerFontSize",parseInt(u.target.value)),className:"w-full p-2 border rounded-md",min:"12",max:"24"})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block text-md color-primary-black",children:"Content Background"}),i.jsx("input",{type:"color",value:o.contentBgColor||"#ffffff",onChange:u=>n("contentBgColor",u.target.value),className:"w-full p-1 h-10 border rounded-md"})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block text-md color-primary-black",children:"Content Text Color"}),i.jsx("input",{type:"color",value:o.contentColor||"#374151",onChange:u=>n("contentColor",u.target.value),className:"w-full p-1 h-10 border rounded-md"})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block text-md color-primary-black",children:"Content Font Size"}),i.jsx("input",{type:"number",value:o.contentFontSize||14,onChange:u=>n("contentFontSize",parseInt(u.target.value)),className:"w-full p-2 border rounded-md",min:"12",max:"20"})]})]})]})},v0=({id:e,content:t,style:o={}})=>{var c;const{updateComponent:r}=Te(),n=(u,p)=>{r(e,{style:{...o,[u]:p}})},s=u=>{r(e,{content:{...t,...u}})},a=()=>{const u={id:`field_${Date.now()}`,type:"text",label:"New Field",name:"",placeholder:"",required:!1,validations:[]};s({fields:[...t.fields||[],u]})},l=u=>{const p=t.fields.filter((m,f)=>f!==u);s({fields:p})},d=(u,p)=>{const m=[...t.fields];m[u]={...m[u],...p},s({fields:m})};return i.jsxs("div",{className:"space-y-6",children:[i.jsxs("div",{className:"space-y-4",children:[i.jsx("h3",{className:"text-md font-regular color-primary-black",children:"Form Settings"}),i.jsxs("div",{children:[i.jsx("label",{className:"block text-md color-primary-black mb-1",children:"Action URL"}),i.jsx("input",{type:"url",value:t.actionUrl||"",onChange:u=>s({actionUrl:u.target.value}),className:"w-full p-2 border rounded-md",placeholder:"https://example.com/submit"})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block text-md color-primary-black mb-1",children:"Success Message"}),i.jsx("input",{type:"text",value:t.successMessage||"",onChange:u=>s({successMessage:u.target.value}),className:"w-full p-2 border rounded-md",placeholder:"Form submitted successfully!"})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block text-md color-primary-black mb-1",children:"Error Message"}),i.jsx("input",{type:"text",value:t.errorMessage||"",onChange:u=>s({errorMessage:u.target.value}),className:"w-full p-2 border rounded-md",placeholder:"Error submitting form. Please try again."})]})]}),i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{className:"flex justify-between items-center",children:[i.jsx("h3",{className:"text-md font-regular color-primary-black",children:"Form Fields"}),i.jsx("button",{onClick:a,className:"p-1.5 bg-primary-blue text-white rounded hover:bg-blue-600",children:i.jsx(ei,{className:"w-4 h-4"})})]}),(c=t.fields)==null?void 0:c.map((u,p)=>{var m;return i.jsxs("div",{className:"p-4 border rounded-lg space-y-3",children:[i.jsxs("div",{className:"flex justify-between items-center",children:[i.jsx("h4",{className:"text-md font-regular color-primary-black",children:u.label}),i.jsx("button",{onClick:()=>l(p),className:"p-1 text-red-500 hover:text-red-600",children:i.jsx(oo,{className:"w-4 h-4"})})]}),i.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[i.jsxs("div",{children:[i.jsx("label",{className:"block text-md color-primary-black",children:"Field Type"}),i.jsxs("select",{value:u.type,onChange:f=>d(p,{type:f.target.value}),className:"w-full p-2 border rounded-md",children:[i.jsx("option",{value:"text",children:"Text"}),i.jsx("option",{value:"email",children:"Email"}),i.jsx("option",{value:"tel",children:"Phone"}),i.jsx("option",{value:"number",children:"Number"}),i.jsx("option",{value:"textarea",children:"Text Area"}),i.jsx("option",{value:"select",children:"Select"}),i.jsx("option",{value:"checkbox",children:"Checkbox"})]})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block text-md color-primary-black",children:"Field Name"}),i.jsx("input",{type:"text",value:u.name,onChange:f=>d(p,{name:f.target.value}),className:"w-full p-2 border rounded-md",placeholder:"field_name"})]})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block text-md color-primary-black",children:"Label"}),i.jsx("input",{type:"text",value:u.label,onChange:f=>d(p,{label:f.target.value}),className:"w-full p-2 border rounded-md",placeholder:"Enter field label"})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block text-md color-primary-black",children:"Placeholder"}),i.jsx("input",{type:"text",value:u.placeholder,onChange:f=>d(p,{placeholder:f.target.value}),className:"w-full p-2 border rounded-md",placeholder:"Enter placeholder text"})]}),u.type==="select"&&i.jsxs("div",{children:[i.jsx("label",{className:"block text-md color-primary-black",children:"Options (one per line)"}),i.jsx("textarea",{value:((m=u.options)==null?void 0:m.join(`
5018
5018
  `))||"",onChange:f=>d(p,{options:f.target.value.split(`
5019
5019
  `).filter(Boolean)}),className:"w-full p-2 border rounded-md h-24",placeholder:`Option 1
5020
5020
  Option 2